lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 20 May 2021 09:57:35 -0700
From:   Bart Van Assche <bvanassche@....org>
To:     John Garry <john.garry@...wei.com>, jejb@...ux.ibm.com,
        martin.petersen@...cle.com
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        ming.lei@...hat.com
Subject: Re: [PATCH] scsi: core: Cap shost cmd_per_lun at can_queue

On 5/20/21 9:41 AM, John Garry wrote:
> On 20/05/2021 16:57, Bart Van Assche wrote:
>> In SCSI header files a mix of int, short and unsigned int is used for
>> cmd_per_lun and can_queue. How about changing the types of these two
>> member variables in include/scsi/*h into u16?
> I don't mind doing that, but is there any requirement for can_queue to
> not be limited to 16b?

Maybe I'm missing something but it is not clear to me why different
structures in the SCSI headers use different data types for can_queue
and cmd_per_lun?

$ git grep -nHEw '(cmd_per_lun|can_queue);' include/scsi
include/scsi/scsi_device.h:318:	unsigned int		can_queue;
include/scsi/scsi_host.h:372:	int can_queue;
include/scsi/scsi_host.h:425:	short cmd_per_lun;
include/scsi/scsi_host.h:612:	int can_queue;
include/scsi/scsi_host.h:613:	short cmd_per_lun;

> It seems intentional that can_queue is int and cmd_per_lun is short.

Intentional? It is not clear to me why? Even high-performance drivers
like iSER and SRP set can_queue by default to a value that fits well in
a 16-bit variable (512 and 64 respectively). The highest value that I
found after a quick search is the following:

 #define ISCSI_TOTAL_CMDS_MAX		4096

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ