Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: tcm_loop: Allow queues, can_queue and cmd_per_lun to be settable

Make can_queue, nr_hw_queues and cmd_per_lun settable by the user instead
of hard coding them.

Link: https://lore.kernel.org/r/1604257174-4524-9-git-send-email-michael.christie@oracle.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Mike Christie and committed by
Martin K. Petersen
94a0dfcf 1526d9f1

+12 -2
+12 -2
drivers/target/loopback/tcm_loop.c
··· 46 46 47 47 static int tcm_loop_queue_status(struct se_cmd *se_cmd); 48 48 49 + static unsigned int tcm_loop_nr_hw_queues = 1; 50 + module_param_named(nr_hw_queues, tcm_loop_nr_hw_queues, uint, 0644); 51 + 52 + static unsigned int tcm_loop_can_queue = 1024; 53 + module_param_named(can_queue, tcm_loop_can_queue, uint, 0644); 54 + 55 + static unsigned int tcm_loop_cmd_per_lun = 1024; 56 + module_param_named(cmd_per_lun, tcm_loop_cmd_per_lun, uint, 0644); 57 + 49 58 /* 50 59 * Called from struct target_core_fabric_ops->check_stop_free() 51 60 */ ··· 314 305 .eh_abort_handler = tcm_loop_abort_task, 315 306 .eh_device_reset_handler = tcm_loop_device_reset, 316 307 .eh_target_reset_handler = tcm_loop_target_reset, 317 - .can_queue = 1024, 318 308 .this_id = -1, 319 309 .sg_tablesize = 256, 320 - .cmd_per_lun = 1024, 321 310 .max_sectors = 0xFFFF, 322 311 .dma_boundary = PAGE_SIZE - 1, 323 312 .module = THIS_MODULE, ··· 349 342 sh->max_lun = 0; 350 343 sh->max_channel = 0; 351 344 sh->max_cmd_len = SCSI_MAX_VARLEN_CDB_SIZE; 345 + sh->nr_hw_queues = tcm_loop_nr_hw_queues; 346 + sh->can_queue = tcm_loop_can_queue; 347 + sh->cmd_per_lun = tcm_loop_cmd_per_lun; 352 348 353 349 host_prot = SHOST_DIF_TYPE1_PROTECTION | SHOST_DIF_TYPE2_PROTECTION | 354 350 SHOST_DIF_TYPE3_PROTECTION | SHOST_DIX_TYPE1_PROTECTION |