Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
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 v5 3/4] RDMA/bnxt_re: Direct Verbs: Support DBR verbs
Date: Wed, 17 Dec 2025 15:58:28 -0400	[thread overview]
Message-ID: <20251217195828.GB243690@nvidia.com> (raw)
In-Reply-To: <20251129165441.75274-4-sriharsha.basavapatna@broadcom.com>

On Sat, Nov 29, 2025 at 10:24:40PM +0530, Sriharsha Basavapatna wrote:
> +DECLARE_UVERBS_NAMED_METHOD(BNXT_RE_METHOD_DBR_QUERY,
> +			    UVERBS_ATTR_PTR_OUT(BNXT_RE_DV_QUERY_DBR_ATTR,
> +						UVERBS_ATTR_STRUCT(struct bnxt_re_dv_db_region,
> +								   dbr),
> +						UA_MANDATORY));
> +
> +DECLARE_UVERBS_NAMED_METHOD_DESTROY(BNXT_RE_METHOD_DBR_FREE,
> +				    UVERBS_ATTR_IDR(BNXT_RE_DV_FREE_DBR_HANDLE,
> +						    BNXT_RE_OBJECT_DBR,
> +						    UVERBS_ACCESS_DESTROY,
> +						    UA_MANDATORY));
> +
> +DECLARE_UVERBS_NAMED_OBJECT(BNXT_RE_OBJECT_DBR,
> +			    UVERBS_TYPE_ALLOC_IDR(bnxt_re_dv_dbr_cleanup),
> +			    &UVERBS_METHOD(BNXT_RE_METHOD_DBR_ALLOC),
> +			    &UVERBS_METHOD(BNXT_RE_METHOD_DBR_FREE),
> +			    &UVERBS_METHOD(BNXT_RE_METHOD_DBR_QUERY));

This is not a "method" on an object because it doesn't accept any
object ID as an argument. This is just a global function, so it should
be using DECLARE_UVERBS_GLOBAL_METHODS().

It should probably also have a clearer name that it is about returning
the ucontext's DBR.

>  /* DPIs */
> +int bnxt_qplib_alloc_uc_dpi(struct bnxt_qplib_res *res, struct bnxt_qplib_dpi *dpi)
> +{
> +	struct bnxt_qplib_dpi_tbl *dpit = &res->dpi_tbl;
> +	struct bnxt_qplib_reg_desc *reg;
> +	u32 bit_num;
> +	int rc = 0;
> +
> +	reg = &dpit->wcreg;
> +	mutex_lock(&res->dpi_tbl_lock);
> +	bit_num = find_first_bit(dpit->tbl, dpit->max);
> +	if (bit_num >= dpit->max) {
> +		rc = -ENOMEM;
> +		goto unlock;
> +	}
> +	/* Found unused DPI */
> +	clear_bit(bit_num, dpit->tbl);

Stuff like this should be implemented as an ida..

Jason

  parent reply	other threads:[~2025-12-17 19:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-29 16:54 [PATCH rdma-next v5 0/4] RDMA/bnxt_re: Support direct verbs Sriharsha Basavapatna
2025-11-29 16:54 ` [PATCH rdma-next v5 1/4] RDMA/bnxt_re: Move the UAPI methods to a dedicated file Sriharsha Basavapatna
2025-11-29 16:54 ` [PATCH rdma-next v5 2/4] RDMA/bnxt_re: Refactor bnxt_qplib_create_qp() function Sriharsha Basavapatna
2025-11-29 16:54 ` [PATCH rdma-next v5 3/4] RDMA/bnxt_re: Direct Verbs: Support DBR verbs Sriharsha Basavapatna
2025-12-17 19:31   ` Jason Gunthorpe
2025-12-24  4:37     ` Sriharsha Basavapatna
2025-12-17 19:58   ` Jason Gunthorpe [this message]
2025-12-24  4:38     ` Sriharsha Basavapatna
2025-12-17 22:33   ` Jason Gunthorpe
2025-12-24  4:39     ` Sriharsha Basavapatna
2025-11-29 16:54 ` [PATCH rdma-next v5 4/4] RDMA/bnxt_re: Direct Verbs: Support CQ and QP verbs Sriharsha Basavapatna
2025-12-17 22:36   ` Jason Gunthorpe
2025-12-24  4:39     ` Sriharsha Basavapatna
2025-12-18  1:46   ` Jason Gunthorpe
2025-12-24  4:41     ` 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=20251217195828.GB243690@nvidia.com \
    --to=jgg@nvidia.com \
    --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