DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Huisong Li <lihuisong@huawei.com>
To: <anatoly.burakov@intel.com>, <sivaprasad.tummala@amd.com>
Cc: <dev@dpdk.org>, <thomas@monjalon.net>,
	<stephen@networkplumber.org>, <fengchengwen@huawei.com>,
	<yangxingui@huawei.com>, <zhanjie9@hisilicon.com>,
	 <lihuisong@huawei.com>
Subject: [PATCH v4 6/6] power: remove unused auto-detection uncore
Date: Wed, 29 Jul 2026 10:51:49 +0800	[thread overview]
Message-ID: <20260729025149.2158868-7-lihuisong@huawei.com> (raw)
In-Reply-To: <20260729025149.2158868-1-lihuisong@huawei.com>

Applications need to set uncore environment first by calling the API
rte_power_set_uncore_env, please see the commit 3b3af56d3c9c ("power:
fix uncore configuration").

Now, rte_power_set_uncore_env() supports automatic detection of uncore
drivers, the automatic detection environment code can be deleted.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 lib/power/rte_power_uncore.c | 32 +++++++-------------------------
 1 file changed, 7 insertions(+), 25 deletions(-)

diff --git a/lib/power/rte_power_uncore.c b/lib/power/rte_power_uncore.c
index 64a8c2648d..8b61b073e0 100644
--- a/lib/power/rte_power_uncore.c
+++ b/lib/power/rte_power_uncore.c
@@ -140,32 +140,14 @@ RTE_EXPORT_SYMBOL(rte_power_uncore_init)
 int
 rte_power_uncore_init(unsigned int pkg, unsigned int die)
 {
-	int ret = -1;
-	struct rte_power_uncore_ops *ops;
-	uint8_t env;
+	if (global_uncore_env == RTE_UNCORE_PM_ENV_NOT_SET ||
+	    global_uncore_env == RTE_UNCORE_PM_ENV_AUTO_DETECT ||
+	    global_uncore_ops == NULL) {
+		POWER_LOG(ERR, "Please set uncore environment first.");
+		return -1;
+	}
 
-	if ((global_uncore_env != RTE_UNCORE_PM_ENV_NOT_SET) &&
-		(global_uncore_env != RTE_UNCORE_PM_ENV_AUTO_DETECT))
-		return global_uncore_ops->init(pkg, die);
-
-	/* Auto Detect Environment */
-	RTE_TAILQ_FOREACH(ops, &uncore_ops_list, next)
-		if (ops) {
-			POWER_LOG(INFO,
-				"Attempting to initialise %s power management...",
-				ops->name);
-			ret = ops->init(pkg, die);
-			if (ret == 0) {
-				for (env = 0; env < RTE_DIM(uncore_env_str); env++)
-					if (strncmp(ops->name, uncore_env_str[env],
-						RTE_POWER_UNCORE_DRIVER_NAMESZ) == 0) {
-						rte_power_set_uncore_env(env);
-						goto out;
-					}
-			}
-		}
-out:
-	return ret;
+	return global_uncore_ops->init(pkg, die);
 }
 
 RTE_EXPORT_SYMBOL(rte_power_uncore_exit)
-- 
2.33.0


      parent reply	other threads:[~2026-07-29  2:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29  2:51 [PATCH v4 0/6] power: uncore power improvements and auto-detection Huisong Li
2026-07-29  2:51 ` [PATCH v4 1/6] examples/l3fwd-power: fix uncore deinit for non-legacy Huisong Li
2026-07-29  2:51 ` [PATCH v4 2/6] examples/l3fwd-power: enable power QoS for all modes Huisong Li
2026-07-29  2:51 ` [PATCH v4 3/6] examples/l3fwd-power: fix uncore help and log info Huisong Li
2026-07-29  2:51 ` [PATCH v4 4/6] examples/l3fwd-power: relocate uncore initialization Huisong Li
2026-07-29  2:51 ` [PATCH v4 5/6] power: support automatic detection of uncore driver Huisong Li
2026-07-29  2:51 ` Huisong Li [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260729025149.2158868-7-lihuisong@huawei.com \
    --to=lihuisong@huawei.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=sivaprasad.tummala@amd.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    --cc=yangxingui@huawei.com \
    --cc=zhanjie9@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox