On 20/07/2024 17:50, Sivaprasad Tummala wrote:
This patch refactors the power management library, addressing uncore
power management. The primary changes involve the creation of dedicated
directories for each driver within 'drivers/power/uncore/*'. The
adjustment of meson.build files enables the selective activation
of individual drivers.

This refactor significantly improves code organization, enhances
clarity and boosts maintainability. It lays the foundation for more
focused development on individual drivers and facilitates seamless
integration of future enhancements, particularly the AMD uncore driver.

Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
---
 .../power/intel_uncore/intel_uncore.c         |  18 +-
 .../power/intel_uncore/intel_uncore.h         |   8 +-
 drivers/power/intel_uncore/meson.build        |   7 +
 drivers/power/meson.build                     |   3 +-
 lib/power/meson.build                         |   2 +-
 lib/power/rte_power_uncore.c                  | 206 ++++++---------
 lib/power/rte_power_uncore.h                  |  91 ++++---
 lib/power/rte_power_uncore_ops.h              | 239 ++++++++++++++++++
 lib/power/version.map                         |   1 +
 9 files changed, 406 insertions(+), 169 deletions(-)
 rename lib/power/power_intel_uncore.c => drivers/power/intel_uncore/intel_uncore.c (95%)
 rename lib/power/power_intel_uncore.h => drivers/power/intel_uncore/intel_uncore.h (97%)
 create mode 100644 drivers/power/intel_uncore/meson.build
 create mode 100644 lib/power/rte_power_uncore_ops.h


--snip--



diff --git a/lib/power/rte_power_uncore.c b/lib/power/rte_power_uncore.c
index 48c75a5da0..127f6ed212 100644
--- a/lib/power/rte_power_uncore.c
+++ b/lib/power/rte_power_uncore.c
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2010-2014 Intel Corporation
- * Copyright(c) 2023 AMD Corporation
+ * Copyright(c) 2024 Advanced Micro Devices, Inc.
  */
 


--snip--


+struct rte_power_uncore_ops *
+rte_power_get_uncore_ops(void)
+{
+	RTE_ASSERT(global_uncore_ops != NULL);


I'm only seeing this now after sending the email for the first patch. This would be a good solution for the global_core_ops check in rte_power_get_core_ops() in rte_power.c,  and would be the smaller change, rather than checking everywhere rte_power_get_env() is called.


+
+	return global_uncore_ops;
 }
 


--snip--