Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3166313rdh; Thu, 28 Sep 2023 04:54:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEOHuhxkTBJbHCIU8TjJlqjx3+83T6IFpkXgKq1WcPh5z2wFIVwKjDstnAddw9CaRTHKfcq X-Received: by 2002:aca:130c:0:b0:3ae:50fa:4ca2 with SMTP id e12-20020aca130c000000b003ae50fa4ca2mr880852oii.24.1695902077561; Thu, 28 Sep 2023 04:54:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695902077; cv=none; d=google.com; s=arc-20160816; b=sBuz3/t3M1znGfMfN7dBtqOKzN+H2nVHDGyBilMBrmi3udC9jiY60PBNouRPp/XYSZ MH3DmWtMroAcuKRZ+FOVLIB4i2pyTSQt2P1uGQRnw37FKUTlRKACCxuNzY1q5KHSlpsI 5+x0gpTL4RaCf3yEZcIPM99tGtMMbArqDDBCtcLqTv82e9CbfGPvDLuWM0yB3oyljjT2 8hj24VFquvxZ/z1QwRp81rF4SuZEmorfq+rRfoHMRcbi4f35q6psb0g1LffOaXiSZNbp mNrpcUMNtrse3xE2yAO3/nWss160JvBb4QeBhsjY4WdoKl3C5En53FbHN9pBViePsgsc gHqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:references:cc:to:subject:from:user-agent:mime-version :date:message-id:dkim-signature; bh=BVmXr9IyTUy+vW3rxAdfl5SSdPrcvbaIsCT2YlDRwr4=; fh=R6YoEx58NTDcgY/peHl7fPEvz3bIV+wS7iXJwG3mSbM=; b=hYrJmG7dF49mLXMQP9/CaR9aGGGVtSi1wNzvSI7O3i+LnGUKwCqGNsG45nFDqVcnZ7 y8qNpyBipz4Ba1V33bX8ItrBm0f1eir/MLO96codjWgACGhHxwkUlsi/EpCC5MXljaBm /RB8wgXuZHnKwLdQ93/nq25028KArt3mvi6zxqUkb4lGzCzi/I5HvydzzmdXhv0vMMf2 OpApQsBKC1A71rRmV3d0N5PzSEKh2mMuj8nUtJt76B7ircI3PPehlv5y5c9J5D/utMb7 omWFU9agtVJfihQzJxXS40fZZ4TfVfb6fUm5rLUaG2ecVQMyXYCfxdA5ORZs47x0CHmT TcFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=WqgcKro8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id cj21-20020a056a00299500b0069024c6a9acsi18062566pfb.314.2023.09.28.04.54.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:54:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=WqgcKro8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D7C2B8235B97; Wed, 27 Sep 2023 20:08:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230085AbjI1DI1 (ORCPT + 99 others); Wed, 27 Sep 2023 23:08:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230053AbjI1DI1 (ORCPT ); Wed, 27 Sep 2023 23:08:27 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C137F99; Wed, 27 Sep 2023 20:08:25 -0700 (PDT) Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38S17hr5027528; Thu, 28 Sep 2023 03:08:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : from : subject : to : cc : references : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=BVmXr9IyTUy+vW3rxAdfl5SSdPrcvbaIsCT2YlDRwr4=; b=WqgcKro8cu2P4lWMGqo9uKOkNx9dkxwfK6k/dpe7z0fLu+bnGt6Rfk56x/MWRpdFizq0 An3KUC8oYG+Z9rOgfqLuqERQmpC1LaJyeAwRwxWte1l40Jbo8gzqCQOmC0ufXxbhsbaD NY+L5hLxDSP6xl6Q3zP2mpljzc5jtDllGJ0xI3DY7Vqf3qVRAAzlv1JQ+gXyZUfbRszb fsLhYsEt2GIP2wP8fpl3yOob4RrGDOTHWqY3Qs7Zxy+rfeZaawCh5UoEM33awOKxbQyh EsQ7qqkjhGzpODTl0E5KfHnVYq4gz26nVHqWUf+1zdsB6zUP0QGbrxu1uT6MQEtKNZvt uQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tcnq0b86p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Sep 2023 03:08:23 +0000 Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 38S38CJx015860; Thu, 28 Sep 2023 03:08:22 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tcnq0b868-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Sep 2023 03:08:22 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 38S1UWof011010; Thu, 28 Sep 2023 03:08:21 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tabukrngd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 28 Sep 2023 03:08:21 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 38S38IWf15532564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 03:08:18 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E3D2520043; Thu, 28 Sep 2023 03:08:17 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F050F20040; Thu, 28 Sep 2023 03:08:16 +0000 (GMT) Received: from [9.171.44.93] (unknown [9.171.44.93]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 28 Sep 2023 03:08:16 +0000 (GMT) Message-ID: Date: Thu, 28 Sep 2023 05:08:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 From: Jan Karcher Subject: Re: [PATCH net-next v4 05/18] net/smc: reserve CHID range for SMC-D virtual device To: Wen Gu , kgraul@linux.ibm.com, wenjia@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, linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1695568613-125057-1-git-send-email-guwen@linux.alibaba.com> <1695568613-125057-6-git-send-email-guwen@linux.alibaba.com> Organization: IBM - Network Linux on Z In-Reply-To: <1695568613-125057-6-git-send-email-guwen@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: kLjslwUk4HNjU3Fp_my62sC1BOZ5bbeW X-Proofpoint-GUID: wpqD0z77ZBj7RhRc3p2kPdhKQaLkSJDY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-27_17,2023-09-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxscore=0 clxscore=1015 malwarescore=0 mlxlogscore=858 lowpriorityscore=0 adultscore=0 impostorscore=0 bulkscore=0 spamscore=0 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309280026 X-Spam-Status: No, score=-2.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 27 Sep 2023 20:08:50 -0700 (PDT) On 24/09/2023 17:16, Wen Gu wrote: > This patch reserve CHID range from 0xFF00 to 0xFFFF for SMC-D virtual The current state is that 0xFF00 - 0xFFFF is the range of all virtual SMC-D devices. This range devides into: - 0xFF00 - 0xFFFE is for virto-ism - 0xFFFF is for loopback > device and introduces helpers to identify them. > > Signed-off-by: Wen Gu > --- > net/smc/smc_ism.h | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/net/smc/smc_ism.h b/net/smc/smc_ism.h > index 14d2e77..2ecc8de 100644 > --- a/net/smc/smc_ism.h > +++ b/net/smc/smc_ism.h > @@ -15,6 +15,9 @@ > > #include "smc.h" > > +#define SMC_VIRT_ISM_CHID_MAX 0xFFFF SMC_VIRT_ISM_MAX is 0xFFFE. Or do you mean virtual devices as the whole group. If yes i think that this naming will be very confusing in a few months/years. Maybe something like SMC_VIRTUAL_DEV_CHID_{MIN|MAX}? > +#define SMC_VIRT_ISM_CHID_MIN 0xFF00 > + > struct smcd_dev_list { /* List of SMCD devices */ > struct list_head list; > struct mutex mutex; /* Protects list of devices */ > @@ -57,4 +60,16 @@ static inline int smc_ism_write(struct smcd_dev *smcd, u64 dmb_tok, > return rc < 0 ? rc : 0; > } > > +static inline bool __smc_ism_is_virtdev(u16 chid) > +{ > + return (chid >= SMC_VIRT_ISM_CHID_MIN && chid <= SMC_VIRT_ISM_CHID_MAX); > +} > + > +static inline bool smc_ism_is_virtdev(struct smcd_dev *smcd) > +{ > + u16 chid = smcd->ops->get_chid(smcd); > + > + return __smc_ism_is_virtdev(chid); > +} > + > #endif