]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ixgbe: Default to queue pairs when number of queues is less than CPUs
authorAlexander Duyck <alexander.h.duyck@intel.com>
Fri, 10 Feb 2012 02:08:37 +0000 (02:08 +0000)
committerJoe Jin <joe.jin@oracle.com>
Thu, 17 May 2012 15:04:34 +0000 (23:04 +0800)
The old code had several errors in how it was determining the vector
budget.  In order to simplify things this patch updates the code so that it
will attempt to always allocated paired Rx/Tx vectors instead of attempting
to allocate individual vectors when the number of queues is less than the
number of CPUs.

(cherry picked from commit 8f15486dd0f6e8423cb33fa8513ed9d074476471)
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/ixgbe/ixgbe.h
drivers/net/ixgbe/ixgbe_main.c

index e39e887b0295c596b7d8869f0147525240b0b220..dd6ce603d056e6ff710dc36bab3c7d0dbfc395a9 100644 (file)
@@ -368,7 +368,7 @@ static inline u16 ixgbe_desc_unused(struct ixgbe_ring *ring)
 #define MAX_MSIX_Q_VECTORS MAX_MSIX_Q_VECTORS_82599
 #define MAX_MSIX_COUNT MAX_MSIX_VECTORS_82599
 
-#define MIN_MSIX_Q_VECTORS 2
+#define MIN_MSIX_Q_VECTORS 1
 #define MIN_MSIX_COUNT (MIN_MSIX_Q_VECTORS + NON_Q_VECTORS)
 
 /* default to trying for four seconds */
index 2a601ddce73c97922343a236f1407960083284ff..af048237561a587d8ded2f9faa6a79073378fafd 100644 (file)
@@ -4545,11 +4545,9 @@ static void ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter,
 {
        int err, vector_threshold;
 
-       /* We'll want at least 3 (vector_threshold):
-        * 1) TxQ[0] Cleanup
-        * 2) RxQ[0] Cleanup
-        * 3) Other (Link Status Change, etc.)
-        * 4) TCP Timer (optional)
+       /* We'll want at least 2 (vector_threshold):
+        * 1) TxQ[0] + RxQ[0] handler
+        * 2) Other (Link Status Change, etc.)
         */
        vector_threshold = MIN_MSIX_COUNT;
 
@@ -4903,9 +4901,11 @@ static int ixgbe_set_interrupt_capability(struct ixgbe_adapter *adapter)
         * doesn't do us much good if we have a lot more vectors
         * than CPU's.  So let's be conservative and only ask for
         * (roughly) the same number of vectors as there are CPU's.
+        * The default is to use pairs of vectors.
         */
-       v_budget = min(adapter->num_rx_queues + adapter->num_tx_queues,
-                      (int)num_online_cpus()) + NON_Q_VECTORS;
+       v_budget = max(adapter->num_rx_queues, adapter->num_tx_queues);
+       v_budget = min_t(int, v_budget, num_online_cpus());
+       v_budget += NON_Q_VECTORS;
 
        /*
         * At the same time, hardware can only support a maximum of