Skip to content

Commit 6eadb0b

Browse files
committed
Merge branch 'smc-r-fixes'
Guangguan Wang says: ==================== Two fixes for SMC-R ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 88e69af + f5146e3 commit 6eadb0b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

net/smc/smc_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,6 +1662,7 @@ void smcr_port_add(struct smc_ib_device *smcibdev, u8 ibport)
16621662
{
16631663
struct smc_link_group *lgr, *n;
16641664

1665+
spin_lock_bh(&smc_lgr_list.lock);
16651666
list_for_each_entry_safe(lgr, n, &smc_lgr_list.list, list) {
16661667
struct smc_link *link;
16671668

@@ -1680,6 +1681,7 @@ void smcr_port_add(struct smc_ib_device *smcibdev, u8 ibport)
16801681
if (link)
16811682
smc_llc_add_link_local(link);
16821683
}
1684+
spin_unlock_bh(&smc_lgr_list.lock);
16831685
}
16841686

16851687
/* link is down - switch connections to alternate link,

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)