From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 032DBC54F55 for ; Wed, 29 Jul 2026 02:55:32 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78F9840A67; Wed, 29 Jul 2026 04:55:04 +0200 (CEST) Received: from canpmsgout07.his.huawei.com (canpmsgout07.his.huawei.com [113.46.200.222]) by mails.dpdk.org (Postfix) with ESMTP id DFCF540A4B for ; Wed, 29 Jul 2026 04:55:02 +0200 (CEST) dkim-signature: v=1; a=rsa-sha256; d=h-partners.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=ZP0E5UrtpW+3mXvS0ZLVky4p5tZQ428ehUrkq3WHC/g=; b=cKyUuD9x4x/MW9X18zJxhrlLPLKdwSpDaA1qBTZ/yAKgEvz9oDDQT4hIzvQh3UxS/NUEqXBUP 7MBe33ZJlobvjgnMzDJSvR27xY3OS8CoRNo473JjDJpVNLoEAaWal4CfeEXIDbvjoU1uV0hUwba RhhjJWQompHXKMFsqHWx2bQ= Received: from mail.maildlp.com (unknown [172.19.163.163]) by canpmsgout07.his.huawei.com (SkyGuard) with ESMTPS id 4h8xXG3RnRzLlTg; Wed, 29 Jul 2026 10:45:34 +0800 (CST) Received: from kwepemo100005.china.huawei.com (unknown [7.202.195.212]) by mail.maildlp.com (Postfix) with ESMTPS id 4F34A4048B; Wed, 29 Jul 2026 10:55:01 +0800 (CST) Received: from localhost.localdomain (10.90.31.46) by kwepemo100005.china.huawei.com (7.202.195.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.36; Wed, 29 Jul 2026 10:55:00 +0800 From: Huisong Li To: , CC: , , , , , , Subject: [PATCH v4 6/6] power: remove unused auto-detection uncore Date: Wed, 29 Jul 2026 10:51:49 +0800 Message-ID: <20260729025149.2158868-7-lihuisong@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20260729025149.2158868-1-lihuisong@huawei.com> References: <20260729025149.2158868-1-lihuisong@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.90.31.46] X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To kwepemo100005.china.huawei.com (7.202.195.212) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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