Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351674
b: refs/heads/master
c: 7225922
h: refs/heads/master
v: v3
  • Loading branch information
Amir Vadai authored and David S. Miller committed Jan 28, 2013
1 parent aff8d17 commit 4a6f97f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 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: f356fcbe12c1174713e83651b630330f8f0f8415
refs/heads/master: 7225922558f04f25a22683ce08454dae8dd4b9f4
16 changes: 15 additions & 1 deletion trunk/drivers/net/ethernet/mellanox/mlx4/en_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,21 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
netif_tx_stop_queue(ring->tx_queue);
priv->port_stats.queue_stopped++;

return NETDEV_TX_BUSY;
/* If queue was emptied after the if, and before the
* stop_queue - need to wake the queue, or else it will remain
* stopped forever.
* Need a memory barrier to make sure ring->cons was not
* updated before queue was stopped.
*/
wmb();

if (unlikely(((int)(ring->prod - ring->cons)) <=
ring->size - HEADROOM - MAX_DESC_TXBBS)) {
netif_tx_wake_queue(ring->tx_queue);
priv->port_stats.wake_queue++;
} else {
return NETDEV_TX_BUSY;
}
}

/* Track current inflight packets for performance analysis */
Expand Down

0 comments on commit 4a6f97f

Please sign in to comment.