@@ -112,6 +112,8 @@ Define ksmbd configuration parameters list.
- smb2 max credits (default: 8192)
This option controls the maximum number of outstanding
simultaneous SMB2 operations.
+ - smbd io size (default: 8MB)
+ This option controls the maximum read/write size of smb-direct.
* Supported [share] level parameters list:
@@ -53,6 +53,7 @@ struct smbconf_global {
unsigned int smb2_max_write;
unsigned int smb2_max_trans;
unsigned int smb2_max_credits;
+ unsigned int smbd_max_io_size;
unsigned int share_fake_fscaps;
unsigned int gen_subauth[3];
char *krb5_keytab_file;
@@ -47,7 +47,8 @@ struct ksmbd_startup_request {
__u32 share_fake_fscaps;
__u32 sub_auth[3];
__u32 smb2_max_credits;
- __u32 reserved[128]; /* Reserved room */
+ __u32 smbd_max_io_size; /* smbd read write size */
+ __u32 reserved[127]; /* Reserved room */
__u32 ifc_list_sz;
__s8 ____payload[];
};
@@ -555,6 +555,11 @@ static gboolean global_group_kv(gpointer _k, gpointer _v, gpointer user_data)
return TRUE;
}
+ if (!cp_key_cmp(_k, "smbd max io size")) {
+ global_conf.smbd_max_io_size = memparse(_v);
+ return TRUE;
+ }
+
/* At this point, this is an option that must be applied to all shares */
return FALSE;
}
@@ -171,6 +171,7 @@ static int ipc_ksmbd_starting_up(void)
ev->smb2_max_read = global_conf.smb2_max_read;
ev->smb2_max_write = global_conf.smb2_max_write;
ev->smb2_max_trans = global_conf.smb2_max_trans;
+ ev->smbd_max_io_size = global_conf.smbd_max_io_size;
ev->share_fake_fscaps = global_conf.share_fake_fscaps;
memcpy(ev->sub_auth, global_conf.gen_subauth, sizeof(ev->sub_auth));
ev->smb2_max_credits = global_conf.smb2_max_credits;
Add 'smbd max io size' parameter in ksmbd configuration to adjust smbd-direct max read/write size. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> --- Documentation/configuration.txt | 2 ++ include/ksmbdtools.h | 1 + include/linux/ksmbd_server.h | 3 ++- lib/config_parser.c | 5 +++++ mountd/ipc.c | 1 + 5 files changed, 11 insertions(+), 1 deletion(-)