From 3065267a80c88d775e8eb34196280e8eee33322f Mon Sep 17 00:00:00 2001 From: "Matthew R. Ochs" Date: Wed, 12 Apr 2017 14:15:53 -0500 Subject: 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 Signed-off-by: Uma Krishnan Signed-off-by: Martin K. Petersen --- drivers/scsi/cxlflash/common.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'drivers/scsi/cxlflash/common.h') 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]; } -- cgit