diff options
author | Matthew R. Ochs <mrochs@linux.vnet.ibm.com> | 2017-04-12 21:16:02 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-04-14 04:55:42 +0200 |
commit | 1dd0c0e4fd02dc5e5bfaf89bd4656aabe4ae3cb3 (patch) | |
tree | 2f636a441569397b3cebb2922e9667a3a021bf24 /drivers/scsi/cxlflash/common.h | |
parent | scsi: cxlflash: Add hardware queues attribute (diff) | |
download | linux-1dd0c0e4fd02dc5e5bfaf89bd4656aabe4ae3cb3.tar.xz linux-1dd0c0e4fd02dc5e5bfaf89bd4656aabe4ae3cb3.zip |
scsi: cxlflash: Introduce hardware queue steering
As an enhancement to distribute requests to multiple hardware queues, add the
infrastructure to hash a SCSI command into a particular hardware queue.
Support the following scenarios when deriving which queue to use: single
queue, tagging when SCSI-MQ enabled, and simple hash via CPU ID when SCSI-MQ
is disabled. Rather than altering the existing send API, the derived hardware
queue is stored in the AFU command where it can be used for sending a command
to the chosen hardware queue.
Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/cxlflash/common.h')
-rw-r--r-- | drivers/scsi/cxlflash/common.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi/cxlflash/common.h index 8fd7a1fa235e..256af819377d 100644 --- a/drivers/scsi/cxlflash/common.h +++ b/drivers/scsi/cxlflash/common.h @@ -96,6 +96,13 @@ enum cxlflash_state { STATE_FAILTERM /* Failed/terminating state, error out users/threads */ }; +enum cxlflash_hwq_mode { + HWQ_MODE_RR, /* Roundrobin (default) */ + HWQ_MODE_TAG, /* Distribute based on block MQ tag */ + HWQ_MODE_CPU, /* CPU affinity */ + MAX_HWQ_MODE +}; + /* * Each context has its own set of resource handles that is visible * only from that context. @@ -146,9 +153,9 @@ struct afu_cmd { struct scsi_cmnd *scp; struct completion cevent; struct list_head queue; + u32 hwq_index; u8 cmd_tmf:1; - u32 hwq_index; /* As per the SISLITE spec the IOARCB EA has to be 16-byte aligned. * However for performance reasons the IOARCB/IOASA should be @@ -213,8 +220,11 @@ struct afu { atomic_t cmds_active; /* Number of currently active AFU commands */ u64 hb; u32 internal_lun; /* User-desired LUN mode for this AFU */ + u32 num_hwqs; /* Number of hardware queues */ u32 desired_hwqs; /* Desired h/w queues, effective on AFU reset */ + enum cxlflash_hwq_mode hwq_mode; /* Steering mode for h/w queues */ + u32 hwq_rr_count; /* Count to distribute traffic for roundrobin */ char version[16]; u64 interface_version; |