lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 15 Aug 2020 20:33:14 +0200
From:   Hauke Mehrtens <hauke@...ke-m.de>
To:     davem@...emloft.net
Cc:     kuba@...nel.org, netdev@...r.kernel.org,
        martin.blumenstingl@...glemail.com,
        Hauke Mehrtens <hauke@...ke-m.de>
Subject: [PATCH 3/3] 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@...ke-m.de>
---
 drivers/net/ethernet/lantiq_xrx200.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c
index f34e4dc8c661..674ffb2ecd9a 100644
--- a/drivers/net/ethernet/lantiq_xrx200.c
+++ b/drivers/net/ethernet/lantiq_xrx200.c
@@ -229,10 +229,8 @@ static int xrx200_poll_rx(struct napi_struct *napi, int budget)
 		}
 	}
 
-	if (rx < budget) {
-		napi_complete(&ch->napi);
+	if (napi_complete_done(&ch->napi, rx))
 		ltq_dma_enable_irq(&ch->dma);
-	}
 
 	return rx;
 }
@@ -271,10 +269,8 @@ static int xrx200_tx_housekeeping(struct napi_struct *napi, int budget)
 	if (netif_queue_stopped(net_dev))
 		netif_wake_queue(net_dev);
 
-	if (pkts < budget) {
-		napi_complete(&ch->napi);
+	if (napi_complete_done(&ch->napi, pkts))
 		ltq_dma_enable_irq(&ch->dma);
-	}
 
 	return pkts;
 }
-- 
2.20.1

Powered by blists - more mailing lists