patch 'net/af_packet: fix MTU set data size calculation' has been queued to stable release 24.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Mar 19 23:02:40 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.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 03/21/26. 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/bluca/dpdk-stable

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

Thanks.

Luca Boccassi

---
>From d7271c057e6e2d89de4cc1534c7998842b5ab169 Mon Sep 17 00:00:00 2001
From: Xavier Guillaume <xavier.guillaume at ovhcloud.com>
Date: Tue, 10 Mar 2026 12:21:20 +0100
Subject: [PATCH] net/af_packet: fix MTU set data size calculation

[ upstream commit b1cd278e97315fc4c19d4157a54d05e974a8d121 ]

The data_size in eth_dev_mtu_set() is calculated as:
  tp_frame_size - TPACKET2_HDRLEN

Since TPACKET2_HDRLEN is defined as:
  TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)

it includes sizeof(struct sockaddr_ll), but the actual packet data
in the TPACKET ring starts at TPACKET_ALIGN(sizeof(struct tpacket2_hdr)).
The sockaddr_ll does not consume frame data space. This makes the
current formula 20 bytes too restrictive, matching neither the
RX queue setup nor the TX queue init path, which both correctly use:
  tp_frame_size - TPACKET2_HDRLEN + sizeof(struct sockaddr_ll)

Fix the calculation to be consistent and accept all valid MTU values.

Fixes: 8020573894a8 ("net/af_packet: fix setting MTU decrements sockaddr twice")

Signed-off-by: Xavier Guillaume <xavier.guillaume at ovhcloud.com>
---
 .mailmap                                  | 1 +
 drivers/net/af_packet/rte_eth_af_packet.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index ba268411d5..7f5b2d18b3 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1716,6 +1716,7 @@ Wojciech Drewek <wojciech.drewek at intel.com>
 Wojciech Liguzinski <wojciechx.liguzinski at intel.com>
 Wojciech Panfil <wojciech.panfil at intel.com>
 Wojciech Zmuda <woz at semihalf.com>
+Xavier Guillaume <xavier.guillaume at ovhcloud.com>
 Xavier Simonart <xavier.simonart at intel.com>
 Xiangjun Meng <mengxiangjun4 at huawei.com>
 Xiaoban Wu <xiaoban_wu at student.uml.edu>
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 0ad199bbd2..6ea1c6c945 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -575,7 +575,7 @@ eth_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 	int ret;
 	int s;
 	unsigned int data_size = internals->req.tp_frame_size -
-				 TPACKET2_HDRLEN;
+				 TPACKET2_HDRLEN + sizeof(struct sockaddr_ll);
 
 	if (mtu > data_size)
 		return -EINVAL;
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-03-19 22:00:49.522294333 +0000
+++ 0048-net-af_packet-fix-MTU-set-data-size-calculation.patch	2026-03-19 22:00:47.814359367 +0000
@@ -1 +1 @@
-From b1cd278e97315fc4c19d4157a54d05e974a8d121 Mon Sep 17 00:00:00 2001
+From d7271c057e6e2d89de4cc1534c7998842b5ab169 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b1cd278e97315fc4c19d4157a54d05e974a8d121 ]
+
@@ -22 +23,0 @@
-Cc: stable at dpdk.org
@@ -31 +32 @@
-index 91866f13c5..e23cd100eb 100644
+index ba268411d5..7f5b2d18b3 100644
@@ -34 +35 @@
-@@ -1791,6 +1791,7 @@ Wojciech Drewek <wojciech.drewek at intel.com>
+@@ -1716,6 +1716,7 @@ Wojciech Drewek <wojciech.drewek at intel.com>
@@ -40 +40,0 @@
- Xi Zhang <xix.zhang at intel.com>
@@ -41,0 +42 @@
+ Xiaoban Wu <xiaoban_wu at student.uml.edu>
@@ -43 +44 @@
-index c0ba3381ea..bfa68297a6 100644
+index 0ad199bbd2..6ea1c6c945 100644
@@ -46 +47 @@
-@@ -612,7 +612,7 @@ eth_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
+@@ -575,7 +575,7 @@ eth_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)


More information about the stable mailing list