From: Namjae Jeon <linkinjeon@kernel.org> To: linux-cifs@vger.kernel.org Cc: smfrench@gmail.com, hyc.lee@gmail.com, senozhatsky@chromium.org, Namjae Jeon <linkinjeon@kernel.org> Subject: [PATCH] ksmbd-tools: add smbd max io size parameter Date: Mon, 16 May 2022 16:42:23 +0900 [thread overview] Message-ID: <20220516074223.28589-1-linkinjeon@kernel.org> (raw) 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(-) diff --git a/Documentation/configuration.txt b/Documentation/configuration.txt index 9580bf1..47d5f9b 100644 --- a/Documentation/configuration.txt +++ b/Documentation/configuration.txt @@ -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: diff --git a/include/ksmbdtools.h b/include/ksmbdtools.h index c51673e..a46bdbc 100644 --- a/include/ksmbdtools.h +++ b/include/ksmbdtools.h @@ -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; diff --git a/include/linux/ksmbd_server.h b/include/linux/ksmbd_server.h index 78ae6e7..6705dac 100644 --- a/include/linux/ksmbd_server.h +++ b/include/linux/ksmbd_server.h @@ -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[]; }; diff --git a/lib/config_parser.c b/lib/config_parser.c index 9ce730c..e9d0a7e 100644 --- a/lib/config_parser.c +++ b/lib/config_parser.c @@ -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; } diff --git a/mountd/ipc.c b/mountd/ipc.c index eded431..015268d 100644 --- a/mountd/ipc.c +++ b/mountd/ipc.c @@ -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; -- 2.25.1
reply other threads:[~2022-05-16 7:42 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220516074223.28589-1-linkinjeon@kernel.org \ --to=linkinjeon@kernel.org \ --cc=hyc.lee@gmail.com \ --cc=linux-cifs@vger.kernel.org \ --cc=senozhatsky@chromium.org \ --cc=smfrench@gmail.com \ --subject='Re: [PATCH] ksmbd-tools: add smbd max io size parameter' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.