Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp709274rdh; Sun, 24 Sep 2023 08:19:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6O61egMeu2Q206ZYq8Vw+4x/e3tXXGrQay2hmqAAj2DNwQQYs886PKk3txI4vUOtazL0G X-Received: by 2002:a05:6a00:b86:b0:68f:dfda:1814 with SMTP id g6-20020a056a000b8600b0068fdfda1814mr6332101pfj.18.1695568746933; Sun, 24 Sep 2023 08:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695568746; cv=none; d=google.com; s=arc-20160816; b=HAO6rxAosQaywhVj6YxwzNxhe3nZOrdZ2bop6CYYfSCLdzWeuuD2ii0XTkvudcLDW9 tUGwUC3rJKorjl2+phzP37q3ZQ6cRBUMDAE4JrkYcEYLBJgTvlJCX1neGQbemD9UXNDM hDPgatpq+lQZFmNlaRdGG8R3ZTe3P4wfUjjaQY0HpIqq/pdW27q0DdXmSA5qdt4cxsSs h9vuVyzQ2We70gXIiI6CE4Rh03hjUOcCvaO1R+UeEuRmbcz+ySb1jRgtv69f9h2cdR71 4JomEF1zA5/omS65xp/MCxNwyHpdLszJvIbcp/vVbjGFA+60Fey62e+QLSWeVFCm74fj xXBw== 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=vaRV/SHmo38xfGxi/oWEK8KYykRR6d7p/u9gPXM7bTA=; fh=kTBstCixiri9Ahdk8UNuw7wmcx8Ry+mqafUdDsc8Vd0=; b=DwZATF2guYYUApl0RcdRE1WcGzvJ+oEUBrSMQKtcGiNAoJVl/xp6KKykVtNOv3HU1/ 1XqN2/EXbU6RNWSsyO/jt9/u+xKcNGk/f5MKkD6gs7bIoBke3bpdut79Am12NPGyBQ8L 1eySIPfUrGhjRCqDsK523KI7IrLDgvb+IWMTENFvG1Wyjatm4L+PVTp+lKW+BvLk5ppF gY8M9DITCrZRHdwWavduv+plLO0XYJbagzNl9l91PTsWiFUEciTMCLotNNz99Pg+7XVJ TXF+Yn8HYd9yB6nui1TCl4E62DgnLyTSl62Rl8tIw2CRteFHLzO0XEYuj3bR+6LnHfor Gegw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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. [23.128.96.36]) by mx.google.com with ESMTPS id u41-20020a056a0009a900b0068fdeb84453si8504206pfg.265.2023.09.24.08.19.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 08:19:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 7154480202ED; Sun, 24 Sep 2023 08:19:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230109AbjIXPRh (ORCPT + 99 others); Sun, 24 Sep 2023 11:17:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbjIXPRe (ORCPT ); Sun, 24 Sep 2023 11:17:34 -0400 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 D9862180; Sun, 24 Sep 2023 08:17:17 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=guwen@linux.alibaba.com;NM=1;PH=DS;RN=18;SR=0;TI=SMTPD_---0VsinOab_1695568633; Received: from localhost(mailfrom:guwen@linux.alibaba.com fp:SMTPD_---0VsinOab_1695568633) by smtp.aliyun-inc.com; Sun, 24 Sep 2023 23:17:15 +0800 From: Wen Gu To: kgraul@linux.ibm.com, wenjia@linux.ibm.com, jaka@linux.ibm.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: wintera@linux.ibm.com, schnelle@linux.ibm.com, gbayer@linux.ibm.com, pasic@linux.ibm.com, alibuda@linux.alibaba.com, tonylu@linux.alibaba.com, dust.li@linux.alibaba.com, guwen@linux.alibaba.com, linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v4 07/18] net/smc: disable SEID on non-s390 architecture Date: Sun, 24 Sep 2023 23:16:42 +0800 Message-Id: <1695568613-125057-8-git-send-email-guwen@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1695568613-125057-1-git-send-email-guwen@linux.alibaba.com> References: <1695568613-125057-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,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]); Sun, 24 Sep 2023 08:19:00 -0700 (PDT) On s390 architecture SMC-Dv2 SEID is generated by ISMv2 device with partial cpuid. It is predefined and unique to represents the physical machine (CPC), the maximum communication space of SMC-D. On non-s390 archs like x86/64 or ARM, there is no similar information to identify physical machine, especially in virtualization scenarios like KVM, etc. In such cases, SEID is forcibly disabled and the user- defined UEID will be used to represent the communicable space. Signed-off-by: Wen Gu --- net/smc/smc_clc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/net/smc/smc_clc.c b/net/smc/smc_clc.c index aeb9643..deb43db 100644 --- a/net/smc/smc_clc.c +++ b/net/smc/smc_clc.c @@ -155,10 +155,12 @@ static int smc_clc_ueid_remove(char *ueid) rc = 0; } } +#if IS_ENABLED(CONFIG_S390) if (!rc && !smc_clc_eid_table.ueid_cnt) { smc_clc_eid_table.seid_enabled = 1; rc = -EAGAIN; /* indicate success and enabling of seid */ } +#endif write_unlock(&smc_clc_eid_table.lock); return rc; } @@ -273,22 +275,30 @@ int smc_nl_dump_seid(struct sk_buff *skb, struct netlink_callback *cb) int smc_nl_enable_seid(struct sk_buff *skb, struct genl_info *info) { +#if IS_ENABLED(CONFIG_S390) write_lock(&smc_clc_eid_table.lock); smc_clc_eid_table.seid_enabled = 1; write_unlock(&smc_clc_eid_table.lock); return 0; +#else + return -EOPNOTSUPP; +#endif } int smc_nl_disable_seid(struct sk_buff *skb, struct genl_info *info) { int rc = 0; +#if IS_ENABLED(CONFIG_S390) write_lock(&smc_clc_eid_table.lock); if (!smc_clc_eid_table.ueid_cnt) rc = -ENOENT; else smc_clc_eid_table.seid_enabled = 0; write_unlock(&smc_clc_eid_table.lock); +#else + rc = -EOPNOTSUPP; +#endif return rc; } @@ -1292,7 +1302,11 @@ void __init smc_clc_init(void) INIT_LIST_HEAD(&smc_clc_eid_table.list); rwlock_init(&smc_clc_eid_table.lock); smc_clc_eid_table.ueid_cnt = 0; +#if IS_ENABLED(CONFIG_S390) smc_clc_eid_table.seid_enabled = 1; +#else + smc_clc_eid_table.seid_enabled = 0; +#endif } void smc_clc_exit(void) -- 1.8.3.1