diff options
author | Tom Herbert <therbert@google.com> | 2011-11-28 11:33:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-29 12:46:20 -0500 |
commit | 298376d3e8f00147548c426959ce79efc47b669a (patch) | |
tree | 605841de4159a57e76cf6e53af087f7f3615760c /drivers/net/ethernet/broadcom | |
parent | b8bfca9439d4ed03446bc9a3fdaef81b364d32dd (diff) |
tg3: Support for byte queue limits
Changes to tg3 to use byte queue limits.
Signed-off-by: Tom Herbert <therbert@google.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index aa413d6551ad..cf36312ac5ac 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -5302,6 +5302,7 @@ static void tg3_tx(struct tg3_napi *tnapi) | |||
5302 | u32 sw_idx = tnapi->tx_cons; | 5302 | u32 sw_idx = tnapi->tx_cons; |
5303 | struct netdev_queue *txq; | 5303 | struct netdev_queue *txq; |
5304 | int index = tnapi - tp->napi; | 5304 | int index = tnapi - tp->napi; |
5305 | unsigned int pkts_compl = 0, bytes_compl = 0; | ||
5305 | 5306 | ||
5306 | if (tg3_flag(tp, ENABLE_TSS)) | 5307 | if (tg3_flag(tp, ENABLE_TSS)) |
5307 | index--; | 5308 | index--; |
@@ -5352,6 +5353,9 @@ static void tg3_tx(struct tg3_napi *tnapi) | |||
5352 | sw_idx = NEXT_TX(sw_idx); | 5353 | sw_idx = NEXT_TX(sw_idx); |
5353 | } | 5354 | } |
5354 | 5355 | ||
5356 | pkts_compl++; | ||
5357 | bytes_compl += skb->len; | ||
5358 | |||
5355 | dev_kfree_skb(skb); | 5359 | dev_kfree_skb(skb); |
5356 | 5360 | ||
5357 | if (unlikely(tx_bug)) { | 5361 | if (unlikely(tx_bug)) { |
@@ -5360,6 +5364,8 @@ static void tg3_tx(struct tg3_napi *tnapi) | |||
5360 | } | 5364 | } |
5361 | } | 5365 | } |
5362 | 5366 | ||
5367 | netdev_completed_queue(tp->dev, pkts_compl, bytes_compl); | ||
5368 | |||
5363 | tnapi->tx_cons = sw_idx; | 5369 | tnapi->tx_cons = sw_idx; |
5364 | 5370 | ||
5365 | /* Need to make the tx_cons update visible to tg3_start_xmit() | 5371 | /* Need to make the tx_cons update visible to tg3_start_xmit() |
@@ -6804,6 +6810,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
6804 | } | 6810 | } |
6805 | 6811 | ||
6806 | skb_tx_timestamp(skb); | 6812 | skb_tx_timestamp(skb); |
6813 | netdev_sent_queue(tp->dev, skb->len); | ||
6807 | 6814 | ||
6808 | /* Packets are ready, update Tx producer idx local and on card. */ | 6815 | /* Packets are ready, update Tx producer idx local and on card. */ |
6809 | tw32_tx_mbox(tnapi->prodmbox, entry); | 6816 | tw32_tx_mbox(tnapi->prodmbox, entry); |
@@ -7286,6 +7293,7 @@ static void tg3_free_rings(struct tg3 *tp) | |||
7286 | dev_kfree_skb_any(skb); | 7293 | dev_kfree_skb_any(skb); |
7287 | } | 7294 | } |
7288 | } | 7295 | } |
7296 | netdev_reset_queue(tp->dev); | ||
7289 | } | 7297 | } |
7290 | 7298 | ||
7291 | /* Initialize tx/rx rings for packet processing. | 7299 | /* Initialize tx/rx rings for packet processing. |