patch 'net/af_packet: fix MTU set data size calculation' has been queued to stable release 23.11.7
Shani Peretz
shperetz at nvidia.com
Wed Apr 15 11:59:43 CEST 2026
Hi,
FYI, your patch has been queued to stable release 23.11.7
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/19/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/shanipr/dpdk-stable
This queued commit can be viewed at:
https://github.com/shanipr/dpdk-stable/commit/b7fef93f1a7cedf283b3760a80c35b1b6bc2da2b
Thanks.
Shani
---
>From b7fef93f1a7cedf283b3760a80c35b1b6bc2da2b 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 9692aaa03c..37c4d8d6bc 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1623,6 +1623,7 @@ Wojciech Andralojc <wojciechx.andralojc at intel.com>
Wojciech Drewek <wojciech.drewek at intel.com>
Wojciech Liguzinski <wojciechx.liguzinski 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 6803502c74..2c8f2565ae 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -534,7 +534,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.43.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-04-14 14:44:32.896657747 +0300
+++ 0042-net-af_packet-fix-MTU-set-data-size-calculation.patch 2026-04-14 14:44:28.614515000 +0300
@@ -1 +1 @@
-From b1cd278e97315fc4c19d4157a54d05e974a8d121 Mon Sep 17 00:00:00 2001
+From b7fef93f1a7cedf283b3760a80c35b1b6bc2da2b 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 9692aaa03c..37c4d8d6bc 100644
@@ -34 +35,2 @@
-@@ -1791,6 +1791,7 @@ Wojciech Drewek <wojciech.drewek at intel.com>
+@@ -1623,6 +1623,7 @@ Wojciech Andralojc <wojciechx.andralojc at intel.com>
+ Wojciech Drewek <wojciech.drewek at intel.com>
@@ -36 +37,0 @@
- Wojciech Panfil <wojciech.panfil 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 6803502c74..2c8f2565ae 100644
@@ -46 +47 @@
-@@ -612,7 +612,7 @@ eth_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
+@@ -534,7 +534,7 @@ eth_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
More information about the stable
mailing list