patch 'gro: fix packet type comparisons' has been queued to stable release 24.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Nov 16 23:52:19 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/18/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/9f469bdc58031630f0eb7b48167c508f1984fa6c

Thanks.

Luca Boccassi

---
>From 9f469bdc58031630f0eb7b48167c508f1984fa6c 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 9c6bb33c96..b85643d2f8 100644
--- a/lib/gro/rte_gro.c
+++ b/lib/gro/rte_gro.c
@@ -34,26 +34,24 @@ static gro_tbl_pkt_count_fn tbl_pkt_count_fn[RTE_GRO_TYPE_MAX_NUM] = {
 			NULL};
 
 #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) == \
 		  RTE_PTYPE_INNER_L3_IPV4) || \
@@ -62,12 +60,13 @@ static gro_tbl_pkt_count_fn tbl_pkt_count_fn[RTE_GRO_TYPE_MAX_NUM] = {
 		 ((ptype & RTE_PTYPE_INNER_L3_MASK) == \
 		  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) || \
 		 ((ptype & RTE_PTYPE_INNER_L3_MASK) == \
@@ -276,7 +275,7 @@ rte_gro_reassemble_burst(struct rte_mbuf **pkts,
 				nb_after_gro--;
 			else if (ret < 0)
 				unprocess_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],
 							&vxlan_udp_tbl, 0);
@@ -293,7 +292,7 @@ rte_gro_reassemble_burst(struct rte_mbuf **pkts,
 				nb_after_gro--;
 			else if (ret < 0)
 				unprocess_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);
 			if (ret > 0)
@@ -397,7 +396,7 @@ rte_gro_reassemble(struct rte_mbuf **pkts,
 			if (gro_vxlan_tcp4_reassemble(pkts[i], vxlan_tcp_tbl,
 						current_time) < 0)
 				unprocess_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,
 						current_time) < 0)
@@ -407,7 +406,7 @@ rte_gro_reassemble(struct rte_mbuf **pkts,
 			if (gro_tcp4_reassemble(pkts[i], tcp_tbl,
 						current_time) < 0)
 				unprocess_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,
 						current_time) < 0)
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-11-16 22:52:19.082106808 +0000
+++ 0065-gro-fix-packet-type-comparisons.patch	2026-11-16 22:52:16.532234650 +0000
@@ -1 +1 @@
-From af14eb0a23f8093db18fc2f193e058f2f981d8ad Mon Sep 17 00:00:00 2001
+From 9f469bdc58031630f0eb7b48167c508f1984fa6c Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit af14eb0a23f8093db18fc2f193e058f2f981d8ad ]
+
@@ -36 +37,0 @@
-Cc: stable at dpdk.org
@@ -45 +46 @@
-index 168960b8af..9fc33def60 100644
+index 9c6bb33c96..b85643d2f8 100644
@@ -48 +49 @@
-@@ -35,26 +35,24 @@ static gro_tbl_pkt_count_fn tbl_pkt_count_fn[RTE_GRO_TYPE_MAX_NUM] = {
+@@ -34,26 +34,24 @@ static gro_tbl_pkt_count_fn tbl_pkt_count_fn[RTE_GRO_TYPE_MAX_NUM] = {
@@ -83 +84 @@
-@@ -63,12 +61,13 @@ static gro_tbl_pkt_count_fn tbl_pkt_count_fn[RTE_GRO_TYPE_MAX_NUM] = {
+@@ -62,12 +60,13 @@ static gro_tbl_pkt_count_fn tbl_pkt_count_fn[RTE_GRO_TYPE_MAX_NUM] = {
@@ -102 +103 @@
-@@ -279,7 +278,7 @@ rte_gro_reassemble_burst(struct rte_mbuf **pkts,
+@@ -276,7 +275,7 @@ rte_gro_reassemble_burst(struct rte_mbuf **pkts,
@@ -105 +106 @@
- 				pkts[unprocess_num++] = pkts[i];
+ 				unprocess_pkts[unprocess_num++] = pkts[i];
@@ -111 +112 @@
-@@ -296,7 +295,7 @@ rte_gro_reassemble_burst(struct rte_mbuf **pkts,
+@@ -293,7 +292,7 @@ rte_gro_reassemble_burst(struct rte_mbuf **pkts,
@@ -114 +115 @@
- 				pkts[unprocess_num++] = pkts[i];
+ 				unprocess_pkts[unprocess_num++] = pkts[i];
@@ -120 +121 @@
-@@ -394,7 +393,7 @@ rte_gro_reassemble(struct rte_mbuf **pkts,
+@@ -397,7 +396,7 @@ rte_gro_reassemble(struct rte_mbuf **pkts,
@@ -123 +124 @@
- 				pkts[unprocess_num++] = pkts[i];
+ 				unprocess_pkts[unprocess_num++] = pkts[i];
@@ -129 +130 @@
-@@ -404,7 +403,7 @@ rte_gro_reassemble(struct rte_mbuf **pkts,
+@@ -407,7 +406,7 @@ rte_gro_reassemble(struct rte_mbuf **pkts,
@@ -132 +133 @@
- 				pkts[unprocess_num++] = pkts[i];
+ 				unprocess_pkts[unprocess_num++] = pkts[i];


More information about the stable mailing list