Skip to content

Commit 649758f

Browse files
karstengrdavem330
authored andcommitted
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 <[email protected]> Reviewed-by: Ursula Braun <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 45fa8da commit 649758f

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

net/smc/af_smc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ static int smcr_clnt_conf_first_link(struct smc_sock *smc)
390390
SMC_CLC_DECLINE, CLC_WAIT_TIME_SHORT);
391391
return rc == -EAGAIN ? SMC_CLC_DECL_TIMEOUT_CL : rc;
392392
}
393+
smc_llc_save_peer_uid(qentry);
393394
rc = smc_llc_eval_conf_link(qentry, SMC_LLC_REQ);
394395
smc_llc_flow_qentry_del(&link->lgr->llc_flow_lcl);
395396
if (rc)
@@ -1056,6 +1057,7 @@ static int smcr_serv_conf_first_link(struct smc_sock *smc)
10561057
SMC_CLC_DECLINE, CLC_WAIT_TIME_SHORT);
10571058
return rc == -EAGAIN ? SMC_CLC_DECL_TIMEOUT_CL : rc;
10581059
}
1060+
smc_llc_save_peer_uid(qentry);
10591061
rc = smc_llc_eval_conf_link(qentry, SMC_LLC_RESP);
10601062
smc_llc_flow_qentry_del(&link->lgr->llc_flow_lcl);
10611063
if (rc)

net/smc/smc_core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ struct smc_link {
119119
u8 peer_gid[SMC_GID_SIZE]; /* gid of peer*/
120120
u8 link_id; /* unique # within link group */
121121
u8 link_uid[SMC_LGR_ID_SIZE]; /* unique lnk id */
122+
u8 peer_link_uid[SMC_LGR_ID_SIZE]; /* peer uid */
122123
u8 link_idx; /* index in lgr link array */
123124
u8 link_is_asym; /* is link asymmetric? */
124125
struct smc_link_group *lgr; /* parent link group */

net/smc/smc_llc.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ static int smc_llc_cli_conf_link(struct smc_link *link,
770770
smc_llc_flow_qentry_del(&lgr->llc_flow_lcl);
771771
return -ENOLINK;
772772
}
773+
smc_llc_save_peer_uid(qentry);
773774
smc_llc_flow_qentry_del(&lgr->llc_flow_lcl);
774775

775776
rc = smc_ib_modify_qp_rts(link_new);
@@ -1041,6 +1042,7 @@ static int smc_llc_srv_conf_link(struct smc_link *link,
10411042
false, SMC_LLC_DEL_LOST_PATH);
10421043
return -ENOLINK;
10431044
}
1045+
smc_llc_save_peer_uid(qentry);
10441046
smc_llc_link_active(link_new);
10451047
if (lgr_new_t == SMC_LGR_ASYMMETRIC_LOCAL ||
10461048
lgr_new_t == SMC_LGR_ASYMMETRIC_PEER)
@@ -1783,6 +1785,13 @@ void smc_llc_link_set_uid(struct smc_link *link)
17831785
memcpy(link->link_uid, &link_uid, SMC_LGR_ID_SIZE);
17841786
}
17851787

1788+
/* save peers link user id, used for debug purposes */
1789+
void smc_llc_save_peer_uid(struct smc_llc_qentry *qentry)
1790+
{
1791+
memcpy(qentry->link->peer_link_uid, qentry->msg.confirm_link.link_uid,
1792+
SMC_LGR_ID_SIZE);
1793+
}
1794+
17861795
/* evaluate confirm link request or response */
17871796
int smc_llc_eval_conf_link(struct smc_llc_qentry *qentry,
17881797
enum smc_llc_reqresp type)

net/smc/smc_llc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ void smc_llc_flow_stop(struct smc_link_group *lgr, struct smc_llc_flow *flow);
9393
int smc_llc_eval_conf_link(struct smc_llc_qentry *qentry,
9494
enum smc_llc_reqresp type);
9595
void smc_llc_link_set_uid(struct smc_link *link);
96+
void smc_llc_save_peer_uid(struct smc_llc_qentry *qentry);
9697
struct smc_llc_qentry *smc_llc_wait(struct smc_link_group *lgr,
9798
struct smc_link *lnk,
9899
int time_out, u8 exp_msg);

0 commit comments

Comments
 (0)