diff options
-rw-r--r-- | drivers/net/ethernet/broadcom/bcmsysport.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index 7e8cf213fd81..744ed6ddaf37 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c | |||
@@ -710,11 +710,8 @@ static unsigned int __bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv, | |||
710 | unsigned int c_index, last_c_index, last_tx_cn, num_tx_cbs; | 710 | unsigned int c_index, last_c_index, last_tx_cn, num_tx_cbs; |
711 | unsigned int pkts_compl = 0, bytes_compl = 0; | 711 | unsigned int pkts_compl = 0, bytes_compl = 0; |
712 | struct bcm_sysport_cb *cb; | 712 | struct bcm_sysport_cb *cb; |
713 | struct netdev_queue *txq; | ||
714 | u32 hw_ind; | 713 | u32 hw_ind; |
715 | 714 | ||
716 | txq = netdev_get_tx_queue(ndev, ring->index); | ||
717 | |||
718 | /* Compute how many descriptors have been processed since last call */ | 715 | /* Compute how many descriptors have been processed since last call */ |
719 | hw_ind = tdma_readl(priv, TDMA_DESC_RING_PROD_CONS_INDEX(ring->index)); | 716 | hw_ind = tdma_readl(priv, TDMA_DESC_RING_PROD_CONS_INDEX(ring->index)); |
720 | c_index = (hw_ind >> RING_CONS_INDEX_SHIFT) & RING_CONS_INDEX_MASK; | 717 | c_index = (hw_ind >> RING_CONS_INDEX_SHIFT) & RING_CONS_INDEX_MASK; |
@@ -745,9 +742,6 @@ static unsigned int __bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv, | |||
745 | 742 | ||
746 | ring->c_index = c_index; | 743 | ring->c_index = c_index; |
747 | 744 | ||
748 | if (netif_tx_queue_stopped(txq) && pkts_compl) | ||
749 | netif_tx_wake_queue(txq); | ||
750 | |||
751 | netif_dbg(priv, tx_done, ndev, | 745 | netif_dbg(priv, tx_done, ndev, |
752 | "ring=%d c_index=%d pkts_compl=%d, bytes_compl=%d\n", | 746 | "ring=%d c_index=%d pkts_compl=%d, bytes_compl=%d\n", |
753 | ring->index, ring->c_index, pkts_compl, bytes_compl); | 747 | ring->index, ring->c_index, pkts_compl, bytes_compl); |
@@ -759,16 +753,33 @@ static unsigned int __bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv, | |||
759 | static unsigned int bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv, | 753 | static unsigned int bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv, |
760 | struct bcm_sysport_tx_ring *ring) | 754 | struct bcm_sysport_tx_ring *ring) |
761 | { | 755 | { |
756 | struct netdev_queue *txq; | ||
762 | unsigned int released; | 757 | unsigned int released; |
763 | unsigned long flags; | 758 | unsigned long flags; |
764 | 759 | ||
760 | txq = netdev_get_tx_queue(priv->netdev, ring->index); | ||
761 | |||
765 | spin_lock_irqsave(&ring->lock, flags); | 762 | spin_lock_irqsave(&ring->lock, flags); |
766 | released = __bcm_sysport_tx_reclaim(priv, ring); | 763 | released = __bcm_sysport_tx_reclaim(priv, ring); |
764 | if (released) | ||
765 | netif_tx_wake_queue(txq); | ||
766 | |||
767 | spin_unlock_irqrestore(&ring->lock, flags); | 767 | spin_unlock_irqrestore(&ring->lock, flags); |
768 | 768 | ||
769 | return released; | 769 | return released; |
770 | } | 770 | } |
771 | 771 | ||
772 | /* Locked version of the per-ring TX reclaim, but does not wake the queue */ | ||
773 | static void bcm_sysport_tx_clean(struct bcm_sysport_priv *priv, | ||
774 | struct bcm_sysport_tx_ring *ring) | ||
775 | { | ||
776 | unsigned long flags; | ||
777 | |||
778 | spin_lock_irqsave(&ring->lock, flags); | ||
779 | __bcm_sysport_tx_reclaim(priv, ring); | ||
780 | spin_unlock_irqrestore(&ring->lock, flags); | ||
781 | } | ||
782 | |||
772 | static int bcm_sysport_tx_poll(struct napi_struct *napi, int budget) | 783 | static int bcm_sysport_tx_poll(struct napi_struct *napi, int budget) |
773 | { | 784 | { |
774 | struct bcm_sysport_tx_ring *ring = | 785 | struct bcm_sysport_tx_ring *ring = |
@@ -1252,7 +1263,7 @@ static void bcm_sysport_fini_tx_ring(struct bcm_sysport_priv *priv, | |||
1252 | napi_disable(&ring->napi); | 1263 | napi_disable(&ring->napi); |
1253 | netif_napi_del(&ring->napi); | 1264 | netif_napi_del(&ring->napi); |
1254 | 1265 | ||
1255 | bcm_sysport_tx_reclaim(priv, ring); | 1266 | bcm_sysport_tx_clean(priv, ring); |
1256 | 1267 | ||
1257 | kfree(ring->cbs); | 1268 | kfree(ring->cbs); |
1258 | ring->cbs = NULL; | 1269 | ring->cbs = NULL; |