patch 'gro: fix packet type comparisons' has been queued to stable release 25.11.5
Kevin Traynor
ktraynor at redhat.com
Thu Dec 3 14:05:56 CET 2026
Hi,
FYI, your patch has been queued to stable release 25.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 12/08/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/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/fd70e28bff5975f757948684e8a3fcd5ad1f760a
Thanks.
Kevin
---
>From fd70e28bff5975f757948684e8a3fcd5ad1f760a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Morten=20Br=C3=B8rup?= <mb at smartsharesystems.com>
Date: Tue, 3 Nov 2026 09:36:18 +0100
Subject: [PATCH] gro: fix packet type comparisons
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit af14eb0a23f8093db18fc2f193e058f2f981d8ad ]
Identifying packet types requires masking with the mask, not the value,
before comparing to the value.
The faulty macros were corrected.
Furthermore, GRO for UDP ingests IP fragments, not UDP packets, so
compare to IP fragments instead of UDP packets.
The same applies to GRO for inner UDP in VXLAN packets; compare to
to inner IP fragments instead of inner UDP packets.
This was not obvious looking at the macros, so they were renamed to
reflect what they match, and comments were added to mention what they are
used for.
Note:
This bug has not been caught earlier, probably because the faulty formula
"((ptype & RTE_PTYPE_L4_UDP) == RTE_PTYPE_L4_UDP)" matched IP fragments
by pure luck:
RTE_PTYPE_L4_UDP has the value 0x200, and
RTE_PTYPE_L4_FRAG has the value 0x300, so the faulty formula
evaluates as "((0x300 & 0x200) == 0x200)", which is true.
It also - incorrectly - matched other packet types with the 0x200 bit set,
e.g. RTE_PTYPE_L4_IGMP (value 0x700), which it shouldn't match.
Fixes: 0d2cbe59b719 ("lib/gro: support TCP/IPv4")
Fixes: 9e0b9d2ec0f4 ("gro: support VxLAN GRO")
Fixes: 1ca5e6740852 ("gro: support UDP/IPv4")
Fixes: e2d811063673 ("gro: support VXLAN UDP/IPv4")
Signed-off-by: Morten Brørup <mb at smartsharesystems.com>
Tested-by: Andrey Mokrushin <a.mokrushin at ideco.ru>
---
lib/gro/rte_gro.c | 37 ++++++++++++++++++-------------------
1 file changed, 18 insertions(+), 19 deletions(-)
diff --git a/lib/gro/rte_gro.c b/lib/gro/rte_gro.c
index 168960b8af..9fc33def60 100644
--- a/lib/gro/rte_gro.c
+++ b/lib/gro/rte_gro.c
@@ -36,24 +36,22 @@ static gro_tbl_pkt_count_fn tbl_pkt_count_fn[RTE_GRO_TYPE_MAX_NUM] = {
#define IS_IPV4_TCP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
- ((ptype & RTE_PTYPE_L4_TCP) == RTE_PTYPE_L4_TCP) && \
- ((ptype & RTE_PTYPE_L4_FRAG) != RTE_PTYPE_L4_FRAG) && \
+ ((ptype & RTE_PTYPE_L4_MASK) == RTE_PTYPE_L4_TCP) && \
(RTE_ETH_IS_TUNNEL_PKT(ptype) == 0))
/* GRO with extension headers is not supported */
#define IS_IPV6_TCP_PKT(ptype) (RTE_ETH_IS_IPV6_HDR(ptype) && \
- ((ptype & RTE_PTYPE_L4_TCP) == RTE_PTYPE_L4_TCP) && \
- ((ptype & RTE_PTYPE_L4_FRAG) != RTE_PTYPE_L4_FRAG) && \
+ ((ptype & RTE_PTYPE_L4_MASK) == RTE_PTYPE_L4_TCP) && \
(RTE_ETH_IS_TUNNEL_PKT(ptype) == 0))
-#define IS_IPV4_UDP_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
- ((ptype & RTE_PTYPE_L4_UDP) == RTE_PTYPE_L4_UDP) && \
+/* GRO for UDP ingests IP fragments */
+#define IS_IPV4_FRAG_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
+ ((ptype & RTE_PTYPE_L4_MASK) == RTE_PTYPE_L4_FRAG) && \
(RTE_ETH_IS_TUNNEL_PKT(ptype) == 0))
#define IS_IPV4_VXLAN_TCP4_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
- ((ptype & RTE_PTYPE_L4_UDP) == RTE_PTYPE_L4_UDP) && \
- ((ptype & RTE_PTYPE_L4_FRAG) != RTE_PTYPE_L4_FRAG) && \
- ((ptype & RTE_PTYPE_TUNNEL_VXLAN) == \
+ ((ptype & RTE_PTYPE_L4_MASK) == RTE_PTYPE_L4_UDP) && \
+ ((ptype & RTE_PTYPE_TUNNEL_MASK) == \
RTE_PTYPE_TUNNEL_VXLAN) && \
- ((ptype & RTE_PTYPE_INNER_L4_TCP) == \
+ ((ptype & RTE_PTYPE_INNER_L4_MASK) == \
RTE_PTYPE_INNER_L4_TCP) && \
(((ptype & RTE_PTYPE_INNER_L3_MASK) == \
@@ -64,10 +62,11 @@ static gro_tbl_pkt_count_fn tbl_pkt_count_fn[RTE_GRO_TYPE_MAX_NUM] = {
RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN)))
-#define IS_IPV4_VXLAN_UDP4_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
- ((ptype & RTE_PTYPE_L4_UDP) == RTE_PTYPE_L4_UDP) && \
- ((ptype & RTE_PTYPE_TUNNEL_VXLAN) == \
+/* GRO for inner UDP of VXLAN ingests inner IP fragments */
+#define IS_IPV4_VXLAN_FRAG4_PKT(ptype) (RTE_ETH_IS_IPV4_HDR(ptype) && \
+ ((ptype & RTE_PTYPE_L4_MASK) == RTE_PTYPE_L4_UDP) && \
+ ((ptype & RTE_PTYPE_TUNNEL_MASK) == \
RTE_PTYPE_TUNNEL_VXLAN) && \
- ((ptype & RTE_PTYPE_INNER_L4_UDP) == \
- RTE_PTYPE_INNER_L4_UDP) && \
+ ((ptype & RTE_PTYPE_INNER_L4_MASK) == \
+ RTE_PTYPE_INNER_L4_FRAG) && \
(((ptype & RTE_PTYPE_INNER_L3_MASK) == \
RTE_PTYPE_INNER_L3_IPV4) || \
@@ -280,5 +279,5 @@ rte_gro_reassemble_burst(struct rte_mbuf **pkts,
else if (ret < 0)
pkts[unprocess_num++] = pkts[i];
- } else if (IS_IPV4_VXLAN_UDP4_PKT(pkts[i]->packet_type) &&
+ } else if (IS_IPV4_VXLAN_FRAG4_PKT(pkts[i]->packet_type) &&
do_vxlan_udp_gro) {
ret = gro_vxlan_udp4_reassemble(pkts[i],
@@ -297,5 +296,5 @@ rte_gro_reassemble_burst(struct rte_mbuf **pkts,
else if (ret < 0)
pkts[unprocess_num++] = pkts[i];
- } else if (IS_IPV4_UDP_PKT(pkts[i]->packet_type) &&
+ } else if (IS_IPV4_FRAG_PKT(pkts[i]->packet_type) &&
do_udp4_gro) {
ret = gro_udp4_reassemble(pkts[i], &udp_tbl, 0);
@@ -395,5 +394,5 @@ rte_gro_reassemble(struct rte_mbuf **pkts,
current_time) < 0)
pkts[unprocess_num++] = pkts[i];
- } else if (IS_IPV4_VXLAN_UDP4_PKT(pkts[i]->packet_type) &&
+ } else if (IS_IPV4_VXLAN_FRAG4_PKT(pkts[i]->packet_type) &&
do_vxlan_udp_gro) {
if (gro_vxlan_udp4_reassemble(pkts[i], vxlan_udp_tbl,
@@ -405,5 +404,5 @@ rte_gro_reassemble(struct rte_mbuf **pkts,
current_time) < 0)
pkts[unprocess_num++] = pkts[i];
- } else if (IS_IPV4_UDP_PKT(pkts[i]->packet_type) &&
+ } else if (IS_IPV4_FRAG_PKT(pkts[i]->packet_type) &&
do_udp4_gro) {
if (gro_udp4_reassemble(pkts[i], udp_tbl,
--
2.56.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-12-03 12:52:51.359415594 +0000
+++ 0430-gro-fix-packet-type-comparisons.patch 2026-12-03 12:52:39.333466866 +0000
@@ -1 +1 @@
-From af14eb0a23f8093db18fc2f193e058f2f981d8ad Mon Sep 17 00:00:00 2001
+From fd70e28bff5975f757948684e8a3fcd5ad1f760a Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit af14eb0a23f8093db18fc2f193e058f2f981d8ad ]
+
@@ -36 +37,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list