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

Kevin Traynor ktraynor at redhat.com
Fri Jul 18 21:30:30 CEST 2025


Hi,

FYI, your patch has been queued to stable release 24.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/23/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://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/a9ea24c564ab79d37387995c0c3cc33e17f771b6

Thanks.

Kevin

---
>From a9ea24c564ab79d37387995c0c3cc33e17f771b6 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

[ 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 7708a0b808..f2ae75a8e1 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -648,4 +648,12 @@ mlx5_dev_set_mtu(struct rte_eth_dev *dev, uint16_t 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);
-- 
2.50.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-07-18 20:29:14.333097682 +0100
+++ 0096-net-mlx5-avoid-setting-kernel-MTU-if-not-needed.patch	2025-07-18 20:29:11.002907552 +0100
@@ -1 +1 @@
-From f1f9113a08b202d302ba9448d351c04da48ff46d Mon Sep 17 00:00:00 2001
+From a9ea24c564ab79d37387995c0c3cc33e17f771b6 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f1f9113a08b202d302ba9448d351c04da48ff46d ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index a50320075c..b7df39ace9 100644
+index 7708a0b808..f2ae75a8e1 100644
@@ -26 +27 @@
-@@ -679,4 +679,12 @@ mlx5_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)
+@@ -648,4 +648,12 @@ mlx5_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu)



More information about the stable mailing list