Skip to contentSkip to conversation

qed: Fix the VF msix vectors flow

PATCH Applied Shai Malin 2 participants 2 messages Aug 22, 2021 – Aug 24, 2021

Subsystems (3)
lore
Share & tools
lore

Shai Malin

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/ethernet/qlogic/qed/qed_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/qlogic/qed/qed_main.c +6 -1
index 6871d892eabf..15ef59aa34ff 100644
@@ -615,7 +615,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;
Signature · 1 line
2.22.0
#1 lore raw
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

Quoted 9 lines · On Sun, 22 Aug 2021 22:21:14 +0300 you wrote:

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.

[...]

Here is the summary with links:
- qed: Fix the VF msix vectors flow

    https://git.kernel.org/netdev/net/c/b0cd08537db8

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html