From patchwork Tue Sep 19 14:41:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Gu X-Patchwork-Id: 141933 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3447220vqi; Tue, 19 Sep 2023 07:52:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHiJ8xz9Hyepf6WLxzwejHkkGTl9eo5BSbEHfhwMmuGm+zEpvur6l3zpM3Ja2GvPNKrl5l9 X-Received: by 2002:a17:902:cec4:b0:1c4:21f3:4be9 with SMTP id d4-20020a170902cec400b001c421f34be9mr11977827plg.62.1695135135399; Tue, 19 Sep 2023 07:52:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695135135; cv=none; d=google.com; s=arc-20160816; b=OkFCPk2gW1743TF6gVvlIZW+ZPcb7k+EC2dpOPNNZSwfC/3hwbwvHt9NqnXfypGwMh DUkY5jCUxGwNveLm8lJAVsGd8TczUYHcs0g7DNbLD2JQR8xIuPb/ygyVZEWyWZ+WdeB2 GKJUo7Il2lezdvShTGmJDEiqqK720YvHN/QToxL0TsO3VQIMhrab6L45lnD9XuHxzqZa jnWTBxKDrKk5MPfILFV5rsGw5BLta4ThBGlDTGKTVBXRiHnZb9bop3g2ku7WkBvDEKyq 7RVaqThGT318k0DL7G5UMXh/rTsfV1z5jzWVNzD6xf2MYwwwFp/cePIk6Op1ZKZxlNaJ hLbQ== 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=pP9s9r8HD7ySucjT4KcOXsTqAgAMIkkPNmugiGe+8G4=; fh=2Ks5OhTjwS8gZt4F+VGxBODwUEQ0u2wJBF3lQY5ZqAM=; b=DIW/eLWK0+Uggjtp0SbGbYxgMd5aodm0WDGpAm6Sybb4Nk3Hf097ScanlPu9VoSSMs K2ohvlm76NRHkOW3ahkWuCpmwSaTcZQbSPqnOvOiCXi1Cnf1Tqc5qIvgg+ZckcoPcHJS kFl8B435GdOuv8JU9rfiupDzy+TW7f/dPsqTAwNFnf3zEvrDU0HWzgejg3gK0idIKt6b mfX0tmI2sHVqhY1FNC69AfuEu3jLtH8hmIk6SAF38NOtxYdREFdQOILVR88ojmdq9a0w 0a1SBg4FUv3o/iNiDpK01pDXux1QaUNJEuAVjd2FoUREBh4ARtZck631EYdjxc0zseDB hd9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id ik26-20020a170902ab1a00b001c0ab540e62si9786974plb.277.2023.09.19.07.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 07:52:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id AAA0F8244C97; Tue, 19 Sep 2023 07:43:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233024AbjISOnS (ORCPT + 26 others); Tue, 19 Sep 2023 10:43:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232922AbjISOnH (ORCPT ); Tue, 19 Sep 2023 10:43:07 -0400 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6256130; Tue, 19 Sep 2023 07:42:53 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=guwen@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0VsRxW9Y_1695134569; Received: from localhost(mailfrom:guwen@linux.alibaba.com fp:SMTPD_---0VsRxW9Y_1695134569) by smtp.aliyun-inc.com; Tue, 19 Sep 2023 22:42:51 +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 08/18] net/smc: enable virtual ISM device feature bit Date: Tue, 19 Sep 2023 22:41:52 +0800 Message-Id: <1695134522-126655-9-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=-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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 19 Sep 2023 07:43:39 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777478019722794789 X-GMAIL-MSGID: 1777478019722794789 This patch enables the first supplement feature of SMCv2.1, that is the support for virtual ISM devices. Signed-off-by: Wen Gu --- net/smc/af_smc.c | 2 ++ net/smc/smc.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 9e31033..7eab600 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -1522,6 +1522,7 @@ static int __smc_connect(struct smc_sock *smc) ini->smcr_version = SMC_V1 | SMC_V2; ini->smc_type_v1 = SMC_TYPE_B; ini->smc_type_v2 = SMC_TYPE_B; + ini->feature_mask = SMC_FEATURE_MASK; /* get vlan id from IP device */ if (smc_vlan_by_tcpsk(smc->clcsock, ini)) { @@ -1987,6 +1988,7 @@ static int smc_listen_v2_check(struct smc_sock *new_smc, ini->smc_type_v2 = pclc->hdr.typev2; ini->smcd_version = smcd_indicated(ini->smc_type_v1) ? SMC_V1 : 0; ini->smcr_version = smcr_indicated(ini->smc_type_v1) ? SMC_V1 : 0; + ini->feature_mask = SMC_FEATURE_MASK; if (pclc->hdr.version > SMC_V1) { if (smcd_indicated(ini->smc_type_v2)) ini->smcd_version |= SMC_V2; diff --git a/net/smc/smc.h b/net/smc/smc.h index 24745fd..71b9640 100644 --- a/net/smc/smc.h +++ b/net/smc/smc.h @@ -58,6 +58,13 @@ enum smc_state { /* possible states of an SMC socket */ SMC_PROCESSABORT = 27, }; +enum smc_supp_feature { /* supplemental features supported by current version */ + SMC_SPF_VIRT_ISM_DEV = 0, +}; + +#define SMC_FEATURE_MASK \ + (BIT(SMC_SPF_VIRT_ISM_DEV)) + struct smc_link_group; struct smc_wr_rx_hdr { /* common prefix part of LLC and CDC to demultiplex */