From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
To: Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk>,
dev@dpdk.org, ivan.malov@arknetworks.am,
jasvinder.singh@intel.com, bruce.richardson@intel.com
Cc: thomas@monjalon.net, stable@dpdk.org
Subject: Re: [PATCH] net/rte_net: fix inner L2 length for tunneled Ethernet packets
Date: Thu, 31 Jul 2025 13:26:51 +0300 [thread overview]
Message-ID: <5a75dd27-a19b-4dad-b3bd-cc7f31e4619d@oktetlabs.ru> (raw)
In-Reply-To: <20250729050647.52745-1-14pwcse1224@uetpeshawar.edu.pk>
On 7/29/25 08:06, Khadem Ullah wrote:
> Hi Ivan,
>
> No, it does not breaking testpmd or any other applications.
> Yes, the structure is correct in rte_net.h and comment as well.
>
> You can run testpmd in rxonly mode and set verbose to 3, send the following packet from remote and you will observe the output as given below:
>
> pkt=Ether(src="04:3f:72:f3:7a:43",dst="C8:0A:A9:04:49:1A")/IP(src="19.168.1.1",dst="19.168.1.1")/UDP(dport=4789)/VXLAN(vni=4094)/Ether(dst="22:11:11:11:11:10")/IP(dst="19.168.1.1")/UDP()
>
>
> port 0/queue 0: received 1 packets
> src=04:3F:72:F3:7A:43 - dst=C8:0A:A9:04:49:1A - pool=mb_pool_0 - type=0x0800 - length=92 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_UDP - sw ptype: L2_ETHER L3_IPV4 L4_UDP TUNNEL_VXLAN INNER_L2_ETHER INNER_L3_IPV4 INNER_L4_UDP - l2_len=14 - l3_len=20 - l4_len=8 - tunnel_len=8 - inner_l2_len=30 - inner_l3_len=20 - inner_l4_len=8 - Destination UDP port=4789 - Receive queue=0x0
> ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
>
> The length is 92 bytes which is correct but inner_l2_len=30 which is incorrect. According to standard, the following calculation is true of VXLAN header (50 bytes) and VXLAN packet size(92 bytes).
>
> 50-byte VXLAN header =(14-byte outer ethernet header + 20-byte outer IP header + 8-byte outer UDP header + 8-byte VXLAN header )
>
> 92-bytes VXLAN packet size= (14-byte outer Ethernet header + 20-byte outer IP header + 8-byte outer UDP header + 8-byte VXLAN header )+ (14-byte inner Ethernet header + 20-byte inner IP header + 8-byte inner UDP)
>
> This patch correct the inner_l2_len which is 14 bytes.
No, you're incorrectly assume that sum of all *_len fields should give
you a length of all packet headers. It is wrong assumption in accordance
with the definition of inner_l2_len which includes outer-l4-len (UDP),
tunnel header (VXLAN) and inner Ethernet header for the packet.
next prev parent reply other threads:[~2025-07-31 10:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-28 13:12 Khadem Ullah
2025-07-28 13:28 ` Ivan Malov
2025-07-29 5:06 ` Khadem Ullah
2025-07-31 10:26 ` Andrew Rybchenko [this message]
2025-08-01 11:28 ` Khadem Ullah
2025-08-01 13:23 ` Ivan Malov
2025-07-31 10:21 ` Andrew Rybchenko
-- strict thread matches above, loose matches on Subject: below --
2025-07-28 12:30 Khadem Ullah
2025-07-28 12:21 Khadem Ullah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5a75dd27-a19b-4dad-b3bd-cc7f31e4619d@oktetlabs.ru \
--to=andrew.rybchenko@oktetlabs.ru \
--cc=14pwcse1224@uetpeshawar.edu.pk \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=ivan.malov@arknetworks.am \
--cc=jasvinder.singh@intel.com \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).