]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net/smc: Fix smc_link->llc_testlink_time overflow
authorTony Lu <tonylu@linux.alibaba.com>
Thu, 28 Oct 2021 07:13:45 +0000 (15:13 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Oct 2021 12:04:28 +0000 (13:04 +0100)
The value of llc_testlink_time is set to the value stored in
net->ipv4.sysctl_tcp_keepalive_time when linkgroup init. The value of
sysctl_tcp_keepalive_time is already jiffies, so we don't need to
multiply by HZ, which would cause smc_link->llc_testlink_time overflow,
and test_link send flood.

Signed-off-by: Tony Lu <tonylu@linux.alibaba.com>
Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Reviewed-by: Wen Gu <guwen@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/smc_llc.c

index 72f4b72eb1753a899f164e10aa1e75620c7e5bfa..f1d323439a2af3658e7997cc0e8e62319f719100 100644 (file)
@@ -1822,7 +1822,7 @@ void smc_llc_link_active(struct smc_link *link)
                            link->smcibdev->ibdev->name, link->ibport);
        link->state = SMC_LNK_ACTIVE;
        if (link->lgr->llc_testlink_time) {
-               link->llc_testlink_time = link->lgr->llc_testlink_time * HZ;
+               link->llc_testlink_time = link->lgr->llc_testlink_time;
                schedule_delayed_work(&link->llc_testlink_wrk,
                                      link->llc_testlink_time);
        }