diff options
author | Karsten Graul <kgraul@linux.ibm.com> | 2020-05-04 14:18:48 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-04 19:54:39 +0200 |
commit | 649758fff327eeb184713db8b0b0ebfa28693077 (patch) | |
tree | 491c9b0129cec2e31bfb5e28c1f5baf9791c4cfa /net/smc/smc_llc.c | |
parent | net/smc: create improved SMC-R link_uid (diff) | |
download | linux-649758fff327eeb184713db8b0b0ebfa28693077.tar.xz linux-649758fff327eeb184713db8b0b0ebfa28693077.zip |
net/smc: save SMC-R peer link_uid
During SMC-R link establishment the peers exchange the link_uid that
is used for debugging purposes. Save the peer link_uid in smc_link so it
can be retrieved by the smc_diag netlink interface.
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>
Diffstat (limited to 'net/smc/smc_llc.c')
-rw-r--r-- | net/smc/smc_llc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c index afb889d60881..66ddc9cf5e2f 100644 --- a/net/smc/smc_llc.c +++ b/net/smc/smc_llc.c @@ -770,6 +770,7 @@ static int smc_llc_cli_conf_link(struct smc_link *link, smc_llc_flow_qentry_del(&lgr->llc_flow_lcl); return -ENOLINK; } + smc_llc_save_peer_uid(qentry); smc_llc_flow_qentry_del(&lgr->llc_flow_lcl); rc = smc_ib_modify_qp_rts(link_new); @@ -1041,6 +1042,7 @@ static int smc_llc_srv_conf_link(struct smc_link *link, false, SMC_LLC_DEL_LOST_PATH); return -ENOLINK; } + smc_llc_save_peer_uid(qentry); smc_llc_link_active(link_new); if (lgr_new_t == SMC_LGR_ASYMMETRIC_LOCAL || lgr_new_t == SMC_LGR_ASYMMETRIC_PEER) @@ -1783,6 +1785,13 @@ void smc_llc_link_set_uid(struct smc_link *link) memcpy(link->link_uid, &link_uid, SMC_LGR_ID_SIZE); } +/* save peers link user id, used for debug purposes */ +void smc_llc_save_peer_uid(struct smc_llc_qentry *qentry) +{ + memcpy(qentry->link->peer_link_uid, qentry->msg.confirm_link.link_uid, + SMC_LGR_ID_SIZE); +} + /* evaluate confirm link request or response */ int smc_llc_eval_conf_link(struct smc_llc_qentry *qentry, enum smc_llc_reqresp type) |