scsi: lpfc: Driver NVME load fails when CPU cnt > WQ resource cnt
authorJames Smart <jsmart2021@gmail.com>
Sat, 5 May 2018 03:37:54 +0000 (20:37 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 8 May 2018 05:03:16 +0000 (01:03 -0400)
commitd38f33b304229b0445c3292ebf2b7bf24dda6917
treecf4b7e834885c1312c23750b9c02748ef1ae2987
parent23288b78a140a6a527187730754021a6a0c0cea6
scsi: lpfc: Driver NVME load fails when CPU cnt > WQ resource cnt

If the cpu count is larger than the number of WQ resources available,
adapter attachment eventually failes due to a WQ_CREATE failure.

Calculate the number of WQs desired (which initializes to cpu count)
after accounting for the number of queues the adapter supports and the
number allocated to SCSI and the control/ELS path, and scale down if
necessary.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_init.c