netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Gobert <richardbgobert@gmail.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	Eric Dumazet <edumazet@google.com>
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	dsahern@kernel.org, xeb@mail.ru, shuah@kernel.org,
	idosch@nvidia.com, razor@blackwall.org, amcohen@nvidia.com,
	petrm@nvidia.com, jbenc@redhat.com, bpoirier@nvidia.com,
	b.galvani@gmail.com, gavinl@nvidia.com, liujian56@huawei.com,
	horms@kernel.org, linyunsheng@huawei.com, therbert@google.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next v3 4/4] net: gro: move L3 flush checks to tcp_gro_receive
Date: Mon, 11 Mar 2024 14:08:07 +0100	[thread overview]
Message-ID: <d72bfd79-ce72-49db-b648-930a08b9302e@gmail.com> (raw)
In-Reply-To: <65eef506331e8_1db78c2941c@willemb.c.googlers.com.notmuch>

Willem de Bruijn wrote:
> Richard Gobert wrote:
>> Eric Dumazet wrote:
>>> On Sat, Mar 9, 2024 at 4:35 PM Richard Gobert <richardbgobert@gmail.com> wrote:
>>>>
>>>> {inet,ipv6}_gro_receive functions perform flush checks (ttl, flags,
>>>> iph->id, ...) against all packets in a loop. These flush checks are
>>>> relevant only to tcp flows, and as such they're used to determine whether
>>>> the packets can be merged later in tcp_gro_receive.
>>>>
>>>> These checks are not relevant to UDP packets.
>>>
>>> I do not think this claim is true.
>>>
>>> Incoming packets  ->  GRO -> GSO -> forwarded packets
>>>
>>> The {GRO,GSO} step must be transparent, GRO is not LRO.
>>
>> Sorry, I should rephrase myself. The patch preserves the
>> current logic in GRO. These L3 checks (ttl, flags, etc.) are written to
>> NAPI_GRO_CB(p)->{flush,flush_id}, and NAPI_GRO_CB(skb)->is_atomic - and
>> all of these are currently used only in tcp_gro_receive.
> 
> That was perhaps an oversight when adding UDP GRO?
> 
> Simply because the flush is determined in the innermost callback.

It might have been an oversight. From what I have seen it's only relevant
to GRO's UDP fraglist path (it was added in 9fd1ff5d ("udp: Support UDP
fraglist GRO/GSO.")). That's the only UDP path that calls skb_gro_receive -
which may alter the forwarded packets and make GRO/GSO not transparent.

AFAIU NAPI_GRO_CB(p)->flush value is not overwritten in encapsulation - it
is determined by both outer and inner callbacks.

I tried to preserve the current behaviour in GRO - if we want to change
this behaviour I'll gladly do it, although I'd prefer to address it in a
different patch series. What do you think?

Thanks

  reply	other threads:[~2024-03-11 13:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-09 15:26 [PATCH net-next v3 0/4] net: gro: encapsulation bug fix and flush checks improvements Richard Gobert
2024-03-09 15:29 ` [PATCH net-next v3 1/4] net: gro: add p_off param in *_gro_complete Richard Gobert
2024-03-09 15:30   ` [PATCH net-next v3 2/4] selftests/net: add local address bind in vxlan selftest Richard Gobert
2024-03-09 15:33 ` [PATCH net-next v3 3/4] net: gro: add {inner_}network_offset to napi_gro_cb Richard Gobert
2024-03-09 15:34 ` [PATCH net-next v3 4/4] net: gro: move L3 flush checks to tcp_gro_receive Richard Gobert
2024-03-09 15:41   ` Eric Dumazet
2024-03-11  9:18     ` Richard Gobert
2024-03-11 12:11       ` Willem de Bruijn
2024-03-11 13:08         ` Richard Gobert [this message]
2024-03-11 13:13           ` Willem de Bruijn
2024-03-10 10:34   ` Willem de Bruijn
2024-03-11  9: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=d72bfd79-ce72-49db-b648-930a08b9302e@gmail.com \
    --to=richardbgobert@gmail.com \
    --cc=amcohen@nvidia.com \
    --cc=b.galvani@gmail.com \
    --cc=bpoirier@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=gavinl@nvidia.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=jbenc@redhat.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linyunsheng@huawei.com \
    --cc=liujian56@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=razor@blackwall.org \
    --cc=shuah@kernel.org \
    --cc=therbert@google.com \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=xeb@mail.ru \
    /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;
as well as URLs for NNTP newsgroup(s).