public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Leon Romanovsky <leon@kernel.org>
Cc: Long Li <longli@microsoft.com>,
	Konstantin Taranov <kotaranov@linux.microsoft.com>,
	Konstantin Taranov <kotaranov@microsoft.com>,
	"sharmaajay@microsoft.com" <sharmaajay@microsoft.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH rdma-next 6/6] RDMA/mana_ib: implement uapi for creation of rnic cq
Date: Tue, 30 Apr 2024 09:57:20 -0300	[thread overview]
Message-ID: <20240430125720.GT231144@ziepe.ca> (raw)
In-Reply-To: <20240430123715.GD100414@unreal>

On Tue, Apr 30, 2024 at 03:37:15PM +0300, Leon Romanovsky wrote:
> On Tue, Apr 23, 2024 at 11:57:53PM +0000, Long Li wrote:
> > > Subject: [PATCH rdma-next 6/6] RDMA/mana_ib: implement uapi for creation
> > > of rnic cq
> > > 
> > > From: Konstantin Taranov <kotaranov@microsoft.com>
> > > 
> > > Enable users to create RNIC CQs.
> > > With the previous request size, an ethernet CQ is created.
> > > Use the cq_buf_size from the user to create an RNIC CQ and return its ID.
> > > 
> > > Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
> > > ---
> > >  drivers/infiniband/hw/mana/cq.c | 56 ++++++++++++++++++++++++++++++---
> > >  include/uapi/rdma/mana-abi.h    |  7 +++++
> > >  2 files changed, 59 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/drivers/infiniband/hw/mana/cq.c
> > > b/drivers/infiniband/hw/mana/cq.c index 8323085..a62bda7 100644
> > > --- a/drivers/infiniband/hw/mana/cq.c
> > > +++ b/drivers/infiniband/hw/mana/cq.c
> > > @@ -9,17 +9,25 @@ int mana_ib_create_cq(struct ib_cq *ibcq, const struct
> > > ib_cq_init_attr *attr,
> > >  		      struct ib_udata *udata)
> > >  {
> > >  	struct mana_ib_cq *cq = container_of(ibcq, struct mana_ib_cq, ibcq);
> > > +	struct mana_ib_create_cq_resp resp = {};
> > > +	struct mana_ib_ucontext *mana_ucontext;
> > >  	struct ib_device *ibdev = ibcq->device;
> > >  	struct mana_ib_create_cq ucmd = {};
> > >  	struct mana_ib_dev *mdev;
> > > +	bool is_rnic_cq = true;
> > > +	u32 doorbell;
> > >  	int err;
> > > 
> > >  	mdev = container_of(ibdev, struct mana_ib_dev, ib_dev);
> > > 
> > > -	if (udata->inlen < sizeof(ucmd))
> > > +	cq->comp_vector = attr->comp_vector % ibdev->num_comp_vectors;
> > > +	cq->cq_handle = INVALID_MANA_HANDLE;
> > > +
> > > +	if (udata->inlen < offsetof(struct mana_ib_create_cq, cq_buf_size))
> > >  		return -EINVAL;
> > > 
> > > -	cq->comp_vector = attr->comp_vector % ibdev->num_comp_vectors;
> > > +	if (udata->inlen == offsetof(struct mana_ib_create_cq, cq_buf_size))
> > > +		is_rnic_cq = false;
> > 
> > I think it's okay with checking on offset in uapi message to decide if this is a newer/updated RNIC uverb.

Yes, this is the expected method

> You should really try to avoid changing MANA_IB_UVERBS_ABI_VERSION as it
> usually means that backward compatibility will be broken after such change.

Yes, please don't do that.

Jason

      reply	other threads:[~2024-04-30 12:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18 16:51 [PATCH rdma-next 0/6] RDMA/mana_ib: Implement RNIC CQs Konstantin Taranov
2024-04-18 16:52 ` [PATCH rdma-next 1/6] RDMA/mana_ib: create EQs for " Konstantin Taranov
2024-04-23 23:24   ` Long Li
2024-04-18 16:52 ` [PATCH rdma-next 2/6] RDMA/mana_ib: create and destroy RNIC cqs Konstantin Taranov
2024-04-23 23:30   ` Long Li
2024-04-18 16:52 ` [PATCH rdma-next 3/6] RDMA/mana_ib: replace duplicate cqe with buf_size Konstantin Taranov
2024-04-23 23:34   ` Long Li
2024-04-24  8:43     ` Konstantin Taranov
2024-04-25 20:17       ` Long Li
2024-04-18 16:52 ` [PATCH rdma-next 4/6] RDMA/mana_ib: introduce a helper to remove cq callbacks Konstantin Taranov
2024-04-23 23:42   ` Long Li
2024-04-24  8:50     ` Konstantin Taranov
2024-04-25 20:29       ` Long Li
2024-04-18 16:52 ` [PATCH rdma-next 5/6] RDMA/mana_ib: boundary check before installing " Konstantin Taranov
2024-04-23 23:45   ` Long Li
2024-04-24  8:58     ` Konstantin Taranov
2024-04-25 20:31   ` Long Li
2024-04-18 16:52 ` [PATCH rdma-next 6/6] RDMA/mana_ib: implement uapi for creation of rnic cq Konstantin Taranov
2024-04-23 23:57   ` Long Li
2024-04-30 12:37     ` Leon Romanovsky
2024-04-30 12:57       ` Jason Gunthorpe [this message]

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=20240430125720.GT231144@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=kotaranov@linux.microsoft.com \
    --cc=kotaranov@microsoft.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=sharmaajay@microsoft.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox