* [PATCH] net: fix incorrect L2 length for GRE tunneling packet
@ 2025-07-23 10:47 Dengdui Huang
2025-09-24 14:41 ` Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Dengdui Huang @ 2025-07-23 10:47 UTC (permalink / raw)
To: dev; +Cc: stephen, aman.deep.singh, lihuisong, fengchengwen, liuyonglong
The meaning of L2_len in the parsing result of the rte_net_get_ptype()
is the same as the L2_len field in the mbuf. For tunnel packets,
the L2_len should include protocol header of tunnel packets.
Bugzilla ID: 1754
Fixes: d21d855464ff ("net: support GRE in software packet type parser")
Cc: stable@dpdk.org
Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
---
lib/net/rte_net.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/net/rte_net.c b/lib/net/rte_net.c
index 44fb6c0f51..c70b57fdc0 100644
--- a/lib/net/rte_net.c
+++ b/lib/net/rte_net.c
@@ -481,6 +481,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
pkt_type |= ptype_tunnel_without_udp(&proto, m, &off);
hdr_lens->tunnel_len = off - prev_off;
+ hdr_lens->inner_l2_len = off - prev_off;
}
/* same job for inner header: we need to duplicate the code
--
2.33.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: fix incorrect L2 length for GRE tunneling packet
2025-07-23 10:47 [PATCH] net: fix incorrect L2 length for GRE tunneling packet Dengdui Huang
@ 2025-09-24 14:41 ` Thomas Monjalon
2025-11-03 2:40 ` fengchengwen
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Monjalon @ 2025-09-24 14:41 UTC (permalink / raw)
To: dev
Cc: stephen, aman.deep.singh, lihuisong, fengchengwen, liuyonglong,
Dengdui Huang, Andrew Rybchenko, Ivan Malov, Ivan Malov,
Sunil Kumar Kori
Looking for review, please.
23/07/2025 12:47, Dengdui Huang:
> The meaning of L2_len in the parsing result of the rte_net_get_ptype()
> is the same as the L2_len field in the mbuf. For tunnel packets,
> the L2_len should include protocol header of tunnel packets.
>
> Bugzilla ID: 1754
> Fixes: d21d855464ff ("net: support GRE in software packet type parser")
> Cc: stable@dpdk.org
>
> Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
> ---
> lib/net/rte_net.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/net/rte_net.c b/lib/net/rte_net.c
> index 44fb6c0f51..c70b57fdc0 100644
> --- a/lib/net/rte_net.c
> +++ b/lib/net/rte_net.c
> @@ -481,6 +481,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
>
> pkt_type |= ptype_tunnel_without_udp(&proto, m, &off);
> hdr_lens->tunnel_len = off - prev_off;
> + hdr_lens->inner_l2_len = off - prev_off;
> }
>
> /* same job for inner header: we need to duplicate the code
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: fix incorrect L2 length for GRE tunneling packet
2025-09-24 14:41 ` Thomas Monjalon
@ 2025-11-03 2:40 ` fengchengwen
0 siblings, 0 replies; 3+ messages in thread
From: fengchengwen @ 2025-11-03 2:40 UTC (permalink / raw)
To: Thomas Monjalon, dev
Cc: stephen, aman.deep.singh, lihuisong, liuyonglong, Dengdui Huang,
Andrew Rybchenko, Ivan Malov, Ivan Malov, Sunil Kumar Kori,
yangxingui
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
This commit also fix one access not-initialized inner_l2_len problem, consider:
If the packet is one tunnel type which recognize by ptype_tunnel_without_udp(), and
application don't init "struct rte_net_hdr_lens hdr_lens;" , then the inner_l2_len will
be random without this commit because later process the inner_l2_len both are both += ops.
On 9/24/2025 10:41 PM, Thomas Monjalon wrote:
> Looking for review, please.
>
>
> 23/07/2025 12:47, Dengdui Huang:
>> The meaning of L2_len in the parsing result of the rte_net_get_ptype()
>> is the same as the L2_len field in the mbuf. For tunnel packets,
>> the L2_len should include protocol header of tunnel packets.
>>
>> Bugzilla ID: 1754
>> Fixes: d21d855464ff ("net: support GRE in software packet type parser")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
>> ---
>> lib/net/rte_net.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/lib/net/rte_net.c b/lib/net/rte_net.c
>> index 44fb6c0f51..c70b57fdc0 100644
>> --- a/lib/net/rte_net.c
>> +++ b/lib/net/rte_net.c
>> @@ -481,6 +481,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
>>
>> pkt_type |= ptype_tunnel_without_udp(&proto, m, &off);
>> hdr_lens->tunnel_len = off - prev_off;
>> + hdr_lens->inner_l2_len = off - prev_off;
>> }
>>
>> /* same job for inner header: we need to duplicate the code
>>
>
>
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-03 2:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-23 10:47 [PATCH] net: fix incorrect L2 length for GRE tunneling packet Dengdui Huang
2025-09-24 14:41 ` Thomas Monjalon
2025-11-03 2:40 ` fengchengwen
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).