Commit 2f66fd36 authored by Otto Estuardo Solares Cabrera's avatar Otto Estuardo Solares Cabrera Committed by Jeff Kirsher

e1000: add byte queue limits

Signed-off-by: default avatarOtto Estuardo Solares Cabrera <solca@galileo.edu>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 7f2e6a5d
...@@ -2014,6 +2014,7 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter, ...@@ -2014,6 +2014,7 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter,
e1000_unmap_and_free_tx_resource(adapter, buffer_info); e1000_unmap_and_free_tx_resource(adapter, buffer_info);
} }
netdev_reset_queue(adapter->netdev);
size = sizeof(struct e1000_buffer) * tx_ring->count; size = sizeof(struct e1000_buffer) * tx_ring->count;
memset(tx_ring->buffer_info, 0, size); memset(tx_ring->buffer_info, 0, size);
...@@ -3262,6 +3263,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, ...@@ -3262,6 +3263,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
nr_frags, mss); nr_frags, mss);
if (count) { if (count) {
netdev_sent_queue(netdev, skb->len);
skb_tx_timestamp(skb); skb_tx_timestamp(skb);
e1000_tx_queue(adapter, tx_ring, tx_flags, count); e1000_tx_queue(adapter, tx_ring, tx_flags, count);
...@@ -3849,6 +3851,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter, ...@@ -3849,6 +3851,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
unsigned int i, eop; unsigned int i, eop;
unsigned int count = 0; unsigned int count = 0;
unsigned int total_tx_bytes=0, total_tx_packets=0; unsigned int total_tx_bytes=0, total_tx_packets=0;
unsigned int bytes_compl = 0, pkts_compl = 0;
i = tx_ring->next_to_clean; i = tx_ring->next_to_clean;
eop = tx_ring->buffer_info[i].next_to_watch; eop = tx_ring->buffer_info[i].next_to_watch;
...@@ -3866,6 +3869,11 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter, ...@@ -3866,6 +3869,11 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
if (cleaned) { if (cleaned) {
total_tx_packets += buffer_info->segs; total_tx_packets += buffer_info->segs;
total_tx_bytes += buffer_info->bytecount; total_tx_bytes += buffer_info->bytecount;
if (buffer_info->skb) {
bytes_compl += buffer_info->skb->len;
pkts_compl++;
}
} }
e1000_unmap_and_free_tx_resource(adapter, buffer_info); e1000_unmap_and_free_tx_resource(adapter, buffer_info);
tx_desc->upper.data = 0; tx_desc->upper.data = 0;
...@@ -3879,6 +3887,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter, ...@@ -3879,6 +3887,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
tx_ring->next_to_clean = i; tx_ring->next_to_clean = i;
netdev_completed_queue(netdev, pkts_compl, bytes_compl);
#define TX_WAKE_THRESHOLD 32 #define TX_WAKE_THRESHOLD 32
if (unlikely(count && netif_carrier_ok(netdev) && if (unlikely(count && netif_carrier_ok(netdev) &&
E1000_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD)) { E1000_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment