[PATCH v2 1/2] net: fix offset calculation for GENEVE packet
huangdengdui
huangdengdui at huawei.com
Fri May 23 03:29:49 CEST 2025
Acked-by: Dengdui Huang <huangdengdui at huawei.com>
On 2025/5/21 13:11, 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>
> ---
> 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..1264f33d61 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;
> + *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