From patchwork Wed Jan 17 14:13:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Singh Tomar X-Patchwork-Id: 13521779 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E3CD2C47DA2 for ; Wed, 17 Jan 2024 14:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Eu7NjCmmDlHe/HGjhBbcewUiazEIz5vC9ey6zqd8GMs=; b=AEBLk9P1QMc4RS odsIC1ZRaBtWZE6L3vGfsQ/psns5p5QzyDrh6hAPFLRo2EMtETGNVx5b9YDfegfssGawLbHlh9nTO VMJ4yJf72cYl0MlcOuIn9DaeNPgTefNmQNovZ32UkNgqykAFQ42v8hzkuFFwVKSS95SIdDikej5W6 A0Ivux+7d7iEM02SmI7Xrpi0lltdeP5Dh3NZqKZuXZt7mlETch7aVdkGedgfA5lHALC6PcJST3C1C WWWsdds6bqalLZ4E7Dfq2KhDRQQxVFARW8mW61xc6xF06wG8oXFj4a3a9VQPDoytP9QktZIjw8uIA IwyxNgflQqDsu1SInOZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQ6h6-00Gy1v-33; Wed, 17 Jan 2024 14:15:05 +0000 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174] helo=mx0b-0016f401.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQ6gu-00Gxmy-18 for linux-arm-kernel@lists.infradead.org; Wed, 17 Jan 2024 14:14:56 +0000 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40H7jhMO028705; Wed, 17 Jan 2024 06:14:36 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= pfpt0220; bh=1GHNM7+8NlxPbSSdFb5vYISuQDRZWQGahxCDaGr7f4Y=; b=eot 7qCgeBIML4qezMB3bQ7MNs3dEL7TCEDzVb/nfkrQwGw9JGYrT9FgWJBkFRahG5J4 dpOIRbWIv/cFReS4nhTURSIG5Ax1/tJFqTC1mgkbhh+Odkl7NnnPuDA1SxR2JrPX v2UgxMtBQjQu/xo0zYSV37ueaS0N3GDUZ4QZs8pcc4dVQrM/KMbthp3UVYAFr9MB Me8d44s+VxP4Q+ZQvOy5cgJ+YHBPKaF0AKjA5K1819PVSBlqhhivHT5Sf11M/AyD KFZus3gENc52epW65Huiu2vxH9rdc67Yu4i06dwRTdES9j2IXYvAiaYwC4xCATno 0n7m+Y9Rryy7LjDgb9A== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3vpask951u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 06:14:36 -0800 (PST) Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 17 Jan 2024 06:14:35 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 17 Jan 2024 06:14:35 -0800 Received: from localhost.localdomain (unknown [10.28.36.167]) by maili.marvell.com (Postfix) with ESMTP id B26705B6932; Wed, 17 Jan 2024 06:14:31 -0800 (PST) From: Amit Singh Tomar To: , CC: , , , , , , , , Amit Singh Tomar Subject: [PATCH v1 06/14] arm_mpam: resctrl: Retrieve priority values from arch code Date: Wed, 17 Jan 2024 19:43:57 +0530 Message-ID: <20240117141405.3063506-7-amitsinght@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240117141405.3063506-1-amitsinght@marvell.com> References: <20240117141405.3063506-1-amitsinght@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: R37DkmxraFyJkxBGo5nvB__FmHpVufj_ X-Proofpoint-GUID: R37DkmxraFyJkxBGo5nvB__FmHpVufj_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-17_08,2024-01-17_01,2023-05-22_02 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240117_061452_452608_8B79F6BD X-CRM114-Status: GOOD ( 13.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Downstream priority values can be read from the "schemata" file, which is fetched from mpam_config structure. This change does the necessary modifications in arch specific code to facilitate reading priority values. Signed-off-by: Amit Singh Tomar --- Changes since RFC: * Reworked, To configure DSPRI partition control use control type instead of dspri_show/store flags. --- drivers/platform/mpam/mpam_internal.h | 1 + drivers/platform/mpam/mpam_resctrl.c | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/drivers/platform/mpam/mpam_internal.h b/drivers/platform/mpam/mpam_internal.h index 30e32389d394..45552ae6548b 100644 --- a/drivers/platform/mpam/mpam_internal.h +++ b/drivers/platform/mpam/mpam_internal.h @@ -160,6 +160,7 @@ struct mpam_config { u32 cpbm; u32 mbw_pbm; u16 mbw_max; + u16 dspri; }; struct mpam_component diff --git a/drivers/platform/mpam/mpam_resctrl.c b/drivers/platform/mpam/mpam_resctrl.c index 4c44d65e6047..0de09e9deee5 100644 --- a/drivers/platform/mpam/mpam_resctrl.c +++ b/drivers/platform/mpam/mpam_resctrl.c @@ -860,8 +860,12 @@ u32 resctrl_arch_get_config(struct rdt_resource *r, struct rdt_domain *d, lockdep_assert_cpus_held(); - if (!mpam_is_enabled()) - return r->default_ctrl; + if (!mpam_is_enabled()) { + if (ctrl_type == SCHEMA_DSPRI) + return r->default_dspri_ctrl; + else + return r->default_ctrl; + } res = container_of(r, struct mpam_resctrl_res, resctrl_res); dom = container_of(d, struct mpam_resctrl_dom, resctrl_dom); @@ -873,7 +877,10 @@ u32 resctrl_arch_get_config(struct rdt_resource *r, struct rdt_domain *d, switch (r->rid) { case RDT_RESOURCE_L2: case RDT_RESOURCE_L3: - configured_by = mpam_feat_cpor_part; + if (ctrl_type == SCHEMA_DSPRI) + configured_by = mpam_feat_dspri_part; + else + configured_by = mpam_feat_cpor_part; break; case RDT_RESOURCE_MBA: if (mba_class_use_mbw_part(cprops)) { @@ -889,13 +896,19 @@ u32 resctrl_arch_get_config(struct rdt_resource *r, struct rdt_domain *d, } if (!r->alloc_capable || partid >= resctrl_arch_get_num_closid(r) || - !mpam_has_feature(configured_by, cfg)) - return r->default_ctrl; + !mpam_has_feature(configured_by, cfg)) { + if (ctrl_type == SCHEMA_DSPRI) + return r->default_dspri_ctrl; + else + return r->default_ctrl; + } switch (configured_by) { case mpam_feat_cpor_part: /* TODO: Scaling is not yet supported */ return cfg->cpbm; + case mpam_feat_dspri_part: + return cfg->dspri; case mpam_feat_mbw_part: /* TODO: Scaling is not yet supported */ return mbw_pbm_to_percent(cfg->mbw_pbm, cprops);