diff options
author | Tom Herbert <therbert@google.com> | 2011-11-28 11:33:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-29 12:46:19 -0500 |
commit | 3f0cfa3bc11e7f00c9994e0f469cbc0e7da7b00c (patch) | |
tree | d6670a4f94b2b9dedacc38edb6f0e1306b889f6b /drivers/net | |
parent | 114cf5802165ee93e3ab461c9c505cd94a08b800 (diff) |
e1000e: Support for byte queue limits
Changes to e1000e 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')
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/netdev.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index a5bd7a3dafc9..c6e976302f97 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c | |||
@@ -1079,6 +1079,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter) | |||
1079 | unsigned int i, eop; | 1079 | unsigned int i, eop; |
1080 | unsigned int count = 0; | 1080 | unsigned int count = 0; |
1081 | unsigned int total_tx_bytes = 0, total_tx_packets = 0; | 1081 | unsigned int total_tx_bytes = 0, total_tx_packets = 0; |
1082 | unsigned int bytes_compl = 0, pkts_compl = 0; | ||
1082 | 1083 | ||
1083 | i = tx_ring->next_to_clean; | 1084 | i = tx_ring->next_to_clean; |
1084 | eop = tx_ring->buffer_info[i].next_to_watch; | 1085 | eop = tx_ring->buffer_info[i].next_to_watch; |
@@ -1096,6 +1097,10 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter) | |||
1096 | if (cleaned) { | 1097 | if (cleaned) { |
1097 | total_tx_packets += buffer_info->segs; | 1098 | total_tx_packets += buffer_info->segs; |
1098 | total_tx_bytes += buffer_info->bytecount; | 1099 | total_tx_bytes += buffer_info->bytecount; |
1100 | if (buffer_info->skb) { | ||
1101 | bytes_compl += buffer_info->skb->len; | ||
1102 | pkts_compl++; | ||
1103 | } | ||
1099 | } | 1104 | } |
1100 | 1105 | ||
1101 | e1000_put_txbuf(adapter, buffer_info); | 1106 | e1000_put_txbuf(adapter, buffer_info); |
@@ -1114,6 +1119,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter) | |||
1114 | 1119 | ||
1115 | tx_ring->next_to_clean = i; | 1120 | tx_ring->next_to_clean = i; |
1116 | 1121 | ||
1122 | netdev_completed_queue(netdev, pkts_compl, bytes_compl); | ||
1123 | |||
1117 | #define TX_WAKE_THRESHOLD 32 | 1124 | #define TX_WAKE_THRESHOLD 32 |
1118 | if (count && netif_carrier_ok(netdev) && | 1125 | if (count && netif_carrier_ok(netdev) && |
1119 | e1000_desc_unused(tx_ring) >= TX_WAKE_THRESHOLD) { | 1126 | e1000_desc_unused(tx_ring) >= TX_WAKE_THRESHOLD) { |
@@ -2240,6 +2247,7 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter) | |||
2240 | e1000_put_txbuf(adapter, buffer_info); | 2247 | e1000_put_txbuf(adapter, buffer_info); |
2241 | } | 2248 | } |
2242 | 2249 | ||
2250 | netdev_reset_queue(adapter->netdev); | ||
2243 | size = sizeof(struct e1000_buffer) * tx_ring->count; | 2251 | size = sizeof(struct e1000_buffer) * tx_ring->count; |
2244 | memset(tx_ring->buffer_info, 0, size); | 2252 | memset(tx_ring->buffer_info, 0, size); |
2245 | 2253 | ||
@@ -5027,6 +5035,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, | |||
5027 | /* if count is 0 then mapping error has occurred */ | 5035 | /* if count is 0 then mapping error has occurred */ |
5028 | count = e1000_tx_map(adapter, skb, first, max_per_txd, nr_frags, mss); | 5036 | count = e1000_tx_map(adapter, skb, first, max_per_txd, nr_frags, mss); |
5029 | if (count) { | 5037 | if (count) { |
5038 | netdev_sent_queue(netdev, skb->len); | ||
5030 | e1000_tx_queue(adapter, tx_flags, count); | 5039 | e1000_tx_queue(adapter, tx_flags, count); |
5031 | /* Make sure there is space in the ring for the next send. */ | 5040 | /* Make sure there is space in the ring for the next send. */ |
5032 | e1000_maybe_stop_tx(netdev, MAX_SKB_FRAGS + 2); | 5041 | e1000_maybe_stop_tx(netdev, MAX_SKB_FRAGS + 2); |