[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6639095ab4887_516de294d8@willemb.c.googlers.com.notmuch>
Date: Mon, 06 May 2024 12:46:18 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Richard Gobert <richardbgobert@...il.com>,
davem@...emloft.net,
edumazet@...gle.com,
willemdebruijn.kernel@...il.com,
kuba@...nel.org,
pabeni@...hat.com,
dsahern@...nel.org,
alobakin@...me,
shuah@...nel.org,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org
Cc: Richard Gobert <richardbgobert@...il.com>
Subject: Re: [PATCH net-next v8 1/3] net: gro: use cb instead of
skb->network_header
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@...il.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);
> }
Powered by blists - more mailing lists