public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Gobert <richardbgobert@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>
Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	willemdebruijn.kernel@gmail.com, dsahern@kernel.org,
	alexander.duyck@gmail.com, shuah@kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next v10 2/3] net: gro: move L3 flush checks to tcp_gro_receive and udp_gro_receive_segment
Date: Tue, 14 May 2024 17:56:44 +0200	[thread overview]
Message-ID: <8e0b027d-4d30-4f0f-82ef-113287f17c6a@gmail.com> (raw)
In-Reply-To: <20240514071407.257c0003@kernel.org>

Jakub Kicinski wrote:
> On Tue, 14 May 2024 14:13:21 +0200 Geert Uytterhoeven wrote:
>> On Thu, May 9, 2024 at 9:09 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 used in
>>> all merging UDP and TCP flows.
>>>
>>> These checks need to be done only once and only against the found p skb,
>>> since they only affect flush and not same_flow.
>>>
>>> This patch leverages correct network header offsets from the cb for both
>>> outer and inner network headers - allowing these checks to be done only
>>> once, in tcp_gro_receive and udp_gro_receive_segment. As a result,
>>> NAPI_GRO_CB(p)->flush is not used at all. In addition, flush_id checks are
>>> more declarative and contained in inet_gro_flush, thus removing the need
>>> for flush_id in napi_gro_cb.
>>>
>>> This results in less parsing code for non-loop flush tests for TCP and UDP
>>> flows.
>>>
>>> To make sure results are not within noise range - I've made netfilter drop
>>> all TCP packets, and measured CPU performance in GRO (in this case GRO is
>>> responsible for about 50% of the CPU utilization).
>>>
>>> perf top while replaying 64 parallel IP/TCP streams merging in GRO:
>>> (gro_receive_network_flush is compiled inline to tcp_gro_receive)
>>> net-next:
>>>         6.94% [kernel] [k] inet_gro_receive
>>>         3.02% [kernel] [k] tcp_gro_receive
>>>
>>> patch applied:
>>>         4.27% [kernel] [k] tcp_gro_receive
>>>         4.22% [kernel] [k] inet_gro_receive
>>>
>>> perf top while replaying 64 parallel IP/IP/TCP streams merging in GRO (same
>>> results for any encapsulation, in this case inet_gro_receive is top
>>> offender in net-next)
>>> net-next:
>>>         10.09% [kernel] [k] inet_gro_receive
>>>         2.08% [kernel] [k] tcp_gro_receive
>>>
>>> patch applied:
>>>         6.97% [kernel] [k] inet_gro_receive
>>>         3.68% [kernel] [k] tcp_gro_receive
>>>
>>> Signed-off-by: Richard Gobert <richardbgobert@gmail.com>  
>>
>> Thanks for your patch, which is now commit 4b0ebbca3e167976 ("net: gro:
>> move L3 flush checks to tcp_gro_receive and udp_gro_receive_segment")
>> in net-next/main (next-20240514).
>>
>> noreply@ellerman.id.au reports build failures on m68k, e.g.
>> http://kisskb.ellerman.id.au/kisskb/buildresult/15168903/
>>
>>     net/core/gro.c: In function ‘dev_gro_receive’:
>>     ././include/linux/compiler_types.h:460:38: error: call to
>> ‘__compiletime_assert_654’ declared with attribute error: BUILD_BUG_ON
>> failed: !IS_ALIGNED(offsetof(struct napi_gro_cb, zeroed), sizeof(u32))
> 
> Hi Richard, any chance of getting this fixed within the next 2 hours?
> I can't send the net-next PR if it doesn't build on one of the arches..

Hi Jakub and Geert,
I'm only seeing this mail now, sorry for the late response.
I can fix this within the next two hours, would you prefer a standalone 
patch or should I add it to this patch series?

  reply	other threads:[~2024-05-14 15:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09 19:08 [PATCH net-next v10 0/3] net: gro: remove network_header use, move p->{flush/flush_id} calculations to L4 Richard Gobert
2024-05-09 19:08 ` [PATCH net-next v10 1/3] net: gro: use cb instead of skb->network_header Richard Gobert
2024-05-13  0:43   ` Willem de Bruijn
2024-05-09 19:08 ` [PATCH net-next v10 2/3] net: gro: move L3 flush checks to tcp_gro_receive and udp_gro_receive_segment Richard Gobert
2024-05-13  0:43   ` Willem de Bruijn
2024-05-14 12:13   ` Geert Uytterhoeven
2024-05-14 14:14     ` Jakub Kicinski
2024-05-14 15:56       ` Richard Gobert [this message]
2024-05-14 16:06         ` Jakub Kicinski
2024-05-14 17:06           ` [PATCH] net: gro: fix napi_gro_cb zeroed alignment Richard Gobert
2024-05-14 18:00             ` patchwork-bot+netdevbpf
2024-05-09 19:08 ` [PATCH net-next v10 3/3] selftests/net: add flush id selftests Richard Gobert
2024-05-13  0:44   ` Willem de Bruijn
2024-05-13 21:50 ` [PATCH net-next v10 0/3] net: gro: remove network_header use, move p->{flush/flush_id} calculations to L4 patchwork-bot+netdevbpf

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=8e0b027d-4d30-4f0f-82ef-113287f17c6a@gmail.com \
    --to=richardbgobert@gmail.com \
    --cc=alexander.duyck@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=geert@linux-m68k.org \
    --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=shuah@kernel.org \
    --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