]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
ixgbe: add support for byte queue limits
authorAlexander Duyck <alexander.h.duyck@intel.com>
Tue, 7 Feb 2012 08:14:33 +0000 (08:14 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 13 Mar 2012 03:14:53 +0000 (20:14 -0700)
This adds support for byte queue limits (BQL).

Based on patch from Eric Dumazet for igb.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe.h
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index 2807a25e04e6519e86a733e2eeb00d2b9591a7a0..f05bfdbf2f32e603b91278fb78b1f1f6b9cd47e8 100644 (file)
@@ -643,4 +643,9 @@ extern int ixgbe_fcoe_get_hbainfo(struct net_device *netdev,
                                  struct netdev_fcoe_hbainfo *info);
 #endif /* IXGBE_FCOE */
 
+static inline struct netdev_queue *txring_txq(const struct ixgbe_ring *ring)
+{
+       return netdev_get_tx_queue(ring->netdev, ring->queue_index);
+}
+
 #endif /* _IXGBE_H_ */
index 23a466530a04cb86955ca1190a704729104194a8..060964378e584113bcf73a99c6940d8e8304827a 100644 (file)
@@ -840,6 +840,9 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
                return true;
        }
 
+       netdev_tx_completed_queue(txring_txq(tx_ring),
+                                 total_packets, total_bytes);
+
 #define TX_WAKE_THRESHOLD (DESC_NEEDED * 2)
        if (unlikely(total_packets && netif_carrier_ok(tx_ring->netdev) &&
                     (ixgbe_desc_unused(tx_ring) >= TX_WAKE_THRESHOLD))) {
@@ -2617,6 +2620,8 @@ void ixgbe_configure_tx_ring(struct ixgbe_adapter *adapter,
        /* enable queue */
        IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(reg_idx), txdctl);
 
+       netdev_tx_reset_queue(txring_txq(ring));
+
        /* TXDCTL.EN will return 0 on 82598 if link is down, so skip it */
        if (hw->mac.type == ixgbe_mac_82598EB &&
            !(IXGBE_READ_REG(hw, IXGBE_LINKS) & IXGBE_LINKS_UP))
@@ -6808,6 +6813,8 @@ static void ixgbe_tx_map(struct ixgbe_ring *tx_ring,
        tx_buffer_info->gso_segs = gso_segs;
        tx_buffer_info->skb = skb;
 
+       netdev_tx_sent_queue(txring_txq(tx_ring), tx_buffer_info->bytecount);
+
        /* set the timestamp */
        first->time_stamp = jiffies;