Commit b0cd0853 authored by Shai Malin's avatar Shai Malin Committed by David S. Miller

qed: Fix the VF msix vectors flow

For VFs we should return with an error in case we didn't get the exact
number of msix vectors as we requested.
Not doing that will lead to a crash when starting queues for this VF.
Signed-off-by: default avatarPrabhakar Kushwaha <pkushwaha@marvell.com>
Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
Signed-off-by: default avatarShai Malin <smalin@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 14315498
...@@ -616,7 +616,12 @@ static int qed_enable_msix(struct qed_dev *cdev, ...@@ -616,7 +616,12 @@ static int qed_enable_msix(struct qed_dev *cdev,
rc = cnt; rc = cnt;
} }
if (rc > 0) { /* For VFs, we should return with an error in case we didn't get the
* exact number of msix vectors as we requested.
* Not doing that will lead to a crash when starting queues for
* this VF.
*/
if ((IS_PF(cdev) && rc > 0) || (IS_VF(cdev) && rc == cnt)) {
/* MSI-x configuration was achieved */ /* MSI-x configuration was achieved */
int_params->out.int_mode = QED_INT_MODE_MSIX; int_params->out.int_mode = QED_INT_MODE_MSIX;
int_params->out.num_vectors = rc; int_params->out.num_vectors = rc;
......
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