Commit bdbc0631 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

igb: Add support for byte queue limits.

This adds support for byte queue limits (BQL)

Since this driver collects bytes count in 'bytecount' field, use it also
in igb_tx_map()
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
CC: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 13acde8f
...@@ -447,4 +447,9 @@ static inline s32 igb_get_phy_info(struct e1000_hw *hw) ...@@ -447,4 +447,9 @@ static inline s32 igb_get_phy_info(struct e1000_hw *hw)
return 0; return 0;
} }
static inline struct netdev_queue *txring_txq(const struct igb_ring *tx_ring)
{
return netdev_get_tx_queue(tx_ring->netdev, tx_ring->queue_index);
}
#endif /* _IGB_H_ */ #endif /* _IGB_H_ */
...@@ -3201,6 +3201,7 @@ static void igb_clean_tx_ring(struct igb_ring *tx_ring) ...@@ -3201,6 +3201,7 @@ static void igb_clean_tx_ring(struct igb_ring *tx_ring)
buffer_info = &tx_ring->tx_buffer_info[i]; buffer_info = &tx_ring->tx_buffer_info[i];
igb_unmap_and_free_tx_resource(tx_ring, buffer_info); igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
} }
netdev_tx_reset_queue(txring_txq(tx_ring));
size = sizeof(struct igb_tx_buffer) * tx_ring->count; size = sizeof(struct igb_tx_buffer) * tx_ring->count;
memset(tx_ring->tx_buffer_info, 0, size); memset(tx_ring->tx_buffer_info, 0, size);
...@@ -4238,6 +4239,8 @@ static void igb_tx_map(struct igb_ring *tx_ring, ...@@ -4238,6 +4239,8 @@ static void igb_tx_map(struct igb_ring *tx_ring,
frag++; frag++;
} }
netdev_tx_sent_queue(txring_txq(tx_ring), first->bytecount);
/* write last descriptor with RS and EOP bits */ /* write last descriptor with RS and EOP bits */
cmd_type |= cpu_to_le32(size) | cpu_to_le32(IGB_TXD_DCMD); cmd_type |= cpu_to_le32(size) | cpu_to_le32(IGB_TXD_DCMD);
tx_desc->read.cmd_type_len = cmd_type; tx_desc->read.cmd_type_len = cmd_type;
...@@ -5777,6 +5780,8 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector) ...@@ -5777,6 +5780,8 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
} }
} }
netdev_tx_completed_queue(txring_txq(tx_ring),
total_packets, total_bytes);
i += tx_ring->count; i += tx_ring->count;
tx_ring->next_to_clean = i; tx_ring->next_to_clean = i;
u64_stats_update_begin(&tx_ring->tx_syncp); u64_stats_update_begin(&tx_ring->tx_syncp);
......
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