patch 'net/mlx5: avoid setting kernel MTU if not needed' has been queued to stable release 23.11.5

Xueming Li xuemingl at nvidia.com
Thu Jun 26 14:01:40 CEST 2025


Hi,

FYI, your patch has been queued to stable release 23.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/28/25. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ca9827ee06b30c13d157fd518ad1594b90c16667

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From ca9827ee06b30c13d157fd518ad1594b90c16667 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin at redhat.com>
Date: Wed, 28 May 2025 11:36:44 +0200
Subject: [PATCH] net/mlx5: avoid setting kernel MTU if not needed
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit f1f9113a08b202d302ba9448d351c04da48ff46d ]

This patch checks whether the Kernel MTU has the same value
as the requested one at port configuration time, and skip
setting it if it is the same.

Doing this, we can avoid the application to require
NET_ADMIN capability, as in v23.11.

Fixes: 10859ecf09c4 ("net/mlx5: fix MTU configuration")

Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
 drivers/net/mlx5/mlx5_ethdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 4218aef032..3762797fe2 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -669,6 +669,14 @@ mlx5_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
 	ret = mlx5_get_mtu(dev, &kern_mtu);
 	if (ret)
 		return ret;
+
+	if (kern_mtu == mtu) {
+		priv->mtu = mtu;
+		DRV_LOG(DEBUG, "port %u adapter MTU was already set to %u",
+			dev->data->port_id, mtu);
+		return 0;
+	}
+
 	/* Set kernel interface MTU first. */
 	ret = mlx5_set_mtu(dev, mtu);
 	if (ret)
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-06-26 19:59:20.720653005 +0800
+++ 0080-net-mlx5-avoid-setting-kernel-MTU-if-not-needed.patch	2025-06-26 19:59:17.514418039 +0800
@@ -1 +1 @@
-From f1f9113a08b202d302ba9448d351c04da48ff46d Mon Sep 17 00:00:00 2001
+From ca9827ee06b30c13d157fd518ad1594b90c16667 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit f1f9113a08b202d302ba9448d351c04da48ff46d ]
@@ -14 +16,0 @@
-Cc: stable at dpdk.org
@@ -23 +25 @@
-index a50320075c..b7df39ace9 100644
+index 4218aef032..3762797fe2 100644
@@ -26 +28 @@
-@@ -678,6 +678,14 @@ mlx5_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
+@@ -669,6 +669,14 @@ mlx5_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)


More information about the stable mailing list