From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F1CD845BDA; Sat, 26 Oct 2024 06:09:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 80D5240265; Sat, 26 Oct 2024 06:09:07 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 68AE240264 for ; Sat, 26 Oct 2024 06:09:05 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Xb5gW4WgjzdbkX; Sat, 26 Oct 2024 12:06:31 +0800 (CST) Received: from kwepemm600004.china.huawei.com (unknown [7.193.23.242]) by mail.maildlp.com (Postfix) with ESMTPS id 397E11800CF; Sat, 26 Oct 2024 12:09:03 +0800 (CST) Received: from [10.67.121.59] (10.67.121.59) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Sat, 26 Oct 2024 12:09:02 +0800 Message-ID: <05a5e8e9-a770-8cf8-e90c-5ec977b2e612@huawei.com> Date: Sat, 26 Oct 2024 12:09:01 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v9 6/6] power: rename library sources for cpu frequency management To: Sivaprasad Tummala CC: , , , , , , , , , Stephen Hemminger References: <20241022184133.700367-1-sivaprasad.tummala@amd.com> <20241023051139.1066426-1-sivaprasad.tummala@amd.com> <20241023051139.1066426-7-sivaprasad.tummala@amd.com> From: "lihuisong (C)" In-Reply-To: <20241023051139.1066426-7-sivaprasad.tummala@amd.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.121.59] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600004.china.huawei.com (7.193.23.242) 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 Hi Sivaprasad, 在 2024/10/23 13:11, Sivaprasad Tummala 写道: > This patch renames the existing core power library source files > from rte_power.* to rte_power_cpufreq.* for better clarity Now it is more clarity for cpufeq and uncore. Thank you for this work. But I have another question, pmd_mgmt component also depands on the initialization of cpufreq layer. So I guess pmd_mgmt is also releated to core dvfs. As Stephen mentioned in other place, if all configurations about core can be extracted one API, it is very good to use for application. I am still not sure if we can do that. But that's okay, we can do this later if possiable. I just worried about whether the current name of rte_power_init() which is external interface is good for what's going on. Now that we rename the core power library source file, the rte_power_init() in rte_power_cpufreq.c may need to rename. How about add the following points? 1> rename rte_power_init() to rte_power_cpufreq_init() just for the initialization of cpufreq library. 2> create a new file rte_power_core.c and rte_power_core_init() which is used to do what Stephen said. 3> applications use rte_power_core_init()  to take place of rte_power_init(). /Huisong > > v9: > - documentation update > > Signed-off-by: Sivaprasad Tummala > --- > app/test/test_power.c | 2 +- > app/test/test_power_cpufreq.c | 2 +- > app/test/test_power_kvm_vm.c | 2 +- > doc/api/doxy-api-index.md | 2 +- > examples/distributor/main.c | 2 +- > examples/l3fwd-power/main.c | 2 +- > examples/l3fwd-power/perf_core.c | 2 +- > examples/vm_power_manager/channel_monitor.c | 2 +- > examples/vm_power_manager/channel_monitor.h | 2 +- > examples/vm_power_manager/guest_cli/main.c | 2 +- > examples/vm_power_manager/guest_cli/vm_power_cli_guest.c | 2 +- > examples/vm_power_manager/power_manager.c | 2 +- > lib/power/meson.build | 4 ++-- > lib/power/{rte_power.c => rte_power_cpufreq.c} | 2 +- > lib/power/{rte_power.h => rte_power_cpufreq.h} | 4 ++-- > lib/power/rte_power_pmd_mgmt.h | 2 +- > 16 files changed, 18 insertions(+), 18 deletions(-) > rename lib/power/{rte_power.c => rte_power_cpufreq.c} (99%) > rename lib/power/{rte_power.h => rte_power_cpufreq.h} (99%) > > diff --git a/app/test/test_power.c b/app/test/test_power.c > index 5df5848c70..38507411bd 100644 > --- a/app/test/test_power.c > +++ b/app/test/test_power.c > @@ -22,7 +22,7 @@ test_power(void) > > #else > > -#include > +#include > > static int > test_power(void) > diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c > index f4522747d5..0331b37fe0 100644 > --- a/app/test/test_power_cpufreq.c > +++ b/app/test/test_power_cpufreq.c > @@ -30,7 +30,7 @@ test_power_caps(void) > } > > #else > -#include > +#include > > #define TEST_POWER_LCORE_ID 2U > #define TEST_POWER_LCORE_INVALID ((unsigned)RTE_MAX_LCORE) > diff --git a/app/test/test_power_kvm_vm.c b/app/test/test_power_kvm_vm.c > index a7d104e973..1c72ba5a4e 100644 > --- a/app/test/test_power_kvm_vm.c > +++ b/app/test/test_power_kvm_vm.c > @@ -20,7 +20,7 @@ test_power_kvm_vm(void) > } > > #else > -#include > +#include > > #define TEST_POWER_VM_LCORE_ID 0U > #define TEST_POWER_VM_LCORE_OUT_OF_BOUNDS (RTE_MAX_LCORE+1) > diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md > index 266c8b90dc..f82570b093 100644 > --- a/doc/api/doxy-api-index.md > +++ b/doc/api/doxy-api-index.md > @@ -102,7 +102,7 @@ The public API headers are grouped by topics: > [per-lcore](@ref rte_per_lcore.h), > [service cores](@ref rte_service.h), > [keepalive](@ref rte_keepalive.h), > - [power/freq](@ref rte_power.h), > + [power/freq](@ref rte_power_cpufreq.h), > [power/uncore](@ref rte_power_uncore.h), > [PMD power](@ref rte_power_pmd_mgmt.h) > > diff --git a/examples/distributor/main.c b/examples/distributor/main.c > index ddbc387c20..ea44939fba 100644 > --- a/examples/distributor/main.c > +++ b/examples/distributor/main.c > @@ -17,7 +17,7 @@ > #include > #include > #include > -#include > +#include > > #define RX_RING_SIZE 1024 > #define TX_RING_SIZE 1024 > diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c > index 6bd76515e6..272e069207 100644 > --- a/examples/l3fwd-power/main.c > +++ b/examples/l3fwd-power/main.c > @@ -41,7 +41,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > #include > diff --git a/examples/l3fwd-power/perf_core.c b/examples/l3fwd-power/perf_core.c > index 6c0f7ea213..1b5419119a 100644 > --- a/examples/l3fwd-power/perf_core.c > +++ b/examples/l3fwd-power/perf_core.c > @@ -10,7 +10,7 @@ > #include > #include > #include > -#include > +#include > #include > > #include "perf_core.h" > diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c > index f21556e27d..d4e0d685c1 100644 > --- a/examples/vm_power_manager/channel_monitor.c > +++ b/examples/vm_power_manager/channel_monitor.c > @@ -31,7 +31,7 @@ > #ifdef RTE_NET_I40E > #include > #endif > -#include > +#include > > #include > #include "channel_monitor.h" > diff --git a/examples/vm_power_manager/channel_monitor.h b/examples/vm_power_manager/channel_monitor.h > index ab69524af5..a9a257abd3 100644 > --- a/examples/vm_power_manager/channel_monitor.h > +++ b/examples/vm_power_manager/channel_monitor.h > @@ -5,7 +5,7 @@ > #ifndef CHANNEL_MONITOR_H_ > #define CHANNEL_MONITOR_H_ > > -#include > +#include > > #include "channel_manager.h" > > diff --git a/examples/vm_power_manager/guest_cli/main.c b/examples/vm_power_manager/guest_cli/main.c > index 9da50020ac..6246cbd6b4 100644 > --- a/examples/vm_power_manager/guest_cli/main.c > +++ b/examples/vm_power_manager/guest_cli/main.c > @@ -9,7 +9,7 @@ > #include > > #include > -#include > +#include > #include > #include > #include > diff --git a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c > index 5eddb47847..803b6d1f82 100644 > --- a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c > +++ b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c > @@ -18,7 +18,7 @@ > #include > #include > > -#include > +#include > > #include "vm_power_cli_guest.h" > > diff --git a/examples/vm_power_manager/power_manager.c b/examples/vm_power_manager/power_manager.c > index 0355a7f4bc..522c713ff4 100644 > --- a/examples/vm_power_manager/power_manager.c > +++ b/examples/vm_power_manager/power_manager.c > @@ -15,7 +15,7 @@ > #include > > #include > -#include > +#include > #include > > #include "channel_manager.h" > diff --git a/lib/power/meson.build b/lib/power/meson.build > index 5fa5d062e3..4f4dc19687 100644 > --- a/lib/power/meson.build > +++ b/lib/power/meson.build > @@ -13,14 +13,14 @@ if not is_linux > endif > sources = files( > 'power_common.c', > - 'rte_power.c', > + 'rte_power_cpufreq.c', > 'rte_power_uncore.c', > 'rte_power_pmd_mgmt.c', > ) > headers = files( > 'power_cpufreq.h', > 'power_uncore_ops.h', > - 'rte_power.h', > + 'rte_power_cpufreq.h', > 'rte_power_guest_channel.h', > 'rte_power_pmd_mgmt.h', > 'rte_power_uncore.h', > diff --git a/lib/power/rte_power.c b/lib/power/rte_power_cpufreq.c > similarity index 99% > rename from lib/power/rte_power.c > rename to lib/power/rte_power_cpufreq.c > index 3168b6d301..d91c530e34 100644 > --- a/lib/power/rte_power.c > +++ b/lib/power/rte_power_cpufreq.c > @@ -8,7 +8,7 @@ > #include > #include > > -#include "rte_power.h" > +#include "rte_power_cpufreq.h" > #include "power_common.h" > > static enum power_management_env global_default_env = PM_ENV_NOT_SET; > diff --git a/lib/power/rte_power.h b/lib/power/rte_power_cpufreq.h > similarity index 99% > rename from lib/power/rte_power.h > rename to lib/power/rte_power_cpufreq.h > index 7d566551bd..b68d8c0bbc 100644 > --- a/lib/power/rte_power.h > +++ b/lib/power/rte_power_cpufreq.h > @@ -3,8 +3,8 @@ > * Copyright(c) 2024 Advanced Micro Devices, Inc. > */ > > -#ifndef _RTE_POWER_H > -#define _RTE_POWER_H > +#ifndef _RTE_POWER_CPUFREQ_H > +#define _RTE_POWER_CPUFREQ_H > > /** > * @file > diff --git a/lib/power/rte_power_pmd_mgmt.h b/lib/power/rte_power_pmd_mgmt.h > index 807e454096..58c25bc3ff 100644 > --- a/lib/power/rte_power_pmd_mgmt.h > +++ b/lib/power/rte_power_pmd_mgmt.h > @@ -13,7 +13,7 @@ > #include > > #include > -#include > +#include > > #ifdef __cplusplus > extern "C" {