Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: Konstantin Taranov <kotaranov@linux.microsoft.com>,
	linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next] RDMA/mana_ib: Enable RDMA devices on the CDX bus
Date: Wed, 4 Nov 2026 11:41:08 +0200	[thread overview]
Message-ID: <20261104094108.GA478286@unreal> (raw)
In-Reply-To: <sashiko-outbox-195213@kernel.org>

On Tue, Nov 03, 2026 at 12:05:41PM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] RDMA/mana_ib: NULL dma_parms in mana_ib_probe() on CDX devices
> --
> 
> commit 4f88c8811c923b9c16d7e0dbf8674249f05b4f08
> Author: Zhiyue Qiu <zhiyueqiu@microsoft.com>
> 
> RDMA/mana_ib: Enable RDMA devices on the CDX bus
> 
> This commit enables MANA RDMA on the CDX bus by depending on the shared GDMA
> core, matching CDX auxiliary devices, mapping non-PCI userspace doorbells
> with pgprot_device(), and reporting the Microsoft vendor ID directly.
> 
> > diff --git a/drivers/infiniband/hw/mana/device.c b/drivers/infiniband/hw/mana/device.c
> > index 62c7803ca6c60..33e47490755f6 100644
> > --- a/drivers/infiniband/hw/mana/device.c
> > +++ b/drivers/infiniband/hw/mana/device.c
> > @@ -257,6 +257,8 @@ static void mana_ib_remove(struct auxiliary_device *adev)
> >  static const struct auxiliary_device_id mana_id_table[] = {
> >  	{ .name = "mana.rdma", },
> >  	{ .name = "mana.eth", },
> > +	{ .name = "mana_cdx.rdma", },
> > +	{ .name = "mana_cdx.eth", },
> 
> [Severity: High]
> When mana_ib_probe() binds to mana_cdx.rdma or mana_cdx.eth, does passing
> gc->dev to ib_register_device() trigger a warning and fall back to a 64 KiB
> DMA segment size limit because gc->dev->dma_parms is NULL?
> 
> In drivers/infiniband/hw/mana/device.c, mana_ib_probe() registers the IB
> device with gc->dev as the dma_device:
> 
> 	ret = ib_register_device(&dev->ib_dev, mana_ib_is_rnic(dev) ? "mana_%d" : "manae_%d",
> 				 gc->dev);
> 
> And in drivers/infiniband/core/device.c, ib_register_device() checks:
> 
> 	WARN_ON(dma_device && !dma_device->dma_parms);
> 	device->dma_device = dma_device;
> 
> Unlike struct pci_dev, struct cdx_device does not attach a dma_parms
> structure, which is noted in mana_cdx_setup_hwc_irqs() in
> drivers/net/ethernet/microsoft/mana/gdma_cdx.c:
> 
> 	/* The PCI path also calls dma_set_max_seg_size(), but that is
> 	 * deliberately omitted here: the CDX core does not attach a
> 	 * dma_parms to the device, so the helper would only WARN, and MANA
> 	 * never builds scatter-gather lists, so the limit is never read.
> 	 */
> 
> In addition to triggering the warning in ib_register_device() on probe,
> mana_ib_create_queue() and mana_ib_reg_user_mr() build scatter-gather lists
> via ib_umem_get_cq_buf_or_va() and ib_umem_get_va(), where
> __ib_umem_get_va() calls ib_dma_max_seg_size() -> dma_get_max_seg_size() and
> falls back to SZ_64K instead of UINT_MAX when dma_parms is NULL.

The analysis looks correct to me. How was it tested?

Thanks

> 
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/20261103115032.736554-1-kotaranov@linux.microsoft.com?part=1
> 

      reply	other threads:[~2026-11-04  9:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 11:50 [PATCH rdma-next] RDMA/mana_ib: Enable RDMA devices on the CDX bus Konstantin Taranov
2026-11-03 12:05 ` sashiko-bot
2026-11-04  9:41   ` Leon Romanovsky [this message]

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=20261104094108.GA478286@unreal \
    --to=leon@kernel.org \
    --cc=kotaranov@linux.microsoft.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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