netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Alexander Lobakin <aleksander.lobakin@intel.com>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	David Miller <davem@davemloft.net>,
	Realtek linux nic maintainers <nic_swsd@realtek.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Ken Milmore <ken.milmore@gmail.com>
Subject: Re: [PATCH net 2/2] r8169: disable interrupts also for GRO-scheduled NAPI
Date: Tue, 14 May 2024 10:47:39 -0700	[thread overview]
Message-ID: <20240514104739.2d06fb10@kernel.org> (raw)
In-Reply-To: <cdaf9e9a-881c-4324-a886-0ed38e2de72e@gmail.com>

On Tue, 14 May 2024 19:09:21 +0200 Heiner Kallweit wrote:
> Thanks for the explanation. What is the benefit of acking interrupts
> at the beginning of NAPI poll, compared to acking them after
> napi_complete_done()?
> If budget is exceeded and we know we're polled again, why ack
> the interrupts in between?

That's a fair point, the main concern for acking after processing
is that we will miss an event. If we ack before processing we can
occasionally take an unnecessary IRQ, but we'll never let a packet
rot on the ring because it arrived between processing packets and
acking the IRQ.
But you know the driver better, maybe there's a clean way of avoiding
the missed IRQs (not sure it would be worth the complexity, tho TBH).

> I just tested with the defaults of gro_flush_timeout=20000 and
> napi_defer_hardirqs=1, and iperf3 --bidir.
> The difference is massive. When acking after napi_complete_done()
> I see only a few hundred interrupts. Acking at the beginning of
> NAPI poll it's few hundred thousand interrupts.

That's quite odd. Maybe because rtl_tx() doesn't contribute to work
done? Maybe it'd be better to set work done to min(budget, !!tx, rx) ?

Or maybe the disabling is not working somehow?

napi_defer_hardirqs=1 should make us reschedule NAPI if there was _any_
work done. Meaning we'd enable NAPI only after a completely empty NAPI
run. On an empty NAPI run it should not matter whether we acked before
or after checking for packets, or so I'd naively think.

  reply	other threads:[~2024-05-14 17:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14  6:49 [PATCH net 0/2] r8169: Fix GRO-related issue with not disabled device interrupts Heiner Kallweit
2024-05-14  6:50 ` [PATCH net 1/2] net: add napi_schedule_prep variant with more granular return value Heiner Kallweit
2024-05-14 11:07   ` Eric Dumazet
2024-05-14 11:40     ` Heiner Kallweit
2024-05-14  6:52 ` [PATCH net 2/2] r8169: disable interrupts also for GRO-scheduled NAPI Heiner Kallweit
2024-05-14  9:45   ` Eric Dumazet
2024-05-14 10:52     ` Alexander Lobakin
2024-05-14 11:05       ` Eric Dumazet
2024-05-14 11:17         ` Alexander Lobakin
2024-05-14 14:27           ` Eric Dumazet
2024-05-14 11:29         ` Heiner Kallweit
2024-05-14 14:11         ` Jakub Kicinski
2024-05-14 16:35           ` Heiner Kallweit
2024-05-14 16:49             ` Jakub Kicinski
2024-05-14 17:09               ` Heiner Kallweit
2024-05-14 17:47                 ` Jakub Kicinski [this message]
2024-05-14 17:49                   ` Jakub Kicinski
2024-05-14 20:47                     ` Ken Milmore
2024-05-15  5:53     ` Heiner Kallweit

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=20240514104739.2d06fb10@kernel.org \
    --to=kuba@kernel.org \
    --cc=aleksander.lobakin@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=ken.milmore@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).