Commit 38a6acdf authored by Wen Gu's avatar Wen Gu Committed by Zhengchao Shao
Browse files

net/smc: support extended GID in SMC-D lgr netlink attribute

mainline inclusion
from mainline-v6.8-rc1
commit 01fd1617dbc6f558efd1811f2bc433659d1e8304
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IACM52

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=01fd1617dbc6f558efd1811f2bc433659d1e8304



--------------------------------

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: default avatarWen Gu <guwen@linux.alibaba.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
parent 9a4c1d5d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -160,6 +160,8 @@ enum {
	SMC_NLA_LGR_D_CHID,		/* u16 */
	SMC_NLA_LGR_D_PAD,		/* flag */
	SMC_NLA_LGR_D_V2_COMMON,	/* nest */
	SMC_NLA_LGR_D_EXT_GID,		/* u64 */
	SMC_NLA_LGR_D_PEER_EXT_GID,	/* u64 */
	__SMC_NLA_LGR_D_MAX,
	SMC_NLA_LGR_D_MAX = __SMC_NLA_LGR_D_MAX - 1
};
+2 −0
Original line number Diff line number Diff line
@@ -107,6 +107,8 @@ struct smcd_diag_dmbinfo { /* SMC-D Socket internals */
	__aligned_u64	my_gid;		/* My GID */
	__aligned_u64	token;		/* Token of DMB */
	__aligned_u64	peer_token;	/* Token of remote DMBE */
	__aligned_u64	peer_gid_ext;	/* Peer GID (extended part) */
	__aligned_u64	my_gid_ext;	/* My GID (extended part) */
};

#endif /* _UAPI_SMC_DIAG_H_ */
+6 −0
Original line number Diff line number Diff line
@@ -526,9 +526,15 @@ static int smc_nl_fill_smcd_lgr(struct smc_link_group *lgr,
	if (nla_put_u64_64bit(skb, SMC_NLA_LGR_D_GID,
			      smcd_gid.gid, SMC_NLA_LGR_D_PAD))
		goto errattr;
	if (nla_put_u64_64bit(skb, SMC_NLA_LGR_D_EXT_GID,
			      smcd_gid.gid_ext, SMC_NLA_LGR_D_PAD))
		goto errattr;
	if (nla_put_u64_64bit(skb, SMC_NLA_LGR_D_PEER_GID, lgr->peer_gid.gid,
			      SMC_NLA_LGR_D_PAD))
		goto errattr;
	if (nla_put_u64_64bit(skb, SMC_NLA_LGR_D_PEER_EXT_GID,
			      lgr->peer_gid.gid_ext, SMC_NLA_LGR_D_PAD))
		goto errattr;
	if (nla_put_u8(skb, SMC_NLA_LGR_D_VLAN_ID, lgr->vlan_id))
		goto errattr;
	if (nla_put_u32(skb, SMC_NLA_LGR_D_CONNS_NUM, lgr->conns_num))
+2 −0
Original line number Diff line number Diff line
@@ -174,8 +174,10 @@ static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb,

		dinfo.linkid = *((u32 *)conn->lgr->id);
		dinfo.peer_gid = conn->lgr->peer_gid.gid;
		dinfo.peer_gid_ext = conn->lgr->peer_gid.gid_ext;
		smcd->ops->get_local_gid(smcd, &smcd_gid);
		dinfo.my_gid = smcd_gid.gid;
		dinfo.my_gid_ext = smcd_gid.gid_ext;
		dinfo.token = conn->rmb_desc->token;
		dinfo.peer_token = conn->peer_token;