summaryrefslogtreecommitdiff
path: root/drivers/scsi/cxlflash/common.h
diff options
context:
space:
mode:
authorMatthew R. Ochs <mrochs@linux.vnet.ibm.com>2017-04-12 22:15:53 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2017-04-14 05:55:42 +0300
commit3065267a80c88d775e8eb34196280e8eee33322f (patch)
tree258a79921e0fe61e2b9b12efe1b26a41d1179ff6 /drivers/scsi/cxlflash/common.h
parentbfc0bab172cabf3bb25c48c4c521b317ff4a909d (diff)
downloadlinux-3065267a80c88d775e8eb34196280e8eee33322f.tar.xz
scsi: cxlflash: Add hardware queues attribute
As staging for supporting multiple hardware queues, add an attribute to show and set the current number of hardware queues for the host. Support specifying a hard limit or a CPU affinitized value. This will allow the number of hardware queues to be tuned by a system administrator. 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.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi/cxlflash/common.h
index b5858ae1deae..8fd7a1fa235e 100644
--- a/drivers/scsi/cxlflash/common.h
+++ b/drivers/scsi/cxlflash/common.h
@@ -60,7 +60,9 @@ extern const struct file_operations cxlflash_cxl_fops;
/* SQ for master issued cmds */
#define NUM_SQ_ENTRY CXLFLASH_MAX_CMDS
-#define CXLFLASH_NUM_HWQS 1
+/* Hardware queue definitions */
+#define CXLFLASH_DEF_HWQS 1
+#define CXLFLASH_MAX_HWQS 8
#define PRIMARY_HWQ 0
@@ -201,7 +203,7 @@ struct hwq {
} __aligned(cache_line_size());
struct afu {
- struct hwq hwqs[CXLFLASH_NUM_HWQS];
+ struct hwq hwqs[CXLFLASH_MAX_HWQS];
int (*send_cmd)(struct afu *, struct afu_cmd *);
void (*context_reset)(struct afu_cmd *);
@@ -211,6 +213,8 @@ 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 */
char version[16];
u64 interface_version;
@@ -221,7 +225,7 @@ struct afu {
static inline struct hwq *get_hwq(struct afu *afu, u32 index)
{
- WARN_ON(index >= CXLFLASH_NUM_HWQS);
+ WARN_ON(index >= CXLFLASH_MAX_HWQS);
return &afu->hwqs[index];
}