net/smc: Print net namespace in log

This adds net namespace ID to the kernel log, net_cookie is unique in
the whole system. It is useful in container environment.

Signed-off-by: Tony Lu <tonylu@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Tony Lu 2021-12-28 21:06:11 +08:00 committed by David S. Miller
parent 79d39fc503
commit de2fea7b39
2 changed files with 14 additions and 9 deletions

View File

@ -1552,9 +1552,9 @@ void smcr_lgr_set_type(struct smc_link_group *lgr, enum smc_lgr_type new_type)
lgr_type = "ASYMMETRIC_LOCAL"; lgr_type = "ASYMMETRIC_LOCAL";
break; break;
} }
pr_warn_ratelimited("smc: SMC-R lg %*phN state changed: " pr_warn_ratelimited("smc: SMC-R lg %*phN net %llu state changed: "
"%s, pnetid %.16s\n", SMC_LGR_ID_SIZE, &lgr->id, "%s, pnetid %.16s\n", SMC_LGR_ID_SIZE, &lgr->id,
lgr_type, lgr->pnet_id); lgr->net->net_cookie, lgr_type, lgr->pnet_id);
} }
/* set new lgr type and tag a link as asymmetric */ /* set new lgr type and tag a link as asymmetric */

View File

@ -242,9 +242,10 @@ static void smc_llc_flow_parallel(struct smc_link_group *lgr, u8 flow_type,
} }
/* drop parallel or already-in-progress llc requests */ /* drop parallel or already-in-progress llc requests */
if (flow_type != msg_type) if (flow_type != msg_type)
pr_warn_once("smc: SMC-R lg %*phN dropped parallel " pr_warn_once("smc: SMC-R lg %*phN net %llu dropped parallel "
"LLC msg: msg %d flow %d role %d\n", "LLC msg: msg %d flow %d role %d\n",
SMC_LGR_ID_SIZE, &lgr->id, SMC_LGR_ID_SIZE, &lgr->id,
lgr->net->net_cookie,
qentry->msg.raw.hdr.common.type, qentry->msg.raw.hdr.common.type,
flow_type, lgr->role); flow_type, lgr->role);
kfree(qentry); kfree(qentry);
@ -359,9 +360,10 @@ struct smc_llc_qentry *smc_llc_wait(struct smc_link_group *lgr,
smc_llc_flow_qentry_clr(flow)); smc_llc_flow_qentry_clr(flow));
return NULL; return NULL;
} }
pr_warn_once("smc: SMC-R lg %*phN dropped unexpected LLC msg: " pr_warn_once("smc: SMC-R lg %*phN net %llu dropped unexpected LLC msg: "
"msg %d exp %d flow %d role %d flags %x\n", "msg %d exp %d flow %d role %d flags %x\n",
SMC_LGR_ID_SIZE, &lgr->id, rcv_msg, exp_msg, SMC_LGR_ID_SIZE, &lgr->id, lgr->net->net_cookie,
rcv_msg, exp_msg,
flow->type, lgr->role, flow->type, lgr->role,
flow->qentry->msg.raw.hdr.flags); flow->qentry->msg.raw.hdr.flags);
smc_llc_flow_qentry_del(flow); smc_llc_flow_qentry_del(flow);
@ -1816,8 +1818,9 @@ finish:
static void smc_llc_protocol_violation(struct smc_link_group *lgr, u8 type) static void smc_llc_protocol_violation(struct smc_link_group *lgr, u8 type)
{ {
pr_warn_ratelimited("smc: SMC-R lg %*phN LLC protocol violation: " pr_warn_ratelimited("smc: SMC-R lg %*phN net %llu LLC protocol violation: "
"llc_type %d\n", SMC_LGR_ID_SIZE, &lgr->id, type); "llc_type %d\n", SMC_LGR_ID_SIZE, &lgr->id,
lgr->net->net_cookie, type);
smc_llc_set_termination_rsn(lgr, SMC_LLC_DEL_PROT_VIOL); smc_llc_set_termination_rsn(lgr, SMC_LLC_DEL_PROT_VIOL);
smc_lgr_terminate_sched(lgr); smc_lgr_terminate_sched(lgr);
} }
@ -2146,9 +2149,10 @@ int smc_llc_link_init(struct smc_link *link)
void smc_llc_link_active(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, " pr_warn_ratelimited("smc: SMC-R lg %*phN net %llu link added: id %*phN, "
"peerid %*phN, ibdev %s, ibport %d\n", "peerid %*phN, ibdev %s, ibport %d\n",
SMC_LGR_ID_SIZE, &link->lgr->id, SMC_LGR_ID_SIZE, &link->lgr->id,
link->lgr->net->net_cookie,
SMC_LGR_ID_SIZE, &link->link_uid, SMC_LGR_ID_SIZE, &link->link_uid,
SMC_LGR_ID_SIZE, &link->peer_link_uid, SMC_LGR_ID_SIZE, &link->peer_link_uid,
link->smcibdev->ibdev->name, link->ibport); link->smcibdev->ibdev->name, link->ibport);
@ -2164,9 +2168,10 @@ void smc_llc_link_active(struct smc_link *link)
void smc_llc_link_clear(struct smc_link *link, bool log) void smc_llc_link_clear(struct smc_link *link, bool log)
{ {
if (log) if (log)
pr_warn_ratelimited("smc: SMC-R lg %*phN link removed: id %*phN" pr_warn_ratelimited("smc: SMC-R lg %*phN net %llu link removed: id %*phN"
", peerid %*phN, ibdev %s, ibport %d\n", ", peerid %*phN, ibdev %s, ibport %d\n",
SMC_LGR_ID_SIZE, &link->lgr->id, SMC_LGR_ID_SIZE, &link->lgr->id,
link->lgr->net->net_cookie,
SMC_LGR_ID_SIZE, &link->link_uid, SMC_LGR_ID_SIZE, &link->link_uid,
SMC_LGR_ID_SIZE, &link->peer_link_uid, SMC_LGR_ID_SIZE, &link->peer_link_uid,
link->smcibdev->ibdev->name, link->ibport); link->smcibdev->ibdev->name, link->ibport);