net/smc: log important pnetid and state change events
Print to system log when SMC links are available or go down, link group state changes or pnetids are applied to and removed from devices. The log entries are triggered by either user configuration actions or adapter activation/deactivation events and are not expected to happen often. The entries help SMC users to keep track of the SMC link group status and to detect when actions are needed (like to add replacements for failed adapters). Signed-off-by: Karsten Graul <kgraul@linux.ibm.com> Reviewed-by: Ursula Braun <ubraun@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
b38eb47f48
commit
0a99be434d
@@ -870,7 +870,7 @@ int smc_llc_cli_add_link(struct smc_link *link, struct smc_llc_qentry *qentry)
|
||||
if (!rc)
|
||||
goto out;
|
||||
out_clear_lnk:
|
||||
smcr_link_clear(lnk_new);
|
||||
smcr_link_clear(lnk_new, false);
|
||||
out_reject:
|
||||
smc_llc_cli_add_link_reject(qentry);
|
||||
out:
|
||||
@@ -977,7 +977,7 @@ static void smc_llc_delete_asym_link(struct smc_link_group *lgr)
|
||||
}
|
||||
smc_llc_flow_qentry_del(&lgr->llc_flow_lcl);
|
||||
out_free:
|
||||
smcr_link_clear(lnk_asym);
|
||||
smcr_link_clear(lnk_asym, true);
|
||||
}
|
||||
|
||||
static int smc_llc_srv_rkey_exchange(struct smc_link *link,
|
||||
@@ -1121,7 +1121,7 @@ int smc_llc_srv_add_link(struct smc_link *link)
|
||||
goto out_err;
|
||||
return 0;
|
||||
out_err:
|
||||
smcr_link_clear(link_new);
|
||||
smcr_link_clear(link_new, false);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -1227,7 +1227,7 @@ static void smc_llc_process_cli_delete_link(struct smc_link_group *lgr)
|
||||
smc_switch_conns(lgr, lnk_del, false);
|
||||
smc_wr_tx_wait_no_pending_sends(lnk_del);
|
||||
}
|
||||
smcr_link_clear(lnk_del);
|
||||
smcr_link_clear(lnk_del, true);
|
||||
|
||||
active_links = smc_llc_active_link_count(lgr);
|
||||
if (lnk_del == lnk_asym) {
|
||||
@@ -1320,7 +1320,7 @@ static void smc_llc_process_srv_delete_link(struct smc_link_group *lgr)
|
||||
}
|
||||
}
|
||||
}
|
||||
smcr_link_clear(lnk_del);
|
||||
smcr_link_clear(lnk_del, true);
|
||||
|
||||
active_links = smc_llc_active_link_count(lgr);
|
||||
if (active_links == 1) {
|
||||
@@ -1711,6 +1711,12 @@ int smc_llc_link_init(struct smc_link *link)
|
||||
|
||||
void smc_llc_link_active(struct smc_link *link)
|
||||
{
|
||||
pr_warn_ratelimited("smc: SMC-R lg %*phN link added: id %*phN, "
|
||||
"peerid %*phN, ibdev %s, ibport %d\n",
|
||||
SMC_LGR_ID_SIZE, &link->lgr->id,
|
||||
SMC_LGR_ID_SIZE, &link->link_uid,
|
||||
SMC_LGR_ID_SIZE, &link->peer_link_uid,
|
||||
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;
|
||||
@@ -1720,8 +1726,15 @@ void smc_llc_link_active(struct smc_link *link)
|
||||
}
|
||||
|
||||
/* called in worker context */
|
||||
void smc_llc_link_clear(struct smc_link *link)
|
||||
void smc_llc_link_clear(struct smc_link *link, bool log)
|
||||
{
|
||||
if (log)
|
||||
pr_warn_ratelimited("smc: SMC-R lg %*phN link removed: id %*phN"
|
||||
", peerid %*phN, ibdev %s, ibport %d\n",
|
||||
SMC_LGR_ID_SIZE, &link->lgr->id,
|
||||
SMC_LGR_ID_SIZE, &link->link_uid,
|
||||
SMC_LGR_ID_SIZE, &link->peer_link_uid,
|
||||
link->smcibdev->ibdev->name, link->ibport);
|
||||
complete(&link->llc_testlink_resp);
|
||||
cancel_delayed_work_sync(&link->llc_testlink_wrk);
|
||||
smc_wr_wakeup_reg_wait(link);
|
||||
|
Reference in New Issue
Block a user