On Wed, Mar 18, 2020 at 02:43:28PM +0200, Leon Romanovsky wrote: > From: Yishai Hadas <yishaih@xxxxxxxxxxxx> > > Extend QP creation to get uar page index from user space, this mode can > be used with the UAR dynamic mode APIs to allocate/destroy a UAR object. > > As part of enabling this option blocked the weird/un-supported cross > channel option which uses index 0 hard-coded. > > This QP flag wasn't exposed to user space as part of any formal upstream > release, the dynamic option can allow having valid UAR page index > instead. > > Signed-off-by: Yishai Hadas <yishaih@xxxxxxxxxxxx> > Reviewed-by: Michael Guralnik <michaelgur@xxxxxxxxxxxx> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> > drivers/infiniband/hw/mlx5/qp.c | 27 +++++++++++++++++---------- > include/uapi/rdma/mlx5-abi.h | 1 + > 2 files changed, 18 insertions(+), 10 deletions(-) > > diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c > index 88db580f7272..380ba3321851 100644 > +++ b/drivers/infiniband/hw/mlx5/qp.c > @@ -919,6 +919,7 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd, > void *qpc; > int err; > u16 uid; > + u32 uar_flags; > > err = ib_copy_from_udata(&ucmd, udata, sizeof(ucmd)); > if (err) { > @@ -928,24 +929,29 @@ static int create_user_qp(struct mlx5_ib_dev *dev, struct ib_pd *pd, > > context = rdma_udata_to_drv_context(udata, struct mlx5_ib_ucontext, > ibucontext); > - if (ucmd.flags & MLX5_QP_FLAG_BFREG_INDEX) { > + uar_flags = ucmd.flags & (MLX5_QP_FLAG_UAR_PAGE_INDEX | > + MLX5_QP_FLAG_BFREG_INDEX); > + switch (uar_flags) { Do we really need this temporary uar_flags? Jason