cfd41f2f0debd454c2474267fa34785e84c8e401
[openwrt/openwrt.git] / target / linux / generic / backport-4.9 / 090-net-generalize-napi_complete_done.patch
1 From 6ad20165d376fa07919a70e4f43dfae564601829 Mon Sep 17 00:00:00 2001
2 From: Eric Dumazet <edumazet@google.com>
3 Date: Mon, 30 Jan 2017 08:22:01 -0800
4 Subject: drivers: net: generalize napi_complete_done()
5
6 napi_complete_done() allows to opt-in for gro_flush_timeout,
7 added back in linux-3.19, commit 3b47d30396ba
8 ("net: gro: add a per device gro flush timer")
9
10 This allows for more efficient GRO aggregation without
11 sacrifying latencies.
12
13 Signed-off-by: Eric Dumazet <edumazet@google.com>
14 Signed-off-by: David S. Miller <davem@davemloft.net>
15 ---
16 drivers/net/can/at91_can.c | 2 +-
17 drivers/net/can/c_can/c_can.c | 2 +-
18 drivers/net/can/flexcan.c | 2 +-
19 drivers/net/can/ifi_canfd/ifi_canfd.c | 2 +-
20 drivers/net/can/janz-ican3.c | 2 +-
21 drivers/net/can/m_can/m_can.c | 2 +-
22 drivers/net/can/rcar/rcar_can.c | 2 +-
23 drivers/net/can/rcar/rcar_canfd.c | 2 +-
24 drivers/net/can/xilinx_can.c | 2 +-
25 drivers/net/ethernet/3com/typhoon.c | 2 +-
26 drivers/net/ethernet/adi/bfin_mac.c | 2 +-
27 drivers/net/ethernet/agere/et131x.c | 2 +-
28 drivers/net/ethernet/altera/altera_tse_main.c | 2 +-
29 drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 2 +-
30 drivers/net/ethernet/aquantia/atlantic/aq_vec.c | 2 +-
31 drivers/net/ethernet/arc/emac_main.c | 2 +-
32 drivers/net/ethernet/atheros/alx/main.c | 2 +-
33 drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 2 +-
34 drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 2 +-
35 drivers/net/ethernet/atheros/atlx/atl1.c | 2 +-
36 drivers/net/ethernet/broadcom/b44.c | 2 +-
37 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 2 +-
38 drivers/net/ethernet/broadcom/bgmac.c | 2 +-
39 drivers/net/ethernet/broadcom/bnx2.c | 4 ++--
40 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 2 +-
41 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +-
42 drivers/net/ethernet/broadcom/sb1250-mac.c | 2 +-
43 drivers/net/ethernet/brocade/bna/bnad.c | 2 +-
44 drivers/net/ethernet/cadence/macb.c | 2 +-
45 drivers/net/ethernet/calxeda/xgmac.c | 2 +-
46 drivers/net/ethernet/cavium/liquidio/lio_main.c | 2 +-
47 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 2 +-
48 drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 2 +-
49 drivers/net/ethernet/cavium/thunder/nicvf_main.c | 2 +-
50 drivers/net/ethernet/chelsio/cxgb/sge.c | 2 +-
51 drivers/net/ethernet/chelsio/cxgb3/sge.c | 4 ++--
52 drivers/net/ethernet/chelsio/cxgb4vf/sge.c | 2 +-
53 drivers/net/ethernet/cisco/enic/enic_main.c | 4 ++--
54 drivers/net/ethernet/dec/tulip/interrupt.c | 6 +++---
55 drivers/net/ethernet/dnet.c | 2 +-
56 drivers/net/ethernet/emulex/benet/be_main.c | 2 +-
57 drivers/net/ethernet/ethoc.c | 2 +-
58 drivers/net/ethernet/ezchip/nps_enet.c | 2 +-
59 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
60 drivers/net/ethernet/freescale/fec_main.c | 2 +-
61 .../net/ethernet/freescale/fs_enet/fs_enet-main.c | 2 +-
62 drivers/net/ethernet/freescale/gianfar.c | 4 ++--
63 drivers/net/ethernet/freescale/ucc_geth.c | 2 +-
64 drivers/net/ethernet/hisilicon/hip04_eth.c | 2 +-
65 drivers/net/ethernet/hisilicon/hisi_femac.c | 2 +-
66 drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 2 +-
67 drivers/net/ethernet/ibm/ibmveth.c | 2 +-
68 drivers/net/ethernet/ibm/ibmvnic.c | 2 +-
69 drivers/net/ethernet/intel/e100.c | 2 +-
70 drivers/net/ethernet/intel/ixgb/ixgb_main.c | 2 +-
71 drivers/net/ethernet/korina.c | 2 +-
72 drivers/net/ethernet/lantiq_etop.c | 21 +++++++++------------
73 drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +-
74 drivers/net/ethernet/marvell/mvneta.c | 6 ++----
75 drivers/net/ethernet/marvell/mvpp2.c | 2 +-
76 drivers/net/ethernet/marvell/pxa168_eth.c | 2 +-
77 drivers/net/ethernet/moxa/moxart_ether.c | 2 +-
78 drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 2 +-
79 drivers/net/ethernet/natsemi/natsemi.c | 2 +-
80 drivers/net/ethernet/neterion/s2io.c | 4 ++--
81 drivers/net/ethernet/neterion/vxge/vxge-main.c | 6 +++---
82 drivers/net/ethernet/nvidia/forcedeth.c | 2 +-
83 drivers/net/ethernet/nxp/lpc_eth.c | 2 +-
84 .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 2 +-
85 drivers/net/ethernet/pasemi/pasemi_mac.c | 2 +-
86 .../net/ethernet/qlogic/netxen/netxen_nic_main.c | 2 +-
87 drivers/net/ethernet/qlogic/qede/qede_fp.c | 2 +-
88 drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 10 +++++-----
89 drivers/net/ethernet/qlogic/qlge/qlge_main.c | 2 +-
90 drivers/net/ethernet/qualcomm/emac/emac.c | 2 +-
91 drivers/net/ethernet/realtek/r8169.c | 2 +-
92 drivers/net/ethernet/rocker/rocker_main.c | 2 +-
93 drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 2 +-
94 drivers/net/ethernet/sfc/efx.c | 2 +-
95 drivers/net/ethernet/sfc/falcon/efx.c | 2 +-
96 drivers/net/ethernet/smsc/smsc9420.c | 2 +-
97 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
98 drivers/net/ethernet/sun/niu.c | 2 +-
99 drivers/net/ethernet/sun/sungem.c | 2 +-
100 drivers/net/ethernet/sun/sunvnet_common.c | 2 +-
101 drivers/net/ethernet/tehuti/tehuti.c | 2 +-
102 drivers/net/ethernet/ti/cpsw.c | 2 +-
103 drivers/net/ethernet/ti/davinci_emac.c | 2 +-
104 drivers/net/ethernet/ti/netcp_core.c | 2 +-
105 drivers/net/ethernet/tile/tilegx.c | 2 +-
106 drivers/net/ethernet/tile/tilepro.c | 2 +-
107 drivers/net/ethernet/toshiba/ps3_gelic_net.c | 2 +-
108 drivers/net/ethernet/toshiba/spider_net.c | 2 +-
109 drivers/net/ethernet/toshiba/tc35815.c | 2 +-
110 drivers/net/ethernet/tundra/tsi108_eth.c | 2 +-
111 drivers/net/ethernet/via/via-rhine.c | 2 +-
112 drivers/net/ethernet/via/via-velocity.c | 2 +-
113 drivers/net/ethernet/wiznet/w5100.c | 2 +-
114 drivers/net/ethernet/wiznet/w5300.c | 2 +-
115 drivers/net/fjes/fjes_main.c | 2 +-
116 drivers/net/vmxnet3/vmxnet3_drv.c | 4 ++--
117 drivers/net/wan/fsl_ucc_hdlc.c | 2 +-
118 drivers/net/wan/hd64572.c | 2 +-
119 drivers/net/wireless/ath/ath10k/pci.c | 2 +-
120 drivers/net/wireless/ath/wil6210/netdev.c | 2 +-
121 drivers/net/xen-netback/interface.c | 2 +-
122 drivers/net/xen-netfront.c | 2 +-
123 drivers/staging/octeon/ethernet-rx.c | 2 +-
124 drivers/staging/unisys/visornic/visornic_main.c | 2 +-
125 109 files changed, 132 insertions(+), 137 deletions(-)
126
127 --- a/drivers/net/can/at91_can.c
128 +++ b/drivers/net/can/at91_can.c
129 @@ -813,7 +813,7 @@ static int at91_poll(struct napi_struct
130 u32 reg_ier = AT91_IRQ_ERR_FRAME;
131 reg_ier |= get_irq_mb_rx(priv) & ~AT91_MB_MASK(priv->rx_next);
132
133 - napi_complete(napi);
134 + napi_complete_done(napi, work_done);
135 at91_write(priv, AT91_IER, reg_ier);
136 }
137
138 --- a/drivers/net/can/c_can/c_can.c
139 +++ b/drivers/net/can/c_can/c_can.c
140 @@ -1070,7 +1070,7 @@ static int c_can_poll(struct napi_struct
141
142 end:
143 if (work_done < quota) {
144 - napi_complete(napi);
145 + napi_complete_done(napi, work_done);
146 /* enable all IRQs if we are not in bus off state */
147 if (priv->can.state != CAN_STATE_BUS_OFF)
148 c_can_irq_control(priv, true);
149 --- a/drivers/net/can/flexcan.c
150 +++ b/drivers/net/can/flexcan.c
151 @@ -703,7 +703,7 @@ static int flexcan_poll(struct napi_stru
152 work_done += flexcan_poll_bus_err(dev, reg_esr);
153
154 if (work_done < quota) {
155 - napi_complete(napi);
156 + napi_complete_done(napi, work_done);
157 /* enable IRQs */
158 flexcan_write(FLEXCAN_IFLAG_DEFAULT, &regs->imask1);
159 flexcan_write(priv->reg_ctrl_default, &regs->ctrl);
160 --- a/drivers/net/can/ifi_canfd/ifi_canfd.c
161 +++ b/drivers/net/can/ifi_canfd/ifi_canfd.c
162 @@ -578,7 +578,7 @@ static int ifi_canfd_poll(struct napi_st
163 work_done += ifi_canfd_do_rx_poll(ndev, quota - work_done);
164
165 if (work_done < quota) {
166 - napi_complete(napi);
167 + napi_complete_done(napi, work_done);
168 ifi_canfd_irq_enable(ndev, 1);
169 }
170
171 --- a/drivers/net/can/janz-ican3.c
172 +++ b/drivers/net/can/janz-ican3.c
173 @@ -1475,7 +1475,7 @@ static int ican3_napi(struct napi_struct
174 /* We have processed all packets that the adapter had, but it
175 * was less than our budget, stop polling */
176 if (received < budget)
177 - napi_complete(napi);
178 + napi_complete_done(napi, received);
179
180 spin_lock_irqsave(&mod->lock, flags);
181
182 --- a/drivers/net/can/m_can/m_can.c
183 +++ b/drivers/net/can/m_can/m_can.c
184 @@ -730,7 +730,7 @@ static int m_can_poll(struct napi_struct
185 work_done += m_can_do_rx_poll(dev, (quota - work_done));
186
187 if (work_done < quota) {
188 - napi_complete(napi);
189 + napi_complete_done(napi, work_done);
190 m_can_enable_all_interrupts(priv);
191 }
192
193 --- a/drivers/net/can/rcar/rcar_can.c
194 +++ b/drivers/net/can/rcar/rcar_can.c
195 @@ -695,7 +695,7 @@ static int rcar_can_rx_poll(struct napi_
196 }
197 /* All packets processed */
198 if (num_pkts < quota) {
199 - napi_complete(napi);
200 + napi_complete_done(napi, num_pkts);
201 priv->ier |= RCAR_CAN_IER_RXFIE;
202 writeb(priv->ier, &priv->regs->ier);
203 }
204 --- a/drivers/net/can/rcar/rcar_canfd.c
205 +++ b/drivers/net/can/rcar/rcar_canfd.c
206 @@ -1512,7 +1512,7 @@ static int rcar_canfd_rx_poll(struct nap
207
208 /* All packets processed */
209 if (num_pkts < quota) {
210 - napi_complete(napi);
211 + napi_complete_done(napi, num_pkts);
212 /* Enable Rx FIFO interrupts */
213 rcar_canfd_set_bit(priv->base, RCANFD_RFCC(ridx),
214 RCANFD_RFCC_RFIE);
215 --- a/drivers/net/can/xilinx_can.c
216 +++ b/drivers/net/can/xilinx_can.c
217 @@ -726,7 +726,7 @@ static int xcan_rx_poll(struct napi_stru
218 can_led_event(ndev, CAN_LED_EVENT_RX);
219
220 if (work_done < quota) {
221 - napi_complete(napi);
222 + napi_complete_done(napi, work_done);
223 ier = priv->read_reg(priv, XCAN_IER_OFFSET);
224 ier |= (XCAN_IXR_RXOK_MASK | XCAN_IXR_RXNEMP_MASK);
225 priv->write_reg(priv, XCAN_IER_OFFSET, ier);
226 --- a/drivers/net/ethernet/3com/typhoon.c
227 +++ b/drivers/net/ethernet/3com/typhoon.c
228 @@ -1748,7 +1748,7 @@ typhoon_poll(struct napi_struct *napi, i
229 }
230
231 if (work_done < budget) {
232 - napi_complete(napi);
233 + napi_complete_done(napi, work_done);
234 iowrite32(TYPHOON_INTR_NONE,
235 tp->ioaddr + TYPHOON_REG_INTR_MASK);
236 typhoon_post_pci_writes(tp->ioaddr);
237 --- a/drivers/net/ethernet/adi/bfin_mac.c
238 +++ b/drivers/net/ethernet/adi/bfin_mac.c
239 @@ -1274,7 +1274,7 @@ static int bfin_mac_poll(struct napi_str
240 }
241
242 if (i < budget) {
243 - napi_complete(napi);
244 + napi_complete_done(napi, i);
245 if (test_and_clear_bit(BFIN_MAC_RX_IRQ_DISABLED, &lp->flags))
246 enable_irq(IRQ_MAC_RX);
247 }
248 --- a/drivers/net/ethernet/agere/et131x.c
249 +++ b/drivers/net/ethernet/agere/et131x.c
250 @@ -3573,7 +3573,7 @@ static int et131x_poll(struct napi_struc
251 et131x_handle_send_pkts(adapter);
252
253 if (work_done < budget) {
254 - napi_complete(&adapter->napi);
255 + napi_complete_done(&adapter->napi, work_done);
256 et131x_enable_interrupts(adapter);
257 }
258
259 --- a/drivers/net/ethernet/altera/altera_tse_main.c
260 +++ b/drivers/net/ethernet/altera/altera_tse_main.c
261 @@ -491,7 +491,7 @@ static int tse_poll(struct napi_struct *
262
263 if (rxcomplete < budget) {
264
265 - napi_complete(napi);
266 + napi_complete_done(napi, rxcomplete);
267
268 netdev_dbg(priv->dev,
269 "NAPI Complete, did %d packets with budget %d\n",
270 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
271 +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
272 @@ -651,7 +651,7 @@ static int xgene_enet_napi(struct napi_s
273 processed = xgene_enet_process_ring(ring, budget);
274
275 if (processed != budget) {
276 - napi_complete(napi);
277 + napi_complete_done(napi, processed);
278 enable_irq(ring->irq);
279 }
280
281 --- a/drivers/net/ethernet/arc/emac_main.c
282 +++ b/drivers/net/ethernet/arc/emac_main.c
283 @@ -284,7 +284,7 @@ static int arc_emac_poll(struct napi_str
284
285 work_done = arc_emac_rx(ndev, budget);
286 if (work_done < budget) {
287 - napi_complete(napi);
288 + napi_complete_done(napi, work_done);
289 arc_reg_or(priv, R_ENABLE, RXINT_MASK | TXINT_MASK);
290 }
291
292 --- a/drivers/net/ethernet/atheros/alx/main.c
293 +++ b/drivers/net/ethernet/atheros/alx/main.c
294 @@ -292,7 +292,7 @@ static int alx_poll(struct napi_struct *
295 if (!tx_complete || work == budget)
296 return budget;
297
298 - napi_complete(&alx->napi);
299 + napi_complete_done(&alx->napi, work);
300
301 /* enable interrupt */
302 if (alx->flags & ALX_FLAG_USING_MSIX) {
303 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
304 +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
305 @@ -1885,7 +1885,7 @@ static int atl1c_clean(struct napi_struc
306
307 if (work_done < budget) {
308 quit_polling:
309 - napi_complete(napi);
310 + napi_complete_done(napi, work_done);
311 adapter->hw.intr_mask |= ISR_RX_PKT;
312 AT_WRITE_REG(&adapter->hw, REG_IMR, adapter->hw.intr_mask);
313 }
314 --- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
315 +++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
316 @@ -1532,7 +1532,7 @@ static int atl1e_clean(struct napi_struc
317 /* If no Tx and not enough Rx work done, exit the polling mode */
318 if (work_done < budget) {
319 quit_polling:
320 - napi_complete(napi);
321 + napi_complete_done(napi, work_done);
322 imr_data = AT_READ_REG(&adapter->hw, REG_IMR);
323 AT_WRITE_REG(&adapter->hw, REG_IMR, imr_data | ISR_RX_EVENT);
324 /* test debug */
325 --- a/drivers/net/ethernet/atheros/atlx/atl1.c
326 +++ b/drivers/net/ethernet/atheros/atlx/atl1.c
327 @@ -2457,7 +2457,7 @@ static int atl1_rings_clean(struct napi_
328 if (work_done >= budget)
329 return work_done;
330
331 - napi_complete(napi);
332 + napi_complete_done(napi, work_done);
333 /* re-enable Interrupt */
334 if (likely(adapter->int_enabled))
335 atlx_imr_set(adapter, IMR_NORMAL_MASK);
336 --- a/drivers/net/ethernet/broadcom/b44.c
337 +++ b/drivers/net/ethernet/broadcom/b44.c
338 @@ -902,7 +902,7 @@ static int b44_poll(struct napi_struct *
339 }
340
341 if (work_done < budget) {
342 - napi_complete(napi);
343 + napi_complete_done(napi, work_done);
344 b44_enable_ints(bp);
345 }
346
347 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
348 +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
349 @@ -511,7 +511,7 @@ static int bcm_enet_poll(struct napi_str
350
351 /* no more packet in rx/tx queue, remove device from poll
352 * queue */
353 - napi_complete(napi);
354 + napi_complete_done(napi, rx_work_done);
355
356 /* restore rx/tx interrupt */
357 enet_dmac_writel(priv, priv->dma_chan_int_mask,
358 --- a/drivers/net/ethernet/broadcom/bgmac.c
359 +++ b/drivers/net/ethernet/broadcom/bgmac.c
360 @@ -1145,7 +1145,7 @@ static int bgmac_poll(struct napi_struct
361 return weight;
362
363 if (handled < weight) {
364 - napi_complete(napi);
365 + napi_complete_done(napi, handled);
366 bgmac_chip_intrs_on(bgmac);
367 }
368
369 --- a/drivers/net/ethernet/broadcom/bnx2.c
370 +++ b/drivers/net/ethernet/broadcom/bnx2.c
371 @@ -3522,7 +3522,7 @@ static int bnx2_poll_msix(struct napi_st
372 rmb();
373 if (likely(!bnx2_has_fast_work(bnapi))) {
374
375 - napi_complete(napi);
376 + napi_complete_done(napi, work_done);
377 BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |
378 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
379 bnapi->last_status_idx);
380 @@ -3559,7 +3559,7 @@ static int bnx2_poll(struct napi_struct
381
382 rmb();
383 if (likely(!bnx2_has_work(bnapi))) {
384 - napi_complete(napi);
385 + napi_complete_done(napi, work_done);
386 if (likely(bp->flags & BNX2_FLAG_USING_MSI_OR_MSIX)) {
387 BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
388 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
389 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
390 +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
391 @@ -3229,7 +3229,7 @@ static int bnx2x_poll(struct napi_struct
392 * has been updated when NAPI was scheduled.
393 */
394 if (IS_FCOE_FP(fp)) {
395 - napi_complete(napi);
396 + napi_complete_done(napi, rx_work_done);
397 } else {
398 bnx2x_update_fpsb_idx(fp);
399 /* bnx2x_has_rx_work() reads the status block,
400 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
401 +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
402 @@ -1774,7 +1774,7 @@ static int bnxt_poll_nitroa0(struct napi
403 }
404
405 if (!bnxt_has_work(bp, cpr) && rx_pkts < budget) {
406 - napi_complete(napi);
407 + napi_complete_done(napi, rx_pkts);
408 BNXT_CP_DB_REARM(cpr->cp_doorbell, cpr->cp_raw_cons);
409 }
410 return rx_pkts;
411 --- a/drivers/net/ethernet/broadcom/sb1250-mac.c
412 +++ b/drivers/net/ethernet/broadcom/sb1250-mac.c
413 @@ -2545,7 +2545,7 @@ static int sbmac_poll(struct napi_struct
414 sbdma_tx_process(sc, &(sc->sbm_txdma), 1);
415
416 if (work_done < budget) {
417 - napi_complete(napi);
418 + napi_complete_done(napi, work_done);
419
420 #ifdef CONFIG_SBMAC_COALESCE
421 __raw_writeq(((M_MAC_INT_EOP_COUNT | M_MAC_INT_EOP_TIMER) << S_MAC_TX_CH0) |
422 --- a/drivers/net/ethernet/brocade/bna/bnad.c
423 +++ b/drivers/net/ethernet/brocade/bna/bnad.c
424 @@ -1881,7 +1881,7 @@ bnad_napi_poll_rx(struct napi_struct *na
425 return rcvd;
426
427 poll_exit:
428 - napi_complete(napi);
429 + napi_complete_done(napi, rcvd);
430
431 rx_ctrl->rx_complete++;
432
433 --- a/drivers/net/ethernet/cadence/macb.c
434 +++ b/drivers/net/ethernet/cadence/macb.c
435 @@ -1069,7 +1069,7 @@ static int macb_poll(struct napi_struct
436
437 work_done = bp->macbgem_ops.mog_rx(bp, budget);
438 if (work_done < budget) {
439 - napi_complete(napi);
440 + napi_complete_done(napi, work_done);
441
442 /* Packets received while interrupts were disabled */
443 status = macb_readl(bp, RSR);
444 --- a/drivers/net/ethernet/calxeda/xgmac.c
445 +++ b/drivers/net/ethernet/calxeda/xgmac.c
446 @@ -1247,7 +1247,7 @@ static int xgmac_poll(struct napi_struct
447 work_done = xgmac_rx(priv, budget);
448
449 if (work_done < budget) {
450 - napi_complete(napi);
451 + napi_complete_done(napi, work_done);
452 __raw_writel(DMA_INTR_DEFAULT_MASK, priv->base + XGMAC_DMA_INTR_ENA);
453 }
454 return work_done;
455 --- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
456 +++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
457 @@ -2433,7 +2433,7 @@ static int liquidio_napi_poll(struct nap
458 }
459
460 if ((work_done < budget) && (tx_done)) {
461 - napi_complete(napi);
462 + napi_complete_done(napi, work_done);
463 octeon_process_droq_poll_cmd(droq->oct_dev, droq->q_no,
464 POLL_EVENT_ENABLE_INTR, 0);
465 return 0;
466 --- a/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
467 +++ b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
468 @@ -501,7 +501,7 @@ static int octeon_mgmt_napi_poll(struct
469
470 if (work_done < budget) {
471 /* We stopped because no more packets were available. */
472 - napi_complete(napi);
473 + napi_complete_done(napi, work_done);
474 octeon_mgmt_enable_rx_irq(p);
475 }
476 octeon_mgmt_update_rx_stats(netdev);
477 --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
478 +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
479 @@ -737,7 +737,7 @@ static int nicvf_poll(struct napi_struct
480
481 if (work_done < budget) {
482 /* Slow packet rate, exit polling */
483 - napi_complete(napi);
484 + napi_complete_done(napi, work_done);
485 /* Re-enable interrupts */
486 cq_head = nicvf_queue_reg_read(nic, NIC_QSET_CQ_0_7_HEAD,
487 cq->cq_idx);
488 --- a/drivers/net/ethernet/chelsio/cxgb/sge.c
489 +++ b/drivers/net/ethernet/chelsio/cxgb/sge.c
490 @@ -1605,7 +1605,7 @@ int t1_poll(struct napi_struct *napi, in
491 int work_done = process_responses(adapter, budget);
492
493 if (likely(work_done < budget)) {
494 - napi_complete(napi);
495 + napi_complete_done(napi, work_done);
496 writel(adapter->sge->respQ.cidx,
497 adapter->regs + A_SG_SLEEPING);
498 }
499 --- a/drivers/net/ethernet/chelsio/cxgb3/sge.c
500 +++ b/drivers/net/ethernet/chelsio/cxgb3/sge.c
501 @@ -1843,7 +1843,7 @@ static int ofld_poll(struct napi_struct
502 __skb_queue_head_init(&queue);
503 skb_queue_splice_init(&q->rx_queue, &queue);
504 if (skb_queue_empty(&queue)) {
505 - napi_complete(napi);
506 + napi_complete_done(napi, work_done);
507 spin_unlock_irq(&q->lock);
508 return work_done;
509 }
510 @@ -2414,7 +2414,7 @@ static int napi_rx_handler(struct napi_s
511 int work_done = process_responses(adap, qs, budget);
512
513 if (likely(work_done < budget)) {
514 - napi_complete(napi);
515 + napi_complete_done(napi, work_done);
516
517 /*
518 * Because we don't atomically flush the following
519 --- a/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
520 +++ b/drivers/net/ethernet/chelsio/cxgb4vf/sge.c
521 @@ -1889,7 +1889,7 @@ static int napi_rx_handler(struct napi_s
522 u32 val;
523
524 if (likely(work_done < budget)) {
525 - napi_complete(napi);
526 + napi_complete_done(napi, work_done);
527 intr_params = rspq->next_intr_params;
528 rspq->next_intr_params = rspq->intr_params;
529 } else
530 --- a/drivers/net/ethernet/cisco/enic/enic_main.c
531 +++ b/drivers/net/ethernet/cisco/enic/enic_main.c
532 @@ -1339,7 +1339,7 @@ static int enic_poll(struct napi_struct
533 * exit polling
534 */
535
536 - napi_complete(napi);
537 + napi_complete_done(napi, rq_work_done);
538 if (enic->rx_coalesce_setting.use_adaptive_rx_coalesce)
539 enic_set_int_moderation(enic, &enic->rq[0]);
540 vnic_intr_unmask(&enic->intr[intr]);
541 @@ -1496,7 +1496,7 @@ static int enic_poll_msix_rq(struct napi
542 * exit polling
543 */
544
545 - napi_complete(napi);
546 + napi_complete_done(napi, work_done);
547 if (enic->rx_coalesce_setting.use_adaptive_rx_coalesce)
548 enic_set_int_moderation(enic, &enic->rq[rq]);
549 vnic_intr_unmask(&enic->intr[intr]);
550 --- a/drivers/net/ethernet/dec/tulip/interrupt.c
551 +++ b/drivers/net/ethernet/dec/tulip/interrupt.c
552 @@ -319,8 +319,8 @@ int tulip_poll(struct napi_struct *napi,
553
554 /* Remove us from polling list and enable RX intr. */
555
556 - napi_complete(napi);
557 - iowrite32(tulip_tbl[tp->chip_id].valid_intrs, tp->base_addr+CSR7);
558 + napi_complete_done(napi, work_done);
559 + iowrite32(tulip_tbl[tp->chip_id].valid_intrs, tp->base_addr+CSR7);
560
561 /* The last op happens after poll completion. Which means the following:
562 * 1. it can race with disabling irqs in irq handler
563 @@ -355,7 +355,7 @@ int tulip_poll(struct napi_struct *napi,
564 * before we did napi_complete(). See? We would lose it. */
565
566 /* remove ourselves from the polling list */
567 - napi_complete(napi);
568 + napi_complete_done(napi, work_done);
569
570 return work_done;
571 }
572 --- a/drivers/net/ethernet/dnet.c
573 +++ b/drivers/net/ethernet/dnet.c
574 @@ -415,7 +415,7 @@ static int dnet_poll(struct napi_struct
575 /* We processed all packets available. Tell NAPI it can
576 * stop polling then re-enable rx interrupts.
577 */
578 - napi_complete(napi);
579 + napi_complete_done(napi, npackets);
580 int_enable = dnet_readl(bp, INTR_ENB);
581 int_enable |= DNET_INTR_SRC_RX_CMDFIFOAF;
582 dnet_writel(bp, int_enable, INTR_ENB);
583 --- a/drivers/net/ethernet/emulex/benet/be_main.c
584 +++ b/drivers/net/ethernet/emulex/benet/be_main.c
585 @@ -3344,7 +3344,7 @@ int be_poll(struct napi_struct *napi, in
586 be_process_mcc(adapter);
587
588 if (max_work < budget) {
589 - napi_complete(napi);
590 + napi_complete_done(napi, max_work);
591
592 /* Skyhawk EQ_DB has a provision to set the rearm to interrupt
593 * delay via a delay multiplier encoding value
594 --- a/drivers/net/ethernet/ethoc.c
595 +++ b/drivers/net/ethernet/ethoc.c
596 @@ -614,7 +614,7 @@ static int ethoc_poll(struct napi_struct
597 tx_work_done = ethoc_tx(priv->netdev, budget);
598
599 if (rx_work_done < budget && tx_work_done < budget) {
600 - napi_complete(napi);
601 + napi_complete_done(napi, rx_work_done);
602 ethoc_enable_irq(priv, INT_MASK_TX | INT_MASK_RX);
603 }
604
605 --- a/drivers/net/ethernet/ezchip/nps_enet.c
606 +++ b/drivers/net/ethernet/ezchip/nps_enet.c
607 @@ -192,7 +192,7 @@ static int nps_enet_poll(struct napi_str
608 if (work_done < budget) {
609 u32 buf_int_enable_value = 0;
610
611 - napi_complete(napi);
612 + napi_complete_done(napi, work_done);
613
614 /* set tx_done and rx_rdy bits */
615 buf_int_enable_value |= NPS_ENET_ENABLE << RX_RDY_SHIFT;
616 --- a/drivers/net/ethernet/freescale/fec_main.c
617 +++ b/drivers/net/ethernet/freescale/fec_main.c
618 @@ -1623,7 +1623,7 @@ static int fec_enet_rx_napi(struct napi_
619 fec_enet_tx(ndev);
620
621 if (pkts < budget) {
622 - napi_complete(napi);
623 + napi_complete_done(napi, pkts);
624 writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
625 }
626 return pkts;
627 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
628 +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
629 @@ -301,7 +301,7 @@ static int fs_enet_napi(struct napi_stru
630
631 if (received < budget && tx_left) {
632 /* done */
633 - napi_complete(napi);
634 + napi_complete_done(napi, received);
635 (*fep->ops->napi_enable)(dev);
636
637 return received;
638 --- a/drivers/net/ethernet/freescale/gianfar.c
639 +++ b/drivers/net/ethernet/freescale/gianfar.c
640 @@ -3193,7 +3193,7 @@ static int gfar_poll_rx_sq(struct napi_s
641
642 if (work_done < budget) {
643 u32 imask;
644 - napi_complete(napi);
645 + napi_complete_done(napi, work_done);
646 /* Clear the halt bit in RSTAT */
647 gfar_write(&regs->rstat, gfargrp->rstat);
648
649 @@ -3282,7 +3282,7 @@ static int gfar_poll_rx(struct napi_stru
650
651 if (!num_act_queues) {
652 u32 imask;
653 - napi_complete(napi);
654 + napi_complete_done(napi, work_done);
655
656 /* Clear the halt bit in RSTAT */
657 gfar_write(&regs->rstat, gfargrp->rstat);
658 --- a/drivers/net/ethernet/freescale/ucc_geth.c
659 +++ b/drivers/net/ethernet/freescale/ucc_geth.c
660 @@ -3303,7 +3303,7 @@ static int ucc_geth_poll(struct napi_str
661 howmany += ucc_geth_rx(ugeth, i, budget - howmany);
662
663 if (howmany < budget) {
664 - napi_complete(napi);
665 + napi_complete_done(napi, howmany);
666 setbits32(ugeth->uccf->p_uccm, UCCE_RX_EVENTS | UCCE_TX_EVENTS);
667 }
668
669 --- a/drivers/net/ethernet/hisilicon/hip04_eth.c
670 +++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
671 @@ -555,7 +555,7 @@ refill:
672 priv->reg_inten |= RCV_INT;
673 writel_relaxed(priv->reg_inten, priv->base + PPE_INTEN);
674 }
675 - napi_complete(napi);
676 + napi_complete_done(napi, rx);
677 done:
678 /* clean up tx descriptors and start a new timer if necessary */
679 tx_remaining = hip04_tx_reclaim(ndev, false);
680 --- a/drivers/net/ethernet/hisilicon/hisi_femac.c
681 +++ b/drivers/net/ethernet/hisilicon/hisi_femac.c
682 @@ -330,7 +330,7 @@ static int hisi_femac_poll(struct napi_s
683 } while (ints & DEF_INT_MASK);
684
685 if (work_done < budget) {
686 - napi_complete(napi);
687 + napi_complete_done(napi, work_done);
688 hisi_femac_irq_enable(priv, DEF_INT_MASK &
689 (~IRQ_INT_TX_PER_PACKET));
690 }
691 --- a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
692 +++ b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
693 @@ -578,7 +578,7 @@ static int hix5hd2_poll(struct napi_stru
694 } while (ints & DEF_INT_MASK);
695
696 if (work_done < budget) {
697 - napi_complete(napi);
698 + napi_complete_done(napi, work_done);
699 hix5hd2_irq_enable(priv);
700 }
701
702 --- a/drivers/net/ethernet/ibm/ibmveth.c
703 +++ b/drivers/net/ethernet/ibm/ibmveth.c
704 @@ -1320,7 +1320,7 @@ restart_poll:
705 ibmveth_replenish_task(adapter);
706
707 if (frames_processed < budget) {
708 - napi_complete(napi);
709 + napi_complete_done(napi, frames_processed);
710
711 /* We think we are done - reenable interrupts,
712 * then check once more to make sure we are done.
713 --- a/drivers/net/ethernet/ibm/ibmvnic.c
714 +++ b/drivers/net/ethernet/ibm/ibmvnic.c
715 @@ -1009,7 +1009,7 @@ restart_poll:
716
717 if (frames_processed < budget) {
718 enable_scrq_irq(adapter, adapter->rx_scrq[scrq_num]);
719 - napi_complete(napi);
720 + napi_complete_done(napi, frames_processed);
721 if (pending_scrq(adapter, adapter->rx_scrq[scrq_num]) &&
722 napi_reschedule(napi)) {
723 disable_scrq_irq(adapter, adapter->rx_scrq[scrq_num]);
724 --- a/drivers/net/ethernet/intel/e100.c
725 +++ b/drivers/net/ethernet/intel/e100.c
726 @@ -2253,7 +2253,7 @@ static int e100_poll(struct napi_struct
727
728 /* If budget not fully consumed, exit the polling mode */
729 if (work_done < budget) {
730 - napi_complete(napi);
731 + napi_complete_done(napi, work_done);
732 e100_enable_irq(nic);
733 }
734
735 --- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
736 +++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
737 @@ -1825,7 +1825,7 @@ ixgb_clean(struct napi_struct *napi, int
738
739 /* If budget not fully consumed, exit the polling mode */
740 if (work_done < budget) {
741 - napi_complete(napi);
742 + napi_complete_done(napi, work_done);
743 if (!test_bit(__IXGB_DOWN, &adapter->flags))
744 ixgb_irq_enable(adapter);
745 }
746 --- a/drivers/net/ethernet/korina.c
747 +++ b/drivers/net/ethernet/korina.c
748 @@ -464,7 +464,7 @@ static int korina_poll(struct napi_struc
749
750 work_done = korina_rx(dev, budget);
751 if (work_done < budget) {
752 - napi_complete(napi);
753 + napi_complete_done(napi, work_done);
754
755 writel(readl(&lp->rx_dma_regs->dmasm) &
756 ~(DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR),
757 --- a/drivers/net/ethernet/lantiq_etop.c
758 +++ b/drivers/net/ethernet/lantiq_etop.c
759 @@ -156,24 +156,21 @@ ltq_etop_poll_rx(struct napi_struct *nap
760 {
761 struct ltq_etop_chan *ch = container_of(napi,
762 struct ltq_etop_chan, napi);
763 - int rx = 0;
764 - int complete = 0;
765 + int work_done = 0;
766
767 - while ((rx < budget) && !complete) {
768 + while (work_done < budget) {
769 struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc];
770
771 - if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) == LTQ_DMA_C) {
772 - ltq_etop_hw_receive(ch);
773 - rx++;
774 - } else {
775 - complete = 1;
776 - }
777 + if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) != LTQ_DMA_C)
778 + break;
779 + ltq_etop_hw_receive(ch);
780 + work_done++;
781 }
782 - if (complete || !rx) {
783 - napi_complete(&ch->napi);
784 + if (work_done < budget) {
785 + napi_complete_done(&ch->napi, work_done);
786 ltq_dma_ack_irq(&ch->dma);
787 }
788 - return rx;
789 + return work_done;
790 }
791
792 static int
793 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
794 +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
795 @@ -2312,7 +2312,7 @@ static int mv643xx_eth_poll(struct napi_
796 if (work_done < budget) {
797 if (mp->oom)
798 mod_timer(&mp->rx_oom, jiffies + (HZ / 10));
799 - napi_complete(napi);
800 + napi_complete_done(napi, work_done);
801 wrlp(mp, INT_MASK, mp->int_mask);
802 }
803
804 --- a/drivers/net/ethernet/marvell/mvneta.c
805 +++ b/drivers/net/ethernet/marvell/mvneta.c
806 @@ -2701,11 +2701,9 @@ static int mvneta_poll(struct napi_struc
807 rx_done = mvneta_rx_swbm(pp, budget, &pp->rxqs[rx_queue]);
808 }
809
810 - budget -= rx_done;
811 -
812 - if (budget > 0) {
813 + if (rx_done < budget) {
814 cause_rx_tx = 0;
815 - napi_complete(&port->napi);
816 + napi_complete_done(&port->napi, rx_done);
817 enable_percpu_irq(pp->dev->irq, 0);
818 }
819
820 --- a/drivers/net/ethernet/marvell/mvpp2.c
821 +++ b/drivers/net/ethernet/marvell/mvpp2.c
822 @@ -5404,7 +5404,7 @@ static int mvpp2_poll(struct napi_struct
823
824 if (budget > 0) {
825 cause_rx = 0;
826 - napi_complete(napi);
827 + napi_complete_done(napi, rx_done);
828
829 mvpp2_interrupts_enable(port);
830 }
831 --- a/drivers/net/ethernet/marvell/pxa168_eth.c
832 +++ b/drivers/net/ethernet/marvell/pxa168_eth.c
833 @@ -1264,7 +1264,7 @@ static int pxa168_rx_poll(struct napi_st
834 }
835 work_done = rxq_process(dev, budget);
836 if (work_done < budget) {
837 - napi_complete(napi);
838 + napi_complete_done(napi, work_done);
839 wrl(pep, INT_MASK, ALL_INTS);
840 }
841
842 --- a/drivers/net/ethernet/moxa/moxart_ether.c
843 +++ b/drivers/net/ethernet/moxa/moxart_ether.c
844 @@ -270,7 +270,7 @@ rx_next:
845 }
846
847 if (rx < budget) {
848 - napi_complete(napi);
849 + napi_complete_done(napi, rx);
850 }
851
852 priv->reg_imr |= RPKT_FINISH_M;
853 --- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
854 +++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
855 @@ -1678,7 +1678,7 @@ static int myri10ge_poll(struct napi_str
856
857 myri10ge_ss_unlock_napi(ss);
858 if (work_done < budget) {
859 - napi_complete(napi);
860 + napi_complete_done(napi, work_done);
861 put_be32(htonl(3), ss->irq_claim);
862 }
863 return work_done;
864 --- a/drivers/net/ethernet/natsemi/natsemi.c
865 +++ b/drivers/net/ethernet/natsemi/natsemi.c
866 @@ -2261,7 +2261,7 @@ static int natsemi_poll(struct napi_stru
867 np->intr_status = readl(ioaddr + IntrStatus);
868 } while (np->intr_status);
869
870 - napi_complete(napi);
871 + napi_complete_done(napi, work_done);
872
873 /* Reenable interrupts providing nothing is trying to shut
874 * the chip down. */
875 --- a/drivers/net/ethernet/neterion/s2io.c
876 +++ b/drivers/net/ethernet/neterion/s2io.c
877 @@ -2783,7 +2783,7 @@ static int s2io_poll_msix(struct napi_st
878 s2io_chk_rx_buffers(nic, ring);
879
880 if (pkts_processed < budget_org) {
881 - napi_complete(napi);
882 + napi_complete_done(napi, pkts_processed);
883 /*Re Enable MSI-Rx Vector*/
884 addr = (u8 __iomem *)&bar0->xmsi_mask_reg;
885 addr += 7 - ring->ring_no;
886 @@ -2817,7 +2817,7 @@ static int s2io_poll_inta(struct napi_st
887 break;
888 }
889 if (pkts_processed < budget_org) {
890 - napi_complete(napi);
891 + napi_complete_done(napi, pkts_processed);
892 /* Re enable the Rx interrupts for the ring */
893 writeq(0, &bar0->rx_traffic_mask);
894 readl(&bar0->rx_traffic_mask);
895 --- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
896 +++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
897 @@ -1823,8 +1823,8 @@ static int vxge_poll_msix(struct napi_st
898 vxge_hw_vpath_poll_rx(ring->handle);
899 pkts_processed = ring->pkts_processed;
900
901 - if (ring->pkts_processed < budget_org) {
902 - napi_complete(napi);
903 + if (pkts_processed < budget_org) {
904 + napi_complete_done(napi, pkts_processed);
905
906 /* Re enable the Rx interrupts for the vpath */
907 vxge_hw_channel_msix_unmask(
908 @@ -1863,7 +1863,7 @@ static int vxge_poll_inta(struct napi_st
909 VXGE_COMPLETE_ALL_TX(vdev);
910
911 if (pkts_processed < budget_org) {
912 - napi_complete(napi);
913 + napi_complete_done(napi, pkts_processed);
914 /* Re enable the Rx interrupts for the ring */
915 vxge_hw_device_unmask_all(hldev);
916 vxge_hw_device_flush_io(hldev);
917 --- a/drivers/net/ethernet/nvidia/forcedeth.c
918 +++ b/drivers/net/ethernet/nvidia/forcedeth.c
919 @@ -3756,7 +3756,7 @@ static int nv_napi_poll(struct napi_stru
920 if (rx_work < budget) {
921 /* re-enable interrupts
922 (msix not enabled in napi) */
923 - napi_complete(napi);
924 + napi_complete_done(napi, rx_work);
925
926 writel(np->irqmask, base + NvRegIrqMask);
927 }
928 --- a/drivers/net/ethernet/nxp/lpc_eth.c
929 +++ b/drivers/net/ethernet/nxp/lpc_eth.c
930 @@ -999,7 +999,7 @@ static int lpc_eth_poll(struct napi_stru
931 rx_done = __lpc_handle_recv(ndev, budget);
932
933 if (rx_done < budget) {
934 - napi_complete(napi);
935 + napi_complete_done(napi, rx_done);
936 lpc_eth_enable_int(pldat->net_base);
937 }
938
939 --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
940 +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
941 @@ -2391,7 +2391,7 @@ static int pch_gbe_napi_poll(struct napi
942 poll_end_flag = true;
943
944 if (poll_end_flag) {
945 - napi_complete(napi);
946 + napi_complete_done(napi, work_done);
947 pch_gbe_irq_enable(adapter);
948 }
949
950 --- a/drivers/net/ethernet/pasemi/pasemi_mac.c
951 +++ b/drivers/net/ethernet/pasemi/pasemi_mac.c
952 @@ -1575,7 +1575,7 @@ static int pasemi_mac_poll(struct napi_s
953 pkts = pasemi_mac_clean_rx(rx_ring(mac), budget);
954 if (pkts < budget) {
955 /* all done, no more packets present */
956 - napi_complete(napi);
957 + napi_complete_done(napi, pkts);
958
959 pasemi_mac_restart_rx_intr(mac);
960 pasemi_mac_restart_tx_intr(mac);
961 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
962 +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
963 @@ -2391,7 +2391,7 @@ static int netxen_nic_poll(struct napi_s
964 work_done = budget;
965
966 if (work_done < budget) {
967 - napi_complete(&sds_ring->napi);
968 + napi_complete_done(&sds_ring->napi, work_done);
969 if (test_bit(__NX_DEV_UP, &adapter->state))
970 netxen_nic_enable_int(sds_ring);
971 }
972 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
973 +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
974 @@ -975,7 +975,7 @@ static int qlcnic_poll(struct napi_struc
975 work_done = budget;
976
977 if (work_done < budget) {
978 - napi_complete(&sds_ring->napi);
979 + napi_complete_done(&sds_ring->napi, work_done);
980 if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) {
981 qlcnic_enable_sds_intr(adapter, sds_ring);
982 qlcnic_enable_tx_intr(adapter, tx_ring);
983 @@ -1019,7 +1019,7 @@ static int qlcnic_rx_poll(struct napi_st
984 work_done = qlcnic_process_rcv_ring(sds_ring, budget);
985
986 if (work_done < budget) {
987 - napi_complete(&sds_ring->napi);
988 + napi_complete_done(&sds_ring->napi, work_done);
989 if (test_bit(__QLCNIC_DEV_UP, &adapter->state))
990 qlcnic_enable_sds_intr(adapter, sds_ring);
991 }
992 @@ -1966,7 +1966,7 @@ static int qlcnic_83xx_msix_sriov_vf_pol
993 work_done = budget;
994
995 if (work_done < budget) {
996 - napi_complete(&sds_ring->napi);
997 + napi_complete_done(&sds_ring->napi, work_done);
998 qlcnic_enable_sds_intr(adapter, sds_ring);
999 }
1000
1001 @@ -1994,7 +1994,7 @@ static int qlcnic_83xx_poll(struct napi_
1002 work_done = budget;
1003
1004 if (work_done < budget) {
1005 - napi_complete(&sds_ring->napi);
1006 + napi_complete_done(&sds_ring->napi, work_done);
1007 qlcnic_enable_sds_intr(adapter, sds_ring);
1008 }
1009
1010 @@ -2032,7 +2032,7 @@ static int qlcnic_83xx_rx_poll(struct na
1011 adapter = sds_ring->adapter;
1012 work_done = qlcnic_83xx_process_rcv_ring(sds_ring, budget);
1013 if (work_done < budget) {
1014 - napi_complete(&sds_ring->napi);
1015 + napi_complete_done(&sds_ring->napi, work_done);
1016 if (test_bit(__QLCNIC_DEV_UP, &adapter->state))
1017 qlcnic_enable_sds_intr(adapter, sds_ring);
1018 }
1019 --- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
1020 +++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
1021 @@ -2334,7 +2334,7 @@ static int ql_napi_poll_msix(struct napi
1022 }
1023
1024 if (work_done < budget) {
1025 - napi_complete(napi);
1026 + napi_complete_done(napi, work_done);
1027 ql_enable_completion_interrupt(qdev, rx_ring->irq);
1028 }
1029 return work_done;
1030 --- a/drivers/net/ethernet/qualcomm/emac/emac.c
1031 +++ b/drivers/net/ethernet/qualcomm/emac/emac.c
1032 @@ -129,7 +129,7 @@ static int emac_napi_rtx(struct napi_str
1033 emac_mac_rx_process(adpt, rx_q, &work_done, budget);
1034
1035 if (work_done < budget) {
1036 - napi_complete(napi);
1037 + napi_complete_done(napi, work_done);
1038
1039 irq->mask |= rx_q->intr;
1040 writel(irq->mask, adpt->base + EMAC_INT_MASK);
1041 --- a/drivers/net/ethernet/realtek/r8169.c
1042 +++ b/drivers/net/ethernet/realtek/r8169.c
1043 @@ -7574,7 +7574,7 @@ static int rtl8169_poll(struct napi_stru
1044 }
1045
1046 if (work_done < budget) {
1047 - napi_complete(napi);
1048 + napi_complete_done(napi, work_done);
1049
1050 rtl_irq_enable(tp, enable_mask);
1051 mmiowb();
1052 --- a/drivers/net/ethernet/rocker/rocker_main.c
1053 +++ b/drivers/net/ethernet/rocker/rocker_main.c
1054 @@ -2480,7 +2480,7 @@ static int rocker_port_poll_rx(struct na
1055 }
1056
1057 if (credits < budget)
1058 - napi_complete(napi);
1059 + napi_complete_done(napi, credits);
1060
1061 rocker_dma_ring_credits_set(rocker, &rocker_port->rx_ring, credits);
1062
1063 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
1064 +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
1065 @@ -1578,7 +1578,7 @@ static int sxgbe_poll(struct napi_struct
1066
1067 work_done = sxgbe_rx(priv, budget);
1068 if (work_done < budget) {
1069 - napi_complete(napi);
1070 + napi_complete_done(napi, work_done);
1071 priv->hw->dma->enable_dma_irq(priv->ioaddr, qnum);
1072 }
1073
1074 --- a/drivers/net/ethernet/sfc/efx.c
1075 +++ b/drivers/net/ethernet/sfc/efx.c
1076 @@ -332,7 +332,7 @@ static int efx_poll(struct napi_struct *
1077 * since efx_nic_eventq_read_ack() will have no effect if
1078 * interrupts have already been disabled.
1079 */
1080 - napi_complete(napi);
1081 + napi_complete_done(napi, spent);
1082 efx_nic_eventq_read_ack(channel);
1083 }
1084
1085 --- a/drivers/net/ethernet/smsc/smsc9420.c
1086 +++ b/drivers/net/ethernet/smsc/smsc9420.c
1087 @@ -869,7 +869,7 @@ static int smsc9420_rx_poll(struct napi_
1088 smsc9420_pci_flush_write(pd);
1089
1090 if (work_done < budget) {
1091 - napi_complete(&pd->napi);
1092 + napi_complete_done(&pd->napi, work_done);
1093
1094 /* re-enable RX DMA interrupts */
1095 dma_intr_ena = smsc9420_reg_read(pd, DMAC_INTR_ENA);
1096 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
1097 +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
1098 @@ -2684,7 +2684,7 @@ static int stmmac_poll(struct napi_struc
1099
1100 work_done = stmmac_rx(priv, budget);
1101 if (work_done < budget) {
1102 - napi_complete(napi);
1103 + napi_complete_done(napi, work_done);
1104 stmmac_enable_dma_irq(priv);
1105 }
1106 return work_done;
1107 --- a/drivers/net/ethernet/sun/niu.c
1108 +++ b/drivers/net/ethernet/sun/niu.c
1109 @@ -3786,7 +3786,7 @@ static int niu_poll(struct napi_struct *
1110 work_done = niu_poll_core(np, lp, budget);
1111
1112 if (work_done < budget) {
1113 - napi_complete(napi);
1114 + napi_complete_done(napi, work_done);
1115 niu_ldg_rearm(np, lp, 1);
1116 }
1117 return work_done;
1118 --- a/drivers/net/ethernet/sun/sungem.c
1119 +++ b/drivers/net/ethernet/sun/sungem.c
1120 @@ -922,7 +922,7 @@ static int gem_poll(struct napi_struct *
1121 gp->status = readl(gp->regs + GREG_STAT);
1122 } while (gp->status & GREG_STAT_NAPI);
1123
1124 - napi_complete(napi);
1125 + napi_complete_done(napi, work_done);
1126 gem_enable_ints(gp);
1127
1128 return work_done;
1129 --- a/drivers/net/ethernet/sun/sunvnet_common.c
1130 +++ b/drivers/net/ethernet/sun/sunvnet_common.c
1131 @@ -850,7 +850,7 @@ int sunvnet_poll_common(struct napi_stru
1132 int processed = vnet_event_napi(port, budget);
1133
1134 if (processed < budget) {
1135 - napi_complete(napi);
1136 + napi_complete_done(napi, processed);
1137 port->rx_event &= ~LDC_EVENT_DATA_READY;
1138 vio_set_intr(vio->vdev->rx_ino, HV_INTR_ENABLED);
1139 }
1140 --- a/drivers/net/ethernet/tehuti/tehuti.c
1141 +++ b/drivers/net/ethernet/tehuti/tehuti.c
1142 @@ -303,7 +303,7 @@ static int bdx_poll(struct napi_struct *
1143 * device lock and allow waiting tasks (eg rmmod) to advance) */
1144 priv->napi_stop = 0;
1145
1146 - napi_complete(napi);
1147 + napi_complete_done(napi, work_done);
1148 bdx_enable_interrupts(priv);
1149 }
1150 return work_done;
1151 --- a/drivers/net/ethernet/ti/cpsw.c
1152 +++ b/drivers/net/ethernet/ti/cpsw.c
1153 @@ -839,7 +839,7 @@ static int cpsw_rx_poll(struct napi_stru
1154 }
1155
1156 if (num_rx < budget) {
1157 - napi_complete(napi_rx);
1158 + napi_complete_done(napi_rx, num_rx);
1159 writel(0xff, &cpsw->wr_regs->rx_en);
1160 if (cpsw->quirk_irq && cpsw->rx_irq_disabled) {
1161 cpsw->rx_irq_disabled = false;
1162 --- a/drivers/net/ethernet/ti/davinci_emac.c
1163 +++ b/drivers/net/ethernet/ti/davinci_emac.c
1164 @@ -1295,7 +1295,7 @@ static int emac_poll(struct napi_struct
1165 &emac_rxhost_errcodes[cause][0], ch);
1166 }
1167 } else if (num_rx_pkts < budget) {
1168 - napi_complete(napi);
1169 + napi_complete_done(napi, num_rx_pkts);
1170 emac_int_enable(priv);
1171 }
1172
1173 --- a/drivers/net/ethernet/ti/netcp_core.c
1174 +++ b/drivers/net/ethernet/ti/netcp_core.c
1175 @@ -939,7 +939,7 @@ static int netcp_rx_poll(struct napi_str
1176
1177 netcp_rxpool_refill(netcp);
1178 if (packets < budget) {
1179 - napi_complete(&netcp->rx_napi);
1180 + napi_complete_done(&netcp->rx_napi, packets);
1181 knav_queue_enable_notify(netcp->rx_queue);
1182 }
1183
1184 --- a/drivers/net/ethernet/tile/tilegx.c
1185 +++ b/drivers/net/ethernet/tile/tilegx.c
1186 @@ -678,7 +678,7 @@ static int tile_net_poll(struct napi_str
1187 }
1188
1189 /* There are no packets left. */
1190 - napi_complete(&info_mpipe->napi);
1191 + napi_complete_done(&info_mpipe->napi, work);
1192
1193 md = &mpipe_data[instance];
1194 /* Re-enable hypervisor interrupts. */
1195 --- a/drivers/net/ethernet/tile/tilepro.c
1196 +++ b/drivers/net/ethernet/tile/tilepro.c
1197 @@ -842,7 +842,7 @@ static int tile_net_poll(struct napi_str
1198 }
1199 }
1200
1201 - napi_complete(&info->napi);
1202 + napi_complete_done(&info->napi, work);
1203
1204 if (!priv->active)
1205 goto done;
1206 --- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
1207 +++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
1208 @@ -1109,7 +1109,7 @@ static int gelic_net_poll(struct napi_st
1209 }
1210
1211 if (packets_done < budget) {
1212 - napi_complete(napi);
1213 + napi_complete_done(napi, packets_done);
1214 gelic_card_rx_irq_on(card);
1215 }
1216 return packets_done;
1217 --- a/drivers/net/ethernet/toshiba/spider_net.c
1218 +++ b/drivers/net/ethernet/toshiba/spider_net.c
1219 @@ -1270,7 +1270,7 @@ static int spider_net_poll(struct napi_s
1220 /* if all packets are in the stack, enable interrupts and return 0 */
1221 /* if not, return 1 */
1222 if (packets_done < budget) {
1223 - napi_complete(napi);
1224 + napi_complete_done(napi, packets_done);
1225 spider_net_rx_irq_on(card);
1226 card->ignore_rx_ramfull = 0;
1227 }
1228 --- a/drivers/net/ethernet/toshiba/tc35815.c
1229 +++ b/drivers/net/ethernet/toshiba/tc35815.c
1230 @@ -1639,7 +1639,7 @@ static int tc35815_poll(struct napi_stru
1231 spin_unlock(&lp->rx_lock);
1232
1233 if (received < budget) {
1234 - napi_complete(napi);
1235 + napi_complete_done(napi, received);
1236 /* enable interrupts */
1237 tc_writel(tc_readl(&tr->DMA_Ctl) & ~DMA_IntMask, &tr->DMA_Ctl);
1238 }
1239 --- a/drivers/net/ethernet/tundra/tsi108_eth.c
1240 +++ b/drivers/net/ethernet/tundra/tsi108_eth.c
1241 @@ -887,7 +887,7 @@ static int tsi108_poll(struct napi_struc
1242
1243 if (num_received < budget) {
1244 data->rxpending = 0;
1245 - napi_complete(napi);
1246 + napi_complete_done(napi, num_received);
1247
1248 TSI_WRITE(TSI108_EC_INTMASK,
1249 TSI_READ(TSI108_EC_INTMASK)
1250 --- a/drivers/net/ethernet/via/via-rhine.c
1251 +++ b/drivers/net/ethernet/via/via-rhine.c
1252 @@ -861,7 +861,7 @@ static int rhine_napipoll(struct napi_st
1253 }
1254
1255 if (work_done < budget) {
1256 - napi_complete(napi);
1257 + napi_complete_done(napi, work_done);
1258 iowrite16(enable_mask, ioaddr + IntrEnable);
1259 mmiowb();
1260 }
1261 --- a/drivers/net/ethernet/via/via-velocity.c
1262 +++ b/drivers/net/ethernet/via/via-velocity.c
1263 @@ -2160,7 +2160,7 @@ static int velocity_poll(struct napi_str
1264 velocity_tx_srv(vptr);
1265 /* If budget not fully consumed, exit the polling mode */
1266 if (rx_done < budget) {
1267 - napi_complete(napi);
1268 + napi_complete_done(napi, rx_done);
1269 mac_enable_int(vptr->mac_regs);
1270 }
1271 spin_unlock_irqrestore(&vptr->lock, flags);
1272 --- a/drivers/net/ethernet/wiznet/w5100.c
1273 +++ b/drivers/net/ethernet/wiznet/w5100.c
1274 @@ -915,7 +915,7 @@ static int w5100_napi_poll(struct napi_s
1275 }
1276
1277 if (rx_count < budget) {
1278 - napi_complete(napi);
1279 + napi_complete_done(napi, rx_count);
1280 w5100_enable_intr(priv);
1281 }
1282
1283 --- a/drivers/net/ethernet/wiznet/w5300.c
1284 +++ b/drivers/net/ethernet/wiznet/w5300.c
1285 @@ -417,7 +417,7 @@ static int w5300_napi_poll(struct napi_s
1286 }
1287
1288 if (rx_count < budget) {
1289 - napi_complete(napi);
1290 + napi_complete_done(napi, rx_count);
1291 w5300_write(priv, W5300_IMR, IR_S0);
1292 mmiowb();
1293 }
1294 --- a/drivers/net/fjes/fjes_main.c
1295 +++ b/drivers/net/fjes/fjes_main.c
1296 @@ -1122,7 +1122,7 @@ static int fjes_poll(struct napi_struct
1297 }
1298
1299 if (work_done < budget) {
1300 - napi_complete(napi);
1301 + napi_complete_done(napi, work_done);
1302
1303 if (adapter->unset_rx_last) {
1304 adapter->rx_last_jiffies = jiffies;
1305 --- a/drivers/net/vmxnet3/vmxnet3_drv.c
1306 +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
1307 @@ -1851,7 +1851,7 @@ vmxnet3_poll(struct napi_struct *napi, i
1308 rxd_done = vmxnet3_do_poll(rx_queue->adapter, budget);
1309
1310 if (rxd_done < budget) {
1311 - napi_complete(napi);
1312 + napi_complete_done(napi, rxd_done);
1313 vmxnet3_enable_all_intrs(rx_queue->adapter);
1314 }
1315 return rxd_done;
1316 @@ -1882,7 +1882,7 @@ vmxnet3_poll_rx_only(struct napi_struct
1317 rxd_done = vmxnet3_rq_rx_complete(rq, adapter, budget);
1318
1319 if (rxd_done < budget) {
1320 - napi_complete(napi);
1321 + napi_complete_done(napi, rxd_done);
1322 vmxnet3_enable_intr(adapter, rq->comp_ring.intr_idx);
1323 }
1324 return rxd_done;
1325 --- a/drivers/net/wan/fsl_ucc_hdlc.c
1326 +++ b/drivers/net/wan/fsl_ucc_hdlc.c
1327 @@ -573,7 +573,7 @@ static int ucc_hdlc_poll(struct napi_str
1328 howmany += hdlc_rx_done(priv, budget - howmany);
1329
1330 if (howmany < budget) {
1331 - napi_complete(napi);
1332 + napi_complete_done(napi, howmany);
1333 qe_setbits32(priv->uccf->p_uccm,
1334 (UCCE_HDLC_RX_EVENTS | UCCE_HDLC_TX_EVENTS) << 16);
1335 }
1336 --- a/drivers/net/wan/hd64572.c
1337 +++ b/drivers/net/wan/hd64572.c
1338 @@ -341,7 +341,7 @@ static int sca_poll(struct napi_struct *
1339 received = sca_rx_done(port, budget);
1340
1341 if (received < budget) {
1342 - napi_complete(napi);
1343 + napi_complete_done(napi, received);
1344 enable_intr(port);
1345 }
1346
1347 --- a/drivers/net/wireless/ath/ath10k/pci.c
1348 +++ b/drivers/net/wireless/ath/ath10k/pci.c
1349 @@ -2804,7 +2804,7 @@ static int ath10k_pci_napi_poll(struct n
1350 done = ath10k_htt_txrx_compl_task(ar, budget);
1351
1352 if (done < budget) {
1353 - napi_complete(ctx);
1354 + napi_complete_done(ctx, done);
1355 /* In case of MSI, it is possible that interrupts are received
1356 * while NAPI poll is inprogress. So pending interrupts that are
1357 * received after processing all copy engine pipes by NAPI poll
1358 --- a/drivers/net/wireless/ath/wil6210/netdev.c
1359 +++ b/drivers/net/wireless/ath/wil6210/netdev.c
1360 @@ -84,7 +84,7 @@ static int wil6210_netdev_poll_rx(struct
1361 done = budget - quota;
1362
1363 if (done < budget) {
1364 - napi_complete(napi);
1365 + napi_complete_done(napi, done);
1366 wil6210_unmask_irq_rx(wil);
1367 wil_dbg_txrx(wil, "NAPI RX complete\n");
1368 }
1369 --- a/drivers/net/xen-netback/interface.c
1370 +++ b/drivers/net/xen-netback/interface.c
1371 @@ -104,7 +104,7 @@ static int xenvif_poll(struct napi_struc
1372 work_done = xenvif_tx_action(queue, budget);
1373
1374 if (work_done < budget) {
1375 - napi_complete(napi);
1376 + napi_complete_done(napi, work_done);
1377 /* If the queue is rate-limited, it shall be
1378 * rescheduled in the timer callback.
1379 */
1380 --- a/drivers/net/xen-netfront.c
1381 +++ b/drivers/net/xen-netfront.c
1382 @@ -1061,7 +1061,7 @@ err:
1383 if (work_done < budget) {
1384 int more_to_do = 0;
1385
1386 - napi_complete(napi);
1387 + napi_complete_done(napi, work_done);
1388
1389 RING_FINAL_CHECK_FOR_RESPONSES(&queue->rx, more_to_do);
1390 if (more_to_do)
1391 --- a/drivers/staging/octeon/ethernet-rx.c
1392 +++ b/drivers/staging/octeon/ethernet-rx.c
1393 @@ -429,7 +429,7 @@ static int cvm_oct_napi_poll(struct napi
1394
1395 if (rx_count < budget) {
1396 /* No more work */
1397 - napi_complete(napi);
1398 + napi_complete_done(napi, rx_count);
1399 enable_irq(rx_group->irq);
1400 }
1401 return rx_count;
1402 --- a/drivers/staging/unisys/visornic/visornic_main.c
1403 +++ b/drivers/staging/unisys/visornic/visornic_main.c
1404 @@ -1657,7 +1657,7 @@ static int visornic_poll(struct napi_str
1405
1406 /* If there aren't any more packets to receive stop the poll */
1407 if (rx_count < budget)
1408 - napi_complete(napi);
1409 + napi_complete_done(napi, rx_count);
1410
1411 return rx_count;
1412 }