mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Gobert <richardbgobert@gmail.com>
To: Eric Dumazet <edumazet@google.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, corbet@lwn.net,
	shenjian15@huawei.com, salil.mehta@huawei.com,
	shaojijie@huawei.com, andrew+netdev@lunn.ch, saeedm@nvidia.com,
	tariqt@nvidia.com, mbloch@nvidia.com, leon@kernel.org,
	ecree.xilinx@gmail.com, dsahern@kernel.org, ncardwell@google.com,
	kuniyu@google.com, shuah@kernel.org, sdf@fomichev.me,
	ahmed.zaki@intel.com, aleksander.lobakin@intel.com,
	florian.fainelli@broadcom.com, willemdebruijn.kernel@gmail.com,
	linux-kernel@vger.kernel.org, linux-net-drivers@amd.com
Subject: Re: [PATCH net-next v2 1/5] net: gro: remove is_ipv6 from napi_gro_cb
Date: Tue, 19 Aug 2025 14:26:47 +0200	[thread overview]
Message-ID: <6533e1fa-2528-4bee-92fa-6f2d1a44d906@gmail.com> (raw)
In-Reply-To: <CANn89iL8XHOeBbq_73SiCEEhYrudeDVagtr=K6wpEkh9JuZV6A@mail.gmail.com>

Eric Dumazet wrote:
> On Mon, Aug 18, 2025 at 11:32 PM Richard Gobert
> <richardbgobert@gmail.com> wrote:
>>
>> Remove is_ipv6 from napi_gro_cb and use sk->sk_family instead.
>> This frees up space for another ip_fixedid bit that will be added
>> in the next commit.
>>
>> Using sk->sk_family is reliable since udp_sock_create always
>> creates either a AF_INET or a AF_INET6 socket, and IPv6-FOU
>> doesn't support receiving IPv4 packets.
>>
>> Signed-off-by: Richard Gobert <richardbgobert@gmail.com>
>> ---
>>  include/net/gro.h      |  3 ---
>>  net/ipv4/fou_core.c    | 31 +++++++++++++------------------
>>  net/ipv4/udp_offload.c |  2 --
>>  net/ipv6/udp_offload.c |  2 --
>>  4 files changed, 13 insertions(+), 25 deletions(-)
>>
>> diff --git a/include/net/gro.h b/include/net/gro.h
>> index a0fca7ac6e7e..87c68007f949 100644
>> --- a/include/net/gro.h
>> +++ b/include/net/gro.h
>> @@ -71,9 +71,6 @@ struct napi_gro_cb {
>>                 /* Free the skb? */
>>                 u8      free:2;
>>
>> -               /* Used in foo-over-udp, set in udp[46]_gro_receive */
>> -               u8      is_ipv6:1;
>> -
>>                 /* Used in GRE, set in fou/gue_gro_receive */
>>                 u8      is_fou:1;
>>
>> diff --git a/net/ipv4/fou_core.c b/net/ipv4/fou_core.c
>> index 3e30745e2c09..261ea2cf460f 100644
>> --- a/net/ipv4/fou_core.c
>> +++ b/net/ipv4/fou_core.c
>> @@ -228,21 +228,26 @@ static int gue_udp_recv(struct sock *sk, struct sk_buff *skb)
>>         return 0;
>>  }
>>
>> +static inline const struct net_offload *fou_gro_ops(struct sock *sk, int proto)
> 
> const struct sock *sk
> 
>> +{
>> +       const struct net_offload __rcu **offloads;
>> +
>> +       /* FOU doesn't allow IPv4 on IPv6 sockets. */
>> +       offloads = sk->sk_family == AF_INET6 ? inet6_offloads : inet_offloads;
> 
> 
> Do we have a guarantee sk->sk_family can not change under us ?
> 
> IPV6_ADDRFORM is available to UDP sockets after all.

This is a kernel socket, and FOU doesn't use IPV6_ADDRFORM.


  reply	other threads:[~2025-08-19 12:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-19  6:32 [PATCH net-next v2 0/5] net: gso: restore outer ip ids correctly Richard Gobert
2025-08-19  6:32 ` [PATCH net-next v2 1/5] net: gro: remove is_ipv6 from napi_gro_cb Richard Gobert
2025-08-19  8:47   ` Eric Dumazet
2025-08-19 12:26     ` Richard Gobert [this message]
2025-08-19  6:32 ` [PATCH net-next v2 2/5] net: gro: only merge packets with incrementing or fixed outer ids Richard Gobert
2025-08-19 14:46   ` Willem de Bruijn
2025-08-20  0:30     ` Jakub Kicinski
2025-08-20 12:27       ` Richard Gobert
2025-08-20 15:04         ` Jakub Kicinski
2025-08-20  0:30   ` Jakub Kicinski
2025-08-19  6:32 ` [PATCH net-next v2 3/5] net: gso: restore ids of outer ip headers correctly Richard Gobert
2025-08-19  6:32 ` [PATCH net-next v2 4/5] net: gro: remove unnecessary df checks Richard Gobert
2025-08-20 11:24   ` Willem de Bruijn
2025-08-19  6:32 ` [PATCH net-next v2 5/5] selftests/net: test ipip packets in gro.sh Richard Gobert
2025-08-20 11:21   ` Willem de Bruijn
2025-08-20 12:21     ` 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=6533e1fa-2528-4bee-92fa-6f2d1a44d906@gmail.com \
    --to=richardbgobert@gmail.com \
    --cc=ahmed.zaki@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-net-drivers@amd.com \
    --cc=mbloch@nvidia.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=salil.mehta@huawei.com \
    --cc=sdf@fomichev.me \
    --cc=shaojijie@huawei.com \
    --cc=shenjian15@huawei.com \
    --cc=shuah@kernel.org \
    --cc=tariqt@nvidia.com \
    --cc=willemdebruijn.kernel@gmail.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

all inboxes | Powered by JetHome®