lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47c175ec-2cb0-4262-bfb1-724749624f58@gmail.com>
Date: Tue, 7 May 2024 18:11:23 +0200
From: Richard Gobert <richardbgobert@...il.com>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>, davem@...emloft.net,
 edumazet@...gle.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,
 alexander.duyck@...il.com
Subject: Re: [PATCH net-next v8 1/3] net: gro: use cb instead of
 skb->network_header

Willem de Bruijn wrote:
> 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?
> 

I'll rename that to skb_gro_receive_network_offset for better clarity,
thanks.

>>  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

Powered by Openwall GNU/*/Linux Powered by OpenVZ