scsi: fnic: Add support for multiqueue (MQ) in fnic driver
authorKaran Tilak Kumar <kartilak@cisco.com>
Mon, 11 Dec 2023 17:36:15 +0000 (09:36 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 14 Dec 2023 03:11:34 +0000 (22:11 -0500)
commitc81df08cd2944f89921033e5f1744ae2960f4e69
treea2d959b0310eb642b29c3425ef595e8243aa83aa
parent52f6e196e52ef834f928aac297d895f4c32276ea
scsi: fnic: Add support for multiqueue (MQ) in fnic driver

Implement support for MQ in fnic driver:

The block multiqueue layer issues IO to the fnic driver with an MQ tag. Use
the mqtag and derive a tag from it.  Derive the hardware queue from the
mqtag and use it in all paths. Modify queuecommand to handle mqtag.

Replace wq and cq indices to support MQ. Replace the zeroth queue with a
hardware queue.  Implement spin locks on a per hardware queue basis.
Replace io_lock with per hardware queue spinlock.  Implement out of range
tag checks.

Allocate an io_req_table to track status of the io_req.

Test the driver by building it, loading it, and configuring 64 queues in
UCSM. Issue IOs using Medusa on multiple fnics. Enable/disable links to
exercise the abort and clean up path.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202310300032.2awCqkfn-lkp@intel.com/
Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com>
Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com>
Tested-by: Karan Tilak Kumar <kartilak@cisco.com>
Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com>
Link: https://lore.kernel.org/r/20231211173617.932990-12-kartilak@cisco.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/fnic/fnic.h
drivers/scsi/fnic/fnic_main.c
drivers/scsi/fnic/fnic_scsi.c