[PATCH v5 6/6] power: remove unused auto-detection uncore

Huisong Li <[email protected]>
Newsgroups org.dpdk.dev
Message-ID <[email protected]>
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 <[email protected]>
---
 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 c50ff8d199..cd2b2a51d5 100644
--- a/lib/power/rte_power_uncore.c
+++ b/lib/power/rte_power_uncore.c
@@ -143,32 +143,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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.