From debd5dc1ad85857a3df5d1a3cebd08149c016416 Mon Sep 17 00:00:00 2001 From: Mete Durlu Date: Fri, 7 Nov 2025 15:48:06 +0100 Subject: [PATCH] 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 f8406a2fd279d05eb4a76c9b77cb740b6f350549 Author: D. Wythe Date: Fri Sep 6 10:35:35 2024 +0800 net/smc: add sysctl for smc_limit_hs In commit 48b6190a0042 ("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 462791bbfa35 ("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 Reviewed-by: Wen Gu Reviewed-by: Jan Karcher Link: https://patch.msgid.link/1725590135-5631-1-git-send-email-alibuda@linux.alibaba.com Signed-off-by: Paolo Abeni Signed-off-by: Mahanta Jambigi Signed-off-by: Mete Durlu --- net/smc/smc_pnet.c | 3 --- net/smc/smc_sysctl.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c index eaf9af7e3b3b..8566937c8903 100644 --- a/net/smc/smc_pnet.c +++ b/net/smc/smc_pnet.c @@ -887,9 +887,6 @@ int smc_pnet_net_init(struct net *net) smc_pnet_create_pnetids_list(net); - /* disable handshake limitation by default */ - net->smc.limit_smc_hs = 0; - return 0; } diff --git a/net/smc/smc_sysctl.c b/net/smc/smc_sysctl.c index aa060ca1ceef..021d89194a47 100644 --- a/net/smc/smc_sysctl.c +++ b/net/smc/smc_sysctl.c @@ -66,6 +66,15 @@ static struct ctl_table smc_table[] = { .extra1 = &conns_per_lgr_min, .extra2 = &conns_per_lgr_max, }, + { + .procname = "limit_smc_hs", + .data = &init_net.smc.limit_smc_hs, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_ONE, + }, { } }; @@ -94,6 +103,8 @@ int __net_init smc_sysctl_net_init(struct net *net) net->smc.sysctl_smcr_testlink_time = SMC_LLC_TESTLINK_DEFAULT_TIME; net->smc.sysctl_max_links_per_lgr = SMC_LINKS_PER_LGR_MAX_PREFER; net->smc.sysctl_max_conns_per_lgr = SMC_CONN_PER_LGR_PREFER; + /* disable handshake limitation by default */ + net->smc.limit_smc_hs = 0; return 0;