summaryrefslogtreecommitdiff
path: root/net/smc/af_smc.c
diff options
context:
space:
mode:
authorDust Li <dust.li@linux.alibaba.com>2022-03-01 17:43:56 +0800
committerDavid S. Miller <davem@davemloft.net>2022-03-01 14:25:12 +0000
commit462791bbfa350189e309a5a94541f6b63cd874e8 (patch)
treed5d643f55e3fe0cd89fa107a215137a9f4d648b8 /net/smc/af_smc.c
parent1e385c08249e4822e0f425efde1896d3933d1471 (diff)
net/smc: add sysctl interface for SMC
This patch add sysctl interface to support container environment for SMC as we talk in the mail list. Link: https://lore.kernel.org/netdev/20220224020253.GF5443@linux.alibaba.com Co-developed-by: Tony Lu <tonylu@linux.alibaba.com> Signed-off-by: Tony Lu <tonylu@linux.alibaba.com> Signed-off-by: Dust Li <dust.li@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/af_smc.c')
-rw-r--r--net/smc/af_smc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 30acc31b2c45..19b3066cf7af 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -51,6 +51,7 @@
#include "smc_close.h"
#include "smc_stats.h"
#include "smc_tracepoint.h"
+#include "smc_sysctl.h"
static DEFINE_MUTEX(smc_server_lgr_pending); /* serialize link group
* creation on server
@@ -3273,9 +3274,17 @@ static int __init smc_init(void)
goto out_sock;
}
+ rc = smc_sysctl_init();
+ if (rc) {
+ pr_err("%s: sysctl_init fails with %d\n", __func__, rc);
+ goto out_ulp;
+ }
+
static_branch_enable(&tcp_have_smc);
return 0;
+out_ulp:
+ tcp_unregister_ulp(&smc_ulp_ops);
out_sock:
sock_unregister(PF_SMC);
out_proto6:
@@ -3303,6 +3312,7 @@ out_pernet_subsys:
static void __exit smc_exit(void)
{
static_branch_disable(&tcp_have_smc);
+ smc_sysctl_exit();
tcp_unregister_ulp(&smc_ulp_ops);
sock_unregister(PF_SMC);
smc_core_exit();