diff options
author | Guangguan Wang | 2023-09-08 11:31:42 +0800 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-10-06 14:56:53 +0200 |
commit | 797d75bd575cbc5263b870adad900ce0ae69cf06 (patch) | |
tree | db20a99e564fd888b987f3af846090265c0feed0 | |
parent | b08a4938229dbb530a35c41b83002a1457c6ff49 (diff) |
net/smc: bugfix for smcr v2 server connect success statistic
[ Upstream commit 6912e724832c47bb381eb1bd1e483ec8df0d0f0f ]
In the macro SMC_STAT_SERV_SUCC_INC, the smcd_version is used
to determin whether to increase the v1 statistic or the v2
statistic. It is correct for SMCD. But for SMCR, smcr_version
should be used.
Signed-off-by: Guangguan Wang <guangguan.wang@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | net/smc/smc_stats.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/smc/smc_stats.h b/net/smc/smc_stats.h index 84b7ecd8c05c..4dbc237b7c19 100644 --- a/net/smc/smc_stats.h +++ b/net/smc/smc_stats.h @@ -244,8 +244,9 @@ while (0) #define SMC_STAT_SERV_SUCC_INC(net, _ini) \ do { \ typeof(_ini) i = (_ini); \ - bool is_v2 = (i->smcd_version & SMC_V2); \ bool is_smcd = (i->is_smcd); \ + u8 version = is_smcd ? i->smcd_version : i->smcr_version; \ + bool is_v2 = (version & SMC_V2); \ typeof(net->smc.smc_stats) smc_stats = (net)->smc.smc_stats; \ if (is_v2 && is_smcd) \ this_cpu_inc(smc_stats->smc[SMC_TYPE_D].srv_v2_succ_cnt); \ |