From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BD61606A31A for ; Mon, 30 Nov 2026 22:37:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=JkplUWk6; dkim=pass (3072-bit key) header.d=samba.org header.i=@samba.org header.a=rsa-sha256 header.s=42 header.b=sxx2ibIG Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 258F1607A7; Mon, 30 Nov 2026 22:37:04 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 4EtJVUxYdAa2; Mon, 30 Nov 2026 22:37:03 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp3.osuosl.org 6E3AB607C6 Authentication-Results: smtp3.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796078223; b=p9P2GW1Xg4NtdjoTNIK40gYnH6iidwP1ZhiYztsdf/O9fs+pbEulBEwbkHTaYgTJFZeG MfJGohe7atmUxpUEmqv2Pu17sRX5Z4kCk/h/kgtqcTZXnH6tRE4/DjQu/sZ1RcBKobvXz SdUwAhG4eMSg8GOKvndLG5yjPhWSRZtPBR3rn8GCG/bN9kJ9/mjwmNPNPoO/mDUGFKMcu 6+RJe9hMxXSyW2kR4auW47oeFZ994VHzGdM0UcEqx2+0dCYd4AWMeO3Vie6Smg3GVYABL wA3/cfO/tye4FKm6iUROoL50jim8VhYctnQ+Kcz25dwsJVCmFFdum9gSM97YhI142cg== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796078223; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:X-Greylist:Received-SPF:Received: DKIM-Signature:Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding:X-BeenThere:X-Mailman-Version: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:Errors-To; bh=rfW+Bqhs7KTzoe/uMUeysW3lcnk7Xtm16WMESyDV7UE=; b=jcvnI7p6OPPiUOK0o0UhNN2NO//4MwNWGePi8nGW221yvcvu7UbE6hMKo62VE9qAFVwy 87VNPpgWB1guaWz1PR6qS7q0PWNcLsFiZZM5MB24a3kYp+iGssp/bUTXu68nLZ3KHd3EY lSNmkiZWRupMXNcUg1bsR2Zfkb+hrfJ+gU7BVtzb2EPsOVCnqhphEtgQ5svcfX4umFxhZ JfOKiWGgemxwHXvavPI4uWRkwuk587pc1GMhQjgz5z8gAIvs3avZDbZUYjHT+/gJdsuAP Ecw/gd3vJ32eyYiH8gyQPLbRup5WeT30UJmIV1ITjGzXxswrsYr+1CFU7VcEG/RrVbw== ARC-Authentication-Results: i=1; smtp3.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1796078223; bh=rfW+Bqhs7KTzoe/uMUeysW3lcnk7Xtm16WMESyDV7UE=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=JkplUWk6WXhkblbYqixDRIjhpW2nzsDah2g4URM6Ra2KMzh/3I2iL9TwSvevdedzz noekYlPL+Zr9EBVNxdaTxAycFy70q/jMH3ANp8xLV+8SXWRFlxYlOxt0h2Wlw/NX3g z87+FDtkPrfBJXFhaVZWavHWbX78kzi+EpX9qipFymCw/g8q0NtxHE9gpG0nbecktG i6OsNp/yrhvlRq05k+X9rZT9udqmVLtum0Sv4/DHflnXl6wH/a+Axx3md/DX/AthFH a9HZ0a4IiyHqjTwCB3rkupD+qKOSD93gixi7o2Oqw6i2sUNdFz/nzSn+KTqm6QB+qd 6Helrelk8C74g== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 6E3AB607C6; Mon, 30 Nov 2026 22:37:03 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists1.osuosl.org (Postfix) with ESMTP id E60C4523 for ; Mon, 30 Nov 2026 22:37:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id C11ED4020D for ; Mon, 30 Nov 2026 22:37:01 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id c0MOM3PFjnTF for ; Mon, 30 Nov 2026 22:37:01 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp2.osuosl.org 6EBA440079 Authentication-Results: smtp2.osuosl.org; arc=none smtp.remote-ip="2a01:4f8:192:486::2:0" X-Greylist: delayed 1601 seconds by postgrey-1.37 at util1.osuosl.org; Mon, 30 Nov 2026 22:37:00 UTC Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=samba.org Authentication-Results: smtp2.osuosl.org; dkim=pass (3072-bit key, unprotected) header.d=samba.org header.i=@samba.org header.a=rsa-sha256 header.s=42 header.b=sxx2ibIG Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a01:4f8:192:486::2:0; helo=hr2.samba.org; envelope-from=metze@samba.org; receiver= Received: from hr2.samba.org (hr2.samba.org [IPv6:2a01:4f8:192:486::2:0]) by smtp2.osuosl.org (Postfix) with ESMTPS id 6EBA440079 for ; Mon, 30 Nov 2026 22:36:59 +0000 (UTC) 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-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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