diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2013-09-28 02:00:37 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2013-10-10 01:13:08 -0400 |
commit | 7070ce0a6419a118842298bc967061ad6cea40db (patch) | |
tree | 6a1343ae36fc60c7651b507e3196ad512a181ffd /drivers/net/ethernet | |
parent | b194130627580519e63665660db055bfe82b6949 (diff) |
i40e: Add support for Tx byte queue limits
Implement BQL (byte queue limit) support in i40e.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_txrx.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index 52dfac206f75..ad2818f26821 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c | |||
@@ -240,6 +240,13 @@ void i40e_clean_tx_ring(struct i40e_ring *tx_ring) | |||
240 | 240 | ||
241 | tx_ring->next_to_use = 0; | 241 | tx_ring->next_to_use = 0; |
242 | tx_ring->next_to_clean = 0; | 242 | tx_ring->next_to_clean = 0; |
243 | |||
244 | if (!tx_ring->netdev) | ||
245 | return; | ||
246 | |||
247 | /* cleanup Tx queue statistics */ | ||
248 | netdev_tx_reset_queue(netdev_get_tx_queue(tx_ring->netdev, | ||
249 | tx_ring->queue_index)); | ||
243 | } | 250 | } |
244 | 251 | ||
245 | /** | 252 | /** |
@@ -436,6 +443,10 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget) | |||
436 | return true; | 443 | return true; |
437 | } | 444 | } |
438 | 445 | ||
446 | netdev_tx_completed_queue(netdev_get_tx_queue(tx_ring->netdev, | ||
447 | tx_ring->queue_index), | ||
448 | total_packets, total_bytes); | ||
449 | |||
439 | #define TX_WAKE_THRESHOLD (DESC_NEEDED * 2) | 450 | #define TX_WAKE_THRESHOLD (DESC_NEEDED * 2) |
440 | if (unlikely(total_packets && netif_carrier_ok(tx_ring->netdev) && | 451 | if (unlikely(total_packets && netif_carrier_ok(tx_ring->netdev) && |
441 | (I40E_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD))) { | 452 | (I40E_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD))) { |
@@ -1602,6 +1613,10 @@ static void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb, | |||
1602 | build_ctob(td_cmd, td_offset, size, td_tag) | | 1613 | build_ctob(td_cmd, td_offset, size, td_tag) | |
1603 | cpu_to_le64((u64)I40E_TXD_CMD << I40E_TXD_QW1_CMD_SHIFT); | 1614 | cpu_to_le64((u64)I40E_TXD_CMD << I40E_TXD_QW1_CMD_SHIFT); |
1604 | 1615 | ||
1616 | netdev_tx_sent_queue(netdev_get_tx_queue(tx_ring->netdev, | ||
1617 | tx_ring->queue_index), | ||
1618 | first->bytecount); | ||
1619 | |||
1605 | /* set the timestamp */ | 1620 | /* set the timestamp */ |
1606 | first->time_stamp = jiffies; | 1621 | first->time_stamp = jiffies; |
1607 | 1622 | ||