Skip to content

Commit c81df08

Browse files
Karan Tilak Kumarmartinkpetersen
authored andcommitted
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 <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Reviewed-by: Sesidhar Baddela <[email protected]> Reviewed-by: Arulprabhu Ponnusamy <[email protected]> Tested-by: Karan Tilak Kumar <[email protected]> Signed-off-by: Karan Tilak Kumar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 52f6e19 commit c81df08

File tree

3 files changed

+328
-254
lines changed

3 files changed

+328
-254
lines changed

drivers/scsi/fnic/fnic.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#define FNIC_MIN_IO_REQ 256 /* Min IO throttle count */
3737
#define FNIC_MAX_IO_REQ 1024 /* scsi_cmnd tag map entries */
3838
#define FNIC_DFLT_IO_REQ 256 /* Default scsi_cmnd tag map entries */
39-
#define FNIC_IO_LOCKS 64 /* IO locks: power of 2 */
4039
#define FNIC_DFLT_QUEUE_DEPTH 256
4140
#define FNIC_STATS_RATE_LIMIT 4 /* limit rate at which stats are pulled up */
4241

@@ -300,7 +299,6 @@ struct fnic {
300299
struct fnic_host_tag *tags;
301300
mempool_t *io_req_pool;
302301
mempool_t *io_sgl_pool[FNIC_SGL_NUM_CACHES];
303-
spinlock_t io_req_lock[FNIC_IO_LOCKS]; /* locks for scsi cmnds */
304302

305303
unsigned int copy_wq_base;
306304
struct work_struct link_work;

drivers/scsi/fnic/fnic_main.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -794,11 +794,6 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
794794
fnic->fw_ack_index[i] = -1;
795795
}
796796

797-
for (i = 0; i < FNIC_IO_LOCKS; i++)
798-
spin_lock_init(&fnic->io_req_lock[i]);
799-
800-
spin_lock_init(&fnic->sgreset_lock);
801-
802797
err = -ENOMEM;
803798
fnic->io_req_pool = mempool_create_slab_pool(2, fnic_io_req_cache);
804799
if (!fnic->io_req_pool)

0 commit comments

Comments
 (0)