All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jacob Moroni <jmoroni@google.com>,
	tatyana.e.nikolova@intel.com, linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next] RDMA/irdma: Check MR contiguity before PBLE alloc
Date: Tue, 13 Oct 2026 14:22:11 +0300	[thread overview]
Message-ID: <20261013112211.GM219304@unreal> (raw)
In-Reply-To: <20261012185010.GH14213@ziepe.ca>

On Mon, Oct 12, 2026 at 03:50:10PM -0300, Jason Gunthorpe wrote:
> 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.

ok, I dropped the patch from mu wip/leon-for-next branch for now.

Thanks

> 
> 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

  reply	other threads:[~2026-10-13 11:22 UTC|newest]

Thread overview: 7+ 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
2026-10-13 11:22   ` Leon Romanovsky [this message]
2026-10-13 16:08     ` Jacob Moroni
2026-10-13 16:29       ` Jason Gunthorpe

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=20261013112211.GM219304@unreal \
    --to=leon@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=jmoroni@google.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.