Re: [PATCH] RDMA/srp: Increase max_segment_size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2019-01-30 3:23 p.m., Bart Van Assche wrote:
On Tue, 2019-01-22 at 15:47 -0500, Douglas Gilbert wrote:
On 2019-01-22 1:25 p.m., Bart Van Assche wrote:
The default behavior of the SCSI core is to set the block layer request
queue parameter max_segment_size to 64 KB. That means that elements of
scatterlists are limited to 64 KB. Since RDMA adapters support larger
sizes, increase max_segment_size for the SRP initiator.

Notes:
- The SCSI max_segment_size parameter was introduced in kernel v5.0. See
    also commit 50c2e9107f17 ("scsi: introduce a max_segment_size
    host_template parameters").
- Some other block drivers already set max_segment_size to UINT_MAX,
    e.g. nbd and rbd.

In my sg v4 driver rewrite one of options within the SG_SET_GET_EXTENDED
ioctl is to allow the user to modify this value. It is a #define to
32 KB in the production sg v3 driver.

Hi Doug,

This functionality seems useful to me. But it is not clear to me how it
will be guaranteed that the value set by the user won't exceed the largest
max_segment_size value supported by the driver?

The sg v4 driver exists and its code can be found at:
   http://sg.danny.cz/sg/sg_v40.html

And the code there takes the min(<given_sgat_sz>, <following_function>) as
the element size. That function is:

static int
max_sectors_bytes(struct request_queue *q)
{
        unsigned int max_sectors = queue_max_sectors(q);

        max_sectors = min_t(unsigned int, max_sectors, INT_MAX >> 9);
        return max_sectors << 9;
}

Also <given_sgat_sz> is rounded up to PAGE_SIZE and rejected if it is not
a power of 2. Does that look correct?

Doug Gilbert




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux