[PATCH] app/testpmd: fix GTP L2 len in checksum engine

Raslan Darawsheh rasland at nvidia.com
Sun Apr 2 14:26:19 CEST 2023


GTP header can be followed by an optional 32 bits extension.

But, l2_len value statically set to RTE_ETHER_GTP_HLEN
which is defined to be
        (sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr))

This fixes the l2_len to take into consideration the extension size.

Fixes: d8e5e69f3a9b ("app/testpmd: add GTP parsing and Tx checksum offload")
Cc: ting.xu at intel.com
Cc: stable at dpdk.org

Signed-off-by: Raslan Darawsheh <rasland at nvidia.com>
---
 app/test-pmd/csumonly.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index fc85c22a77..b50b89367a 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -250,7 +250,7 @@ parse_gtp(struct rte_udp_hdr *udp_hdr,
 		info->l4_proto = 0;
 	}
 
-	info->l2_len += RTE_ETHER_GTP_HLEN;
+	info->l2_len += gtp_len + sizeof(udp_hdr);
 }
 
 /* Parse a vxlan header */
-- 
2.25.1



More information about the stable mailing list