[PATCH 3.13.y-ckt 005/143] netxen: fix netxen_nic_poll() logic

Kamal Mostafa kamal at canonical.com
Tue Mar 31 19:46:10 UTC 2015

3.13.11-ckt18 -stable review patch.  If anyone has any objections, please let me know.


From: Eric Dumazet <edumazet at google.com>

[ Upstream commit 6088beef3f7517717bd21d90b379714dd0837079 ]

NAPI poll logic now enforces that a poller returns exactly the budget
when it wants to be called again.

If a driver limits TX completion, it has to return budget as well when
the limit is hit, not the number of received packets.

Reported-and-tested-by: Mike Galbraith <umgwanakikbuti at gmail.com>
Signed-off-by: Eric Dumazet <edumazet at google.com>
Fixes: d75b1ade567f ("net: less interrupt masking in NAPI")
Cc: Manish Chopra <manish.chopra at qlogic.com>
Acked-by: Manish Chopra <manish.chopra at qlogic.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
 drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index 3bec8cf..024cd49 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -2392,7 +2392,10 @@ static int netxen_nic_poll(struct napi_struct *napi, int budget)
 	work_done = netxen_process_rcv_ring(sds_ring, budget);
-	if ((work_done < budget) && tx_complete) {
+	if (!tx_complete)
+		work_done = budget;
+	if (work_done < budget) {
 		if (test_bit(__NX_DEV_UP, &adapter->state))

More information about the kernel-team mailing list