@@ -160,6 +160,7 @@ struct mpam_config {
u32 cpbm;
u32 mbw_pbm;
u16 mbw_max;
+ u16 dspri;
};
struct mpam_component
@@ -864,7 +864,7 @@ 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;
+ return r->dspri_show ? r->dspri_default_ctrl : r->default_ctrl;
res = container_of(r, struct mpam_resctrl_res, resctrl_res);
dom = container_of(d, struct mpam_resctrl_dom, resctrl_dom);
@@ -876,7 +876,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 (r->dspri_show)
+ 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)) {
@@ -893,12 +896,14 @@ 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;
+ return r->dspri_show ? r->dspri_default_ctrl : 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);
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 <amitsinght@marvell.com> --- drivers/platform/mpam/mpam_internal.h | 1 + drivers/platform/mpam/mpam_resctrl.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-)