Re: [PATCH rdma-next v3] RDMA/mana_ib: Enable RDMA devices on the CDX bus

From: Leon Romanovsky

Date: Thu Dec 03 2026 - 14:43:29 EST


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@xxxxxxxxxxxxx>
> Co-developed-by: Konstantin Taranov <kotaranov@xxxxxxxxxxxxx>
> Signed-off-by: Konstantin Taranov <kotaranov@xxxxxxxxxxxxx>
> ---
> 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