Skip to content

Commit

Permalink
net/smc: add sysctl for smc_limit_hs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
D. Wythe authored and Paolo Abeni committed Sep 10, 2024
1 parent 0246388 commit f8406a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 0 additions & 3 deletions net/smc/smc_pnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
11 changes: 11 additions & 0 deletions net/smc/smc_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,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,
},
};

int __net_init smc_sysctl_net_init(struct net *net)
Expand Down Expand Up @@ -121,6 +130,8 @@ int __net_init smc_sysctl_net_init(struct net *net)
WRITE_ONCE(net->smc.sysctl_rmem, net_smc_rmem_init);
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;

Expand Down

0 comments on commit f8406a2

Please sign in to comment.