From: Stefan Metzmacher <metze@samba.org>
To: netdev@vger.kernel.org
Cc: metze@samba.org, Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Willem de Bruijn <willemb@google.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Potnuri Bharat Teja <bharat@chelsio.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Tatyana Nikolova <tatyana.e.nikolova@intel.com>,
Jacob Moroni <jmoroni@google.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Tariq Toukan <tariqt@nvidia.com>, Mark Bloch <mbloch@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>
Subject: [PATCH net-next 0/3] devlink: support the enable_rdma param in runtime cmode for cxgb4, mlx5 and ice
Date: Mon, 30 Nov 2026 23:09:57 +0100 [thread overview]
Message-ID: <cover.1796076486.git.metze@samba.org> (raw)
Hi,
today the RDMA function of a NIC can only be detached by unloading
the RDMA driver (iw_cxgb4, mlx5_ib, irdma), which affects all
adapters, or with a devlink reload of enable_rdma in driverinit
cmode, which also unregisters the netdev, so its addresses, routes
and other configuration are lost.
This series adds the runtime cmode of the generic enable_rdma devlink
param to cxgb4, mlx5 and ice:
devlink dev param set pci/0000:03:00.0 name enable_rdma value false cmode runtime
It only unplugs (or plugs again) the RDMA part of the function and
leaves the netdev alone. This is useful e.g. to run a software RDMA
provider (siw or rxe) on the same port, or to test how RDMA
consumers handle a device going away and coming back.
- cxgb4 gets a devlink instance for adapters with offload support,
the param detaches/attaches the RDMA ULD of that adapter (there is
one RDMA device for all ports of an adapter). Disabling it is
refused while user space applications use the RDMA device, as
iw_cxgb4 can't disassociate them.
- mlx5 adds the runtime cmode next to the existing driverinit one,
it unplugs/plugs the RDMA auxiliary device of the function and
disables the RoCE state of the NIC vport again, so RoCEv2 packets
reach the netdev. It's refused in switchdev/multiport mode and
while LAG is active.
- ice adds the runtime cmode next to the existing driverinit one,
unlike setting enable_roce and enable_iwarp to false the selected
RDMA protocol is kept and the auxiliary device stays unplugged
across resets.
For mlx5 and ice enabling it at runtime requires it to be enabled in
driverinit cmode, and a reload resets it to the driverinit value.
A related iw_cxgb4 change, which reuses the uld context when attached
again, is sent separately to linux-rdma.
These patches were developed with the help of Claude (Anthropic),
which was used for code analysis, writing parts of the code and the
commit messages. I reviewed all changes and take full responsibility
for them.
Testing: the series is part of the kernel of our RDMA test setup since
v7.4-rc1, currently v7.4-rc4 based, two hosts with Chelsio T520-BT
(cxgb4/iw_cxgb4), ConnectX (mlx5) and Intel E810 (ice/irdma). Its
setup scripts use the runtime cmode regularly to detach and attach the
hardware RDMA of the cxgb4 and mlx5 ports, e.g. to use siw or rxe on
the same port instead. For ice the off/on cycle was done on the
v7.4-rc4 based kernel on both PFs, one in RoCEv2 and one in iWARP mode:
the irdma device went away and came back, the netdev kept its addresses
and routes, and the RDMA device was usable again (SMB over RDMA with
RoCEv2, rping with iWARP). On netdev-next/main the series was only
build tested.
Base: netdev-next/main (02e8a63b4685)
Stefan Metzmacher (3):
cxgb4: support the enable_rdma devlink param in runtime cmode
net/mlx5: support the enable_rdma devlink param in runtime cmode
ice: support the enable_rdma devlink param in runtime cmode
Documentation/networking/devlink/cxgb4.rst | 31 +++++++
Documentation/networking/devlink/ice.rst | 7 ++
Documentation/networking/devlink/index.rst | 1 +
Documentation/networking/devlink/mlx5.rst | 11 +++
drivers/infiniband/hw/cxgb4/device.c | 1 +
drivers/net/ethernet/chelsio/Kconfig | 1 +
drivers/net/ethernet/chelsio/cxgb4/Makefile | 2 +-
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 7 ++
.../ethernet/chelsio/cxgb4/cxgb4_devlink.c | 93 +++++++++++++++++++
.../net/ethernet/chelsio/cxgb4/cxgb4_main.c | 6 ++
.../net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 74 +++++++++++++++
.../net/ethernet/chelsio/cxgb4/cxgb4_uld.h | 2 +
.../net/ethernet/intel/ice/devlink/devlink.c | 66 ++++++++++++-
drivers/net/ethernet/intel/ice/ice.h | 1 +
drivers/net/ethernet/intel/ice/ice_idc.c | 5 +-
drivers/net/ethernet/mellanox/mlx5/core/dev.c | 10 +-
.../net/ethernet/mellanox/mlx5/core/devlink.c | 70 +++++++++++++-
.../ethernet/mellanox/mlx5/core/mlx5_core.h | 1 +
include/linux/mlx5/driver.h | 2 +
19 files changed, 383 insertions(+), 8 deletions(-)
create mode 100644 Documentation/networking/devlink/cxgb4.rst
create mode 100644 drivers/net/ethernet/chelsio/cxgb4/cxgb4_devlink.c
--
2.43.0
next reply other threads:[~2026-11-30 22:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 22:09 Stefan Metzmacher [this message]
2026-11-30 22:09 ` [PATCH net-next 1/3] cxgb4: support the enable_rdma devlink param in runtime cmode Stefan Metzmacher
2026-11-30 22:09 ` [PATCH net-next 2/3] net/mlx5: " Stefan Metzmacher
2026-11-30 22:10 ` [PATCH net-next 3/3] ice: " Stefan Metzmacher
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=cover.1796076486.git.metze@samba.org \
--to=metze@samba.org \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=bharat@chelsio.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jgg@ziepe.ca \
--cc=jiri@resnulli.us \
--cc=jmoroni@google.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=rdunlap@infradead.org \
--cc=saeedm@nvidia.com \
--cc=skhan@linuxfoundation.org \
--cc=tariqt@nvidia.com \
--cc=tatyana.e.nikolova@intel.com \
--cc=willemb@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox