Skip to contentSkip to conversation

app/testpmd: fix GTP L2 len in checksum engine

PATCH Applied Raslan Darawsheh 3 participants 3 messages Apr 2, 2023 – May 17, 2023

lore
Share & tools
lore
#0 lore raw

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

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")
---
 app/test-pmd/csumonly.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/csumonly.c +1 -1
index fc85c22a77..b50b89367a 100644
@@ -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 */
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Raslan Darawsheh

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))

Quoted 7 lines

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

Fixes d8e5e69f3a9b ("app/testpmd: add GTP parsing and Tx checksum offload")
Quoted 9 lines
---
  app/test-pmd/csumonly.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/csumonly.c +0 -0
index fc85c22a77..b50b89367a 100644

app/test-pmd/csumonly.c parse_gtp(struct rte_udp_hdr *udp_hdr, · line 253

Quoted 5 lines
app/test-pmd/csumonly.c +1 -1
@@ -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);

Macro is unused after above change.
So can be removed.

Quoted 3 lines
app/test-pmd/csumonly.c +0 -0
  }
 
  /* Parse a vxlan header */
Applied
#2 lore raw
Quoted 10 lines · Aman Deep
Quoted 8 lines · Raslan Darawsheh

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.

Quoted 8 lines
Quoted 6 lines
Fixes d8e5e69f3a9b ("app/testpmd: add GTP parsing and Tx checksum

offload")
Cc: [email protected]
Cc: [email protected]

Applied to dpdk-next-net/main, thanks.