Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50f73f31 authored by Shai Malin's avatar Shai Malin Committed by Greg Kroah-Hartman
Browse files

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: 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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 92abb09f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -559,7 +559,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;