aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2012-01-04 15:23:36 -0500
committerDavid S. Miller <davem@davemloft.net>2012-01-05 13:12:03 -0500
commitbdbc063129e811264cd6c311d8c2d9b95de01231 (patch)
tree1039a1bb653ad6826fd36fc733f98b5ba8b0b71e /drivers/net
parent13acde8fffc0afbe8341fe08d2c594243f905c1f (diff)
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: Eric Dumazet <eric.dumazet@gmail.com> CC: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/intel/igb/igb.h5
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h
index c69feebf2653..3d12e67eebb4 100644
--- a/drivers/net/ethernet/intel/igb/igb.h
+++ b/drivers/net/ethernet/intel/igb/igb.h
@@ -447,4 +447,9 @@ static inline s32 igb_get_phy_info(struct e1000_hw *hw)
447 return 0; 447 return 0;
448} 448}
449 449
450static inline struct netdev_queue *txring_txq(const struct igb_ring *tx_ring)
451{
452 return netdev_get_tx_queue(tx_ring->netdev, tx_ring->queue_index);
453}
454
450#endif /* _IGB_H_ */ 455#endif /* _IGB_H_ */
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 89d576ce5776..dcc68cc19da6 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -3201,6 +3201,7 @@ static void igb_clean_tx_ring(struct igb_ring *tx_ring)
3201 buffer_info = &tx_ring->tx_buffer_info[i]; 3201 buffer_info = &tx_ring->tx_buffer_info[i];
3202 igb_unmap_and_free_tx_resource(tx_ring, buffer_info); 3202 igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
3203 } 3203 }
3204 netdev_tx_reset_queue(txring_txq(tx_ring));
3204 3205
3205 size = sizeof(struct igb_tx_buffer) * tx_ring->count; 3206 size = sizeof(struct igb_tx_buffer) * tx_ring->count;
3206 memset(tx_ring->tx_buffer_info, 0, size); 3207 memset(tx_ring->tx_buffer_info, 0, size);
@@ -4238,6 +4239,8 @@ static void igb_tx_map(struct igb_ring *tx_ring,
4238 frag++; 4239 frag++;
4239 } 4240 }
4240 4241
4242 netdev_tx_sent_queue(txring_txq(tx_ring), first->bytecount);
4243
4241 /* write last descriptor with RS and EOP bits */ 4244 /* write last descriptor with RS and EOP bits */
4242 cmd_type |= cpu_to_le32(size) | cpu_to_le32(IGB_TXD_DCMD); 4245 cmd_type |= cpu_to_le32(size) | cpu_to_le32(IGB_TXD_DCMD);
4243 tx_desc->read.cmd_type_len = cmd_type; 4246 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 } 5780 }
5778 } 5781 }
5779 5782
5783 netdev_tx_completed_queue(txring_txq(tx_ring),
5784 total_packets, total_bytes);
5780 i += tx_ring->count; 5785 i += tx_ring->count;
5781 tx_ring->next_to_clean = i; 5786 tx_ring->next_to_clean = i;
5782 u64_stats_update_begin(&tx_ring->tx_syncp); 5787 u64_stats_update_begin(&tx_ring->tx_syncp);