[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SJ1PR21MB345775858C05B9FE51C2BDF0CE112@SJ1PR21MB3457.namprd21.prod.outlook.com>
Date: Tue, 23 Apr 2024 23:57:53 +0000
From: Long Li <longli@...rosoft.com>
To: Konstantin Taranov <kotaranov@...ux.microsoft.com>, Konstantin Taranov
<kotaranov@...rosoft.com>, "sharmaajay@...rosoft.com"
<sharmaajay@...rosoft.com>, "jgg@...pe.ca" <jgg@...pe.ca>, "leon@...nel.org"
<leon@...nel.org>
CC: "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
> 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.
Powered by blists - more mailing lists