Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp362516rdh; Tue, 19 Dec 2023 00:49:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IEsy2ySjzLgrBkxJz5pcf8tXSeRLHaYmex0LdcNIlRhTlkY6I48XztSJznjSEr8yTNMGzV4 X-Received: by 2002:a50:d0da:0:b0:553:8e5e:daed with SMTP id g26-20020a50d0da000000b005538e5edaedmr363503edf.72.1702975772749; Tue, 19 Dec 2023 00:49:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702975772; cv=none; d=google.com; s=arc-20160816; b=xJAnooNzQ09LDj7v/7Au/Y29OzDxzU9BD6npFvTzPIaqrTM42u9Mqa0LAyVrv93kM9 a8pujSTrQoCd6FRTW/uu2N3pERERPjIcb8VG2HyBK+jjy1ejLaDUoZ/KSARRgkyxOrRr X2AOWRX+3Lt2Iku7sZ9hWq1l3kBM/qG5nN/ySdY4lbrAycAwbIiI0xGBsAtBOfyUnhlT kmes8Jq5o0quM+3asLcvZhwBQySJLdwsxDhl9xVpnf+igd7kSOt61sXIWnAvzGv7yg+4 F0wyn6X0MtSTxKq/qN9bRtNQyUTLuQ2gJ7/7l7Q6r4Sc7rGULzx4uyRnTz7NLgWBSpWY GJ0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=zgpnIdJFcFIG84WcCVpJubybALlwgLdncpNVcccSgtc=; fh=uTJ0crBczByYIhxgrQpYUSGkMqtgvc9XI1pgPEVZjxY=; b=mTF9fMvm4lHHHJxnywu5Vqt5nKliUxw1a5QTbcBN7luAijicAoMM/gRBdZu65LN4hr CPq6HVr2w9mT67Dr9DBLG6H8gFc0bKYlqXBQQgPEjl877vfrYCX3vc30PiLpQ6/4t0Pr 7HNd2MY3FpCvK/9x4bZPPS5Y2tltrROoruK9PwcHQhr2P8oGbMhwnrVpAq3GCv0fsncn i07gG8X8IxkZ9XXHf1huA0+gcVuEeNXP2clYMVA2GWMemDCrX32tNAMO2KzrlRBO2wea EbGyPoXqQ1zTtv6GxtmCrfAgDkWoajXm/ap3uGZlVrN/O0lu8vJMwjs8wzv0izZox35M M4UA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4919-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4919-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v6-20020a056402348600b0054c943a07bfsi11066289edc.373.2023.12.19.00.49.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 00:49:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4919-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4919-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4919-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6C6031F2523E for ; Tue, 19 Dec 2023 08:49:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B7500199AA; Tue, 19 Dec 2023 08:46:12 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC60F179BC; Tue, 19 Dec 2023 08:46:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R601e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=guwen@linux.alibaba.com;NM=1;PH=DS;RN=22;SR=0;TI=SMTPD_---0VyqKZza_1702975559; Received: from localhost(mailfrom:guwen@linux.alibaba.com fp:SMTPD_---0VyqKZza_1702975559) by smtp.aliyun-inc.com; Tue, 19 Dec 2023 16:46:01 +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 v7 09/10] net/smc: disable SEID on non-s390 archs where virtual ISM may be used Date: Tue, 19 Dec 2023 16:45:35 +0800 Message-Id: <20231219084536.8158-10-guwen@linux.alibaba.com> X-Mailer: git-send-email 2.32.0.3.g01195cf9f In-Reply-To: <20231219084536.8158-1-guwen@linux.alibaba.com> References: <20231219084536.8158-1-guwen@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The system EID (SEID) is an internal EID used by SMC-D to represent the s390 physical machine that OS is executing on. On s390 architecture, it predefined by fixed string and part of cpuid and is enabled regardless of whether underlay device is virtual ISM or platform firmware ISM. However on non-s390 architectures where SMC-D can be used with virtual ISM devices, there is no similar information to identify physical machines, especially in virtualization scenarios. So 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 Reviewed-and-tested-by: Wenjia Zhang --- 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 b43be3cafdcc..9a13709bea1c 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; } @@ -1328,7 +1338,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) -- 2.32.0.3.g01195cf9f