aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2015-03-13 15:11:07 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-13 15:52:31 -0400
commitddd0ca5d60b350bbfbfb60b25885a9779ce6d6c7 (patch)
tree974239fd13e2133fedb00e2096adfca16983440b
parentae67bf0188cbb9d1786bdfcca9e1976cb36ee327 (diff)
net: bcmgenet: add support for xmit_more
Delay the update of the TDMA producer index unless this is the last SKB in a batch, or the queue is already stopped. Move the check for whether the queue should be stopped before the xmit_more check to avoid locking the transmit queue in case there was a SKB submitted which has xmit_more set. Signed-off-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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 53c916ea06a2..e74ae628bbb9 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -1316,12 +1316,13 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
1316 ring->prod_index += nr_frags + 1; 1316 ring->prod_index += nr_frags + 1;
1317 ring->prod_index &= DMA_P_INDEX_MASK; 1317 ring->prod_index &= DMA_P_INDEX_MASK;
1318 1318
1319 bcmgenet_tdma_ring_writel(priv, ring->index,
1320 ring->prod_index, TDMA_PROD_INDEX);
1321
1322 if (ring->free_bds <= (MAX_SKB_FRAGS + 1)) 1319 if (ring->free_bds <= (MAX_SKB_FRAGS + 1))
1323 netif_tx_stop_queue(txq); 1320 netif_tx_stop_queue(txq);
1324 1321
1322 if (!skb->xmit_more || netif_xmit_stopped(txq))
1323 /* Packets are ready, update producer index */
1324 bcmgenet_tdma_ring_writel(priv, ring->index,
1325 ring->prod_index, TDMA_PROD_INDEX);
1325out: 1326out:
1326 spin_unlock_irqrestore(&ring->lock, flags); 1327 spin_unlock_irqrestore(&ring->lock, flags);
1327 1328