Skip to content

Commit 01fd161

Browse files
Wen Gudavem330
authored andcommitted
net/smc: support extended GID in SMC-D lgr netlink attribute
Virtual ISM devices introduced in SMCv2.1 requires a 128 bit extended GID vs. the existing ISM 64bit GID. So the 2nd 64 bit of extended GID should be included in SMC-D linkgroup netlink attribute as well. Signed-off-by: Wen Gu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b40584d commit 01fd161

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

include/uapi/linux/smc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ enum {
160160
SMC_NLA_LGR_D_CHID, /* u16 */
161161
SMC_NLA_LGR_D_PAD, /* flag */
162162
SMC_NLA_LGR_D_V2_COMMON, /* nest */
163+
SMC_NLA_LGR_D_EXT_GID, /* u64 */
164+
SMC_NLA_LGR_D_PEER_EXT_GID, /* u64 */
163165
__SMC_NLA_LGR_D_MAX,
164166
SMC_NLA_LGR_D_MAX = __SMC_NLA_LGR_D_MAX - 1
165167
};

include/uapi/linux/smc_diag.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ struct smcd_diag_dmbinfo { /* SMC-D Socket internals */
107107
__aligned_u64 my_gid; /* My GID */
108108
__aligned_u64 token; /* Token of DMB */
109109
__aligned_u64 peer_token; /* Token of remote DMBE */
110+
__aligned_u64 peer_gid_ext; /* Peer GID (extended part) */
111+
__aligned_u64 my_gid_ext; /* My GID (extended part) */
110112
};
111113

112114
#endif /* _UAPI_SMC_DIAG_H_ */

net/smc/smc_core.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,15 @@ static int smc_nl_fill_smcd_lgr(struct smc_link_group *lgr,
526526
if (nla_put_u64_64bit(skb, SMC_NLA_LGR_D_GID,
527527
smcd_gid.gid, SMC_NLA_LGR_D_PAD))
528528
goto errattr;
529+
if (nla_put_u64_64bit(skb, SMC_NLA_LGR_D_EXT_GID,
530+
smcd_gid.gid_ext, SMC_NLA_LGR_D_PAD))
531+
goto errattr;
529532
if (nla_put_u64_64bit(skb, SMC_NLA_LGR_D_PEER_GID, lgr->peer_gid.gid,
530533
SMC_NLA_LGR_D_PAD))
531534
goto errattr;
535+
if (nla_put_u64_64bit(skb, SMC_NLA_LGR_D_PEER_EXT_GID,
536+
lgr->peer_gid.gid_ext, SMC_NLA_LGR_D_PAD))
537+
goto errattr;
532538
if (nla_put_u8(skb, SMC_NLA_LGR_D_VLAN_ID, lgr->vlan_id))
533539
goto errattr;
534540
if (nla_put_u32(skb, SMC_NLA_LGR_D_CONNS_NUM, lgr->conns_num))

net/smc/smc_diag.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,10 @@ static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb,
175175

176176
dinfo.linkid = *((u32 *)conn->lgr->id);
177177
dinfo.peer_gid = conn->lgr->peer_gid.gid;
178+
dinfo.peer_gid_ext = conn->lgr->peer_gid.gid_ext;
178179
smcd->ops->get_local_gid(smcd, &smcd_gid);
179180
dinfo.my_gid = smcd_gid.gid;
181+
dinfo.my_gid_ext = smcd_gid.gid_ext;
180182
dinfo.token = conn->rmb_desc->token;
181183
dinfo.peer_token = conn->peer_token;
182184

0 commit comments

Comments
 (0)