DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
To: Jie Hai <haijie1@huawei.com>
Cc: <dev@dpdk.org>, <jerinj@marvell.com>, <ndabilpuram@marvell.com>,
	"Rakesh Kudurumalla" <rkudurumalla@marvell.com>
Subject: [PATCH v1 1/1] net: fix inner L2 length for GRE and NVGRE
Date: Wed, 29 Oct 2025 18:35:23 +0530	[thread overview]
Message-ID: <20251029130523.1642847-1-rkudurumalla@marvell.com> (raw)

Inner l2 length needs to be updated to include GRE and NVGRE
headers. Not updating this would cause failures for applications
which would be expecting l2_len field to be valid for
inner checksum offload cases.

Fixes: 76730c7b9b5a ("app/testpmd: use packet type parsing API")

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 lib/net/rte_net.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/net/rte_net.c b/lib/net/rte_net.c
index 44fb6c0f51..5476d2a573 100644
--- a/lib/net/rte_net.c
+++ b/lib/net/rte_net.c
@@ -480,6 +480,9 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
 			return pkt_type;
 
 		pkt_type |= ptype_tunnel_without_udp(&proto, m, &off);
+		if ((pkt_type & RTE_PTYPE_TUNNEL_MASK) == RTE_PTYPE_TUNNEL_GRE ||
+		    (pkt_type & RTE_PTYPE_TUNNEL_MASK) == RTE_PTYPE_TUNNEL_NVGRE)
+			hdr_lens->inner_l2_len += sizeof(struct rte_gre_hdr);
 		hdr_lens->tunnel_len = off - prev_off;
 	}
 
-- 
2.25.1


                 reply	other threads:[~2025-10-29 13:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20251029130523.1642847-1-rkudurumalla@marvell.com \
    --to=rkudurumalla@marvell.com \
    --cc=dev@dpdk.org \
    --cc=haijie1@huawei.com \
    --cc=jerinj@marvell.com \
    --cc=ndabilpuram@marvell.com \
    /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).