summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Berger <opendmb@gmail.com>2017-03-14 03:41:38 +0300
committerDavid S. Miller <davem@davemloft.net>2017-03-14 07:51:50 +0300
commitc4d453d2b14d4c844fd6b492fbd16ce0615a59d8 (patch)
tree381315684d210d4ea87064daa3da20c7454efd8b
parentd5810ca3252a5bf61e5b2fc789da456e0f65ba8c (diff)
downloadlinux-c4d453d2b14d4c844fd6b492fbd16ce0615a59d8.tar.xz
net: bcmgenet: correct return value of __bcmgenet_tx_reclaim
The reclaim function should return the number of buffer descriptors reclaimed, not just the number corresponding to skb packets. Also, remove the unnecessary computation when updating the consumer index. While this is not a functional problem it could degrade performance of napi in a fragmented transmit stream. Signed-off-by: Doug Berger <opendmb@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/genet/bcmgenet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 1f94ba1773dd..d90d366b286f 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -1218,7 +1218,7 @@ static unsigned int __bcmgenet_tx_reclaim(struct net_device *dev,
}
ring->free_bds += txbds_processed;
- ring->c_index = (ring->c_index + txbds_processed) & DMA_C_INDEX_MASK;
+ ring->c_index = c_index;
dev->stats.tx_packets += pkts_compl;
dev->stats.tx_bytes += bytes_compl;
@@ -1231,7 +1231,7 @@ static unsigned int __bcmgenet_tx_reclaim(struct net_device *dev,
netif_tx_wake_queue(txq);
}
- return pkts_compl;
+ return txbds_processed;
}
static unsigned int bcmgenet_tx_reclaim(struct net_device *dev,