diff options
author | Dust Li <dust.li@linux.alibaba.com> | 2022-03-01 17:43:58 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-03-01 14:25:12 +0000 |
commit | 12bbb0d163a90d81a2677cf7808d364697290207 (patch) | |
tree | cc1b0752c04cca5ee363f20aba99b404ef6e3161 /net/smc/smc_sysctl.c | |
parent | dcd2cf5f2fc0d4d37aa5400b308d401a150c38b6 (diff) |
net/smc: add sysctl for autocorking
This add a new sysctl: net.smc.autocorking_size
We can dynamically change the behaviour of autocorking
by change the value of autocorking_size.
Setting to 0 disables autocorking in SMC
Signed-off-by: Dust Li <dust.li@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_sysctl.c')
-rw-r--r-- | net/smc/smc_sysctl.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/smc/smc_sysctl.c b/net/smc/smc_sysctl.c index 8a3a8e145976..3b59876aaac9 100644 --- a/net/smc/smc_sysctl.c +++ b/net/smc/smc_sysctl.c @@ -14,9 +14,17 @@ #include <linux/sysctl.h> #include <net/net_namespace.h> +#include "smc.h" #include "smc_sysctl.h" static struct ctl_table smc_table[] = { + { + .procname = "autocorking_size", + .data = &init_net.smc.sysctl_autocorking_size, + .maxlen = sizeof(unsigned int), + .mode = 0644, + .proc_handler = proc_douintvec, + }, { } }; @@ -40,6 +48,8 @@ static __net_init int smc_sysctl_init_net(struct net *net) if (!net->smc.smc_hdr) goto err_reg; + net->smc.sysctl_autocorking_size = SMC_AUTOCORKING_DEFAULT_SIZE; + return 0; err_reg: |