[PATCH 1/2] net: fix offset calculation for GENEVE packet
Stephen Hemminger
stephen at networkplumber.org
Tue May 20 23:21:37 CEST 2025
On Mon, 19 May 2025 21:36:55 +0530
<skori at marvell.com> wrote:
> From: Sunil Kumar Kori <skori at 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 at marvell.com>
Looks good, but why reorder the assignment to *off ?
Could just be:
diff --git a/lib/net/rte_net.c b/lib/net/rte_net.c
index be24690fdf..cdad463398 100644
--- a/lib/net/rte_net.c
+++ b/lib/net/rte_net.c
@@ -252,6 +252,7 @@ ptype_tunnel_with_udp(uint16_t *proto, const struct rte_mbuf *m,
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;
*proto = gnh->proto;
if (gnh->proto == 0)
*proto = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4);
More information about the dev
mailing list