mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH rdma v7 0/7] Add ZTE DingHai Ethernet Protocol Driver for RDMA
@ 2026-10-27  2:11 Yanze Zhang
  2026-10-27  2:11 ` [PATCH rdma v7 1/7] RDMA/zrdma: Add build infrastructure and module skeleton Yanze Zhang
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Yanze Zhang @ 2026-10-27  2:11 UTC (permalink / raw)
  To: jgg, leon, julianbraha, huangjunxian6, yanjun.zhu
  Cc: Markus.Elfring, lkp, linux-kernel, linux-rdma, wei.quan,
	han.junyang, ran.ming, han.chengfei, zhang.yanze

Hi,

This is v7 of the ZTE DingHai (ZXDH) RDMA driver, providing RoCEv2
support for ZTE DingHai network adapters.

The DingHai Ethernet PF driver this RDMA driver attaches to is being
merged through net-next. The first batch, which introduces the DINGHAI
Kconfig symbol and the "dinghai10e" PF driver, is already in net-next
[1]; the second batch is still under review [2]. The auxiliary device
that this driver binds to is created by a patch that is still being
prepared and has not been posted yet; this series is therefore posted
for review ahead of that patch, and the driver will not probe on the
upstream baseline until it lands. This series is based on an
rdma/for-next baseline that already contains the first batch, so
"depends on DINGHAI" resolves. The driver registers as an auxiliary
driver and matches the auxiliary device by name only, so it cannot bind
to an unrelated PCI function.

v7 folds the review feedback on v6 [3] back into the patch that
introduced the affected code. Each change below was verified against
the reported issue before being applied:

 - Patch 2/7: tag the UAPI header with the Linux-syscall-note SPDX
   identifier, which is required for a header that is installed to
   userspace.
 - Patch 3/7: pass the name buffer length to zxdh_get_del_rdma_name()
   and use guard(spinlock_irqsave) in zxdh_free_rsrc(); zxdh_alloc_rsrc()
   keeps the explicit lock because of its multiple early exits.
 - Patch 4/7: keep zrdma_main.c in place. v6 removed it in the middle
   of the series, which broke both bisection and the build of that
   single commit; the probe implementation now modifies the file
   instead.
 - Patch 5/7: install the device ops right after ib_alloc_device(), so
   the dealloc_driver hook is in place before any resource is taken.
   The hook releases the pci function, the handler and the resource
   bitmaps, and it only destroys the ah_list_lock when it was actually
   initialised.
 - Patch 6/7: report the SRQ doorbell offset like the SQ and CQ
   doorbells, and extend the SRQ mapping so that it covers the whole
   doorbell area on 16K and 64K page systems. The size handed to
   userspace is the very same length that is registered, otherwise
   rdma_user_mmap_entry_get() rejects the mmap.
 - Patch 7/7: accept a NULL udata in query_device(), which is how the
   core calls it during registration; report the number of send and
   receive SGEs; parse the firmware version as unsigned values and
   keep the "N/A" placeholder when no version can be extracted; read
   the driver info with rtnl held, taking the lock only when the
   caller does not hold it already; take the port speed from
   ib_get_eth_speed() instead of caching a value that goes stale on a
   link change; fill in the immutable port information directly, so
   that it does not depend on the port query being run while the
   device is still being registered; pass the port number to
   rdma_protocol_roce() instead of hard coding it; drop the query_gid
   callback, as the RoCE GID cache is owned by the core.

In short, v7 additionally fixes:

 - The UAPI SPDX identifier, which headers_install rejected because the
   header is installed to userspace.
 - The probe error paths, which leaked the pci function, the handler and
   the hardware resource buffers because dealloc_driver was not
   registered early enough.
 - The deletion of zrdma_main.c in the middle of the series, which broke
   both bisection and the build of that single commit.
 - The NULL dereference of udata in query_device(), which
   ib_register_device() passes as NULL.
 - The missing max_send_sge and max_recv_sge, the SRQ doorbell page
   offset on 16K and 64K page systems, and the misuse of
   rtnl_trylock() in get_drvinfo().
 - The immutable port information, which was taken from the port query
   while the device was still being registered.

rmmod stress-testing also found a refcount_underflow in
ib_device.refcount: ib_unregister_device_and_put() performs an extra
put, but the auxiliary-bus probe path never takes a 'get'. The driver
uses plain ib_unregister_device(); ib_dealloc_device() still runs
.dealloc_driver via the normal refcount-release path. The issue was
reproduced before the fix, and the fix was verified with repeated
load/unload cycles on v6. v7 keeps the very same plain
ib_unregister_device() path, so the fix itself is unchanged.

Testing in this version focuses on the review fixes: the driver
builds, probes on DingHai hardware, and 'rdma link' / 'ibv_devinfo'
enumerate the device. The hardware testing was done with a PF driver
that already creates the auxiliary device, because the baseline that
this series is based on only has the first batch, which does not create
it yet. The build was tested with CONFIG_DINGHAI=y, because the Kconfig
now depends on it, and every commit of the series was built on its own
to make sure that the series stays bisectable. Perftest (QP/CQ/MR
creation and the data path) is covered by the parallel network driver
series, so we did not want to hold these review fixes on it. Functional
verbs testing will be reported once both series are merged.

Two items raised in review are deliberately left out because they
need input we do not have yet:

 - The common_func() opcode for the IRQ capability query: needs
   confirmation against the firmware interface document; the current
   opcode works on the tested firmware.
 - The shutdown-vs-quiesce semantics and the doorbell isolation
   mechanism: these need the hardware team's confirmation.

Two other points are noted for completeness. An __iomem annotation on
mem_rsrc is moot, since it is plain vzalloc'd memory rather than a BAR
mapping. Replacing the resource bitmaps with XArray/IDA is a cleanup
that does not change behaviour and will follow separately. Neither of
them affects probe/remove or the verbs that are implemented here.

[1] https://lore.kernel.org/netdev/178598040988.599522.8462097247667886071.git-patchwork-notify@kernel.org/
[2] https://lore.kernel.org/netdev/20261014151200489685SCIlolykW0NGfL5EtQ@zte.com.cn/
[3] https://lore.kernel.org/linux-rdma/20261024071539.2182864-1-zhang.yanze@zte.com.cn/

Yanze Zhang (7):
  RDMA/zrdma: Add build infrastructure and module skeleton
  RDMA/zrdma: Add core data structures and ABI definitions
  RDMA/zrdma: Add internal headers and hardware register definitions
  RDMA/zrdma: Add hardware resource initialization and verbs skeleton
  RDMA/zrdma: Add device probe and remove logic
  RDMA/zrdma: Implement context, PD, and mmap operations
  RDMA/zrdma: Implement device and port query operations

 MAINTAINERS                               |   6 +
 drivers/infiniband/Kconfig                |   1 +
 drivers/infiniband/hw/Makefile            |   1 +
 drivers/infiniband/hw/zrdma/Kconfig       |  11 +
 drivers/infiniband/hw/zrdma/Makefile      |   7 +
 drivers/infiniband/hw/zrdma/zrdma_ctrl.h  |  22 +
 drivers/infiniband/hw/zrdma/zrdma_defs.h  |  19 +
 drivers/infiniband/hw/zrdma/zrdma_hw.c    | 118 ++++
 drivers/infiniband/hw/zrdma/zrdma_hw.h    |  21 +
 drivers/infiniband/hw/zrdma/zrdma_main.c  | 305 ++++++++++
 drivers/infiniband/hw/zrdma/zrdma_main.h  | 216 +++++++
 drivers/infiniband/hw/zrdma/zrdma_type.h  |  86 +++
 drivers/infiniband/hw/zrdma/zrdma_verbs.c | 697 ++++++++++++++++++++++
 drivers/infiniband/hw/zrdma/zrdma_verbs.h | 134 +++++
 include/uapi/rdma/ib_user_ioctl_verbs.h   |   1 +
 include/uapi/rdma/zrdma_abi.h             |  80 +++
 16 files changed, 1725 insertions(+)
 create mode 100644 drivers/infiniband/hw/zrdma/Kconfig
 create mode 100644 drivers/infiniband/hw/zrdma/Makefile
 create mode 100644 drivers/infiniband/hw/zrdma/zrdma_ctrl.h
 create mode 100644 drivers/infiniband/hw/zrdma/zrdma_defs.h
 create mode 100644 drivers/infiniband/hw/zrdma/zrdma_hw.c
 create mode 100644 drivers/infiniband/hw/zrdma/zrdma_hw.h
 create mode 100644 drivers/infiniband/hw/zrdma/zrdma_main.c
 create mode 100644 drivers/infiniband/hw/zrdma/zrdma_main.h
 create mode 100644 drivers/infiniband/hw/zrdma/zrdma_type.h
 create mode 100644 drivers/infiniband/hw/zrdma/zrdma_verbs.c
 create mode 100644 drivers/infiniband/hw/zrdma/zrdma_verbs.h
 create mode 100644 include/uapi/rdma/zrdma_abi.h

-- 
2.27.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-10-27  7:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27  2:11 [PATCH rdma v7 0/7] Add ZTE DingHai Ethernet Protocol Driver for RDMA Yanze Zhang
2026-10-27  2:11 ` [PATCH rdma v7 1/7] RDMA/zrdma: Add build infrastructure and module skeleton Yanze Zhang
2026-10-27  2:11 ` [PATCH rdma v7 2/7] RDMA/zrdma: Add core data structures and ABI definitions Yanze Zhang
2026-10-27  2:11 ` [PATCH rdma v7 3/7] RDMA/zrdma: Add internal headers and hardware register definitions Yanze Zhang
2026-10-27  7:10   ` Markus Elfring
2026-10-27  2:11 ` [PATCH rdma v7 4/7] RDMA/zrdma: Add hardware resource initialization and verbs skeleton Yanze Zhang
2026-10-27  2:11 ` [PATCH rdma v7 5/7] RDMA/zrdma: Add device probe and remove logic Yanze Zhang
2026-10-27  2:11 ` [PATCH rdma v7 6/7] RDMA/zrdma: Implement context, PD, and mmap operations Yanze Zhang
2026-10-27  2:11 ` [PATCH rdma v7 7/7] RDMA/zrdma: Implement device and port query operations Yanze Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®