stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.9 1/5] qed: Fix the VF msix vectors flow
@ 2021-08-30 12:00 Sasha Levin
  2021-08-30 12:00 ` [PATCH AUTOSEL 4.9 2/5] qede: Fix memset corruption Sasha Levin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sasha Levin @ 2021-08-30 12:00 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Shai Malin, Prabhakar Kushwaha, Ariel Elior, David S . Miller,
	Sasha Levin, netdev

From: Shai Malin <smalin@marvell.com>

[ 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>
---
 drivers/net/ethernet/qlogic/qed/qed_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c
index 708117fc6f73..7669d36151c6 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_main.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
@@ -374,7 +374,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;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-30 12:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 12:00 [PATCH AUTOSEL 4.9 1/5] qed: Fix the VF msix vectors flow Sasha Levin
2021-08-30 12:00 ` [PATCH AUTOSEL 4.9 2/5] qede: Fix memset corruption Sasha Levin
2021-08-30 12:00 ` [PATCH AUTOSEL 4.9 3/5] perf/x86/amd/ibs: Work around erratum #1197 Sasha Levin
2021-08-30 12:00 ` [PATCH AUTOSEL 4.9 4/5] net: fix NULL pointer reference in cipso_v4_doi_free Sasha Levin
2021-08-30 12:00 ` [PATCH AUTOSEL 4.9 5/5] cryptoloop: add a deprecation warning Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).