diff options
| -rw-r--r-- | drivers/net/ethernet/broadcom/genet/bcmgenet.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index cfcb046f4de5..8f87fe001541 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c | |||
| @@ -868,10 +868,12 @@ static void __bcmgenet_tx_reclaim(struct net_device *dev, | |||
| 868 | struct bcmgenet_priv *priv = netdev_priv(dev); | 868 | struct bcmgenet_priv *priv = netdev_priv(dev); |
| 869 | int last_tx_cn, last_c_index, num_tx_bds; | 869 | int last_tx_cn, last_c_index, num_tx_bds; |
| 870 | struct enet_cb *tx_cb_ptr; | 870 | struct enet_cb *tx_cb_ptr; |
| 871 | struct netdev_queue *txq; | ||
| 871 | unsigned int c_index; | 872 | unsigned int c_index; |
| 872 | 873 | ||
| 873 | /* Compute how many buffers are transmited since last xmit call */ | 874 | /* Compute how many buffers are transmited since last xmit call */ |
| 874 | c_index = bcmgenet_tdma_ring_readl(priv, ring->index, TDMA_CONS_INDEX); | 875 | c_index = bcmgenet_tdma_ring_readl(priv, ring->index, TDMA_CONS_INDEX); |
| 876 | txq = netdev_get_tx_queue(dev, ring->queue); | ||
| 875 | 877 | ||
| 876 | last_c_index = ring->c_index; | 878 | last_c_index = ring->c_index; |
| 877 | num_tx_bds = ring->size; | 879 | num_tx_bds = ring->size; |
| @@ -917,8 +919,8 @@ static void __bcmgenet_tx_reclaim(struct net_device *dev, | |||
| 917 | if (ring->free_bds > (MAX_SKB_FRAGS + 1)) | 919 | if (ring->free_bds > (MAX_SKB_FRAGS + 1)) |
| 918 | ring->int_disable(priv, ring); | 920 | ring->int_disable(priv, ring); |
| 919 | 921 | ||
| 920 | if (__netif_subqueue_stopped(dev, ring->queue)) | 922 | if (netif_tx_queue_stopped(txq)) |
| 921 | netif_wake_subqueue(dev, ring->queue); | 923 | netif_tx_wake_queue(txq); |
| 922 | 924 | ||
| 923 | ring->c_index = c_index; | 925 | ring->c_index = c_index; |
| 924 | } | 926 | } |
| @@ -1106,6 +1108,7 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 1106 | { | 1108 | { |
| 1107 | struct bcmgenet_priv *priv = netdev_priv(dev); | 1109 | struct bcmgenet_priv *priv = netdev_priv(dev); |
| 1108 | struct bcmgenet_tx_ring *ring = NULL; | 1110 | struct bcmgenet_tx_ring *ring = NULL; |
| 1111 | struct netdev_queue *txq; | ||
| 1109 | unsigned long flags = 0; | 1112 | unsigned long flags = 0; |
| 1110 | int nr_frags, index; | 1113 | int nr_frags, index; |
| 1111 | u16 dma_desc_flags; | 1114 | u16 dma_desc_flags; |
| @@ -1127,10 +1130,11 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 1127 | 1130 | ||
| 1128 | nr_frags = skb_shinfo(skb)->nr_frags; | 1131 | nr_frags = skb_shinfo(skb)->nr_frags; |
| 1129 | ring = &priv->tx_rings[index]; | 1132 | ring = &priv->tx_rings[index]; |
| 1133 | txq = netdev_get_tx_queue(dev, ring->queue); | ||
| 1130 | 1134 | ||
| 1131 | spin_lock_irqsave(&ring->lock, flags); | 1135 | spin_lock_irqsave(&ring->lock, flags); |
| 1132 | if (ring->free_bds <= nr_frags + 1) { | 1136 | if (ring->free_bds <= nr_frags + 1) { |
| 1133 | netif_stop_subqueue(dev, ring->queue); | 1137 | netif_tx_stop_queue(txq); |
| 1134 | netdev_err(dev, "%s: tx ring %d full when queue %d awake\n", | 1138 | netdev_err(dev, "%s: tx ring %d full when queue %d awake\n", |
| 1135 | __func__, index, ring->queue); | 1139 | __func__, index, ring->queue); |
| 1136 | ret = NETDEV_TX_BUSY; | 1140 | ret = NETDEV_TX_BUSY; |
| @@ -1177,7 +1181,7 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 1177 | ring->prod_index, TDMA_PROD_INDEX); | 1181 | ring->prod_index, TDMA_PROD_INDEX); |
| 1178 | 1182 | ||
| 1179 | if (ring->free_bds <= (MAX_SKB_FRAGS + 1)) { | 1183 | if (ring->free_bds <= (MAX_SKB_FRAGS + 1)) { |
| 1180 | netif_stop_subqueue(dev, ring->queue); | 1184 | netif_tx_stop_queue(txq); |
| 1181 | ring->int_enable(priv, ring); | 1185 | ring->int_enable(priv, ring); |
| 1182 | } | 1186 | } |
| 1183 | 1187 | ||
