summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2017-02-04 15:24:52 -0800
committerDavid S. Miller <davem@davemloft.net>2017-02-05 16:11:57 -0500
commitab1e7e1d26669365e49e8312f96f7a5fa0b703a9 (patch)
tree5a5f0edbe78ba5fbcd0ee5861837329b020be2e5 /drivers
parent617f01211bafed65b5cb2fa5b671e839c7f2af86 (diff)
downloadlinux-ab1e7e1d26669365e49e8312f96f7a5fa0b703a9.tar.bz2
8139cp: use napi_complete_done()
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. 4) Eventually get rid of napi_gro_flush() in the future. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/realtek/8139cp.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
index 0b3cd58093d5..672f6b696069 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -465,10 +465,8 @@ static int cp_rx_poll(struct napi_struct *napi, int budget)
struct cp_private *cp = container_of(napi, struct cp_private, napi);
struct net_device *dev = cp->dev;
unsigned int rx_tail = cp->rx_tail;
- int rx;
+ int rx = 0;
- rx = 0;
-rx_status_loop:
cpw16(IntrStatus, cp_rx_intr_mask);
while (rx < budget) {
@@ -556,15 +554,10 @@ rx_next:
/* if we did not reach work limit, then we're done with
* this round of polling
*/
- if (rx < budget) {
+ if (rx < budget && napi_complete_done(napi, rx)) {
unsigned long flags;
- if (cpr16(IntrStatus) & cp_rx_intr_mask)
- goto rx_status_loop;
-
- napi_gro_flush(napi, false);
spin_lock_irqsave(&cp->lock, flags);
- __napi_complete(napi);
cpw16_f(IntrMask, cp_intr_mask);
spin_unlock_irqrestore(&cp->lock, flags);
}