net: systemport: fix TX NAPI work done return value
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 26 Jun 2014 17:06:46 +0000 (10:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Jul 2014 00:10:17 +0000 (17:10 -0700)
Although we do not limit the number of packets the TX completion
function bcm_sysport_tx_reclaim() is allowed to reclaim, we were still
using its return value as-is. This means that we could hit the WARN() in
net/core/dev.c where work_done >= budget.

Make sure we do exit the NAPI context when the TX ring is empty, and
pretend there was no work to do.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcmsysport.c

index d31f7d239064cd80ca47443f1d9c6f891d5aaf8a..5776e503e4c57eb374e304fecc8e0fa44e2e5f85 100644 (file)
@@ -654,13 +654,13 @@ static int bcm_sysport_tx_poll(struct napi_struct *napi, int budget)
 
        work_done = bcm_sysport_tx_reclaim(ring->priv, ring);
 
-       if (work_done < budget) {
+       if (work_done == 0) {
                napi_complete(napi);
                /* re-enable TX interrupt */
                intrl2_1_mask_clear(ring->priv, BIT(ring->index));
        }
 
-       return work_done;
+       return 0;
 }
 
 static void bcm_sysport_tx_reclaim_all(struct bcm_sysport_priv *priv)
This page took 0.027112 seconds and 5 git commands to generate.