]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ice: Allow 2 queue pairs per VF on SR-IOV initialization
authorBrett Creeley <brett.creeley@intel.com>
Thu, 30 Jul 2020 00:19:16 +0000 (17:19 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Sat, 1 Aug 2020 15:44:04 +0000 (08:44 -0700)
Currently VFs are only allowed to get 16, 4, and 1 queue pair by
default, which require 17, 5, and 2 MSI-X vectors respectively. This
is because each VF needs a MSI-X per data queue and a MSI-X for its
other interrupt. The calculation is based on the number of VFs created,
MSI-X available, and queue pairs available at the time of VF creation.

Unfortunately the values above exclude 2 queue pairs when only 3 MSI-X
are available to each VF based on resource constraints. The current
calculation would default to 2 MSI-X and 1 queue pair. This is a waste
of resources, so fix this by allowing 2 queue pairs per VF when there
are between 2 and 5 MSI-X available per VF.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h

index 7061730f0f37459583a830ac76e46be0af329910..cfdd820e9a2ae09a12ea638caa3aac7c37929973 100644 (file)
@@ -932,6 +932,8 @@ static int ice_set_per_vf_res(struct ice_pf *pf)
                num_msix_per_vf = ICE_NUM_VF_MSIX_MED;
        } else if (msix_avail_per_vf >= ICE_NUM_VF_MSIX_SMALL) {
                num_msix_per_vf = ICE_NUM_VF_MSIX_SMALL;
+       } else if (msix_avail_per_vf >= ICE_NUM_VF_MSIX_MULTIQ_MIN) {
+               num_msix_per_vf = ICE_NUM_VF_MSIX_MULTIQ_MIN;
        } else if (msix_avail_per_vf >= ICE_MIN_INTR_PER_VF) {
                num_msix_per_vf = ICE_MIN_INTR_PER_VF;
        } else {
index 049e0b583383bb0a4364e1b6161ae2fe3d606536..0f519fba3770d3d3b4f250b69158c53f1170293b 100644 (file)
@@ -32,6 +32,7 @@
 #define ICE_MAX_RSS_QS_PER_VF          16
 #define ICE_NUM_VF_MSIX_MED            17
 #define ICE_NUM_VF_MSIX_SMALL          5
+#define ICE_NUM_VF_MSIX_MULTIQ_MIN     3
 #define ICE_MIN_INTR_PER_VF            (ICE_MIN_QS_PER_VF + 1)
 #define ICE_MAX_VF_RESET_TRIES         40
 #define ICE_MAX_VF_RESET_SLEEP_MS      20