From: Douglas Gilbert <dgilbert@interlog.com>
To: linux-scsi@vger.kernel.org
Cc: martin.petersen@oracle.com, jejb@linux.vnet.ibm.com,
hare@suse.de, Damien.LeMoal@wdc.com,
Damien Le Moal <damien.lemoal@wdc.com>
Subject: [PATCH v4 11/14] scsi_debug: zone_max_open module parameter
Date: Tue, 25 Feb 2020 01:23:48 -0500 [thread overview]
Message-ID: <20200225062351.21267-12-dgilbert@interlog.com> (raw)
In-Reply-To: <20200225062351.21267-1-dgilbert@interlog.com>
From: Damien Le Moal <damien.lemoal@wdc.com>
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).
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
---
drivers/scsi/scsi_debug.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 7e601e96808e..c40ec259ff1b 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -799,7 +799,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 */
@@ -4699,11 +4699,11 @@ static int sdebug_device_create_zones(struct sdebug_dev_info *devip)
devip->zsize_shift = ilog2(devip->zsize);
devip->nr_zones = (capacity + devip->zsize - 1) >> devip->zsize_shift;
- /* zbc_max_open_zones can be 0, meaning "no limit" */
- if (zbc_max_open_zones >= devip->nr_zones - 1)
+ /* sdeb_zbc_max_open can be 0, meaning "no limit" */
+ 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);
@@ -5452,6 +5452,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");
@@ -5514,6 +5515,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];
--
2.25.1
next prev parent reply other threads:[~2020-02-25 6:24 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-25 6:23 [PATCH v4 00/14] scsi_debug: host managed ZBC + doublestore Douglas Gilbert
2020-02-25 6:23 ` [PATCH v4 01/14] scsi_debug: randomize command completion time Douglas Gilbert
2020-04-13 22:24 ` Martin K. Petersen
2020-02-25 6:23 ` [PATCH v4 02/14] scsi_debug: add doublestore option Douglas Gilbert
2020-04-13 22:36 ` Martin K. Petersen
2020-02-25 6:23 ` [PATCH v4 03/14] scsi_debug: implement verify(10), add verify(16) Douglas Gilbert
2020-04-13 22:48 ` Martin K. Petersen
2020-02-25 6:23 ` [PATCH v4 04/14] scsi_debug: weaken rwlock around ramdisk access Douglas Gilbert
2020-02-25 6:23 ` [PATCH v4 05/14] scsi_debug: improve command duration calculation Douglas Gilbert
2020-04-13 22:50 ` Martin K. Petersen
2020-02-25 6:23 ` [PATCH v4 06/14] scsi_debug: implement pre-fetch commands Douglas Gilbert
2020-04-13 22:57 ` Martin K. Petersen
2020-04-19 18:01 ` Douglas Gilbert
2020-04-19 18:22 ` Julian Wiedmann
2020-04-19 21:53 ` Douglas Gilbert
2020-02-25 6:23 ` [PATCH v4 07/14] scsi_debug: expand zbc support Douglas Gilbert
2020-04-13 23:00 ` Martin K. Petersen
2020-04-13 23:05 ` Damien Le Moal
2020-04-13 23:06 ` Damien Le Moal
2020-04-14 1:55 ` Martin K. Petersen
2020-04-14 5:38 ` Damien Le Moal
2020-02-25 6:23 ` [PATCH v4 08/14] scsi_debug: add zone commands Douglas Gilbert
2020-02-25 6:23 ` [PATCH v4 09/14] scsi_debug: add zbc parameter Douglas Gilbert
2020-04-15 2:10 ` Martin K. Petersen
2020-02-25 6:23 ` [PATCH v4 10/14] scsi_debug: re-arrange parameters alphabetically Douglas Gilbert
2020-02-25 6:23 ` Douglas Gilbert [this message]
2020-02-25 6:23 ` [PATCH v4 12/14] scsi_debug: zone_nr_conv module parameter Douglas Gilbert
2020-02-25 6:23 ` [PATCH v4 13/14] scsi_debug: zone_size_mb " Douglas Gilbert
2020-02-25 6:23 ` [PATCH v4 14/14] scsi_debug: bump to version 1.89 Douglas Gilbert
2020-04-13 23:19 ` [PATCH v4 00/14] scsi_debug: host managed ZBC + doublestore Martin K. Petersen
2020-04-14 2:49 ` Douglas Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200225062351.21267-12-dgilbert@interlog.com \
--to=dgilbert@interlog.com \
--cc=Damien.LeMoal@wdc.com \
--cc=hare@suse.de \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).