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

Hi,

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

The driver binds to the DingHai Ethernet function through the auxiliary
bus; the corresponding Ethernet network driver is being submitted in
parallel [1]. Because the auxiliary device is only created by that
network driver, the RDMA driver cannot probe unrelated PCI devices even
though Kconfig currently depends on generic NETDEVICES and PCI. We plan
to replace this with a direct dependency once the network driver is
merged, but the current dependency is intentional and safe at runtime.

v6 addresses the review feedback on v5 [2], folding each fix back into
the patch that introduced the affected code:

 - Patch 1/7: drop the ineffective .driver.name indirection in
   auxiliary_driver.
 - Patch 2/7: drop ZXDH_RDMA_TOOL_SHOW_RES_MAP (bit-5 collision with
   ZXDH_RDMA_TOOL_CFG_DEV_PARAM); move zrdma_abi.h to
   include/uapi/rdma/ and include <linux/types.h> so userspace can use
   the ABI directly.
 - Patch 3/7: pick up the new UAPI header location.
 - Patch 4/7: remove the now-unused SRQ_DB_OFFSET macro.
 - Patch 5/7: use .dealloc_driver for probe/remove cleanup; add a
   NULL guard in zxdh_del_handler; drop the duplicate
   ib_register_device retry; publish the handler only after
   ib_register_device succeeds; pass the name buffer length to
   zxdh_get_del_rdma_name() instead of strlen() on an output buffer;
   take the common_func() result as int so a negative errno is not
   mistaken for a capability; guard max_ceqs against msix_count == 0;
   free the leftover zxdh_rdma_list on module exit.
 - Patch 6/7: use kvfree for the vzalloc'd regions; rate-limit the
   PD-allocation warning; apply the page-offset mask to
   srq_db_bar_off like the SQ/CQ doorbells.
 - Patch 7/7: use rtnl_trylock instead of rtnl_lock when walking the
   bond's lower devices; add an ethtool_ops NULL guard; build
   sys_image_guid with addrconf_addr_eui48(); set ibdev_status before
   ib_register_device(); rewrite extract_version() to handle both
   "E310-V25.30.103.01" and "<ver> (<vendor>)" layouts.

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'. v6 uses
plain ib_unregister_device(); ib_dealloc_device() still runs
.dealloc_driver via the normal refcount-release path. This was
reproduced before the fix and verified with repeated load/unload
cycles after it.

Testing in this version focused on the review fixes above: the driver
builds and probes on DingHai hardware, and 'rdma link' / 'ibv_devinfo'
enumerate the device correctly. Functional verbs testing (QP/CQ/MR
creation and data path) is being run against the parallel network
driver submission and will be reported with that series; we did not
want to hold these review fixes on it.

The following items were raised in review and are deliberately not
part of this series. None of them affects the probe/remove path or the
verbs implemented here:

 - __iomem annotation: mem_rsrc is plain vzalloc'd memory, not a BAR
   mapping, so the annotation is moot until the access path changes.
 - XArray/IDA for resource tracking: current list-based tracking is
   bounded by the number of resources created per device; converting
   it is a cleanup we will do separately.
 - The common_func() opcode for the IRQ capability query: needs
   confirmation against the firmware interface document; the current
   opcode works on the tested firmware.
 - shutdown-vs-quiesce semantics, doorbell isolation mechanism, and
   the resource-pool name in the allocation failure log: these need
   input from the hardware/firmware team and will follow in a separate
   series.

[1] https://lore.kernel.org/netdev/178598040988.599522.8462097247667886071.git-patchwork-notify@kernel.org/
[2] https://sashiko.dev/#/patchset/20260811093740.2607476-1-zhang.yanze@zte.com.cn

 MAINTAINERS                               |   6 +
 drivers/infiniband/Kconfig                |   1 +
 drivers/infiniband/hw/Makefile            |   1 +
 drivers/infiniband/hw/zrdma/Kconfig       |  12 +
 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    | 103 +++
 drivers/infiniband/hw/zrdma/zrdma_hw.h    |  21 +
 drivers/infiniband/hw/zrdma/zrdma_main.c  | 299 +++++++++
 drivers/infiniband/hw/zrdma/zrdma_main.h  | 216 +++++++
 drivers/infiniband/hw/zrdma/zrdma_type.h  |  86 +++
 drivers/infiniband/hw/zrdma/zrdma_verbs.c | 753 ++++++++++++++++++++++
 drivers/infiniband/hw/zrdma/zrdma_verbs.h | 128 +++
 include/uapi/rdma/ib_user_ioctl_verbs.h   |   1 +
 include/uapi/rdma/zrdma_abi.h             |  81 +++
 16 files changed, 1756 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] 10+ messages in thread

end of thread, other threads:[~2026-10-24 18:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-24  7:15 [PATCH rdma v6 0/7] Add ZTE DingHai Ethernet Protocol Driver for RDMA Yanze Zhang
2026-10-24  7:15 ` [PATCH 1/7] RDMA/zrdma: Add build infrastructure and module skeleton Yanze Zhang
2026-10-24  7:15 ` [PATCH 2/7] RDMA/zrdma: Add core data structures and ABI definitions Yanze Zhang
2026-10-24 18:33   ` kernel test robot
2026-10-24  7:15 ` [PATCH 3/7] RDMA/zrdma: Add internal headers and hardware register definitions Yanze Zhang
2026-10-24  8:43   ` [PATCH v6? " Markus Elfring
2026-10-24  7:15 ` [PATCH 4/7] RDMA/zrdma: Add hardware resource initialization and verbs skeleton Yanze Zhang
2026-10-24  7:15 ` [PATCH 5/7] RDMA/zrdma: Add device probe and remove logic Yanze Zhang
2026-10-24  7:15 ` [PATCH 6/7] RDMA/zrdma: Implement context, PD, and mmap operations Yanze Zhang
2026-10-24  7:15 ` [PATCH 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®