Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp423352rdb; Wed, 17 Jan 2024 06:16:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IEnoNZLfnK5sC22q1cI/bWaWfgS2ROn/7NWrEqNTdtikcDBfHdgUL5Lu7LjimXs4E2ja6ko X-Received: by 2002:a05:6a00:22d3:b0:6d9:ab2a:8233 with SMTP id f19-20020a056a0022d300b006d9ab2a8233mr5916586pfj.38.1705501015079; Wed, 17 Jan 2024 06:16:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705501015; cv=pass; d=google.com; s=arc-20160816; b=GXCzhHNON6UOVTXlx8BxPdmOgwC6SHiZSFnaXJkdXkTDHM3OkFyPStu0IF5UNbDMv3 ndHH2P0lWl+rJJAP3gt8JO6y5fgDB56nyI8FZfDb0oaJsteVhU65EldJ3eA3AzZycwpn x75TDHTser54Sq6lwHxHDgZR5Cj/6d/5BgpFL/akpJCvSMv1LRL5QVrXagDRfrpzygEy nQKH8vDQOAJJYcNSyY3fzwfaGGlAVLRIDa7nHt1X8m7NkFJTy5wUx1D34shyBhSlFIjG HPbhnNqq7il3Kq2qqrGr31foIaxFcoGqnHDxIBh+df79MuXj8LkpE3kzb5IgMuxeydDb Hr0A== ARC-Message-Signature: i=2; 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:dkim-signature; bh=1GHNM7+8NlxPbSSdFb5vYISuQDRZWQGahxCDaGr7f4Y=; fh=j6SLEof9e8AyCQLu0pJpTyZST5iXPx6e/Ker9f2ENNE=; b=09l7J5R2/l3Z/VS53SCnATr2kUFG5Uo88NTb+vueS2RD3nKmGQn78rLPjA6sEL/svm vThX6QqM/ch9eVoy4jOExgeP1iotThao0aZqtGCF2p3vBoy82siFastGqsOXo8v5BHXV y0Asdl9l+H2isJT03YFRGfVF4+pmCQ5iKEyav3CWCbh72p4Ljk2WeBWO/OvVNnPTntkX cNKmNWaJ46TWBaxavBxyoCN/WyKmY8RW8Y6gKGr00xMzcgwOw3y1zRAEBb8bzGl3TTcc iou4Kr3PhLIJ1FctbBycgNlPyjvYw61y3HGOf3wavG443yAhauMGNhVftIJw+6JUpHbn bpSw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=eot7qCge; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-29055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29055-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id fd39-20020a056a002ea700b006db8f4389fesi1773367pfb.98.2024.01.17.06.16.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 06:16:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=eot7qCge; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-29055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29055-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CD36DB251AF for ; Wed, 17 Jan 2024 14:15:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 163ED21343; Wed, 17 Jan 2024 14:14:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="eot7qCge" Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) (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 ED7D82110E for ; Wed, 17 Jan 2024 14:14:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.148.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705500898; cv=none; b=oiEm25fKBswhHAYKL05fcwvjcK4rpx0ZniyJGWDmtsa+UxFXPGwtJBHi+jnygdnXjKH2lX0ME2Xokauo56d8IWihq1MiEQcQmxgdHoMgYBNc40fV2QfocUb8BANNtN0Co3f5gGb0Iu9UcFHg57OsM47s7P1VBsmHXFUq7LK5Raw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705500898; c=relaxed/simple; bh=HNvW3WKsIlxMJniVquCnypLBT+tR+7lOcEkV6NGM0lY=; h=Received:DKIM-Signature:Received:Received:Received:Received:From: To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type: X-Proofpoint-ORIG-GUID:X-Proofpoint-GUID: X-Proofpoint-Virus-Version; b=ozFg6swkO1RnhIOjJGlyOpyepTIF08jSwG2Af0qlmMdGcW9xvIhtaMAFNMhPYRf89ehOftiwhBkKJK4EXvc/CIwpew+UaTDk3OczDUk9Y3Qd9rbmsesRbcXz9/vawpHo00OR/ezS++mE6rYO1cnzLsmpbSR7iyLbAtLlZeUu304= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=eot7qCge; arc=none smtp.client-ip=67.231.148.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 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); -- 2.25.1