diff options
-rw-r--r-- | drivers/net/cxgb3/sge.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index 9ca8c66abd16..979f3fc5e765 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -1059,6 +1059,14 @@ static void write_tx_pkt_wr(struct adapter *adap, struct sk_buff *skb, | |||
1059 | htonl(V_WR_TID(q->token))); | 1059 | htonl(V_WR_TID(q->token))); |
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | static inline void t3_stop_queue(struct net_device *dev, struct sge_qset *qs, | ||
1063 | struct sge_txq *q) | ||
1064 | { | ||
1065 | netif_stop_queue(dev); | ||
1066 | set_bit(TXQ_ETH, &qs->txq_stopped); | ||
1067 | q->stops++; | ||
1068 | } | ||
1069 | |||
1062 | /** | 1070 | /** |
1063 | * eth_xmit - add a packet to the Ethernet Tx queue | 1071 | * eth_xmit - add a packet to the Ethernet Tx queue |
1064 | * @skb: the packet | 1072 | * @skb: the packet |
@@ -1090,31 +1098,18 @@ int t3_eth_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1090 | ndesc = calc_tx_descs(skb); | 1098 | ndesc = calc_tx_descs(skb); |
1091 | 1099 | ||
1092 | if (unlikely(credits < ndesc)) { | 1100 | if (unlikely(credits < ndesc)) { |
1093 | if (!netif_queue_stopped(dev)) { | 1101 | t3_stop_queue(dev, qs, q); |
1094 | netif_stop_queue(dev); | 1102 | dev_err(&adap->pdev->dev, |
1095 | set_bit(TXQ_ETH, &qs->txq_stopped); | 1103 | "%s: Tx ring %u full while queue awake!\n", |
1096 | q->stops++; | 1104 | dev->name, q->cntxt_id & 7); |
1097 | dev_err(&adap->pdev->dev, | ||
1098 | "%s: Tx ring %u full while queue awake!\n", | ||
1099 | dev->name, q->cntxt_id & 7); | ||
1100 | } | ||
1101 | spin_unlock(&q->lock); | 1105 | spin_unlock(&q->lock); |
1102 | return NETDEV_TX_BUSY; | 1106 | return NETDEV_TX_BUSY; |
1103 | } | 1107 | } |
1104 | 1108 | ||
1105 | q->in_use += ndesc; | 1109 | q->in_use += ndesc; |
1106 | if (unlikely(credits - ndesc < q->stop_thres)) { | 1110 | if (unlikely(credits - ndesc < q->stop_thres)) |
1107 | q->stops++; | 1111 | if (USE_GTS || !should_restart_tx(q)) |
1108 | netif_stop_queue(dev); | 1112 | t3_stop_queue(dev, qs, q); |
1109 | set_bit(TXQ_ETH, &qs->txq_stopped); | ||
1110 | #if !USE_GTS | ||
1111 | if (should_restart_tx(q) && | ||
1112 | test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) { | ||
1113 | q->restarts++; | ||
1114 | netif_wake_queue(dev); | ||
1115 | } | ||
1116 | #endif | ||
1117 | } | ||
1118 | 1113 | ||
1119 | gen = q->gen; | 1114 | gen = q->gen; |
1120 | q->unacked += ndesc; | 1115 | q->unacked += ndesc; |