Commit ca12c9d4 authored by Patryk Małek's avatar Patryk Małek Committed by Jeff Kirsher

i40e: Fix recalculation of MSI-X vectors for VMDq

This patch adds a recalculation of number of MSI-X
vectors for VMDq in the case where we have less
vectors available than we would want to reserve for
VMDq.

It fixes the issue where we recalculate vectors left
and vectors wanted but we didn't take into account
the reduced number of queue pairs per VSI.
Signed-off-by: default avatarPatryk Małek <patryk.malek@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 132ee00e
...@@ -10309,21 +10309,28 @@ static int i40e_init_msix(struct i40e_pf *pf) ...@@ -10309,21 +10309,28 @@ static int i40e_init_msix(struct i40e_pf *pf)
/* any vectors left over go for VMDq support */ /* any vectors left over go for VMDq support */
if (pf->flags & I40E_FLAG_VMDQ_ENABLED) { if (pf->flags & I40E_FLAG_VMDQ_ENABLED) {
int vmdq_vecs_wanted = pf->num_vmdq_vsis * pf->num_vmdq_qps;
int vmdq_vecs = min_t(int, vectors_left, vmdq_vecs_wanted);
if (!vectors_left) { if (!vectors_left) {
pf->num_vmdq_msix = 0; pf->num_vmdq_msix = 0;
pf->num_vmdq_qps = 0; pf->num_vmdq_qps = 0;
} else { } else {
int vmdq_vecs_wanted =
pf->num_vmdq_vsis * pf->num_vmdq_qps;
int vmdq_vecs =
min_t(int, vectors_left, vmdq_vecs_wanted);
/* if we're short on vectors for what's desired, we limit /* if we're short on vectors for what's desired, we limit
* the queues per vmdq. If this is still more than are * the queues per vmdq. If this is still more than are
* available, the user will need to change the number of * available, the user will need to change the number of
* queues/vectors used by the PF later with the ethtool * queues/vectors used by the PF later with the ethtool
* channels command * channels command
*/ */
if (vmdq_vecs < vmdq_vecs_wanted) if (vectors_left < vmdq_vecs_wanted) {
pf->num_vmdq_qps = 1; pf->num_vmdq_qps = 1;
vmdq_vecs_wanted = pf->num_vmdq_vsis;
vmdq_vecs = min_t(int,
vectors_left,
vmdq_vecs_wanted);
}
pf->num_vmdq_msix = pf->num_vmdq_qps; pf->num_vmdq_msix = pf->num_vmdq_qps;
v_budget += vmdq_vecs; v_budget += vmdq_vecs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment