Skip to content

Commit 7ae5e58

Browse files
committed
cifs: add mount parameter tcpnodelay
Although corking and uncorking the socket (which cifs.ko already does) should usually have the desired benefit, using the new tcpnodelay mount option causes tcp_sock_set_nodelay() to be set on the socket which may be useful in order to ensure that we don't ever have cases where the network stack is waiting on sending an SMB request until multiple SMB requests have been added to the send queue (since this could lead to long latencies). To enable it simply append "tcpnodelay" it to the mount options Reviewed-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 7be3248 commit 7ae5e58

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

fs/cifs/fs_context.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ const struct fs_parameter_spec smb3_fs_parameters[] = {
116116
fsparam_flag("nosharesock", Opt_nosharesock),
117117
fsparam_flag_no("persistenthandles", Opt_persistent),
118118
fsparam_flag_no("resilienthandles", Opt_resilient),
119+
fsparam_flag_no("tcpnodelay", Opt_tcp_nodelay),
119120
fsparam_flag("domainauto", Opt_domainauto),
120121
fsparam_flag("rdma", Opt_rdma),
121122
fsparam_flag("modesid", Opt_modesid),
@@ -1389,6 +1390,13 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
13891390
}
13901391
}
13911392
break;
1393+
case Opt_tcp_nodelay:
1394+
/* tcp nodelay should not usually be needed since we CORK/UNCORK the socket */
1395+
if (result.negated)
1396+
ctx->sockopt_tcp_nodelay = false;
1397+
else
1398+
ctx->sockopt_tcp_nodelay = true;
1399+
break;
13921400
case Opt_domainauto:
13931401
ctx->domainauto = true;
13941402
break;

fs/cifs/fs_context.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ enum cifs_param {
9898
Opt_nosharesock,
9999
Opt_persistent,
100100
Opt_resilient,
101+
Opt_tcp_nodelay,
101102
Opt_domainauto,
102103
Opt_rdma,
103104
Opt_modesid,

0 commit comments

Comments
 (0)