[PATCH v3 22/26] fs/resctrl: Add type define for PERF_PKG files

Tony Luck
2025-04-07T23:41:01Z

Creation of the default info file for monitor resources requires
an RFTYPE_RES_ define and mapping from the resource id.

Add the define and case in fflags_from_resource().

Signed-off-by: Tony Luck <tony.luck@intel.com>
---
fs/resctrl/internal.h | 2 ++
fs/resctrl/rdtgroup.c | 2 ++
2 files changed, 4 insertions(+)

diff --git a/fs/resctrl/internal.h b/fs/resctrl/internal.h
index 4a840e683e96..b7bc820da726 100644
--- a/fs/resctrl/internal.h
+++ b/fs/resctrl/internal.h
@@ -253,6 +253,8 @@ struct rdtgroup {

#define RFTYPE_DEBUG BIT(10)

+#define RFTYPE_RES_PERF_PKG BIT(11)
+
#define RFTYPE_CTRL_INFO (RFTYPE_INFO | RFTYPE_CTRL)

#define RFTYPE_MON_INFO (RFTYPE_INFO | RFTYPE_MON)
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 34fcd20f8dd7..cae68e8b9f86 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -2175,6 +2175,8 @@ static unsigned long fflags_from_resource(struct rdt_resource *r)
case RDT_RESOURCE_MBA:
case RDT_RESOURCE_SMBA:
return RFTYPE_RES_MB;
+ case RDT_RESOURCE_PERF_PKG:
+ return RFTYPE_RES_PERF_PKG;
}

return WARN_ON_ONCE(1);
--
2.48.1