net: renesas: rswitch: Fix unmasking irq condition
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tue, 12 Sep 2023 01:49:35 +0000 (10:49 +0900)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 14 Sep 2023 08:26:40 +0000 (10:26 +0200)
Fix unmasking irq condition by using napi_complete_done(). Otherwise,
redundant interrupts happen.

Fixes: 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/renesas/rswitch.c

index 6083b1c..26c8807 100644 (file)
@@ -816,10 +816,10 @@ retry:
 
        netif_wake_subqueue(ndev, 0);
 
-       napi_complete(napi);
-
-       rswitch_enadis_data_irq(priv, rdev->tx_queue->index, true);
-       rswitch_enadis_data_irq(priv, rdev->rx_queue->index, true);
+       if (napi_complete_done(napi, budget - quota)) {
+               rswitch_enadis_data_irq(priv, rdev->tx_queue->index, true);
+               rswitch_enadis_data_irq(priv, rdev->rx_queue->index, true);
+       }
 
 out:
        return budget - quota;