DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dengdui Huang <huangdengdui@huawei.com>
To: <dev@dpdk.org>
Cc: <thomas@monjalon.net>, <jasvinder.singh@intel.com>,
	<stephen@networkplumber.org>, <aman.deep.singh@intel.com>,
	<lihuisong@huawei.com>, <fengchengwen@huawei.com>,
	<liuyonglong@huawei.com>
Subject: [PATCH 2/2] app/testpmd: fix obtain inner info of tunnel packet
Date: Mon, 16 Jun 2025 16:27:02 +0800	[thread overview]
Message-ID: <20250616082702.3422034-3-huangdengdui@huawei.com> (raw)
In-Reply-To: <20250616082702.3422034-1-huangdengdui@huawei.com>

The l2_len field of tunnel packets already includes the tunnel_len field.
Additionally, the current offset used for the internal Ethernet header is
incorrect. This patch fixes these issues.

Fixes: 76730c7b9b5a ("app/testpmd: use packet type parsing API")
Cc: stable@dpdk.org

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
---
 app/test-pmd/csumonly.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 203af35cf0..d355dbd8c0 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -712,11 +712,11 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 		if (txp->parse_tunnel && RTE_ETH_IS_TUNNEL_PKT(ptype) != 0) {
 			info.is_tunnel = 1;
 			update_tunnel_outer(&info);
-			info.l2_len = hdr_lens.inner_l2_len + hdr_lens.tunnel_len;
+			info.l2_len = hdr_lens.inner_l2_len;
 			info.l3_len = hdr_lens.inner_l3_len;
 			info.l4_len = hdr_lens.inner_l4_len;
-			eth_hdr = (struct rte_ether_hdr *)(char *)l3_hdr +
-					info.outer_l3_len + hdr_lens.tunnel_len;
+			eth_hdr = (struct rte_ether_hdr *)((char *)l3_hdr +
+				hdr_lens.l3_len + hdr_lens.l4_len + hdr_lens.tunnel_len);
 			info.ethertype = get_ethertype_by_ptype(eth_hdr,
 						ptype & RTE_PTYPE_INNER_L3_MASK);
 			tx_ol_flags |= get_tunnel_ol_flags_by_ptype(ptype);
-- 
2.33.0


      parent reply	other threads:[~2025-06-16  8:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-16  8:27 [PATCH 0/2] fix parse tunnel packet ptyoe Dengdui Huang
2025-06-16  8:27 ` [PATCH 1/2] net: fix parse the tunnel length of tunnel with UDP Dengdui Huang
2025-06-16  8:27 ` Dengdui Huang [this message]

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=20250616082702.3422034-3-huangdengdui@huawei.com \
    --to=huangdengdui@huawei.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=jasvinder.singh@intel.com \
    --cc=lihuisong@huawei.com \
    --cc=liuyonglong@huawei.com \
    --cc=stephen@networkplumber.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).