All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@mellanox.com>
Cc: Doug Ledford <dledford@redhat.com>,
	Yishai Hadas <yishaih@mellanox.com>,
	linux-rdma@vger.kernel.org,
	Michael Guralnik <michaelgur@mellanox.com>
Subject: Re: [PATCH rdma-next 3/4] IB/mlx5: Extend QP creation to get uar page index from user space
Date: Wed, 18 Mar 2020 15:08:44 +0200	[thread overview]
Message-ID: <20200318130844.GX3351@unreal> (raw)
In-Reply-To: <20200318130514.GJ13183@mellanox.com>

On Wed, Mar 18, 2020 at 10:05:14AM -0300, Jason Gunthorpe wrote:
> On Wed, Mar 18, 2020 at 02:43:28PM +0200, Leon Romanovsky wrote:
> > From: Yishai Hadas <yishaih@mellanox.com>
> >
> > 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@mellanox.com>
> > Reviewed-by: Michael Guralnik <michaelgur@mellanox.com>
> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> >  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?

I thinks that it is more clear, this is why I used temp variable.

Thanks

>
> Jason

  reply	other threads:[~2020-03-18 13:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18 12:43 [PATCH rdma-next 0/4] Introduce dynamic UAR allocation mode Leon Romanovsky
2020-03-18 12:43 ` [PATCH rdma-next 1/4] IB/mlx5: Expose UAR object and its alloc/destroy commands Leon Romanovsky
2020-03-18 12:43 ` [PATCH rdma-next 2/4] IB/mlx5: Extend CQ creation to get uar page index from user space Leon Romanovsky
2020-03-18 12:43 ` [PATCH rdma-next 3/4] IB/mlx5: Extend QP " Leon Romanovsky
2020-03-18 13:05   ` Jason Gunthorpe
2020-03-18 13:08     ` Leon Romanovsky [this message]
2020-03-18 12:43 ` [PATCH mlx5-next 4/4] IB/mlx5: Move to fully dynamic UAR mode once user space supports it Leon Romanovsky
2020-03-18 23:38   ` Saeed Mahameed
2020-03-19  5:55     ` Leon Romanovsky
2020-03-18 12:54 ` [PATCH rdma-next 0/4] Introduce dynamic UAR allocation mode Jason Gunthorpe
2020-03-18 13:14   ` Leon Romanovsky
2020-03-18 13:21     ` Jason Gunthorpe
2020-03-18 13:56       ` Leon Romanovsky
2020-03-18 14:00         ` Jason Gunthorpe
2020-03-18 14:09           ` Leon Romanovsky
2020-03-18 14:12             ` Jason Gunthorpe
2020-03-18 14:24               ` Leon Romanovsky
2020-03-18 14:39                 ` Jason Gunthorpe
2020-03-18 17:07                   ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200318130844.GX3351@unreal \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=jgg@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=michaelgur@mellanox.com \
    --cc=yishaih@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.