OSDN Git Service

net: lantiq: Use napi_complete_done()
authorHauke Mehrtens <hauke@hauke-m.de>
Sat, 12 Sep 2020 19:36:28 +0000 (21:36 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Sep 2020 21:53:15 +0000 (14:53 -0700)
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>
drivers/net/ethernet/lantiq_xrx200.c

index f34e4dc..abee7d6 100644 (file)
@@ -230,8 +230,8 @@ static int xrx200_poll_rx(struct napi_struct *napi, int budget)
        }
 
        if (rx < budget) {
-               napi_complete(&ch->napi);
-               ltq_dma_enable_irq(&ch->dma);
+               if (napi_complete_done(&ch->napi, rx))
+                       ltq_dma_enable_irq(&ch->dma);
        }
 
        return rx;
@@ -272,8 +272,8 @@ static int xrx200_tx_housekeeping(struct napi_struct *napi, int budget)
                netif_wake_queue(net_dev);
 
        if (pkts < budget) {
-               napi_complete(&ch->napi);
-               ltq_dma_enable_irq(&ch->dma);
+               if (napi_complete_done(&ch->napi, pkts))
+                       ltq_dma_enable_irq(&ch->dma);
        }
 
        return pkts;