diff options
author | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2012-01-19 13:31:34 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2012-03-12 23:10:58 -0400 |
commit | 51a76c30929cc8b7d541f51e634f146e54ea9bb7 (patch) | |
tree | d5f81b1bb1cc640c137142ec53bb0e3d0c0a16ac | |
parent | f124488e4713dc9afa2028553261b1d399286e68 (diff) |
igb: fix ethtool offline test
A bug was introduced with the following patch:
Commmit bdbc063129e811264cd6c311d8c2d9b95de01231
Author: Eric Dumazet <eric.dumazet@gmail.com>
igb: Add support for byte queue limits.
The ethtool offline tests will cause a perpetual link flap, this
is because the tests also need to account for byte queue limits (BQL).
CC: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/igb/igb_ethtool.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index aa399a8a8f0d..e10821a0f249 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c | |||
@@ -1577,7 +1577,9 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring, | |||
1577 | union e1000_adv_rx_desc *rx_desc; | 1577 | union e1000_adv_rx_desc *rx_desc; |
1578 | struct igb_rx_buffer *rx_buffer_info; | 1578 | struct igb_rx_buffer *rx_buffer_info; |
1579 | struct igb_tx_buffer *tx_buffer_info; | 1579 | struct igb_tx_buffer *tx_buffer_info; |
1580 | struct netdev_queue *txq; | ||
1580 | u16 rx_ntc, tx_ntc, count = 0; | 1581 | u16 rx_ntc, tx_ntc, count = 0; |
1582 | unsigned int total_bytes = 0, total_packets = 0; | ||
1581 | 1583 | ||
1582 | /* initialize next to clean and descriptor values */ | 1584 | /* initialize next to clean and descriptor values */ |
1583 | rx_ntc = rx_ring->next_to_clean; | 1585 | rx_ntc = rx_ring->next_to_clean; |
@@ -1601,6 +1603,8 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring, | |||
1601 | 1603 | ||
1602 | /* unmap buffer on tx side */ | 1604 | /* unmap buffer on tx side */ |
1603 | tx_buffer_info = &tx_ring->tx_buffer_info[tx_ntc]; | 1605 | tx_buffer_info = &tx_ring->tx_buffer_info[tx_ntc]; |
1606 | total_bytes += tx_buffer_info->bytecount; | ||
1607 | total_packets += tx_buffer_info->gso_segs; | ||
1604 | igb_unmap_and_free_tx_resource(tx_ring, tx_buffer_info); | 1608 | igb_unmap_and_free_tx_resource(tx_ring, tx_buffer_info); |
1605 | 1609 | ||
1606 | /* increment rx/tx next to clean counters */ | 1610 | /* increment rx/tx next to clean counters */ |
@@ -1615,6 +1619,9 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring, | |||
1615 | rx_desc = IGB_RX_DESC(rx_ring, rx_ntc); | 1619 | rx_desc = IGB_RX_DESC(rx_ring, rx_ntc); |
1616 | } | 1620 | } |
1617 | 1621 | ||
1622 | txq = netdev_get_tx_queue(tx_ring->netdev, tx_ring->queue_index); | ||
1623 | netdev_tx_completed_queue(txq, total_packets, total_bytes); | ||
1624 | |||
1618 | /* re-map buffers to ring, store next to clean values */ | 1625 | /* re-map buffers to ring, store next to clean values */ |
1619 | igb_alloc_rx_buffers(rx_ring, count); | 1626 | igb_alloc_rx_buffers(rx_ring, count); |
1620 | rx_ring->next_to_clean = rx_ntc; | 1627 | rx_ring->next_to_clean = rx_ntc; |