qla2x00t-32gbit: Fix WARN_ON in qla_nvme_register_hba

qla_nvme_register_hba() puts out a warning when there are not enough queue
pairs available for FC-NVME.  Just fail the NVME registration rather than a
WARNING + call Trace.

Link: https://lore.kernel.org/r/20200806111014.28434-8-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

See also upstream commit 897d68eb816bfae5ad9e870f68350dbb599d6e0e.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9134 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2020-08-29 15:43:39 +00:00
parent 426ee6a956
commit 49ba5cf318
2 changed files with 10 additions and 1 deletions

View File

@@ -3907,6 +3907,7 @@ struct qla_hw_data {
uint32_t scm_supported_f:1;
/* Enabled in Driver */
uint32_t scm_enabled:1;
uint32_t max_req_queue_warned:1;
} flags;
uint16_t max_exchg;

View File

@@ -708,7 +708,15 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
tmpl = &qla_nvme_fc_transport;
WARN_ON(vha->nvme_local_port);
WARN_ON(ha->max_req_queues < 3);
if (ha->max_req_queues < 3) {
if (!ha->flags.max_req_queue_warned)
ql_log(ql_log_info, vha, 0x2120,
"%s: Disabling FC-NVME due to lack of free queue pairs (%d).\n",
__func__, ha->max_req_queues);
ha->flags.max_req_queue_warned = 1;
return ret;
}
qla_nvme_fc_transport.max_hw_queues =
min((uint8_t)(qla_nvme_fc_transport.max_hw_queues),