Skip to content

Commit debd5dc

Browse files
author
Mete Durlu
committed
net/smc: add sysctl for smc_limit_hs
JIRA: https://issues.redhat.com/browse/RHEL-99989 Conflicts: Conflicts due to change in line numbers between 5.14 & 6.17 kernel, no functional changes commit f8406a2 Author: D. Wythe <alibuda@linux.alibaba.com> Date: Fri Sep 6 10:35:35 2024 +0800 net/smc: add sysctl for smc_limit_hs In commit 48b6190 ("net/smc: Limit SMC visits when handshake workqueue congested"), we introduce a mechanism to put constraint on SMC connections visit according to the pressure of SMC handshake process. At that time, we believed that controlling the feature through netlink was sufficient. However, most people have realized now that netlink is not convenient in container scenarios, and sysctl is a more suitable approach. In addition, since commit 462791b ("net/smc: add sysctl interface for SMC") had introcuded smc_sysctl_net_init(), it is reasonable for us to initialize limit_smc_hs in it instead of initializing it in smc_pnet_net_int(). Signed-off-by: D. Wythe <alibuda@linux.alibaba.com> Reviewed-by: Wen Gu <guwen@linux.alibaba.com> Reviewed-by: Jan Karcher <jaka@linux.ibm.com> Link: https://patch.msgid.link/1725590135-5631-1-git-send-email-alibuda@linux.alibaba.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Mahanta Jambigi <mjambigi@linux.ibm.com> Signed-off-by: Mete Durlu <mdurlu@redhat.com>
1 parent 1d1ede1 commit debd5dc

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

net/smc/smc_pnet.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,6 @@ int smc_pnet_net_init(struct net *net)
887887

888888
smc_pnet_create_pnetids_list(net);
889889

890-
/* disable handshake limitation by default */
891-
net->smc.limit_smc_hs = 0;
892-
893890
return 0;
894891
}
895892

net/smc/smc_sysctl.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ static struct ctl_table smc_table[] = {
6666
.extra1 = &conns_per_lgr_min,
6767
.extra2 = &conns_per_lgr_max,
6868
},
69+
{
70+
.procname = "limit_smc_hs",
71+
.data = &init_net.smc.limit_smc_hs,
72+
.maxlen = sizeof(int),
73+
.mode = 0644,
74+
.proc_handler = proc_dointvec_minmax,
75+
.extra1 = SYSCTL_ZERO,
76+
.extra2 = SYSCTL_ONE,
77+
},
6978
{ }
7079
};
7180

@@ -94,6 +103,8 @@ int __net_init smc_sysctl_net_init(struct net *net)
94103
net->smc.sysctl_smcr_testlink_time = SMC_LLC_TESTLINK_DEFAULT_TIME;
95104
net->smc.sysctl_max_links_per_lgr = SMC_LINKS_PER_LGR_MAX_PREFER;
96105
net->smc.sysctl_max_conns_per_lgr = SMC_CONN_PER_LGR_PREFER;
106+
/* disable handshake limitation by default */
107+
net->smc.limit_smc_hs = 0;
97108

98109
return 0;
99110

0 commit comments

Comments
 (0)