diff mbox series

[net,2/4] net/smc: Fix smc_link->llc_testlink_time overflow

Message ID 20211027085208.16048-3-tonylu@linux.alibaba.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series Fixes for SMC | expand

Checks

Context Check Description
netdev/cover_letter success Series has a cover letter
netdev/fixes_present success Fixes tag present in non-next series
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Fixes tag looks correct
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Tony Lu Oct. 27, 2021, 8:52 a.m. UTC
From: Tony Lu <tony.ly@linux.alibaba.com>

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.

Fixes: 00a049cfde95 ("net/smc: move llc layer related init and clear into smc_llc.c")
Cc: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Tony Lu <tony.ly@linux.alibaba.com>
Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Reviewed-by: Wen Gu <guwen@linux.alibaba.com>
---
 net/smc/smc_llc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Karsten Graul Oct. 27, 2021, 10:24 a.m. UTC | #1
On 27/10/2021 10:52, Tony Lu wrote:
> From: Tony Lu <tony.ly@linux.alibaba.com>
> 
> 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.

Thanks for fixing this, we will include your patch in our next submission
to the netdev tree.
Tony Lu Oct. 28, 2021, 6:52 a.m. UTC | #2
On Wed, Oct 27, 2021 at 12:24:18PM +0200, Karsten Graul wrote:
> On 27/10/2021 10:52, Tony Lu wrote:
> > From: Tony Lu <tony.ly@linux.alibaba.com>
> > 
> > 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.
> 
> Thanks for fixing this, we will include your patch in our next submission
> to the netdev tree.

Thanks for your reply. There is a little mistake for my email address,
the wrong email address (tony.ly@linux.alibaba.com) should be corrected
to tonylu@linux.alibaba.com. I will send these two patches with the next
one in v2.

Cheers,
Tony Lu
diff mbox series

Patch

diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c
index 72f4b72eb175..f1d323439a2a 100644
--- a/net/smc/smc_llc.c
+++ b/net/smc/smc_llc.c
@@ -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);
 	}