diff mbox series

[v2,7/8] scsi_debug: Support configuring the maximum segment size

Message ID 20221123205740.463185-8-bvanassche@acm.org
State New
Headers show
Series None | expand

Commit Message

Bart Van Assche Nov. 23, 2022, 8:57 p.m. UTC
Add a kernel module parameter for configuring the maximum segment size.
This patch enables testing SCSI support for segments smaller than the
page size.

Cc: Doug Gilbert <dgilbert@interlog.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/scsi_debug.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Bart Van Assche Nov. 30, 2022, 10:30 p.m. UTC | #1
On 11/25/22 09:34, Douglas Gilbert wrote:
> On 2022-11-23 15:57, Bart Van Assche wrote:
>>   module_param_named(no_uld, sdebug_no_uld, int, S_IRUGO);
>> +module_param_named(max_segment_size, sdebug_max_segment_size, uint, 
>> S_IRUGO);
> 
> Could you place the above line in alphabetical order.
> 
>>   module_param_named(num_parts, sdebug_num_parts, int, S_IRUGO);
>>   module_param_named(num_tgts, sdebug_num_tgts, int, S_IRUGO | S_IWUSR);
>>   module_param_named(opt_blks, sdebug_opt_blks, int, S_IRUGO);
>> @@ -7815,6 +7817,7 @@ static int sdebug_driver_probe(struct device *dev)
>>       sdebug_driver_template.can_queue = sdebug_max_queue;
>>       sdebug_driver_template.cmd_per_lun = sdebug_max_queue;
>> +    sdebug_driver_template.max_segment_size = sdebug_max_segment_size;
>>       if (!sdebug_clustering)
>>           sdebug_driver_template.dma_boundary = PAGE_SIZE - 1;
> 
> And could you add a
> MODULE_PARM_DESC(max_segment_size, "<1 line description>");
> 
> entry as well (also in alphabetical order).

Hi Doug,

I will make these changes.

Thanks for the feedback.

Bart.
diff mbox series

Patch

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index bebda917b138..ea8f762c55c3 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -770,6 +770,7 @@  static int sdebug_sector_size = DEF_SECTOR_SIZE;
 static int sdeb_tur_ms_to_ready = DEF_TUR_MS_TO_READY;
 static int sdebug_virtual_gb = DEF_VIRTUAL_GB;
 static int sdebug_vpd_use_hostno = DEF_VPD_USE_HOSTNO;
+static unsigned int sdebug_max_segment_size = -1U;
 static unsigned int sdebug_lbpu = DEF_LBPU;
 static unsigned int sdebug_lbpws = DEF_LBPWS;
 static unsigned int sdebug_lbpws10 = DEF_LBPWS10;
@@ -5851,6 +5852,7 @@  module_param_named(ndelay, sdebug_ndelay, int, S_IRUGO | S_IWUSR);
 module_param_named(no_lun_0, sdebug_no_lun_0, int, S_IRUGO | S_IWUSR);
 module_param_named(no_rwlock, sdebug_no_rwlock, bool, S_IRUGO | S_IWUSR);
 module_param_named(no_uld, sdebug_no_uld, int, S_IRUGO);
+module_param_named(max_segment_size, sdebug_max_segment_size, uint, S_IRUGO);
 module_param_named(num_parts, sdebug_num_parts, int, S_IRUGO);
 module_param_named(num_tgts, sdebug_num_tgts, int, S_IRUGO | S_IWUSR);
 module_param_named(opt_blks, sdebug_opt_blks, int, S_IRUGO);
@@ -7815,6 +7817,7 @@  static int sdebug_driver_probe(struct device *dev)
 
 	sdebug_driver_template.can_queue = sdebug_max_queue;
 	sdebug_driver_template.cmd_per_lun = sdebug_max_queue;
+	sdebug_driver_template.max_segment_size = sdebug_max_segment_size;
 	if (!sdebug_clustering)
 		sdebug_driver_template.dma_boundary = PAGE_SIZE - 1;