diff options
author | Namjae Jeon <linkinjeon@kernel.org> | 2022-05-16 10:22:43 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-05-21 23:01:43 +0300 |
commit | 65bb45b97b578c8eed1ffa80caec84708df49729 (patch) | |
tree | d783a45c1fe9cd4fa962da7d763ae22db88b7cd7 /fs/ksmbd/transport_rdma.c | |
parent | 65ca7a3ffff811d6c0d4342d467c381257d566d4 (diff) | |
download | linux-65bb45b97b578c8eed1ffa80caec84708df49729.tar.xz |
ksmbd: add smbd max io size parameter
Add 'smbd max io size' parameter to adjust smbd-direct max read/write
size.
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/ksmbd/transport_rdma.c')
-rw-r--r-- | fs/ksmbd/transport_rdma.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/ksmbd/transport_rdma.c b/fs/ksmbd/transport_rdma.c index 19a605fd46ff..6d652ff38b82 100644 --- a/fs/ksmbd/transport_rdma.c +++ b/fs/ksmbd/transport_rdma.c @@ -80,7 +80,7 @@ static int smb_direct_max_fragmented_recv_size = 1024 * 1024; /* The maximum single-message size which can be received */ static int smb_direct_max_receive_size = 8192; -static int smb_direct_max_read_write_size = 8 * 1024 * 1024; +static int smb_direct_max_read_write_size = SMBD_DEFAULT_IOSIZE; static LIST_HEAD(smb_direct_device_list); static DEFINE_RWLOCK(smb_direct_device_lock); @@ -214,6 +214,12 @@ struct smb_direct_rdma_rw_msg { struct scatterlist sg_list[]; }; +void init_smbd_max_io_size(unsigned int sz) +{ + sz = clamp_val(sz, SMBD_MIN_IOSIZE, SMBD_MAX_IOSIZE); + smb_direct_max_read_write_size = sz; +} + static inline int get_buf_page_count(void *buf, int size) { return DIV_ROUND_UP((uintptr_t)buf + size, PAGE_SIZE) - |