090-net-generalize-napi_complete_done.patch 48 KB

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