summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
authorDamien Le Moal <damien.lemoal@wdc.com>2020-04-22 13:42:18 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2020-05-05 07:37:32 +0300
commit380603a5bb83d3c55eee20511ba3091e206b7d99 (patch)
tree298baa06b24ba8f6ead294ab6c9ed6bfb5b8006e /drivers/scsi/scsi_debug.c
parent9267e0eb41fedc2d4b930a90aca17051fa1ef21a (diff)
downloadlinux-380603a5bb83d3c55eee20511ba3091e206b7d99.tar.xz
scsi: scsi_debug: Add zone_max_open module parameter
Add the zone_max_open module parameters to control the maximum number of open zones of a ZBC device. This parameter is ignored for device types other than 0x14 (zbc=2 case). Link: https://lore.kernel.org/r/20200422104221.378203-5-damien.lemoal@wdc.com Signed-off-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r--drivers/scsi/scsi_debug.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index d0ac1f584205..31e8d0b02747 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -822,7 +822,7 @@ static int dif_errors;
/* ZBC global data */
static bool sdeb_zbc_in_use; /* true when ptype=TYPE_ZBC [0x14] */
static const int zbc_zone_size_mb;
-static const int zbc_max_open_zones = DEF_ZBC_MAX_OPEN_ZONES;
+static int sdeb_zbc_max_open = DEF_ZBC_MAX_OPEN_ZONES;
static int submit_queues = DEF_SUBMIT_QUEUES; /* > 1 for multi-queue (mq) */
static struct sdebug_queue *sdebug_q_arr; /* ptr to array of submit queues */
@@ -4788,10 +4788,10 @@ static int sdebug_device_create_zones(struct sdebug_dev_info *devip)
devip->nr_zones = (capacity + devip->zsize - 1) >> devip->zsize_shift;
/* zbc_max_open_zones can be 0, meaning "not reported" (no limit) */
- if (zbc_max_open_zones >= devip->nr_zones - 1)
+ if (sdeb_zbc_max_open >= devip->nr_zones - 1)
devip->max_open = (devip->nr_zones - 1) / 2;
else
- devip->max_open = zbc_max_open_zones;
+ devip->max_open = sdeb_zbc_max_open;
devip->zstate = kcalloc(devip->nr_zones,
sizeof(struct sdeb_zone_state), GFP_KERNEL);
@@ -5540,6 +5540,7 @@ module_param_named(wp, sdebug_wp, bool, S_IRUGO | S_IWUSR);
module_param_named(write_same_length, sdebug_write_same_length, int,
S_IRUGO | S_IWUSR);
module_param_named(zbc, sdeb_zbc_model_s, charp, S_IRUGO);
+module_param_named(zone_max_open, sdeb_zbc_max_open, int, S_IRUGO);
MODULE_AUTHOR("Eric Youngdale + Douglas Gilbert");
MODULE_DESCRIPTION("SCSI debug adapter driver");
@@ -5602,6 +5603,7 @@ MODULE_PARM_DESC(vpd_use_hostno, "0 -> dev ids ignore hostno (def=1 -> unique de
MODULE_PARM_DESC(wp, "Write Protect (def=0)");
MODULE_PARM_DESC(write_same_length, "Maximum blocks per WRITE SAME cmd (def=0xffff)");
MODULE_PARM_DESC(zbc, "'none' [0]; 'aware' [1]; 'managed' [2] (def=0). Can have 'host-' prefix");
+MODULE_PARM_DESC(zone_max_open, "Maximum number of open zones; [0] for no limit (def=auto)");
#define SDEBUG_INFO_LEN 256
static char sdebug_info[SDEBUG_INFO_LEN];