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

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
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -616,7 +616,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;