Skip to content

Commit

Permalink
8139too: use napi_complete_done()
Browse files Browse the repository at this point in the history
Use napi_complete_done() instead of __napi_complete() to :

1) Get support of gro_flush_timeout if opt-in
2) Not rearm interrupts for busy-polling users.
3) use standard NAPI API.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Feb 5, 2017
1 parent 3976001 commit 617f012
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/net/ethernet/realtek/8139too.c
Original file line number Diff line number Diff line change
Expand Up @@ -2135,14 +2135,10 @@ static int rtl8139_poll(struct napi_struct *napi, int budget)
if (likely(RTL_R16(IntrStatus) & RxAckBits))
work_done += rtl8139_rx(dev, tp, budget);

if (work_done < budget) {
if (work_done < budget && napi_complete_done(napi, work_done)) {
unsigned long flags;
/*
* Order is important since data can get interrupted
* again when we think we are done.
*/

spin_lock_irqsave(&tp->lock, flags);
__napi_complete(napi);
RTL_W16_F(IntrMask, rtl8139_intr_mask);
spin_unlock_irqrestore(&tp->lock, flags);
}
Expand Down

0 comments on commit 617f012

Please sign in to comment.