All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Cc: Jie Hai <haijie1@huawei.com>, <dev@dpdk.org>,
	<jerinj@marvell.com>, <ndabilpuram@marvell.com>
Subject: Re: [PATCH v2 1/1] net: fix inner L2 length for GRE and NVGRE
Date: Sun, 21 Dec 2025 08:50:55 -0800	[thread overview]
Message-ID: <20251221085055.7a205117@phoenix.local> (raw)
In-Reply-To: <20251218090932.1767124-1-rkudurumalla@marvell.com>

On Thu, 18 Dec 2025 14:39:32 +0530
Rakesh Kudurumalla <rkudurumalla@marvell.com> wrote:

> 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>
> ---
> 
> V2: update innner l2 length based of GRE header flags
> for key, sequence and checksum
> 
>  lib/net/rte_net.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/lib/net/rte_net.c b/lib/net/rte_net.c
> index c70b57fdc0..a24a0db526 100644
> --- a/lib/net/rte_net.c
> +++ b/lib/net/rte_net.c
> @@ -480,6 +480,19 @@ 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) {
> +			const struct rte_gre_hdr *gh;
> +
> +			gh = rte_pktmbuf_read(m, prev_off, sizeof(*gh), NULL);

This looks wrong. rte_pktmbuf_read() is intended to handle non-contiguous data
and you should pass a temporary header buffer for it to use.

Or if you can verify that the header is in first mbuf and does not span
segments, then just use rte_pktmbuf_mtod_offset.

      reply	other threads:[~2025-12-21 16:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-29 13:05 [PATCH v1 1/1] net: fix inner L2 length for GRE and NVGRE Rakesh Kudurumalla
2025-12-18  9:09 ` [PATCH v2 " Rakesh Kudurumalla
2025-12-21 16:50   ` Stephen Hemminger [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=20251221085055.7a205117@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=haijie1@huawei.com \
    --cc=jerinj@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=rkudurumalla@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.