Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1411427rdb; Wed, 6 Dec 2023 19:51:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGM94fVgtecti/hb/FsTEKwV14CB7NdD6aL7Ghdov9y4hci+95keUnwK0GnCpcbGEFujlaN X-Received: by 2002:a05:6870:71c4:b0:1fa:a95:12a7 with SMTP id p4-20020a05687071c400b001fa0a9512a7mr2174175oag.38.1701921107219; Wed, 06 Dec 2023 19:51:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701921107; cv=none; d=google.com; s=arc-20160816; b=tKKgPqMCf9+scLziuW0tHXqfbr7cIk7hUp3y5OS1EIAMCbnvzfNP+pM1XdPYJn+ZDD JBOOqo5X692HuwWR00cB9+wL9UWrGC/w73Qp7u+bp7yDcrM1pQ2RyCvno07wt7JKd0PY YpG6N5R0iDcwBuGVlQRmZGmoSPnzLrNIC7lEh+sgU2Ek3vJR2t0rbmKO18QXEbOZBaxy yZ4dxq9Lrr/v7rNe2eDKjQs7zC+Leb+YCLhXVW302m08YdaqUscJEkkqV8Qwzn9AuWfr eXgcKM5VTRwsLWNGYjHUUqH7fF8SGyEFLoi9ECvZdCPA5XjR6wpxjn5AQeqF+tP6bJeZ ssng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=c1+Tpl0Saa93ABaIAFUiLACKwUBJUDc5D+ql9OokVw0=; fh=uTJ0crBczByYIhxgrQpYUSGkMqtgvc9XI1pgPEVZjxY=; b=mvfOHeDbxwTqH/xELQ0FdBomBF9mNpp8cwvzQnExoPOZq0G+Zx08LozqZtePkiaypH Zsd3kt6NGfo/1TtbU0YYu8b16b2TDRF4dJ7a9tO41iXhSy2qrznuGL+qFylZcsJAKP0m mGmvw1UeWxP4eLRAvYAXaoSeAhObIgaGpGkyhKlMd1ctqhT4nS1lo8rSmWx1w1XIf71l TqgCgfzblZAdei8GElZGte0mH0yJofTsXo0rrSeUMtNYa3CFhNtAcifNhFlxa7CfKgRX VZhEkR1MuKA2P2KCQ6p6PA+rvhubDN5+eXdCveLknMycYn4lDPRAfpmR1Xde2dYtJWqT 4Pqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id ca40-20020a056a0206a800b005bdbd1b52d4si413155pgb.270.2023.12.06.19.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 19:51:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 9581B80A6883; Wed, 6 Dec 2023 19:51:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230473AbjLGDur (ORCPT + 99 others); Wed, 6 Dec 2023 22:50:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbjLGDuZ (ORCPT ); Wed, 6 Dec 2023 22:50:25 -0500 Received: from out30-112.freemail.mail.aliyun.com (out30-112.freemail.mail.aliyun.com [115.124.30.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BD6F1717; Wed, 6 Dec 2023 19:50:23 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=guwen@linux.alibaba.com;NM=1;PH=DS;RN=22;SR=0;TI=SMTPD_---0Vy-N8Tj_1701921018; Received: from localhost(mailfrom:guwen@linux.alibaba.com fp:SMTPD_---0Vy-N8Tj_1701921018) by smtp.aliyun-inc.com; Thu, 07 Dec 2023 11:50:20 +0800 From: Wen Gu To: wintera@linux.ibm.com, wenjia@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, kgraul@linux.ibm.com, jaka@linux.ibm.com Cc: borntraeger@linux.ibm.com, svens@linux.ibm.com, alibuda@linux.alibaba.com, tonylu@linux.alibaba.com, guwen@linux.alibaba.com, raspl@linux.ibm.com, schnelle@linux.ibm.com, guangguan.wang@linux.alibaba.com, linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v4 9/9] net/smc: support extended GID in SMC-D lgr netlink attribute Date: Thu, 7 Dec 2023 11:49:54 +0800 Message-Id: <1701920994-73705-10-git-send-email-guwen@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1701920994-73705-1-git-send-email-guwen@linux.alibaba.com> References: <1701920994-73705-1-git-send-email-guwen@linux.alibaba.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 06 Dec 2023 19:51:44 -0800 (PST) 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 --- include/uapi/linux/smc.h | 2 ++ include/uapi/linux/smc_diag.h | 2 ++ net/smc/smc_core.c | 6 ++++++ net/smc/smc_diag.c | 2 ++ 4 files changed, 12 insertions(+) diff --git a/include/uapi/linux/smc.h b/include/uapi/linux/smc.h index 837fcd4..b531e3e 100644 --- a/include/uapi/linux/smc.h +++ b/include/uapi/linux/smc.h @@ -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 }; diff --git a/include/uapi/linux/smc_diag.h b/include/uapi/linux/smc_diag.h index 8cb3a6f..58eceb7 100644 --- a/include/uapi/linux/smc_diag.h +++ b/include/uapi/linux/smc_diag.h @@ -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_ */ diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index 672eff0..95cc954 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -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)) diff --git a/net/smc/smc_diag.c b/net/smc/smc_diag.c index c180c18..3fbe14e 100644 --- a/net/smc/smc_diag.c +++ b/net/smc/smc_diag.c @@ -175,8 +175,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; -- 1.8.3.1