Skip to content

Commit 6912e72

Browse files
GuangguanWangdavem330
authored andcommitted
net/smc: bugfix for smcr v2 server connect success statistic
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 88e69af commit 6912e72

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/smc/smc_stats.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,9 @@ while (0)
243243
#define SMC_STAT_SERV_SUCC_INC(net, _ini) \
244244
do { \
245245
typeof(_ini) i = (_ini); \
246-
bool is_v2 = (i->smcd_version & SMC_V2); \
247246
bool is_smcd = (i->is_smcd); \
247+
u8 version = is_smcd ? i->smcd_version : i->smcr_version; \
248+
bool is_v2 = (version & SMC_V2); \
248249
typeof(net->smc.smc_stats) smc_stats = (net)->smc.smc_stats; \
249250
if (is_v2 && is_smcd) \
250251
this_cpu_inc(smc_stats->smc[SMC_TYPE_D].srv_v2_succ_cnt); \

0 commit comments

Comments
 (0)