Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 85594
b: refs/heads/master
c: a8cc21f
h: refs/heads/master
v: v3
  • Loading branch information
Krishna Kumar authored and Jeff Garzik committed Feb 11, 2008
1 parent fedc98c commit d2272af
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3c34ac36ac1084e571ef9b6fb1d6a5b10ccc1fd0
refs/heads/master: a8cc21f64648073e443365d113c55755b92622a6
35 changes: 15 additions & 20 deletions trunk/drivers/net/cxgb3/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,14 @@ static void write_tx_pkt_wr(struct adapter *adap, struct sk_buff *skb,
htonl(V_WR_TID(q->token)));
}

static inline void t3_stop_queue(struct net_device *dev, struct sge_qset *qs,
struct sge_txq *q)
{
netif_stop_queue(dev);
set_bit(TXQ_ETH, &qs->txq_stopped);
q->stops++;
}

/**
* eth_xmit - add a packet to the Ethernet Tx queue
* @skb: the packet
Expand Down Expand Up @@ -1090,31 +1098,18 @@ int t3_eth_xmit(struct sk_buff *skb, struct net_device *dev)
ndesc = calc_tx_descs(skb);

if (unlikely(credits < ndesc)) {
if (!netif_queue_stopped(dev)) {
netif_stop_queue(dev);
set_bit(TXQ_ETH, &qs->txq_stopped);
q->stops++;
dev_err(&adap->pdev->dev,
"%s: Tx ring %u full while queue awake!\n",
dev->name, q->cntxt_id & 7);
}
t3_stop_queue(dev, qs, q);
dev_err(&adap->pdev->dev,
"%s: Tx ring %u full while queue awake!\n",
dev->name, q->cntxt_id & 7);
spin_unlock(&q->lock);
return NETDEV_TX_BUSY;
}

q->in_use += ndesc;
if (unlikely(credits - ndesc < q->stop_thres)) {
q->stops++;
netif_stop_queue(dev);
set_bit(TXQ_ETH, &qs->txq_stopped);
#if !USE_GTS
if (should_restart_tx(q) &&
test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) {
q->restarts++;
netif_wake_queue(dev);
}
#endif
}
if (unlikely(credits - ndesc < q->stop_thres))
if (USE_GTS || !should_restart_tx(q))
t3_stop_queue(dev, qs, q);

gen = q->gen;
q->unacked += ndesc;
Expand Down

0 comments on commit d2272af

Please sign in to comment.