public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
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 4/4] RDMA/bnxt_re: Direct Verbs: Support CQ and QP verbs
Date: Fri, 9 Jan 2026 15:08:57 -0400	[thread overview]
Message-ID: <20260109190857.GO545276@ziepe.ca> (raw)
In-Reply-To: <20251224042602.56255-5-sriharsha.basavapatna@broadcom.com>

On Wed, Dec 24, 2025 at 09:56:02AM +0530, Sriharsha Basavapatna wrote:
> +static struct ib_umem *bnxt_re_dv_umem_get(struct bnxt_re_dev *rdev,
> +					   struct ib_ucontext *ib_uctx,
> +					   int dmabuf_fd,
> +					   u64 addr, u64 size,
> +					   struct bnxt_qplib_sg_info *sg)
> +{
> +	int access = IB_ACCESS_LOCAL_WRITE;
> +	struct ib_umem *umem;
> +	int umem_pgs, rc;
> +
> +	if (dmabuf_fd) {
> +		struct ib_umem_dmabuf *umem_dmabuf;
> +
> +		umem_dmabuf = ib_umem_dmabuf_get_pinned(&rdev->ibdev, addr, size,
> +							dmabuf_fd, access);
> +		if (IS_ERR(umem_dmabuf)) {
> +			rc = PTR_ERR(umem_dmabuf);
> +			goto umem_err;
> +		}
> +		umem = &umem_dmabuf->umem;
> +	} else {
> +		umem = ib_umem_get(&rdev->ibdev, addr, size, access);
> +		if (IS_ERR(umem)) {
> +			rc = PTR_ERR(umem);
> +			goto umem_err;
> +		}
> +	}
> +
> +	umem_pgs = ib_umem_num_dma_blocks(umem, PAGE_SIZE);

I should never see PAGE_SIZE passed to dma_blocks, and you can't call
dma_blocks without previously calling ib_umem_find_best_pgsz() to
validate that the umem is compatible.

I assume you want to use SZ_4K here, as any sizing of the umem should
be derived from absolute hardware capability, never PAGE_SIZE.

Jason

  parent reply	other threads:[~2026-01-09 19:08 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
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 [this message]
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=20260109190857.GO545276@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