netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Eric Dumazet <edumazet@google.com>, songliubraving@fb.com
Cc: Alexei Starovoitov <ast@fb.com>, netdev <netdev@vger.kernel.org>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	Alexander Duyck <alexander.h.duyck@intel.com>,
	michael.chan@broadcom.com, kernel-team <Kernel-team@fb.com>
Subject: Re: pegged softirq and NAPI race (?)
Date: Tue, 18 Sep 2018 14:25:38 -0700	[thread overview]
Message-ID: <09e7e3f8-dee8-71ea-7e57-4d0c92dcf13b@gmail.com> (raw)
In-Reply-To: <CANn89i+kg=tE9aRYoFb+9ws35CCJJQz9Yc9i=9w=vDj=Epvj=A@mail.gmail.com>

On 09/18/2018 02:13 PM, Eric Dumazet wrote:
> On Tue, Sep 18, 2018 at 1:37 PM Song Liu <songliubraving@fb.com> wrote:
>>
> 
>> Looks like a patch like the following fixes the issue for ixgbe. But I
>> cannot explain it yet.
>>
>> Does this ring a bell?
> 
> I dunno, it looks like the NIC is  generating an interrupt while it should not,
> and constantly sets NAPI_STATE_MISSED.
> 
> Or maybe we need to properly check napi_complete_done() return value.
> 
> diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
> b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
> index d3e72d0f66ef428b08e4bd88508e05b734bc43a4..c4c565c982a98a5891603cedcdcb72dc1c401813
> 100644
> --- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
> +++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
> @@ -1773,8 +1773,8 @@ ixgb_clean(struct napi_struct *napi, int budget)
>         ixgb_clean_rx_irq(adapter, &work_done, budget);
> 
>         /* If budget not fully consumed, exit the polling mode */
> -       if (work_done < budget) {
> -               napi_complete_done(napi, work_done);
> +       if (work_done < budget &&
> +           napi_complete_done(napi, work_done)) {
>                 if (!test_bit(__IXGB_DOWN, &adapter->flags))
>                         ixgb_irq_enable(adapter);
>         }

This would not be the only driver doing this unfortunately... should we
add a __must_check annotation to help catch those (mis)uses? Though that
could cause false positives for drivers using NAPI to clean their TX ring.
-- 
Florian

  parent reply	other threads:[~2018-09-19  3:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18  8:41 pegged softirq and NAPI race (?) Song Liu
2018-09-18 13:45 ` Eric Dumazet
2018-09-18 16:19   ` Song Liu
2018-09-18 16:31     ` Rik van Riel
2018-09-18 16:33     ` Eric Dumazet
2018-09-18 16:49       ` Song Liu
2018-09-18 17:51   ` Alexei Starovoitov
2018-09-18 18:17     ` Eric Dumazet
2018-09-18 20:37       ` Song Liu
2018-09-18 21:13         ` Eric Dumazet
2018-09-18 21:21           ` Eric Dumazet
2018-09-18 21:36             ` Jeff Kirsher
2018-09-18 21:40               ` Song Liu
2018-09-18 21:46                 ` Eric Dumazet
2018-09-18 21:55                   ` Song Liu
2018-09-18 22:04                     ` Eric Dumazet
2018-09-18 21:21           ` Song Liu
2018-09-18 21:25             ` Eric Dumazet
2018-09-18 21:25           ` Florian Fainelli [this message]
2018-09-18 21:28             ` Eric Dumazet
2018-09-18 21:35               ` Florian Fainelli
2018-09-18 21:36               ` Song Liu

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=09e7e3f8-dee8-71ea-7e57-4d0c92dcf13b@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=Kernel-team@fb.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=ast@fb.com \
    --cc=edumazet@google.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.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).