提交 ab1e7e1d 编写于 作者: E Eric Dumazet 提交者: David S. Miller

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: NEric Dumazet <edumazet@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 617f0121
...@@ -465,10 +465,8 @@ static int cp_rx_poll(struct napi_struct *napi, int budget) ...@@ -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 cp_private *cp = container_of(napi, struct cp_private, napi);
struct net_device *dev = cp->dev; struct net_device *dev = cp->dev;
unsigned int rx_tail = cp->rx_tail; unsigned int rx_tail = cp->rx_tail;
int rx; int rx = 0;
rx = 0;
rx_status_loop:
cpw16(IntrStatus, cp_rx_intr_mask); cpw16(IntrStatus, cp_rx_intr_mask);
while (rx < budget) { while (rx < budget) {
...@@ -556,15 +554,10 @@ static int cp_rx_poll(struct napi_struct *napi, int budget) ...@@ -556,15 +554,10 @@ static int cp_rx_poll(struct napi_struct *napi, int budget)
/* if we did not reach work limit, then we're done with /* if we did not reach work limit, then we're done with
* this round of polling * this round of polling
*/ */
if (rx < budget) { if (rx < budget && napi_complete_done(napi, rx)) {
unsigned long flags; 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); spin_lock_irqsave(&cp->lock, flags);
__napi_complete(napi);
cpw16_f(IntrMask, cp_intr_mask); cpw16_f(IntrMask, cp_intr_mask);
spin_unlock_irqrestore(&cp->lock, flags); spin_unlock_irqrestore(&cp->lock, flags);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册