[dpdk-dev] [PATCH v6 1/2] power: add support for cppc cpufreq
David Marchand
david.marchand at redhat.com
Thu Jul 8 15:30:09 CEST 2021
On Thu, Jul 8, 2021 at 4:35 AM Richael Zhuang <richael.zhuang at arm.com> wrote:
>
> Currently in DPDK only acpi_cpufreq and pstate_cpufreq drivers are
> supported, which are both not available on arm64 platforms. Add
> support for cppc_cpufreq driver which works on most arm64 platforms.
Worth a release note update.
WDYT of:
diff --git a/doc/guides/rel_notes/release_21_08.rst
b/doc/guides/rel_notes/release_21_08.rst
index c92e016783..6fd9f0168a 100644
--- a/doc/guides/rel_notes/release_21_08.rst
+++ b/doc/guides/rel_notes/release_21_08.rst
@@ -103,6 +103,10 @@ New Features
usecases. Configuration happens via standard rawdev enq/deq operations. See
the :doc:`../rawdevs/cnxk_bphy` rawdev guide for more details on this driver.
+* **Added cppc_cpufreq support to Power Management library.**
+
+ Added support for cppc_cpufreq driver which works on most arm64 platforms.
+
Removed Items
-------------
>
> Signed-off-by: Richael Zhuang <richael.zhuang at arm.com>
> ---
> app/test/test_power.c | 3 +-
> app/test/test_power_cpufreq.c | 3 +-
> lib/power/meson.build | 1 +
> lib/power/power_cppc_cpufreq.c | 681 +++++++++++++++++++++++++++++++++
> lib/power/power_cppc_cpufreq.h | 230 +++++++++++
> lib/power/rte_power.c | 26 ++
> lib/power/rte_power.h | 2 +-
> 7 files changed, 943 insertions(+), 3 deletions(-)
> create mode 100644 lib/power/power_cppc_cpufreq.c
> create mode 100644 lib/power/power_cppc_cpufreq.h
>
> diff --git a/app/test/test_power.c b/app/test/test_power.c
> index da1d67c0a..b7b556134 100644
> --- a/app/test/test_power.c
> +++ b/app/test/test_power.c
> @@ -133,7 +133,8 @@ test_power(void)
> /* Perform tests for valid environments.*/
> const enum power_management_env envs[] = {PM_ENV_ACPI_CPUFREQ,
> PM_ENV_KVM_VM,
> - PM_ENV_PSTATE_CPUFREQ};
> + PM_ENV_PSTATE_CPUFREQ,
> + PM_ENV_CPPC_CPUFREQ};
>
> unsigned int i;
> for (i = 0; i < RTE_DIM(envs); ++i) {
> diff --git a/app/test/test_power_cpufreq.c b/app/test/test_power_cpufreq.c
> index 0c3adc5f3..8516df4ca 100644
> --- a/app/test/test_power_cpufreq.c
> +++ b/app/test/test_power_cpufreq.c
> @@ -496,7 +496,8 @@ test_power_cpufreq(void)
>
> /* Test environment configuration */
> env = rte_power_get_env();
> - if ((env != PM_ENV_ACPI_CPUFREQ) && (env != PM_ENV_PSTATE_CPUFREQ)) {
> + if ((env != PM_ENV_ACPI_CPUFREQ) && (env != PM_ENV_PSTATE_CPUFREQ) &&
> + (env != PM_ENV_CPPC_CPUFREQ)) {
> printf("Unexpectedly got an environment other than ACPI/PSTATE\n");
> goto fail_all;
> }
> diff --git a/lib/power/meson.build b/lib/power/meson.build
> index 74c5f3a29..4a5b07292 100644
> --- a/lib/power/meson.build
> +++ b/lib/power/meson.build
> @@ -21,6 +21,7 @@ sources = files(
> 'rte_power.c',
> 'rte_power_empty_poll.c',
> 'rte_power_pmd_mgmt.c',
> + 'power_cppc_cpufreq.c',
Wrong indent + worth sorting alphabetically.
> )
> headers = files(
> 'rte_power.h',
[snip]
> diff --git a/lib/power/power_cppc_cpufreq.h b/lib/power/power_cppc_cpufreq.h
> new file mode 100644
> index 000000000..3bfc5f59c
> --- /dev/null
> +++ b/lib/power/power_cppc_cpufreq.h
> @@ -0,0 +1,230 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2010-2021 Intel Corporation
> + * Copyright(c) 2021 Arm Limited
> + */
> +
> +#ifndef _POWER_CPPC_CPUFREQ_H
> +#define _POWER_CPPC_CPUFREQ_H
> +
> +/**
> + * @file
> + * RTE Power Management via userspace CPPC cpufreq
> + */
> +
> +#include <rte_common.h>
> +#include <rte_byteorder.h>
> +#include <rte_log.h>
> +#include <rte_string_fns.h>
> +#include "rte_power.h"
> +
[snip]
> +#endif
Nit: #endif /* _POWER_CPPC_CPUFREQ_H */
> diff --git a/lib/power/rte_power.c b/lib/power/rte_power.c
> index 98eaba915..3d51ff8be 100644
> --- a/lib/power/rte_power.c
> +++ b/lib/power/rte_power.c
> @@ -10,6 +10,7 @@
> #include "power_kvm_vm.h"
> #include "power_pstate_cpufreq.h"
> #include "power_common.h"
> +#include "power_cppc_cpufreq.h"
Nit: this include can be sorted alphabetically with other driver headers above.
>
> enum power_management_env global_default_env = PM_ENV_NOT_SET;
>
--
David Marchand
More information about the dev
mailing list