summaryrefslogtreecommitdiff
path: root/net/smc/smc_diag.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-06-30 14:42:26 +0300
committerDavid S. Miller <davem@davemloft.net>2018-06-30 14:42:26 +0300
commitb5f16484dd1c99b63eb986121c2b0fc624182d52 (patch)
tree75c7a211188000f16cd750058b57c5405e722aad /net/smc/smc_diag.c
parentb0402f0113675ad78bc10c839f93a25348dd1f73 (diff)
parent684b89bc39ce4f204b1a2b180f39f2eb36a6b695 (diff)
downloadlinux-b5f16484dd1c99b63eb986121c2b0fc624182d52.tar.xz
Merge branch 'smc-pnetid-and-SMC-D-support'
Ursula Braun says: ==================== smc: pnetid and SMC-D support SMC requires a configured pnet table to map Ethernet interfaces to RoCE adapter ports. For s390 there exists hardware support to group such devices. The first three patches cover the s390 pnetid support, enabling SMC-R usage on s390 without configuring an extra pnet table. SMC currently requires RoCE adapters, and uses RDMA-techniques implemented with IB-verbs. But s390 offers another method for intra-CEC Shared Memory communication. The following seven patches implement a solution to run SMC traffic based on intra-CEC DMA, called SMC-D. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/smc_diag.c')
-rw-r--r--net/smc/smc_diag.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/net/smc/smc_diag.c b/net/smc/smc_diag.c
index 839354402215..6d83eef1b743 100644
--- a/net/smc/smc_diag.c
+++ b/net/smc/smc_diag.c
@@ -136,7 +136,8 @@ static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb,
goto errout;
}
- if ((req->diag_ext & (1 << (SMC_DIAG_LGRINFO - 1))) && smc->conn.lgr &&
+ if (smc->conn.lgr && !smc->conn.lgr->is_smcd &&
+ (req->diag_ext & (1 << (SMC_DIAG_LGRINFO - 1))) &&
!list_empty(&smc->conn.lgr->list)) {
struct smc_diag_lgrinfo linfo = {
.role = smc->conn.lgr->role,
@@ -155,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)
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);
return 0;