mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Richard Gobert <richardbgobert@gmail.com>,
	 davem@davemloft.net,  edumazet@google.com,
	 willemdebruijn.kernel@gmail.com,  kuba@kernel.org,
	 pabeni@redhat.com,  dsahern@kernel.org,  alobakin@pm.me,
	 shuah@kernel.org,  netdev@vger.kernel.org,
	 linux-kernel@vger.kernel.org,  linux-kselftest@vger.kernel.org
Cc: Richard Gobert <richardbgobert@gmail.com>
Subject: Re: [PATCH net-next v8 1/3] net: gro: use cb instead of skb->network_header
Date: Mon, 06 May 2024 12:46:18 -0400	[thread overview]
Message-ID: <6639095ab4887_516de294d8@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <20240506093550.128210-2-richardbgobert@gmail.com>

Richard Gobert wrote:
> This patch converts references of skb->network_header to napi_gro_cb's
> network_offset and inner_network_offset.
> 
> Signed-off-by: Richard Gobert <richardbgobert@gmail.com>
> ---
>  include/net/gro.h        | 9 +++++++--
>  net/ipv4/af_inet.c       | 4 ----
>  net/ipv4/tcp_offload.c   | 3 ++-
>  net/ipv6/ip6_offload.c   | 5 ++---
>  net/ipv6/tcpv6_offload.c | 3 ++-
>  5 files changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/include/net/gro.h b/include/net/gro.h
> index c1d4ca0463a1..1faff23b66e8 100644
> --- a/include/net/gro.h
> +++ b/include/net/gro.h
> @@ -181,12 +181,17 @@ static inline void *skb_gro_header(struct sk_buff *skb, unsigned int hlen,
>  	return ptr;
>  }
>  
> +static inline int skb_gro_network_offset(const struct sk_buff *skb)
> +{
> +	return NAPI_GRO_CB(skb)->network_offsets[NAPI_GRO_CB(skb)->encap_mark];
> +}
> +

The fact that .._receive sets encap_mark, but .._complete must read
encapsulation, due to the clear in udp_gro_complete, is non-obvious.

Can you add a comment to clarify this or rename this to
skb_gro_receive_network_offset?

>  static inline void *skb_gro_network_header(const struct sk_buff *skb)
>  {
>  	if (skb_gro_may_pull(skb, skb_gro_offset(skb)))
> -		return skb_gro_header_fast(skb, skb_network_offset(skb));
> +		return skb_gro_header_fast(skb, skb_gro_network_offset(skb));
>  
> -	return skb_network_header(skb);
> +	return skb->data + skb_gro_network_offset(skb);
>  }

  reply	other threads:[~2024-05-06 16:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06  9:35 [PATCH net-next v8 0/3] net: gro: remove network_header use, move p->{flush/flush_id} calculations to L4 Richard Gobert
2024-05-06  9:35 ` [PATCH net-next v8 1/3] net: gro: use cb instead of skb->network_header Richard Gobert
2024-05-06 16:46   ` Willem de Bruijn [this message]
2024-05-07 16:11     ` Richard Gobert
2024-05-06  9:47 ` [PATCH net-next v8 2/3] net: gro: move L3 flush checks to tcp_gro_receive and udp_gro_receive_segment Richard Gobert
2024-05-06 17:20   ` Willem de Bruijn
2024-05-07 16:18     ` Richard Gobert
2024-05-06  9:51 ` [PATCH net-next v8 3/3] selftests/net: add flush id selftests Richard Gobert
2024-05-06 17:26   ` Willem de Bruijn
2024-05-07 16:19     ` Richard Gobert

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=6639095ab4887_516de294d8@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=alobakin@pm.me \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardbgobert@gmail.com \
    --cc=shuah@kernel.org \
    /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

all inboxes | Powered by JetHome®