Commit 6eadb0b3 authored by David S. Miller's avatar David S. Miller

Merge branch 'smc-r-fixes'

Guangguan Wang says:

====================
Two fixes for SMC-R
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 88e69af0 f5146e3e
...@@ -1662,6 +1662,7 @@ void smcr_port_add(struct smc_ib_device *smcibdev, u8 ibport) ...@@ -1662,6 +1662,7 @@ void smcr_port_add(struct smc_ib_device *smcibdev, u8 ibport)
{ {
struct smc_link_group *lgr, *n; struct smc_link_group *lgr, *n;
spin_lock_bh(&smc_lgr_list.lock);
list_for_each_entry_safe(lgr, n, &smc_lgr_list.list, list) { list_for_each_entry_safe(lgr, n, &smc_lgr_list.list, list) {
struct smc_link *link; struct smc_link *link;
...@@ -1680,6 +1681,7 @@ void smcr_port_add(struct smc_ib_device *smcibdev, u8 ibport) ...@@ -1680,6 +1681,7 @@ void smcr_port_add(struct smc_ib_device *smcibdev, u8 ibport)
if (link) if (link)
smc_llc_add_link_local(link); smc_llc_add_link_local(link);
} }
spin_unlock_bh(&smc_lgr_list.lock);
} }
/* link is down - switch connections to alternate link, /* link is down - switch connections to alternate link,
......
...@@ -243,8 +243,9 @@ while (0) ...@@ -243,8 +243,9 @@ while (0)
#define SMC_STAT_SERV_SUCC_INC(net, _ini) \ #define SMC_STAT_SERV_SUCC_INC(net, _ini) \
do { \ do { \
typeof(_ini) i = (_ini); \ typeof(_ini) i = (_ini); \
bool is_v2 = (i->smcd_version & SMC_V2); \
bool is_smcd = (i->is_smcd); \ 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; \ typeof(net->smc.smc_stats) smc_stats = (net)->smc.smc_stats; \
if (is_v2 && is_smcd) \ if (is_v2 && is_smcd) \
this_cpu_inc(smc_stats->smc[SMC_TYPE_D].srv_v2_succ_cnt); \ this_cpu_inc(smc_stats->smc[SMC_TYPE_D].srv_v2_succ_cnt); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment