ibm/emac: use napi_complete_done()

Use napi_complete_done() instead of __napi_complete()

We plan to remove __napi_complete() to reduce NAPI complexity.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Eric Dumazet 2017-02-04 15:25:00 -08:00 committed by David S. Miller
parent 0eb7b85c96
commit 3d1a6333d9
1 changed files with 9 additions and 9 deletions

View File

@ -421,20 +421,20 @@ static int mal_poll(struct napi_struct *napi, int budget)
int n; int n;
if (unlikely(test_bit(MAL_COMMAC_POLL_DISABLED, &mc->flags))) if (unlikely(test_bit(MAL_COMMAC_POLL_DISABLED, &mc->flags)))
continue; continue;
n = mc->ops->poll_rx(mc->dev, budget); n = mc->ops->poll_rx(mc->dev, budget - received);
if (n) { if (n) {
received += n; received += n;
budget -= n; if (received >= budget)
if (budget <= 0) return budget;
goto more_work; // XXX What if this is the last one ?
} }
} }
/* We need to disable IRQs to protect from RXDE IRQ here */ if (napi_complete_done(napi, received)) {
spin_lock_irqsave(&mal->lock, flags); /* We need to disable IRQs to protect from RXDE IRQ here */
__napi_complete(napi); spin_lock_irqsave(&mal->lock, flags);
mal_enable_eob_irq(mal); mal_enable_eob_irq(mal);
spin_unlock_irqrestore(&mal->lock, flags); spin_unlock_irqrestore(&mal->lock, flags);
}
/* Check for "rotting" packet(s) */ /* Check for "rotting" packet(s) */
list_for_each(l, &mal->poll_list) { list_for_each(l, &mal->poll_list) {