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 09:49:08 -0700 [thread overview]
Message-ID: <20240514094908.61593793@kernel.org> (raw)
In-Reply-To: <78fb284b-f78a-4dde-8398-d4f175e49723@gmail.com>
On Tue, 14 May 2024 18:35:46 +0200 Heiner Kallweit wrote:
> > I thought the bug is because of a race with disable.
>
> No, the second napi_poll() in this scenario is executed with device
> interrupts enabled, what triggers a (supposedly) hw bug under heavy
> load. So the fix is to disable device interrupts also in the case
> that NAPI is already scheduled when entering the interrupt handler.
>
> > But there's already a synchronize_net() after disable, so NAPI poll
> > must fully exit before we mask in rtl8169_cleanup().
> >
> > If the bug is double-enable you describe the fix is just making
> > the race window smaller. But I don't think that's the bug.
> >
> > BTW why are events only acked in rtl8169_interrupt() and not
> > rtl8169_poll()?
>
> You mean clearing the rx/tx-related interrupt status bits only
> after napi_complete_done(), as an alternative to disabling
> device interrupts?
Before, basically ack them at the start of a poll function.
If gro_timeout / IRQ suppression is not enabled it won't make
much of a difference. Probably also won't make much difference
with iperf.
But normally traffic is bursty so with gro_timeout we can see
something like:
packets: x x x x x < no more packets >
IRQ pending: xxx xxxxxxxxxxxxxxxxxxxxxx
ISR: [] []
IRQ ack: x x
NAPI: [=====] < timeout > [=] [=] < timeout > [=]
Acking at the beginning of NAPI poll can't make us miss events
but we'd clear the pending IRQ on the "deferred" NAPI run, avoiding
an extra HW IRQ and 2 NAPI calls:
packets: x x x x x < no more packets >
IRQ pending: xxxx xxxxxxxxxxxxxxxxxxx
ISR: []
IRQ ack: x x
NAPI: [=====] < timeout > [=]
next prev parent reply other threads:[~2024-05-14 16:49 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 [this message]
2024-05-14 17:09 ` Heiner Kallweit
2024-05-14 17:47 ` Jakub Kicinski
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=20240514094908.61593793@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.