James Smart 3ad348d944 scsi: lpfc: Fix oops when fewer hdwqs than cpus
When tearing down the adapter for a reset, online/offline, or driver
unload, the queue free routine would hit a GPF oops.  This only occurs on
conditions where the number of hardware queues created is fewer than the
number of cpus in the system. In this condition cpus share a hardware
queue. And of course, it's the 2nd cpu that shares a hardware that
attempted to free it a second time and hit the oops.

Fix by reworking the cpu to hardware queue mapping such that:
Assignment of hardware queues to cpus occur in two passes:
first pass: is first time assignment of a hardware queue to a cpu.
  This will set the LPFC_CPU_FIRST_IRQ flag for the cpu.
second pass: for cpus that did not get a hardware queue they will
  be assigned one from a primary cpu (one set in first pass).

Deletion of hardware queues is driven by cpu itteration, and queues
will only be deleted if the LPFC_CPU_FIRST_IRQ flag is set.

Also contains a few small cleanup fixes and a little better logging.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-08-19 22:41:09 -04:00
..
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-06-02 09:26:34 -07:00
2019-07-20 10:04:58 -07:00
2019-07-20 10:04:58 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:17:41 -07:00
2019-03-02 11:39:54 -08:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:17:41 -07:00
2018-12-18 23:19:21 -05:00
2019-07-11 15:17:41 -07:00
2019-01-08 21:58:35 -05:00
2019-01-08 21:58:35 -05:00
2019-07-20 10:04:58 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-06-18 19:46:18 -04:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:17:41 -07:00
2018-12-18 23:19:21 -05:00
2018-11-06 21:31:28 -05:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:17:41 -07:00
2018-12-28 14:48:06 -08:00
2019-05-20 10:56:43 -04:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2019-07-20 10:04:58 -07:00
2019-07-11 15:14:01 -07:00
2019-07-11 15:14:01 -07:00
2018-12-18 23:19:21 -05:00
2019-05-21 06:16:23 -04:00
2019-07-11 15:14:01 -07:00
2019-07-20 10:04:58 -07:00
2019-07-11 15:17:41 -07:00
2019-07-11 15:14:01 -07:00