scsi: pm8001: Expose hardware queues for pm80xx
authorJohn Garry <john.garry@huawei.com>
Fri, 10 Jun 2022 16:46:42 +0000 (00:46 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 17 Jun 2022 01:45:09 +0000 (21:45 -0400)
commit42f22fe36d51a621a065352898e369bd7983107f
tree11b7def7dba8702c849452f5eeef4eb16e7cda11
parent940f5efa63161642b32b8dd82c17089b8ada7cbb
scsi: pm8001: Expose hardware queues for pm80xx

In commit 05c6c029a44d ("scsi: pm80xx: Increase number of supported
queues"), support for 80xx chip was improved by enabling multiple HW
queues.

In this, like other SCSI MQ HBA drivers at the time, the HW queues were not
exposed to upper layer, and instead the driver managed the queues
internally.

However, this management duplicates blk-mq code. In addition, the HW queue
management is sub-optimal for a system where the number of CPUs exceeds the
HW queues - this is because queues are selected in a round-robin fashion,
when it would be better to make adjacent CPUs submit on the same queue. And
finally, the affinity of the completion queue interrupts is not set to
mirror the cpu<->HQ queue mapping, which is suboptimal.

As such, for when MSIX is supported, expose HW queues to upper layer. We
always use queue index #0 for "internal" commands, i.e. anything which does
not come from the block layer, so omit this from the affinity spreading.

Link: https://lore.kernel.org/r/1654879602-33497-5-git-send-email-john.garry@huawei.com
Tested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/pm8001/pm8001_init.c
drivers/scsi/pm8001/pm8001_sas.h
drivers/scsi/pm8001/pm80xx_hwi.c