summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSivaprasad Tummala <sivaprasad.tummala@amd.com>2023-10-26 08:19:59 -0700
committerThomas Monjalon <thomas@monjalon.net>2023-11-27 22:30:50 +0100
commit3b3af56d3c9c472f9ba0ee1078d714919cc2b6b4 (patch)
treea9b12182f2d82325fed7ef453f781101a95f3dd4 /examples
parentae20b97726caa7a9d208e607ec23271009e66b70 (diff)
power: fix uncore configuration
Add uncore auto-detect environment. Update the l3fwd-power app to configure the uncore env before invoking any uncore API. With auto-detection in 'rte_power_uncore_init()' it is too late because other APIs already called. Bugzilla ID: 1304 Fixes: ac1edcb6621a ("power: refactor uncore power management API") Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com> Tested-by: Karen Kelly <karen.kelly@intel.com> Acked-by: David Hunt <david.hunt@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/l3fwd-power/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 5fbc16bb2a..9c0dcd343b 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1561,6 +1561,12 @@ parse_uncore_options(enum uncore_choice choice, const char *argument)
{
unsigned int die, pkg, max_pkg, max_die;
int ret = 0;
+ ret = rte_power_set_uncore_env(RTE_UNCORE_PM_ENV_AUTO_DETECT);
+ if (ret < 0) {
+ RTE_LOG(INFO, L3FWD_POWER, "Failed to set uncore env\n");
+ return ret;
+ }
+
max_pkg = rte_power_uncore_get_num_pkgs();
if (max_pkg == 0)
return -1;