diff options
author | James Morse <james.morse@arm.com> | 2021-07-28 20:06:25 +0300 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2021-08-11 17:21:35 +0300 |
commit | e198fde3fe0892a5d1e28c0e29f1eebfb6f8c1cd (patch) | |
tree | 7897d0734a8b0c4577011bc8a823737b7062abe8 /include/linux/resctrl.h | |
parent | c091e90721b836c2367fa3017636d92427f3f8f7 (diff) | |
download | linux-e198fde3fe0892a5d1e28c0e29f1eebfb6f8c1cd.tar.xz |
x86/resctrl: Move the schemata names into struct resctrl_schema
resctrl 'info' directories and schema parsing use the schema name.
This lives in the struct rdt_resource, and is specified by the
architecture code.
Once the CDP resources are merged, there will only be one resource (and
one name) in use by two schemata. To allow the CDP CODE/DATA property to
be the type of configuration the schema uses, the name should also be
per-schema.
Add a name field to struct resctrl_schema, and use this wherever
the schema name is exposed (or read from) user-space. Calculating
max_name_width for padding the schemata file also moves as this is
visible to user-space. As the names in struct rdt_resource already
include the CDP information, schemata_list_create() copies them.
schemata_list_create() includes the length of the CDP suffix when
calculating max_name_width in preparation for CDP resources being
merged.
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Jamie Iles <jamie@nuviainc.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Babu Moger <babu.moger@amd.com>
Link: https://lkml.kernel.org/r/20210728170637.25610-13-james.morse@arm.com
Diffstat (limited to 'include/linux/resctrl.h')
-rw-r--r-- | include/linux/resctrl.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index 4b30571fbc8e..e482ce790ce2 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -171,6 +171,7 @@ struct rdt_resource { * struct resctrl_schema - configuration abilities of a resource presented to * user-space * @list: Member of resctrl_schema_all. + * @name: The name to use in the "schemata" file. * @conf_type: Whether this schema is specific to code/data. * @res: The resource structure exported by the architecture to describe * the hardware that is configured by this schema. @@ -180,6 +181,7 @@ struct rdt_resource { */ struct resctrl_schema { struct list_head list; + char name[8]; enum resctrl_conf_type conf_type; struct rdt_resource *res; u32 num_closid; |