lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240430123715.GD100414@unreal>
Date: Tue, 30 Apr 2024 15:37:15 +0300
From: Leon Romanovsky <leon@...nel.org>
To: Long Li <longli@...rosoft.com>
Cc: Konstantin Taranov <kotaranov@...ux.microsoft.com>,
	Konstantin Taranov <kotaranov@...rosoft.com>,
	"sharmaajay@...rosoft.com" <sharmaajay@...rosoft.com>,
	"jgg@...pe.ca" <jgg@...pe.ca>,
	"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH rdma-next 6/6] RDMA/mana_ib: implement uapi for creation
 of rnic cq

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@...rosoft.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@...rosoft.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.
> 
> But increasing MANA_IB_UVERBS_ABI_VERSION may make the code simpler. I have a feeling that you may need to increase it anyway, because a new uapi message "mana_ib_create_cq_resp" is introduced.
> 
> Jason or Leon may have a better idea on this.

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.

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ