All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] r8169: fix NAPI handling under high load
@ 2018-10-16 20:37 Heiner Kallweit
  2018-10-16 21:17 ` Holger Hoffstätte
                   ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Heiner Kallweit @ 2018-10-16 20:37 UTC (permalink / raw)
  To: David Miller, Realtek linux nic maintainers; +Cc: netdev

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>
---
 drivers/net/ethernet/realtek/r8169.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 8c4f49adc..7caf3b7e9 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -6528,17 +6528,15 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
 	struct rtl8169_private *tp = container_of(napi, struct rtl8169_private, napi);
 	struct net_device *dev = tp->dev;
 	u16 enable_mask = RTL_EVENT_NAPI | tp->event_slow;
-	int work_done= 0;
+	int work_done;
 	u16 status;
 
 	status = rtl_get_events(tp);
 	rtl_ack_events(tp, status & ~tp->event_slow);
 
-	if (status & RTL_EVENT_NAPI_RX)
-		work_done = rtl_rx(dev, tp, (u32) budget);
+	work_done = rtl_rx(dev, tp, (u32) budget);
 
-	if (status & RTL_EVENT_NAPI_TX)
-		rtl_tx(dev, tp);
+	rtl_tx(dev, tp);
 
 	if (status & tp->event_slow) {
 		enable_mask &= ~tp->event_slow;
-- 
2.19.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2018-10-22  7:24 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.