From: Heiner Kallweit <hkallweit1@gmail.com>
To: Eric Dumazet <edumazet@google.com>
Cc: Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
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: Wed, 15 May 2024 07:53:44 +0200 [thread overview]
Message-ID: <442303d8-ffaa-40dc-8f71-786bebde1366@gmail.com> (raw)
In-Reply-To: <CANn89iLgj0ph5gRWOA2M2J8N_4hQd3Ndm73gATR8WODXaOM_LA@mail.gmail.com>
On 14.05.2024 11:45, Eric Dumazet wrote:
> On Tue, May 14, 2024 at 8:52 AM Heiner Kallweit <hkallweit1@gmail.com> wrote:
>>
>> Ken reported that RTL8125b can lock up if gro_flush_timeout has the
>> default value of 20000 and napi_defer_hard_irqs is set to 0.
>> In this scenario device interrupts aren't disabled, what seems to
>> trigger some silicon bug under heavy load. I was able to reproduce this
>> behavior on RTL8168h.
>> Disabling device interrupts if NAPI is scheduled from a place other than
>> the driver's interrupt handler is a necessity in r8169, for other
>> drivers it may still be a performance optimization.
>>
>> Fixes: 7274c4147afb ("r8169: don't try to disable interrupts if NAPI is scheduled already")
>> Reported-by: Ken Milmore <ken.milmore@gmail.com>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>> drivers/net/ethernet/realtek/r8169_main.c | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
>> index e5ea827a2..01f0ca53d 100644
>> --- a/drivers/net/ethernet/realtek/r8169_main.c
>> +++ b/drivers/net/ethernet/realtek/r8169_main.c
>> @@ -4639,6 +4639,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
>> {
>> struct rtl8169_private *tp = dev_instance;
>> u32 status = rtl_get_events(tp);
>> + int ret;
>>
>> if ((status & 0xffff) == 0xffff || !(status & tp->irq_mask))
>> return IRQ_NONE;
>> @@ -4657,10 +4658,11 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
>> rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
>> }
>>
>> - if (napi_schedule_prep(&tp->napi)) {
>> + ret = __napi_schedule_prep(&tp->napi);
>> + if (ret >= 0)
>> rtl_irq_disable(tp);
>> + if (ret > 0)
>> __napi_schedule(&tp->napi);
>> - }
>> out:
>> rtl_ack_events(tp, status);
>>
>
> I do not understand this patch.
>
> __napi_schedule_prep() would only return -1 if NAPIF_STATE_DISABLE was set,
> but this should not happen under normal operations ?
>
> A simple revert would avoid adding yet another NAPI helper.
Fine with me, I'll go with the revert for now.
prev parent reply other threads:[~2024-05-15 5:53 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
2024-05-14 17:49 ` Jakub Kicinski
2024-05-14 20:47 ` Ken Milmore
2024-05-15 5:53 ` Heiner Kallweit [this message]
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=442303d8-ffaa-40dc-8f71-786bebde1366@gmail.com \
--to=hkallweit1@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=ken.milmore@gmail.com \
--cc=kuba@kernel.org \
--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.