From: Jason Gunthorpe <jgg@ziepe.ca>
To: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Cc: leon@kernel.org, linux-rdma@vger.kernel.org,
andrew.gospodarek@broadcom.com, selvin.xavier@broadcom.com,
kalesh-anakkur.purayil@broadcom.com
Subject: Re: [PATCH rdma-next v6 3/4] RDMA/bnxt_re: Direct Verbs: Support DBR verbs
Date: Fri, 9 Jan 2026 14:55:42 -0400 [thread overview]
Message-ID: <20260109185542.GM545276@ziepe.ca> (raw)
In-Reply-To: <20251224042602.56255-4-sriharsha.basavapatna@broadcom.com>
On Wed, Dec 24, 2025 at 09:56:01AM +0530, Sriharsha Basavapatna wrote:
> +static int UVERBS_HANDLER(BNXT_RE_METHOD_DBR_ALLOC)(struct uverbs_attr_bundle *attrs)
> +{
> + struct bnxt_re_dv_db_region dbr = {};
> + struct bnxt_re_alloc_dbr_obj *obj;
> + struct bnxt_re_ucontext *uctx;
> + struct ib_ucontext *ib_uctx;
> + struct bnxt_qplib_dpi *dpi;
> + struct bnxt_re_dev *rdev;
> + struct ib_uobject *uobj;
> + u64 mmap_offset;
> + int ret;
> +
> + ib_uctx = ib_uverbs_get_ucontext(attrs);
> + if (IS_ERR(ib_uctx))
> + return PTR_ERR(ib_uctx);
> +
> + uctx = container_of(ib_uctx, struct bnxt_re_ucontext, ib_uctx);
> + rdev = uctx->rdev;
> + uobj = uverbs_attr_get_uobject(attrs, BNXT_RE_DV_ALLOC_DBR_HANDLE);
> +
> + obj = kzalloc(sizeof(*obj), GFP_KERNEL);
> + if (!obj)
> + return -ENOMEM;
> +
> + dpi = &obj->dpi;
> + ret = bnxt_qplib_alloc_uc_dpi(&rdev->qplib_res, dpi);
> + if (ret)
> + goto free_mem;
> +
> + obj->entry = bnxt_re_mmap_entry_insert(uctx, 0, BNXT_RE_MMAP_UC_DB,
> + &mmap_offset);
> + if (!obj->entry) {
> + ret = -ENOMEM;
> + goto free_dpi;
> + }
> +
> + obj->rdev = rdev;
> + dbr.umdbr = dpi->umdbr;
> + dbr.dpi = dpi->dpi;
> +
> + ret = uverbs_copy_to_struct_or_zero(attrs, BNXT_RE_DV_ALLOC_DBR_ATTR,
> + &dbr, sizeof(dbr));
> + if (ret)
> + goto free_entry;
> +
> + ret = uverbs_copy_to(attrs, BNXT_RE_DV_ALLOC_DBR_OFFSET,
> + &mmap_offset, sizeof(mmap_offset));
> + if (ret)
> + goto free_entry;
> +
> + uobj->object = obj;
> + uverbs_finalize_uobj_create(attrs, BNXT_RE_DV_ALLOC_DBR_HANDLE);
> + hash_add(rdev->dpi_hash, &obj->hash_entry, dpi->dpi);
This is out of order, hash_del is done inside bnxt_re_dv_dbr_cleanup()
so it should be before finalize, but it isn't a bug.
It should probably be written like this:
uobj->object = obj;
hash_add(rdev->dpi_hash, &obj->hash_entry, dpi->dpi);
uverbs_finalize_uobj_create(attrs, BNXT_RE_DV_ALLOC_DBR_HANDLE);
ret = uverbs_copy_to_struct_or_zero(attrs, BNXT_RE_DV_ALLOC_DBR_ATTR,
&dbr, sizeof(dbr));
if (ret)
return ret;
ret = uverbs_copy_to(attrs, BNXT_RE_DV_ALLOC_DBR_OFFSET,
&mmap_offset, sizeof(mmap_offset));
if (ret)
return ret;
return 0;
Jason
next prev parent reply other threads:[~2026-01-09 18:55 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-24 4:25 [PATCH rdma-next v6 0/4] RDMA/bnxt_re: Support direct verbs Sriharsha Basavapatna
2025-12-24 4:25 ` [PATCH rdma-next v6 1/4] RDMA/bnxt_re: Move the UAPI methods to a dedicated file Sriharsha Basavapatna
2025-12-24 4:26 ` [PATCH rdma-next v6 2/4] RDMA/bnxt_re: Refactor bnxt_qplib_create_qp() function Sriharsha Basavapatna
2025-12-24 4:26 ` [PATCH rdma-next v6 3/4] RDMA/bnxt_re: Direct Verbs: Support DBR verbs Sriharsha Basavapatna
2026-01-09 18:35 ` Jason Gunthorpe
2026-01-13 17:13 ` Sriharsha Basavapatna
2026-01-09 18:50 ` Jason Gunthorpe
2026-01-13 17:13 ` Sriharsha Basavapatna
2026-01-09 18:55 ` Jason Gunthorpe [this message]
2026-01-13 17:13 ` Sriharsha Basavapatna
2026-01-09 19:01 ` Jason Gunthorpe
2026-01-13 17:14 ` Sriharsha Basavapatna
2025-12-24 4:26 ` [PATCH rdma-next v6 4/4] RDMA/bnxt_re: Direct Verbs: Support CQ and QP verbs Sriharsha Basavapatna
2026-01-09 18:37 ` Jason Gunthorpe
2026-01-13 17:13 ` Sriharsha Basavapatna
2026-01-09 19:08 ` Jason Gunthorpe
2026-01-13 17:14 ` Sriharsha Basavapatna
2026-01-13 17:27 ` Jason Gunthorpe
2026-01-17 8:07 ` Sriharsha Basavapatna
2026-01-09 19:37 ` Jason Gunthorpe
2026-01-13 17:15 ` Sriharsha Basavapatna
2026-01-13 17:28 ` Jason Gunthorpe
2026-01-17 8:07 ` Sriharsha Basavapatna
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=20260109185542.GM545276@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=andrew.gospodarek@broadcom.com \
--cc=kalesh-anakkur.purayil@broadcom.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=selvin.xavier@broadcom.com \
--cc=sriharsha.basavapatna@broadcom.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