patch 'app/testpmd: fix VXLAN-GPE and GENEVE custom port parsing' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 14:05:15 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/eb3812bdc968910bb1a373d4d9bc2358df74c3c0

Thanks.

Kevin

---
>From eb3812bdc968910bb1a373d4d9bc2358df74c3c0 Mon Sep 17 00:00:00 2001
From: Maayan Kashani <mkashani at nvidia.com>
Date: Tue, 10 Nov 2026 09:41:37 +0200
Subject: [PATCH] app/testpmd: fix VXLAN-GPE and GENEVE custom port parsing

[ upstream commit 7142459f4e64250d78ef614db9ca13371fa90a32 ]

The csum forwarding engine parses packets with rte_net_get_ptype(),
which recognizes VXLAN-GPE and GENEVE tunnels only on their default UDP
ports. Since the switch to that API, --vxlan-gpe-port and
--geneve-parsed-port no longer take effect: a packet whose outer UDP
destination port matches a configured non-default port is not detected
as a tunnel, so tunnel Tx flags, outer checksum handling and tunnel TSO
are skipped.

When parse-tunnel is enabled, temporarily map a configured port to the
corresponding default while calling rte_net_get_ptype(), then restore the
packet. If an option replaces a default port, hide that default from the
parser to preserve the options' previous behavior. Plain VXLAN is
unchanged: the csum engine has always recognized it only on
RTE_VXLAN_DEFAULT_PORT, and rx_vxlan_port configures the device filter
rather than this parser.

Only process inner checksums when the parser identified an inner IP
header and all declared inner headers fit in the first segment. This
preserves tunnel forwarding for valid non-IP payloads and avoids
accessing truncated or non-contiguous inner headers on both default and
configured tunnel ports.

Fixes: 76730c7b9b5a ("app/testpmd: use packet type parsing API")

Signed-off-by: Maayan Kashani <mkashani at nvidia.com>
---
 app/test-pmd/csumonly.c | 90 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 85 insertions(+), 5 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index c841651756..52ced5b15c 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -574,4 +574,73 @@ parse_l4_proto(const struct rte_mbuf *m, uint32_t off, uint32_t ptype, bool in_t
 }
 
+/*
+ * rte_net_get_ptype() recognizes VXLAN-GPE and GENEVE only on their default
+ * UDP ports. Present the configured port as the corresponding default port,
+ * or hide a default port that has been replaced, while calling the parser.
+ * Plain VXLAN stays on RTE_VXLAN_DEFAULT_PORT: the csum engine has no
+ * equivalent option for it.
+ */
+static uint32_t
+parse_tunnel_udp_custom_port(struct rte_mbuf *m, uint32_t ptype,
+			     struct rte_net_hdr_lens *hdr_lens)
+{
+	uint32_t off = hdr_lens->l2_len + hdr_lens->l3_len;
+	struct rte_net_hdr_lens parsed = {0};
+	struct rte_udp_hdr *uh;
+	uint32_t tunnel_type;
+	uint16_t default_port;
+	rte_be16_t saved_port;
+	uint16_t dst_port;
+	uint32_t new_ptype;
+
+	if (vxlan_gpe_udp_port == RTE_VXLAN_GPE_DEFAULT_PORT &&
+	    geneve_udp_port == RTE_GENEVE_DEFAULT_PORT)
+		return ptype;
+
+	if (rte_pktmbuf_data_len(m) < off + sizeof(*uh))
+		return ptype;
+
+	uh = rte_pktmbuf_mtod_offset(m, struct rte_udp_hdr *, off);
+	dst_port = rte_be_to_cpu_16(uh->dst_port);
+	tunnel_type = ptype & RTE_PTYPE_TUNNEL_MASK;
+	if (dst_port == vxlan_gpe_udp_port)
+		default_port = RTE_VXLAN_GPE_DEFAULT_PORT;
+	else if (dst_port == geneve_udp_port)
+		default_port = RTE_GENEVE_DEFAULT_PORT;
+	else if ((tunnel_type == RTE_PTYPE_TUNNEL_VXLAN_GPE &&
+		  vxlan_gpe_udp_port != RTE_VXLAN_GPE_DEFAULT_PORT) ||
+		 (tunnel_type == RTE_PTYPE_TUNNEL_GENEVE &&
+		  geneve_udp_port != RTE_GENEVE_DEFAULT_PORT))
+		default_port = 0;
+	else
+		return ptype;
+
+	saved_port = uh->dst_port;
+	if (saved_port == rte_cpu_to_be_16(default_port))
+		return ptype;
+	uh->dst_port = rte_cpu_to_be_16(default_port);
+	new_ptype = rte_net_get_ptype(m, &parsed, RTE_PTYPE_ALL_MASK);
+	uh->dst_port = saved_port;
+
+	*hdr_lens = parsed;
+	return new_ptype;
+}
+
+static bool
+can_process_inner_headers(const struct rte_mbuf *m, uint32_t ptype,
+			  const struct rte_net_hdr_lens *hdr_lens)
+{
+	uint32_t headers_len;
+
+	if ((ptype & RTE_PTYPE_INNER_L3_MASK) == 0)
+		return false;
+
+	headers_len = hdr_lens->l2_len + hdr_lens->l3_len +
+		hdr_lens->inner_l2_len + hdr_lens->inner_l3_len +
+		hdr_lens->inner_l4_len;
+
+	return rte_pktmbuf_data_len(m) >= headers_len;
+}
+
 /*
  * Receive a burst of packets, and for each packet:
@@ -670,4 +739,5 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 	for (i = 0; i < nb_rx; i++) {
 		struct rte_net_hdr_lens hdr_lens = {0};
+		bool process_inner = false;
 
 		if (likely(i < nb_rx - 1))
@@ -704,4 +774,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 
 		ptype = rte_net_get_ptype(m, &hdr_lens, RTE_PTYPE_ALL_MASK);
+		if (txp->parse_tunnel &&
+		    (ptype & RTE_PTYPE_L4_MASK) == RTE_PTYPE_L4_UDP)
+			ptype = parse_tunnel_udp_custom_port(m, ptype, &hdr_lens);
 		info.l2_len = hdr_lens.l2_len;
 		info.l3_len = hdr_lens.l3_len;
@@ -719,8 +792,14 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			info.l3_len = hdr_lens.inner_l3_len;
 			info.l4_len = hdr_lens.inner_l4_len;
-			eth_hdr = (struct rte_ether_hdr *)((char *)l3_hdr +
-				hdr_lens.l3_len + hdr_lens.l4_len + hdr_lens.tunnel_len);
-			info.ethertype = get_ethertype_by_ptype(eth_hdr,
-						ptype & RTE_PTYPE_INNER_L3_MASK);
+			process_inner = can_process_inner_headers(m, ptype, &hdr_lens);
+			if (process_inner) {
+				eth_hdr = (struct rte_ether_hdr *)((char *)l3_hdr +
+					hdr_lens.l3_len + hdr_lens.l4_len +
+					hdr_lens.tunnel_len);
+				info.ethertype = get_ethertype_by_ptype(eth_hdr,
+							ptype & RTE_PTYPE_INNER_L3_MASK);
+			} else {
+				info.ethertype = 0;
+			}
 			tx_ol_flags |= get_tunnel_ol_flags_by_ptype(ptype);
 		}
@@ -731,5 +810,6 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			outer_l3_hdr = l3_hdr;
 			l3_hdr = (char *)l3_hdr + info.outer_l3_len + info.l2_len;
-			info.l4_proto = parse_l4_proto(m, l3_off, ptype, true);
+			if (process_inner)
+				info.l4_proto = parse_l4_proto(m, l3_off, ptype, true);
 		}
 		/* step 2: depending on user command line configuration,
-- 
2.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:50.193981945 +0000
+++ 0389-app-testpmd-fix-VXLAN-GPE-and-GENEVE-custom-port-par.patch	2026-12-03 12:52:39.298417018 +0000
@@ -1 +1 @@
-From 7142459f4e64250d78ef614db9ca13371fa90a32 Mon Sep 17 00:00:00 2001
+From eb3812bdc968910bb1a373d4d9bc2358df74c3c0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7142459f4e64250d78ef614db9ca13371fa90a32 ]
+
@@ -29 +30,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list