On Wed, 2019-01-30 at 17:50 -0500, Douglas Gilbert wrote: +AD4 On 2019-01-30 3:23 p.m., Bart Van Assche wrote: +AD4 +AD4 On Tue, 2019-01-22 at 15:47 -0500, Douglas Gilbert wrote: +AD4 +AD4 +AD4 On 2019-01-22 1:25 p.m., Bart Van Assche wrote: +AD4 +AD4 +AD4 +AD4 The default behavior of the SCSI core is to set the block layer request +AD4 +AD4 +AD4 +AD4 queue parameter max+AF8-segment+AF8-size to 64 KB. That means that elements of +AD4 +AD4 +AD4 +AD4 scatterlists are limited to 64 KB. Since RDMA adapters support larger +AD4 +AD4 +AD4 +AD4 sizes, increase max+AF8-segment+AF8-size for the SRP initiator. +AD4 +AD4 +AD4 +AD4 +AD4 +AD4 +AD4 +AD4 Notes: +AD4 +AD4 +AD4 +AD4 - The SCSI max+AF8-segment+AF8-size parameter was introduced in kernel v5.0. See +AD4 +AD4 +AD4 +AD4 also commit 50c2e9107f17 (+ACI-scsi: introduce a max+AF8-segment+AF8-size +AD4 +AD4 +AD4 +AD4 host+AF8-template parameters+ACI). +AD4 +AD4 +AD4 +AD4 - Some other block drivers already set max+AF8-segment+AF8-size to UINT+AF8-MAX, +AD4 +AD4 +AD4 +AD4 e.g. nbd and rbd. +AD4 +AD4 +AD4 +AD4 +AD4 +AD4 In my sg v4 driver rewrite one of options within the SG+AF8-SET+AF8-GET+AF8-EXTENDED +AD4 +AD4 +AD4 ioctl is to allow the user to modify this value. It is a +ACM-define to +AD4 +AD4 +AD4 32 KB in the production sg v3 driver. +AD4 +AD4 +AD4 +AD4 Hi Doug, +AD4 +AD4 +AD4 +AD4 This functionality seems useful to me. But it is not clear to me how it +AD4 +AD4 will be guaranteed that the value set by the user won't exceed the largest +AD4 +AD4 max+AF8-segment+AF8-size value supported by the driver? +AD4 +AD4 The sg v4 driver exists and its code can be found at: +AD4 http://sg.danny.cz/sg/sg+AF8-v40.html +AD4 +AD4 And the code there takes the min(+ADw-given+AF8-sgat+AF8-sz+AD4, +ADw-following+AF8-function+AD4) as +AD4 the element size. That function is: +AD4 +AD4 static int +AD4 max+AF8-sectors+AF8-bytes(struct request+AF8-queue +ACo-q) +AD4 +AHs +AD4 unsigned int max+AF8-sectors +AD0 queue+AF8-max+AF8-sectors(q)+ADs +AD4 +AD4 max+AF8-sectors +AD0 min+AF8-t(unsigned int, max+AF8-sectors, INT+AF8-MAX +AD4APg 9)+ADs +AD4 return max+AF8-sectors +ADwAPA 9+ADs +AD4 +AH0 +AD4 +AD4 Also +ADw-given+AF8-sgat+AF8-sz+AD4 is rounded up to PAGE+AF8-SIZE and rejected if it is not +AD4 a power of 2. Does that look correct? Hi Doug, Have you noticed that my patch affects max+AF8-segment+AF8-size and that your patch refers to the max+AF8-sectors limit? From the Linux kernel header file blkdev.h: static inline unsigned int queue+AF8-max+AF8-sectors(struct request+AF8-queue +ACo-q) +AHs return q-+AD4-limits.max+AF8-sectors+ADs +AH0 +AFs ... +AF0 static inline unsigned int queue+AF8-max+AF8-segment+AF8-size(struct request+AF8-queue +ACo-q) +AHs return q-+AD4-limits.max+AF8-segment+AF8-size+ADs +AH0 Thanks, Bart.