All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	Heiner Kallweit <hkallweit1@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	Realtek linux nic maintainers <nic_swsd@realtek.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net] r8169: fix NAPI handling under high load
Date: Tue, 16 Oct 2018 17:19:31 -0700	[thread overview]
Message-ID: <e5f341ed-9776-35d8-898b-89da9dbeb24a@gmail.com> (raw)
In-Reply-To: <20181016151708.3fff9bd9@xeon-e3>



On 10/16/2018 03:17 PM, Stephen Hemminger wrote:
> On Tue, 16 Oct 2018 22:37:31 +0200
> Heiner Kallweit <hkallweit1@gmail.com> wrote:
> 
>> rtl_rx() and rtl_tx() are called only if the respective bits are set
>> in the interrupt status register. Under high load NAPI may not be
>> able to process all data (work_done == budget) and it will schedule
>> subsequent calls to the poll callback.
>> rtl_ack_events() however resets the bits in the interrupt status
>> register, therefore subsequent calls to rtl8169_poll() won't call
>> rtl_rx() and rtl_tx() - chip interrupts are still disabled.
>>
>> Fix this by calling rtl_rx() and rtl_tx() independent of the bits
>> set in the interrupt status register. Both functions will detect
>> if there's nothing to do for them.
>>
>> This issue has been there more or less forever (at least it exists in
>> 3.16 already), so I can't provide a "Fixes" tag. 
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> 
> Another issue is this:
> 
> 	if (work_done < budget) {
> 		napi_complete_done(napi, work_done);
> 
> 		rtl_irq_enable(tp, enable_mask);
> 		mmiowb();
> 	}
> 
> 	return work_done;
> }
> 
> 
> The code needs to check return value of napi_complete_done.
> 
> 	if (work_done < budget &&
> 	    napi_complete_done(napi, work_done) {
> 		rtl_irq_enable(tp, enable_mask);
> 		mmiowb();
> 	}
> 
> 	return work_done;
> }
> 
> Try that, it might fix the problem and your logic would
> be unnecessary 
> 

Well, I do not believe this is related.

Testing napi_complete_done() is not mandatory, it is only an optimization [1]
and only for busy polling users.

In short, by default, this should not matter, since busy-polling is not enabled by default.


[1] busy polling users are spinning anyway, so it is not even clear if this
   is really an optimization, unless maybe the cost of irq enabling is really really high...

  reply	other threads:[~2018-10-17  8:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-16 20:37 [PATCH net] r8169: fix NAPI handling under high load Heiner Kallweit
2018-10-16 21:17 ` Holger Hoffstätte
2018-10-16 23:03   ` Stephen Hemminger
2018-10-16 23:08     ` Florian Fainelli
2018-10-17  0:23       ` Eric Dumazet
2018-10-17  3:10         ` Florian Fainelli
2018-10-17  0:21     ` Eric Dumazet
2018-10-17 18:12   ` Heiner Kallweit
2018-10-17 18:48     ` Fwd: " Heiner Kallweit
2018-10-17 19:11     ` Holger Hoffstätte
2018-10-17 19:27       ` Heiner Kallweit
2018-10-17 20:07         ` Holger Hoffstätte
2018-10-20  9:55           ` Holger Hoffstätte
2018-10-17 23:30       ` Francois Romieu
2018-10-18  5:58         ` Jonathan Woithe
2018-10-18  6:03           ` Heiner Kallweit
2018-10-18  6:15             ` Jonathan Woithe
2018-10-18 11:52               ` Holger Hoffstätte
2018-10-19  7:29                 ` Jonathan Woithe
2018-10-21 23:07               ` Jonathan Woithe
2018-10-16 22:17 ` Stephen Hemminger
2018-10-17  0:19   ` Eric Dumazet [this message]
2018-10-17 23:30 ` Francois Romieu
2018-10-18  5:21   ` David Miller
2018-10-18  5:58     ` Heiner Kallweit
2018-10-18  6:24       ` David Miller

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=e5f341ed-9776-35d8-898b-89da9dbeb24a@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=stephen@networkplumber.org \
    /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.