i40e: don't add more vectors to num_lan_msix than number of CPUs
authorJacob Keller <jacob.e.keller@intel.com>
Tue, 24 Jan 2017 18:24:01 +0000 (10:24 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 15 Mar 2017 08:57:44 +0000 (01:57 -0700)
commitc0cf70a6fc373570f86c6dc4799d775363b9946e
tree15919091a5fe7eda2c301db0e437c4f983feefa2
parent0ef2d5afb12d379f4dd5df696219a01b88bb778a
i40e: don't add more vectors to num_lan_msix than number of CPUs

This is a solution to avoid adding too many queues to num_lan_msix.
A recent refactor of queue pairs accidentally added all remaining
vectors to the num_lan_msix which can have adverse performance issues,
due to enabling more queues than the number of CPU cores.

This patch removes the old calculation, and replaces it with a simple
algorithm.

1) add queue pairs up to num_online_cpus(), but capped at half of total
   vectors
2) then add alternative features such as flow directory and similar
3) finally, add the remaining vectors back to queue pairs, but capped
   such that the total number of queue pairs does not exceed
   num_online_cpus().

Change-ID: I668abf67d5011a1248866daba8885f4ff00cb8d9
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c