summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShai Malin <smalin@marvell.com>2021-08-22 22:21:14 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-09-22 11:47:46 +0200
commitc1290961f2824a44618d4cb3f0ee5bdb8224bbe3 (patch)
treeb872451306ecb61f505832c18769df6fb2c1fee7
parent42150e1b46a474541f677c759ac61599277c8a9c (diff)
downloadlinux-stable-c1290961f2824a44618d4cb3f0ee5bdb8224bbe3.tar.gz
linux-stable-c1290961f2824a44618d4cb3f0ee5bdb8224bbe3.tar.bz2
linux-stable-c1290961f2824a44618d4cb3f0ee5bdb8224bbe3.zip
qed: Fix the VF msix vectors flow
[ Upstream commit b0cd08537db8d2fbb227cdb2e5835209db295a24 ] 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: Prabhakar Kushwaha <pkushwaha@marvell.com> Signed-off-by: Ariel Elior <aelior@marvell.com> Signed-off-by: Shai Malin <smalin@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/ethernet/qlogic/qed/qed_main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c
index 049a83b40e46..9d77f318d11e 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_main.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
@@ -439,7 +439,12 @@ static int qed_enable_msix(struct qed_dev *cdev,
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 */
int_params->out.int_mode = QED_INT_MODE_MSIX;
int_params->out.num_vectors = rc;