Skip to content

Commit bb13ace

Browse files
Sudarsana Reddy Kallurudavem330
authored andcommitted
qed: Prevent 100g from working in MSI
Adapter can support 100g in both MSIx and INTa, but not in MSI. Signed-off-by: Sudarsana Reddy Kalluru <[email protected]> Signed-off-by: Yuval Mintz <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1af9dcf commit bb13ace

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

drivers/net/ethernet/qlogic/qed/qed_dev.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,11 @@ int qed_hw_init(struct qed_dev *cdev,
835835
u32 load_code, param;
836836
int rc, mfw_rc, i;
837837

838+
if ((int_mode == QED_INT_MODE_MSI) && (cdev->num_hwfns > 1)) {
839+
DP_NOTICE(cdev, "MSI mode is not supported for CMT devices\n");
840+
return -EINVAL;
841+
}
842+
838843
if (IS_PF(cdev)) {
839844
rc = qed_init_fw_data(cdev, bin_fw_data);
840845
if (rc != 0)

drivers/net/ethernet/qlogic/qed/qed_main.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -413,15 +413,17 @@ static int qed_set_int_mode(struct qed_dev *cdev, bool force_mode)
413413
/* Fallthrough */
414414

415415
case QED_INT_MODE_MSI:
416-
rc = pci_enable_msi(cdev->pdev);
417-
if (!rc) {
418-
int_params->out.int_mode = QED_INT_MODE_MSI;
419-
goto out;
420-
}
416+
if (cdev->num_hwfns == 1) {
417+
rc = pci_enable_msi(cdev->pdev);
418+
if (!rc) {
419+
int_params->out.int_mode = QED_INT_MODE_MSI;
420+
goto out;
421+
}
421422

422-
DP_NOTICE(cdev, "Failed to enable MSI\n");
423-
if (force_mode)
424-
goto out;
423+
DP_NOTICE(cdev, "Failed to enable MSI\n");
424+
if (force_mode)
425+
goto out;
426+
}
425427
/* Fallthrough */
426428

427429
case QED_INT_MODE_INTA:

0 commit comments

Comments
 (0)