With this simple change, the Decline messages should never cross or
collide (during Confirm link timeout).
This issue requires an immediate solution, since the protocol updates
involve a more long-term solution.
Fixes: 0fb0b02bd6fd ("net/smc: adapt SMC client code to use the LLC
flow")
Signed-off-by: D. Wythe <alibuda@xxxxxxxxxxxxxxxxx>
---
include/net/netns/smc.h | 2 ++
net/smc/af_smc.c | 3 ++-
net/smc/smc_sysctl.c | 12 ++++++++++++
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/include/net/netns/smc.h b/include/net/netns/smc.h
index 582212a..5198896 100644
--- a/include/net/netns/smc.h
+++ b/include/net/netns/smc.h
@@ -22,5 +22,7 @@ struct netns_smc {
int sysctl_smcr_testlink_time;
int sysctl_wmem;
int sysctl_rmem;
+ /* server's Confirm Link timeout in seconds */
+ int sysctl_smcr_srv_confirm_link_timeout;
};
#endif
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index abd2667..b86ad30 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -1870,7 +1870,8 @@ static int smcr_serv_conf_first_link(struct
smc_sock *smc)
return SMC_CLC_DECL_TIMEOUT_CL;
/* receive CONFIRM LINK response from client over the RoCE
fabric */
- qentry = smc_llc_wait(link->lgr, link, SMC_LLC_WAIT_TIME,
+ qentry = smc_llc_wait(link->lgr, link,
+ sock_net(&smc->sk)->smc.sysctl_smcr_srv_confirm_link_timeout,
SMC_LLC_CONFIRM_LINK);
if (!qentry) {
struct smc_clc_msg_decline dclc;
diff --git a/net/smc/smc_sysctl.c b/net/smc/smc_sysctl.c
index 5cbc18c..919f3f7 100644
--- a/net/smc/smc_sysctl.c
+++ b/net/smc/smc_sysctl.c
@@ -51,6 +51,13 @@
.proc_handler = proc_dointvec_jiffies,
},
{
+ .procname = "smcr_srv_confirm_link_timeout",
+ .data =
&init_net.smc.sysctl_smcr_srv_confirm_link_timeout,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec_jiffies,
+ },
+ {
.procname = "wmem",
.data = &init_net.smc.sysctl_wmem,
.maxlen = sizeof(int),
@@ -95,6 +102,11 @@ int __net_init smc_sysctl_net_init(struct net *net)
net->smc.sysctl_autocorking_size = SMC_AUTOCORKING_DEFAULT_SIZE;
net->smc.sysctl_smcr_buf_type = SMCR_PHYS_CONT_BUFS;
net->smc.sysctl_smcr_testlink_time =
SMC_LLC_TESTLINK_DEFAULT_TIME;
+ /* Increasing the server's timeout by twice as much as the client's
+ * timeout by default can temporarily avoid decline messages of
+ * both side been crossed or collided.