@@ -109,6 +109,9 @@ Define ksmbd configuration parameters list.
This boolean parameter controls whether ksmbd will support
SMB3 multi-channel. Warn that this is experimental feature
which means data can be corrupted under race conditions.
+ - smb2 max credits (default: 8192)
+ This option controls the maximum number of outstanding
+ simultaneous SMB2 operations.
* Supported [share] level parameters list:
@@ -52,6 +52,7 @@ struct smbconf_global {
unsigned int smb2_max_read;
unsigned int smb2_max_write;
unsigned int smb2_max_trans;
+ unsigned int smb2_max_credits;
unsigned int share_fake_fscaps;
unsigned int gen_subauth[3];
char *krb5_keytab_file;
@@ -46,6 +46,7 @@ struct ksmbd_startup_request {
__u32 smb2_max_trans;
__u32 share_fake_fscaps;
__u32 sub_auth[3];
+ __u32 smb2_max_credits;
__u32 ifc_list_sz;
__s8 ____payload[];
};
@@ -548,6 +548,11 @@ static void global_group_kv(gpointer _k, gpointer _v, gpointer user_data)
return;
}
+
+ if (!cp_key_cmp(_k, "smb2 max credits")) {
+ global_conf.smb2_max_credits = memparse(_v);
+ return;
+ }
}
static void fixup_missing_global_group(void)
@@ -173,6 +173,7 @@ static int ipc_ksmbd_starting_up(void)
ev->smb2_max_trans = global_conf.smb2_max_trans;
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;
if (global_conf.server_min_protocol) {
strncpy(ev->min_prot,
Add smb2 max credits parameter to adjust maximum credits value to limit number of outstanding requests. Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> --- Documentation/configuration.txt | 3 +++ include/ksmbdtools.h | 1 + include/linux/ksmbd_server.h | 1 + lib/config_parser.c | 5 +++++ mountd/ipc.c | 1 + 5 files changed, 11 insertions(+)