Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp734958rdb; Tue, 19 Sep 2023 08:40:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFygDjDbt720/kgbKUaJiFO+xTzru+nrWZExpsESJpQwkggDi3fsF3xzBbuGx25WTjusOPp X-Received: by 2002:a05:6a20:d38b:b0:15a:f7fd:dd97 with SMTP id iq11-20020a056a20d38b00b0015af7fddd97mr11053058pzb.2.1695138011355; Tue, 19 Sep 2023 08:40:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695138011; cv=none; d=google.com; s=arc-20160816; b=VRhCxkLQ1BlTZ2Ic31CHkxkytjL8c7OVODfQ0bn5zjI69PQYXfgyEFlSe0O8x0G8JG DPIxyCFquYmgJi8vpMnexu8BoqIcOVYpSBQH+JOHf+3Mxp4oSYiyFrPvf/14g97tm08k DfEv0pp3/XtfFhe5dX8dPGL9UoPJOz3dLlLyRSFTEBd8UHkqfgEd4oe0XX6XVVmfGSgf Xh+rNKPs/wH0PvLPF3GHpX1Nw+LCvTMj9lzklitQokg+7ncesttRTZPBc1w78OKBAtyq pjP1M7EJM/X549lDpBx7cRY8x/uU/q2NOGXtahljwfYX06UIvr8Snuvp47IlX/Fyxolo Xt2g== 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=QM5jWKqujrJ6N/9s0YdsuBov0QHoba6spTSFi4QNLGk=; fh=2Ks5OhTjwS8gZt4F+VGxBODwUEQ0u2wJBF3lQY5ZqAM=; b=keMyorcAlRodWVvW89NIbdQiBgt14OT17VzSC53FTsMa7qhCDELV4XuBJQC9gE+MuV ERzwqxtc5gkEsGfo0Ru60foaeb0a19BpCXuvi+sU0n0FkCJoT1dLzPvHAA9SOWQKsZOh N/JritBSzzHyH7fMjCtp173bIEg3ooYexKX5aXC4GzG/UGY3i3174siNzMn2V3KNNwYx qhDJzDZDf8JVNkdkaapKJdUx1NroC8JImDWAWzVc+9Dy7yUlQEuisIRBWVmXtrnBf49q DQzBylZiIPZgHxMoQDaiH0WlLnCMMZFPBKsiKNzBr7kyDitIZvoChU8R4r2/FtIW1hce TymA== 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:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b29-20020a63931d000000b005774d2f4abasi9812927pge.876.2023.09.19.08.40.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 08:40:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 32EAC80FA9D0; Tue, 19 Sep 2023 07:43:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233010AbjISOnO (ORCPT + 99 others); Tue, 19 Sep 2023 10:43:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232943AbjISOnG (ORCPT ); Tue, 19 Sep 2023 10:43:06 -0400 Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFAB5BF; Tue, 19 Sep 2023 07:42:52 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=guwen@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0VsRsRuO_1695134567; Received: from localhost(mailfrom:guwen@linux.alibaba.com fp:SMTPD_---0VsRsRuO_1695134567) by smtp.aliyun-inc.com; Tue, 19 Sep 2023 22:42:49 +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: alibuda@linux.alibaba.com, tonylu@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 07/18] net/smc: disable SEID on non-s390 architecture Date: Tue, 19 Sep 2023 22:41:51 +0800 Message-Id: <1695134522-126655-8-git-send-email-guwen@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1695134522-126655-1-git-send-email-guwen@linux.alibaba.com> References: <1695134522-126655-1-git-send-email-guwen@linux.alibaba.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 19 Sep 2023 07:43:26 -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 c08e138..be56a7d 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; } @@ -1290,7 +1300,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