From: Jason Gunthorpe <jgg@ziepe.ca>
To: Jacob Moroni <jmoroni@google.com>
Cc: tatyana.e.nikolova@intel.com, leon@kernel.org,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next] RDMA/irdma: Check MR contiguity before PBLE alloc
Date: Mon, 12 Oct 2026 15:50:10 -0300 [thread overview]
Message-ID: <20261012185010.GH14213@ziepe.ca> (raw)
In-Reply-To: <20261010194832.2415477-1-jmoroni@google.com>
On Sat, Oct 10, 2026 at 07:48:32PM +0000, Jacob Moroni wrote:
> @@ -3487,6 +3442,8 @@ static struct irdma_mr *irdma_alloc_iwmr(struct ib_umem *region,
> pgsz_bitmap = (reg_type == IRDMA_MEMREG_TYPE_MEM) ?
> iwdev->rf->sc_dev.hw_attrs.page_size_cap : SZ_4K;
>
> + iwmr->is_contig = ib_umem_is_contiguous(region);
> + /* Call best_pgsz after is_contiguous to restore correct umem->iova. */
> iwmr->page_size = ib_umem_find_best_pgsz(region, pgsz_bitmap, virt);
> if (unlikely(!iwmr->page_size)) {
> kfree(iwmr);
> @@ -3846,6 +3803,7 @@ static int irdma_rereg_mr_trans(struct irdma_mr *iwmr, u64 start, u64 len,
> iwmr->region = region;
> iwmr->ibmr.iova = virt;
> iwmr->ibmr.pd = pd;
> + iwmr->is_contig = ib_umem_is_contiguous(region);
> iwmr->page_size = ib_umem_find_best_pgsz(region,
> iwdev->rf->sc_dev.hw_attrs.page_size_cap,
> virt);
You should not call ib_umem_find_best_pgsz() after
ib_umem_is_contiguous(), it is nonsense to compute a page_size once
the contiguous optimization is being used.
Once you decide to use contiguous the start dma address should go
straight into the MR structure and just avoid all the pbl stuff.
Jason
next prev parent reply other threads:[~2026-10-12 18:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-10 19:48 [PATCH rdma-next] RDMA/irdma: Check MR contiguity before PBLE alloc Jacob Moroni
2026-10-10 19:57 ` sashiko-bot
2026-10-12 14:00 ` Leon Romanovsky
2026-10-12 18:50 ` Jason Gunthorpe [this message]
2026-10-13 11:22 ` Leon Romanovsky
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=20261012185010.GH14213@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=jmoroni@google.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=tatyana.e.nikolova@intel.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