From: Leon Romanovsky <leon@kernel.org>
To: Zhiyue Qiu <zhiyueqiu@microsoft.com>
Cc: Konstantin Taranov <kotaranov@microsoft.com>,
Snehal Sanghvi <snsanghvi@microsoft.com>,
"longli@microsoft.com" <longli@microsoft.com>,
"jgg@ziepe.ca" <jgg@ziepe.ca>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH rdma-next v3] RDMA/mana_ib: Enable RDMA devices on the CDX bus
Date: Thu, 3 Dec 2026 21:43:23 +0200 [thread overview]
Message-ID: <20261203194323.GY31440@unreal> (raw)
In-Reply-To: <PH0PR21MB5918CB654FDD560F4CDD96EFBE4B2@PH0PR21MB5918.namprd21.prod.outlook.com>
On Thu, Dec 03, 2026 at 06:34:37AM +0000, Zhiyue Qiu wrote:
> Enable MANA RDMA on CDX by depending on the shared GDMA core and matching
> the CDX auxiliary devices.
>
> On arm64, ioremap() maps the CDX doorbell pages in BAR0 as Device-nGnRE,
> but pgprot_writecombine() maps them as Normal-NC in userspace. Using
> pgprot_device() to match the kernel mapping fixes the observed CDX
> lockup. PCI write-combining is unchanged.
>
> mana_ib_query_device() reads the vendor ID through to_pci_dev(), but the
> GDMA device on CDX is not a pci_dev. Both MANA transport ID tables match
> only Microsoft's vendor ID (0x1414). Report PCI_VENDOR_ID_MICROSOFT
> directly so userspace gets the same ID on either bus without a PCI cast.
>
> Allocate missing DMA parameters before GDMA setup using managed memory.
> Register a cleanup action to clear the device pointer before the memory
> is freed. Set the 32-bit DMA mask and segment limits in CDX probe before
> GDMA sets up interrupts or queues. These are device-wide constraints,
> not properties of the HWC IRQs.
>
> Signed-off-by: Zhiyue Qiu <zhiyueqiu@microsoft.com>
> Co-developed-by: Konstantin Taranov <kotaranov@microsoft.com>
> Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
> ---
> Changes in v3:
> - Explain the CDX doorbell memory type and the source of the RDMA vendor ID.
> - Leave the Kconfig help text unchanged.
> - Move CDX DMA mask and segment setup from HWC IRQ setup to probe.
>
> Changes in v2:
> - Allocate missing CDX DMA parameters before GDMA setup.
>
> drivers/infiniband/hw/mana/Kconfig | 2 +-
> drivers/infiniband/hw/mana/device.c | 2 +
> drivers/infiniband/hw/mana/main.c | 9 ++-
> .../net/ethernet/microsoft/mana/gdma_cdx.c | 70 ++++++++++++-------
> 4 files changed, 54 insertions(+), 29 deletions(-)
<...>
> +static void mana_cdx_clear_dma_parms(void *data)
> +{
> + struct device *dev = data;
> +
> + dev->dma_parms = NULL;
Like I said, this is not needed.
> +}
> +
> static int mana_cdx_gd_probe(struct cdx_device *cdx_dev)
> {
> struct gdma_context *gc;
> @@ -241,6 +224,43 @@ static int mana_cdx_gd_probe(struct cdx_device *cdx_dev)
> gc->bar0_va = bar0_va;
> gc->dev = &cdx_dev->dev;
> gc->bus_ops = &mana_cdx_bus_ops;
> + if (!gc->dev->dma_parms) {
> + gc->dev->dma_parms = devm_kzalloc(gc->dev,
> + sizeof(*gc->dev->dma_parms),
> + GFP_KERNEL);
I generally avoid devm_* interfaces when the allocation and cleanup paths are explicit.
Thanks
prev parent reply other threads:[~2026-12-03 19:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 6:34 [PATCH rdma-next v3] RDMA/mana_ib: Enable RDMA devices on the CDX bus Zhiyue Qiu
2026-12-03 6:54 ` sashiko-bot
2026-12-03 19:43 ` 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=20261203194323.GY31440@unreal \
--to=leon@kernel.org \
--cc=jgg@ziepe.ca \
--cc=kotaranov@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=snsanghvi@microsoft.com \
--cc=zhiyueqiu@microsoft.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.