From patchwork Fri Oct 6 16:21:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Harris X-Patchwork-Id: 13411722 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 7A9D928685 for ; Fri, 6 Oct 2023 16:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="gOo+kGgJ" Received: from mailout2.w2.samsung.com (mailout2.w2.samsung.com [211.189.100.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1634E9E for ; Fri, 6 Oct 2023 09:22:01 -0700 (PDT) Received: from uscas1p2.samsung.com (unknown [182.198.245.207]) by mailout2.w2.samsung.com (KnoxPortal) with ESMTP id 20231006162200usoutp0249d246864cc42763ec2e2897cbc62ae6~LkTAFhn002937729377usoutp02- for ; Fri, 6 Oct 2023 16:22:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w2.samsung.com 20231006162200usoutp0249d246864cc42763ec2e2897cbc62ae6~LkTAFhn002937729377usoutp02- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1696609320; bh=m+7lNOVrTM41r4nKf3Mtqzz4slqL3SQUg/PU5tWzNyw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gOo+kGgJP/5T/b6xsm5o7+R0aVBk28Jk3loXQZNT1JcFdV+fCvTZ0F7p1Vf0rV3rr m+k2ugSBW8H9Rj2BdpjwYHurc32vGrWT04tnrrad5etBpF106zYbm4ikQGQU9EQf99 oZ5udrfGDjIrSLFcOC3igS9TmDrJzou3kkd+5H2o= Received: from ussmges1new.samsung.com (u109.gpu85.samsung.co.kr [203.254.195.109]) by uscas1p1.samsung.com (KnoxPortal) with ESMTP id 20231006162159uscas1p1851542549bf73833123e7664572e87b4~LkS--gBzj0210602106uscas1p1g for ; Fri, 6 Oct 2023 16:21:59 +0000 (GMT) Received: from uscas1p2.samsung.com ( [182.198.245.207]) by ussmges1new.samsung.com (USCPEMTA) with SMTP id 73.21.50148.72430256; Fri, 6 Oct 2023 12:21:59 -0400 (EDT) Received: from ussmgxs3new.samsung.com (u92.gpu85.samsung.co.kr [203.254.195.92]) by uscas1p2.samsung.com (KnoxPortal) with ESMTP id 20231006162159uscas1p2b3ca1cd7a8371c20ac30b38cd70d65e7~LkS-qn_Pj1602216022uscas1p2i for ; Fri, 6 Oct 2023 16:21:59 +0000 (GMT) X-AuditID: cbfec36d-559ff7000002c3e4-fb-6520342786af Received: from SSI-EX1.ssi.samsung.com ( [105.128.2.146]) by ussmgxs3new.samsung.com (USCPEXMTA) with SMTP id 30.DB.31410.72430256; Fri, 6 Oct 2023 12:21:59 -0400 (EDT) Received: from SSI-EX2.ssi.samsung.com (105.128.2.227) by SSI-EX1.ssi.samsung.com (105.128.2.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.2375.24; Fri, 6 Oct 2023 09:21:58 -0700 Received: from SSI-EX2.ssi.samsung.com ([105.128.2.227]) by SSI-EX2.ssi.samsung.com ([105.128.2.227]) with mapi id 15.01.2375.024; Fri, 6 Oct 2023 09:21:58 -0700 From: Jim Harris To: "linux-cxl@vger.kernel.org" Subject: [PATCH] cxl/region: use region (not root decoder) granularity for calculations Thread-Topic: [PATCH] cxl/region: use region (not root decoder) granularity for calculations Thread-Index: AQHZ+HE60VRkQwelP0mqMgNoFwajUg== Date: Fri, 6 Oct 2023 16:21:58 +0000 Message-ID: <169660931834.684402.2774329392272976121.stgit@bgt-140510-bm03.eng.stellus.in> In-Reply-To: <169646090522.666328.17608442776078591123.stgit@bgt-140510-bm03.eng.stellus.in> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [105.128.2.176] Content-ID: <704F5F7021D6FF4596348A4EB43D0104@ssi.samsung.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOIsWRmVeSWpSXmKPExsWy7djX87rqJgqpBpdmG1ucn3WKxYHR4/Mm uQDGKC6blNSczLLUIn27BK6MJZeuMRWsEanYebOPqYHxhXAXIyeHhICJxPPDE1m6GLk4hARW Mko8fLqQDcJZyiTx4ddEpi5GDrCqCZctIeJrGSXaXy9ih3A+Mkp8WbwZpoNRYmVzGwvIXDYB TYlfV9YwgdgiAtYSExqWsIHYwgKREleWvmOEiMdJfJ/2lQ3C1pPoXgVhswioSMx6ugtsDq9A lMS7R0fA4pwCMRJ9rY1gMxkFxCS+n4KYzywgLnHryXwmiH8EJRbN3sMMYYtJ/Nv1kA3CVpS4 //0lO8g3zEC3rd+lD9FqJ/F50VpWCFtRYkr3Q3aItYISJ2c+YYFolZQ4uOIGOIgkBP6yS5y7 tosdIuEicevTUyhbWmL6mstQDdkSK9d3QEOuQKLhSBBE2Fpi4Z/1UCfzSfz99YhxAqPyLCQf zEK4bhaS62YhuW4WkusWMLKuYhQvLS7OTU8tNsxLLdcrTswtLs1L10vOz93ECEwbp/8dzt3B uOPWR71DjEwcjIcYJTiYlUR40xtkUoV4UxIrq1KL8uOLSnNSiw8xSnOwKInzGtqeTBYSSE8s Sc1OTS1ILYLJMnFwSjUwiVflJDJt/mh38MksN/WMJTdUnP9eEIw+rrvQP2inshaDi0zXh4jl M+f8Flpv+CQtUvOA7d/Kj0tXJ52ftFe95sl+9oRnrXOnJ6nc0H6ofnWZo5TthLcr1F62/a33 /vgjIMHbbtOerSdXfz5iHvXJ1Cn/8K8tk0V2+qeabdEuafq8sSD91QvL3we3VvnvWSZ7KKng RY2Bz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y9pzpv2mUvubn7zmYpfTgc7mawst52/dD736K2ZaV1Swhr9OjunpCfO+bH0jhJL cUaioRZzUXEiABtc02ccAwAA X-CMS-MailID: 20231006162159uscas1p2b3ca1cd7a8371c20ac30b38cd70d65e7 CMS-TYPE: 301P X-CMS-RootMailID: 20231006162159uscas1p2b3ca1cd7a8371c20ac30b38cd70d65e7 References: <169646090522.666328.17608442776078591123.stgit@bgt-140510-bm03.eng.stellus.in> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Root decoder granularity must match value from CFWMS, which may not be the region's granularity for non-interleaved root decoders. So when calculating granularities for host bridge decoders, use the region's granularity instead of the root decoder's granularity to ensure the correct granularities are set for the host bridge decoders and any downstream switch decoders. Test configuration is 1 host bridge * 2 switches * 2 endpoints per switch. Region created with 2048 granularity using following command line: cxl create-region -m -d decoder0.0 -w 4 mem0 mem2 mem1 mem3 \ -g 2048 -s 2048M Use "cxl list -PDE | grep granularity" to get a view of the granularity set at each level of the topology. Before this patch: "interleave_granularity":2048, "interleave_granularity":2048, "interleave_granularity":512, "interleave_granularity":2048, "interleave_granularity":2048, "interleave_granularity":512, "interleave_granularity":256, After: "interleave_granularity":2048, "interleave_granularity":2048, "interleave_granularity":4096, "interleave_granularity":2048, "interleave_granularity":2048, "interleave_granularity":4096, "interleave_granularity":2048, Signed-off-by: Jim Harris --- drivers/cxl/core/region.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index 6d63b8798c29..70f7c66ee2ce 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -1133,7 +1133,7 @@ static int cxl_port_setup_targets(struct cxl_port *port, } if (is_cxl_root(parent_port)) { - parent_ig = cxlrd->cxlsd.cxld.interleave_granularity; + parent_ig = p->interleave_granularity; parent_iw = cxlrd->cxlsd.cxld.interleave_ways; /* * For purposes of address bit routing, use power-of-2 math for