* [PATCH 1/2] net: fix offset calculation for GENEVE packet
@ 2025-05-19 16:06 skori
2025-05-19 16:06 ` [PATCH 2/2] app/testpmd: clear stale internal len information skori
0 siblings, 1 reply; 2+ messages in thread
From: skori @ 2025-05-19 16:06 UTC (permalink / raw)
To: Jie Hai; +Cc: dev, Sunil Kumar Kori
From: Sunil Kumar Kori <skori@marvell.com>
While parsing packet headers, offset must be added to get next
header but for geneve header parsing offset is overwritten.
Also inner_l2_len is not set in case of geneve packets.
Fixes: 64ed7f854cf4 ("net: add tunnel packet type parsing")
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
lib/net/rte_net.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/net/rte_net.c b/lib/net/rte_net.c
index be24690fdf..8a3ebf8478 100644
--- a/lib/net/rte_net.c
+++ b/lib/net/rte_net.c
@@ -251,7 +251,8 @@ ptype_tunnel_with_udp(uint16_t *proto, const struct rte_mbuf *m,
if (unlikely(gnh == NULL))
return 0;
geneve_len = sizeof(*gnh) + gnh->opt_len * 4;
- *off = geneve_len;
+ hdr_lens->inner_l2_len = sizeof(struct rte_udp_hdr) + geneve_len;
+ *off += geneve_len;
*proto = gnh->proto;
if (gnh->proto == 0)
*proto = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/2] app/testpmd: clear stale internal len information
2025-05-19 16:06 [PATCH 1/2] net: fix offset calculation for GENEVE packet skori
@ 2025-05-19 16:06 ` skori
0 siblings, 0 replies; 2+ messages in thread
From: skori @ 2025-05-19 16:06 UTC (permalink / raw)
To: Aman Singh; +Cc: dev, Sunil Kumar Kori
From: Sunil Kumar Kori <skori@marvell.com>
hdr_lens is used to maintain header lengths after parsing packets.
When port receives different type of packets (say first is VXLAN
packet and second is GRE packet).
For first packet, L2/L3/L4 lengths are set for inner and outer header
alongwith tunnel_len.
Now for second packet, tunnel_len is added more than its size it
contains stale value which further leads to wrong header pointers.
Hence clearing stale information before processing each packet.
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
app/test-pmd/csumonly.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index fa0002d321..4d02d622d6 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -670,6 +670,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1],
void *));
+ memset(&hdr_lens, 0, sizeof(struct rte_net_hdr_lens));
m = pkts_burst[i];
info.is_tunnel = 0;
info.pkt_len = rte_pktmbuf_pkt_len(m);
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-19 16:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-19 16:06 [PATCH 1/2] net: fix offset calculation for GENEVE packet skori
2025-05-19 16:06 ` [PATCH 2/2] app/testpmd: clear stale internal len information skori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).