From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=144.76.82.148 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796076620; b=oZes4bdgpeSXWuN34JTcaBmO4+udvyaZVBdkgSVCo9/FfaSTyYvv98gwpSA+Dv4fiF3I iuwrHN3Hfm/l9wkZwy3xpL+NH+1YpNuLZDr5apDEmc6gphXZx7/wv/4KURRJ82TQ63i1z MhwyQyQgVbtec0Um6n5QeQR4OFoST5US8EAlY3WBlhvuerJM7aF3AsSbV0DOBU2OYZRPI b9AuRmNaKDoostFyS0x/iIg8ePb/LAFK/5zObp7YyzPCWuaWtcTtBFE4yDB+nH0jSwCA2 lPUBM55BRLlf+IzA6mFBk9sqOsz5OH7km/sPzfpsKffqgIxZyRPt2TqSKJ3/ktsD3hA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796076620; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=rfW+Bqhs7KTzoe/uMUeysW3lcnk7Xtm16WMESyDV7UE=; b=f/+Ifhc21/3tSFB3QX3kQi4eww8YCt9wNlLoyr0+F6X1pqBuUNsZE3EkyMPLdT+7Ganz tkVvWcmcs73bAJeODIRDhdX5WGVTZ7wW2QEE0grsClZdIB12qSx3JKA+vuR5Nem26oPou 9dKymyY6h4UyYe99UWbBjr++r8pF/oJc4V6zPoA2zN41DS64qRMId8hEpiBpu7dEAjq9v sBCK2rt4NOyT4oB+XAchV4dsvTf6APrBjhNDvNzDX3c1GmpPqt9BKv1t4ISVdsB/n0irs p+BTQo7YkAd7n95CE3cESfPRjOg3JVuxZaLJNAFGRqVvEUptrU+2W/5EDAtGmCd3Ctg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=samba.org; spf=pass smtp.mailfrom=samba.org; dkim=pass header.d=samba.org header.i=@samba.org header.a=rsa-sha256 header.s=42 header.b=sxx2ibIG; arc=none smtp.remote-ip=144.76.82.148 Received: from hr2.samba.org (hr2.samba.org [144.76.82.148]) (using TLSv1.3 with cipher TLS_CHACHA20_POLY1305_SHA256 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0590606A31A; Mon, 30 Nov 2026 22:10:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E0590606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=samba.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samba.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (3072-bit key) header.d=samba.org header.i=@samba.org header.a=rsa-sha256 header.s=42 header.b=sxx2ibIG DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42; h=Message-ID:Date:Cc:To:From; bh=rfW+Bqhs7KTzoe/uMUeysW3lcnk7Xtm16WMESyDV7UE=; b=sxx2ibIGrSJNJJsUb+PiMeq1BX 6T89sQXpGIgTghktooww+J2aqr4VtMQI06MUMAqWALIvocdiOW43dUzQf5/KVY8yQN9yZhfeDOC1h SnLe5CNxDkaHMA9coww746/EFwBdZ0drSQu/5r3vyRSkKzRCiDOepi2HEJ78nL0QxSx26RXSg3/ps rwiaiZKqcSqsd4ufdJoAIlqasUOwHa+LQDd2HbnGKGDHGNo0dd3GdIl5RDBX3Nf3pEqMDi8+6weGO tjABxl15JAWu0xiCwat/oxKGxvKcBBcFsxSA888qrXMK8vynGnIziYs9gcAmxE7jJ56FcZRfaWpXF UX/HqtkgXW3ecDzvR+gp7mNDDIoep8dRC7RdDM8JVdxJeZv3U5ooO7dUY3TIjEReBdjkjpVx41Y/O M2uWIYSf0/zRu2hMG4mYwyUP5H+BaOm9X8OBAW0dcaSxkpyVJhgw8snBl7i3o7xLbgb93IZFBUASV HAWYqBfIy9nZXcrNMeZTvMw1; Received: from [127.0.0.2] (localhost [127.0.0.1]) by hr2.samba.org with esmtpsa (TLS1.3:ECDHE_SECP256R1__ECDSA_SECP256R1_SHA256__CHACHA20_POLY1305:256) (Exim) id 1xY9ZY-000000005hA-460X; Mon, 30 Nov 2026 22:10:09 +0000 From: Stefan Metzmacher To: netdev@vger.kernel.org Cc: metze@samba.org, Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Willem de Bruijn , Andrew Lunn , Potnuri Bharat Teja , Jason Gunthorpe , Tony Nguyen , Przemek Kitszel , Tatyana Nikolova , Jacob Moroni , Saeed Mahameed , Tariq Toukan , Mark Bloch , Leon Romanovsky , Jonathan Corbet , intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan , Randy Dunlap 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 Message-ID: X-Mailer: git-send-email 2.43.0 X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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