Commit 649758ff authored by Karsten Graul's avatar Karsten Graul Committed by David S. Miller

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: default avatarKarsten Graul <kgraul@linux.ibm.com>
Reviewed-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 45fa8da0
...@@ -390,6 +390,7 @@ static int smcr_clnt_conf_first_link(struct smc_sock *smc) ...@@ -390,6 +390,7 @@ static int smcr_clnt_conf_first_link(struct smc_sock *smc)
SMC_CLC_DECLINE, CLC_WAIT_TIME_SHORT); SMC_CLC_DECLINE, CLC_WAIT_TIME_SHORT);
return rc == -EAGAIN ? SMC_CLC_DECL_TIMEOUT_CL : rc; return rc == -EAGAIN ? SMC_CLC_DECL_TIMEOUT_CL : rc;
} }
smc_llc_save_peer_uid(qentry);
rc = smc_llc_eval_conf_link(qentry, SMC_LLC_REQ); rc = smc_llc_eval_conf_link(qentry, SMC_LLC_REQ);
smc_llc_flow_qentry_del(&link->lgr->llc_flow_lcl); smc_llc_flow_qentry_del(&link->lgr->llc_flow_lcl);
if (rc) if (rc)
...@@ -1056,6 +1057,7 @@ static int smcr_serv_conf_first_link(struct smc_sock *smc) ...@@ -1056,6 +1057,7 @@ static int smcr_serv_conf_first_link(struct smc_sock *smc)
SMC_CLC_DECLINE, CLC_WAIT_TIME_SHORT); SMC_CLC_DECLINE, CLC_WAIT_TIME_SHORT);
return rc == -EAGAIN ? SMC_CLC_DECL_TIMEOUT_CL : rc; return rc == -EAGAIN ? SMC_CLC_DECL_TIMEOUT_CL : rc;
} }
smc_llc_save_peer_uid(qentry);
rc = smc_llc_eval_conf_link(qentry, SMC_LLC_RESP); rc = smc_llc_eval_conf_link(qentry, SMC_LLC_RESP);
smc_llc_flow_qentry_del(&link->lgr->llc_flow_lcl); smc_llc_flow_qentry_del(&link->lgr->llc_flow_lcl);
if (rc) if (rc)
......
...@@ -119,6 +119,7 @@ struct smc_link { ...@@ -119,6 +119,7 @@ struct smc_link {
u8 peer_gid[SMC_GID_SIZE]; /* gid of peer*/ u8 peer_gid[SMC_GID_SIZE]; /* gid of peer*/
u8 link_id; /* unique # within link group */ u8 link_id; /* unique # within link group */
u8 link_uid[SMC_LGR_ID_SIZE]; /* unique lnk id */ u8 link_uid[SMC_LGR_ID_SIZE]; /* unique lnk id */
u8 peer_link_uid[SMC_LGR_ID_SIZE]; /* peer uid */
u8 link_idx; /* index in lgr link array */ u8 link_idx; /* index in lgr link array */
u8 link_is_asym; /* is link asymmetric? */ u8 link_is_asym; /* is link asymmetric? */
struct smc_link_group *lgr; /* parent link group */ struct smc_link_group *lgr; /* parent link group */
......
...@@ -770,6 +770,7 @@ static int smc_llc_cli_conf_link(struct smc_link *link, ...@@ -770,6 +770,7 @@ static int smc_llc_cli_conf_link(struct smc_link *link,
smc_llc_flow_qentry_del(&lgr->llc_flow_lcl); smc_llc_flow_qentry_del(&lgr->llc_flow_lcl);
return -ENOLINK; return -ENOLINK;
} }
smc_llc_save_peer_uid(qentry);
smc_llc_flow_qentry_del(&lgr->llc_flow_lcl); smc_llc_flow_qentry_del(&lgr->llc_flow_lcl);
rc = smc_ib_modify_qp_rts(link_new); rc = smc_ib_modify_qp_rts(link_new);
...@@ -1041,6 +1042,7 @@ static int smc_llc_srv_conf_link(struct smc_link *link, ...@@ -1041,6 +1042,7 @@ static int smc_llc_srv_conf_link(struct smc_link *link,
false, SMC_LLC_DEL_LOST_PATH); false, SMC_LLC_DEL_LOST_PATH);
return -ENOLINK; return -ENOLINK;
} }
smc_llc_save_peer_uid(qentry);
smc_llc_link_active(link_new); smc_llc_link_active(link_new);
if (lgr_new_t == SMC_LGR_ASYMMETRIC_LOCAL || if (lgr_new_t == SMC_LGR_ASYMMETRIC_LOCAL ||
lgr_new_t == SMC_LGR_ASYMMETRIC_PEER) lgr_new_t == SMC_LGR_ASYMMETRIC_PEER)
...@@ -1783,6 +1785,13 @@ void smc_llc_link_set_uid(struct smc_link *link) ...@@ -1783,6 +1785,13 @@ void smc_llc_link_set_uid(struct smc_link *link)
memcpy(link->link_uid, &link_uid, SMC_LGR_ID_SIZE); 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 */ /* evaluate confirm link request or response */
int smc_llc_eval_conf_link(struct smc_llc_qentry *qentry, int smc_llc_eval_conf_link(struct smc_llc_qentry *qentry,
enum smc_llc_reqresp type) enum smc_llc_reqresp type)
......
...@@ -93,6 +93,7 @@ void smc_llc_flow_stop(struct smc_link_group *lgr, struct smc_llc_flow *flow); ...@@ -93,6 +93,7 @@ void smc_llc_flow_stop(struct smc_link_group *lgr, struct smc_llc_flow *flow);
int smc_llc_eval_conf_link(struct smc_llc_qentry *qentry, int smc_llc_eval_conf_link(struct smc_llc_qentry *qentry,
enum smc_llc_reqresp type); enum smc_llc_reqresp type);
void smc_llc_link_set_uid(struct smc_link *link); void smc_llc_link_set_uid(struct smc_link *link);
void smc_llc_save_peer_uid(struct smc_llc_qentry *qentry);
struct smc_llc_qentry *smc_llc_wait(struct smc_link_group *lgr, struct smc_llc_qentry *smc_llc_wait(struct smc_link_group *lgr,
struct smc_link *lnk, struct smc_link *lnk,
int time_out, u8 exp_msg); int time_out, u8 exp_msg);
......
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