Skip to content

Commit c582a7f

Browse files
haukedavem330
authored andcommitted
net: lantiq: Use napi_complete_done()
Use napi_complete_done() and activate the interrupts when this function returns true. This way the generic NAPI code can take care of activating the interrupts. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 74c7b80 commit c582a7f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/ethernet/lantiq_xrx200.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ static int xrx200_poll_rx(struct napi_struct *napi, int budget)
230230
}
231231

232232
if (rx < budget) {
233-
napi_complete(&ch->napi);
234-
ltq_dma_enable_irq(&ch->dma);
233+
if (napi_complete_done(&ch->napi, rx))
234+
ltq_dma_enable_irq(&ch->dma);
235235
}
236236

237237
return rx;
@@ -272,8 +272,8 @@ static int xrx200_tx_housekeeping(struct napi_struct *napi, int budget)
272272
netif_wake_queue(net_dev);
273273

274274
if (pkts < budget) {
275-
napi_complete(&ch->napi);
276-
ltq_dma_enable_irq(&ch->dma);
275+
if (napi_complete_done(&ch->napi, pkts))
276+
ltq_dma_enable_irq(&ch->dma);
277277
}
278278

279279
return pkts;

0 commit comments

Comments
 (0)