Skip to content

Commit 722477c

Browse files
Thomas Bogendoerfermartinkpetersen
authored andcommitted
scsi: qedf: Limit number of CQs
FCOE offloading failed with: [qed_sp_fcoe_func_start:150(sp-0-3b:00.02)]Cannot satisfy CQ amount. CQs requested 8, CQs available 6. Aborting function start [qed_fcoe_start:821()]Failed to start fcoe [__qedf_probe:3041]:6: Cannot start FCoE function. The reason is a newly introduced check in the qed main part. This change also provides the information about how many CQs are available, so we simply limit the number of requested CQs.. Fixes: 3c5da94 ("qed: Share additional information with qedf") Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Acked-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent f9f22a8 commit 722477c

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

drivers/scsi/qedf/qedf.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,8 @@ struct fip_vlan {
528528
#define QEDF_WRITE (1 << 0)
529529
#define MAX_FIBRE_LUNS 0xffffffff
530530

531-
#define QEDF_MAX_NUM_CQS 8
531+
#define MIN_NUM_CPUS_MSIX(x) min_t(u32, x->dev_info.num_cqs, \
532+
num_online_cpus())
532533

533534
/*
534535
* PCI function probe defines

drivers/scsi/qedf/qedf_main.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2760,11 +2760,9 @@ static int qedf_set_fcoe_pf_param(struct qedf_ctx *qedf)
27602760
* we allocation is the minimum off:
27612761
*
27622762
* Number of CPUs
2763-
* Number of MSI-X vectors
2764-
* Max number allocated in hardware (QEDF_MAX_NUM_CQS)
2763+
* Number allocated by qed for our PCI function
27652764
*/
2766-
qedf->num_queues = min((unsigned int)QEDF_MAX_NUM_CQS,
2767-
num_online_cpus());
2765+
qedf->num_queues = MIN_NUM_CPUS_MSIX(qedf);
27682766

27692767
QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC, "Number of CQs is %d.\n",
27702768
qedf->num_queues);
@@ -2962,6 +2960,13 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
29622960
goto err1;
29632961
}
29642962

2963+
/* Learn information crucial for qedf to progress */
2964+
rc = qed_ops->fill_dev_info(qedf->cdev, &qedf->dev_info);
2965+
if (rc) {
2966+
QEDF_ERR(&(qedf->dbg_ctx), "Failed to dev info.\n");
2967+
goto err1;
2968+
}
2969+
29652970
/* queue allocation code should come here
29662971
* order should be
29672972
* slowpath_start
@@ -2977,13 +2982,6 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
29772982
}
29782983
qed_ops->common->update_pf_params(qedf->cdev, &qedf->pf_params);
29792984

2980-
/* Learn information crucial for qedf to progress */
2981-
rc = qed_ops->fill_dev_info(qedf->cdev, &qedf->dev_info);
2982-
if (rc) {
2983-
QEDF_ERR(&(qedf->dbg_ctx), "Failed to dev info.\n");
2984-
goto err1;
2985-
}
2986-
29872985
/* Record BDQ producer doorbell addresses */
29882986
qedf->bdq_primary_prod = qedf->dev_info.primary_dbq_rq_addr;
29892987
qedf->bdq_secondary_prod = qedf->dev_info.secondary_bdq_rq_addr;

0 commit comments

Comments
 (0)