Commit 4b1b7d3b authored by Hans Wippel's avatar Hans Wippel Committed by David S. Miller

net/smc: add SMC-D diag support

This patch adds diag support for SMC-D.
Signed-off-by: default avatarHans Wippel <hwippel@linux.ibm.com>
Signed-off-by: default avatarUrsula Braun <ubraun@linux.ibm.com>
Suggested-by: default avatarThomas Richter <tmricht@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 41349844
...@@ -35,6 +35,7 @@ enum { ...@@ -35,6 +35,7 @@ enum {
SMC_DIAG_CONNINFO, SMC_DIAG_CONNINFO,
SMC_DIAG_LGRINFO, SMC_DIAG_LGRINFO,
SMC_DIAG_SHUTDOWN, SMC_DIAG_SHUTDOWN,
SMC_DIAG_DMBINFO,
__SMC_DIAG_MAX, __SMC_DIAG_MAX,
}; };
...@@ -83,4 +84,13 @@ struct smc_diag_lgrinfo { ...@@ -83,4 +84,13 @@ struct smc_diag_lgrinfo {
struct smc_diag_linkinfo lnk[1]; struct smc_diag_linkinfo lnk[1];
__u8 role; __u8 role;
}; };
struct smcd_diag_dmbinfo { /* SMC-D Socket internals */
__u32 linkid; /* Link identifier */
__u64 peer_gid; /* Peer GID */
__u64 my_gid; /* My GID */
__u64 token; /* Token of DMB */
__u64 peer_token; /* Token of remote DMBE */
};
#endif /* _UAPI_SMC_DIAG_H_ */ #endif /* _UAPI_SMC_DIAG_H_ */
...@@ -156,6 +156,21 @@ static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb, ...@@ -156,6 +156,21 @@ static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb,
if (nla_put(skb, SMC_DIAG_LGRINFO, sizeof(linfo), &linfo) < 0) if (nla_put(skb, SMC_DIAG_LGRINFO, sizeof(linfo), &linfo) < 0)
goto errout; goto errout;
} }
if (smc->conn.lgr && smc->conn.lgr->is_smcd &&
(req->diag_ext & (1 << (SMC_DIAG_DMBINFO - 1))) &&
!list_empty(&smc->conn.lgr->list)) {
struct smc_connection *conn = &smc->conn;
struct smcd_diag_dmbinfo dinfo = {
.linkid = *((u32 *)conn->lgr->id),
.peer_gid = conn->lgr->peer_gid,
.my_gid = conn->lgr->smcd->local_gid,
.token = conn->rmb_desc->token,
.peer_token = conn->peer_token
};
if (nla_put(skb, SMC_DIAG_DMBINFO, sizeof(dinfo), &dinfo) < 0)
goto errout;
}
nlmsg_end(skb, nlh); nlmsg_end(skb, nlh);
return 0; return 0;
......
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