Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <guwen@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Wen Gu and committed by
David S. Miller
01fd1617 b40584d1

+12
+2
include/uapi/linux/smc.h
··· 160 160 SMC_NLA_LGR_D_CHID, /* u16 */ 161 161 SMC_NLA_LGR_D_PAD, /* flag */ 162 162 SMC_NLA_LGR_D_V2_COMMON, /* nest */ 163 + SMC_NLA_LGR_D_EXT_GID, /* u64 */ 164 + SMC_NLA_LGR_D_PEER_EXT_GID, /* u64 */ 163 165 __SMC_NLA_LGR_D_MAX, 164 166 SMC_NLA_LGR_D_MAX = __SMC_NLA_LGR_D_MAX - 1 165 167 };
+2
include/uapi/linux/smc_diag.h
··· 107 107 __aligned_u64 my_gid; /* My GID */ 108 108 __aligned_u64 token; /* Token of DMB */ 109 109 __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) */ 110 112 }; 111 113 112 114 #endif /* _UAPI_SMC_DIAG_H_ */
+6
net/smc/smc_core.c
··· 526 526 if (nla_put_u64_64bit(skb, SMC_NLA_LGR_D_GID, 527 527 smcd_gid.gid, SMC_NLA_LGR_D_PAD)) 528 528 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; 529 532 if (nla_put_u64_64bit(skb, SMC_NLA_LGR_D_PEER_GID, lgr->peer_gid.gid, 530 533 SMC_NLA_LGR_D_PAD)) 534 + 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)) 531 537 goto errattr; 532 538 if (nla_put_u8(skb, SMC_NLA_LGR_D_VLAN_ID, lgr->vlan_id)) 533 539 goto errattr;
+2
net/smc/smc_diag.c
··· 175 175 176 176 dinfo.linkid = *((u32 *)conn->lgr->id); 177 177 dinfo.peer_gid = conn->lgr->peer_gid.gid; 178 + dinfo.peer_gid_ext = conn->lgr->peer_gid.gid_ext; 178 179 smcd->ops->get_local_gid(smcd, &smcd_gid); 179 180 dinfo.my_gid = smcd_gid.gid; 181 + dinfo.my_gid_ext = smcd_gid.gid_ext; 180 182 dinfo.token = conn->rmb_desc->token; 181 183 dinfo.peer_token = conn->peer_token; 182 184