Skip to content

Commit 6b839b6

Browse files
hkallweitdavem330
authored andcommitted
r8169: fix NAPI handling under high load
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. Fixes: da78dbf ("r8169: remove work from irq handler.") Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2ee653f commit 6b839b6

File tree

1 file changed

+3
-5
lines changed
  • drivers/net/ethernet/realtek

1 file changed

+3
-5
lines changed

drivers/net/ethernet/realtek/r8169.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6549,17 +6549,15 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
65496549
struct rtl8169_private *tp = container_of(napi, struct rtl8169_private, napi);
65506550
struct net_device *dev = tp->dev;
65516551
u16 enable_mask = RTL_EVENT_NAPI | tp->event_slow;
6552-
int work_done= 0;
6552+
int work_done;
65536553
u16 status;
65546554

65556555
status = rtl_get_events(tp);
65566556
rtl_ack_events(tp, status & ~tp->event_slow);
65576557

6558-
if (status & RTL_EVENT_NAPI_RX)
6559-
work_done = rtl_rx(dev, tp, (u32) budget);
6558+
work_done = rtl_rx(dev, tp, (u32) budget);
65606559

6561-
if (status & RTL_EVENT_NAPI_TX)
6562-
rtl_tx(dev, tp);
6560+
rtl_tx(dev, tp);
65636561

65646562
if (status & tp->event_slow) {
65656563
enable_mask &= ~tp->event_slow;

0 commit comments

Comments
 (0)