DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Richael Zhuang <richael.zhuang@arm.com>
Cc: dev <dev@dpdk.org>, Yu Jiang <yux.jiang@intel.com>,
	David Hunt <david.hunt@intel.com>
Subject: Re: [dpdk-dev] [PATCH v6 1/2] power: add support for cppc cpufreq
Date: Thu, 8 Jul 2021 15:30:09 +0200	[thread overview]
Message-ID: <CAJFAV8xdC3DC-hqfycWJKWDun_pcf57uytvKBZ=yZRoLwYB-Sw@mail.gmail.com> (raw)
In-Reply-To: <20210708023447.20495-2-richael.zhuang@arm.com>

On Thu, Jul 8, 2021 at 4:35 AM Richael Zhuang <richael.zhuang@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@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


  parent reply	other threads:[~2021-07-08 13:36 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22  6:15 [dpdk-dev] [PATCH v1 0/1] power: add support for cppc cpufreq driver Richael Zhuang
2021-04-22  6:15 ` [dpdk-dev] [PATCH v1 1/1] power: add support for cppc cpufreq Richael Zhuang
2021-04-22  9:06   ` Burakov, Anatoly
2021-04-22  9:29     ` Richael Zhuang
2021-04-22  9:59       ` Burakov, Anatoly
2021-04-22 10:02         ` Richael Zhuang
2021-04-23 11:37           ` Burakov, Anatoly
2021-04-24  7:03             ` Richael Zhuang
2021-05-12  3:49   ` [dpdk-dev] [PATCH v2 0/2] power: add support for cppc cpufreq driver Richael Zhuang
2021-05-12  3:49     ` [dpdk-dev] [PATCH v2 1/2] power: add support for cppc cpufreq Richael Zhuang
2021-05-12  3:49     ` [dpdk-dev] [PATCH v2 2/2] test/power: round cpuinfo cur freq only when using CPPC cpufreq Richael Zhuang
2021-05-12  3:57   ` [dpdk-dev] [PATCH v3 0/2] power: add support for cppc cpufreq driver Richael Zhuang
2021-05-12  3:57     ` [dpdk-dev] [PATCH v3 1/2] power: add support for cppc cpufreq Richael Zhuang
2021-06-23  3:55       ` [dpdk-dev] [PATCH v4 0/2] power: add support for cppc cpufreq driver Richael Zhuang
2021-06-23  3:55         ` [dpdk-dev] [PATCH v4 1/2] power: add support for cppc cpufreq Richael Zhuang
2021-06-23 14:10           ` David Hunt
2021-06-24  2:13             ` Richael Zhuang
2021-06-25  2:02           ` [dpdk-dev] [PATCH v5 0/2] power: add support for cppc cpufreq driver Richael Zhuang
2021-06-25  2:02             ` [dpdk-dev] [PATCH v5 1/2] power: add support for cppc cpufreq Richael Zhuang
2021-07-07 13:47               ` David Hunt
2021-07-08  2:09                 ` Richael Zhuang
2021-07-08  2:34               ` [dpdk-dev] [PATCH v6 0/2] power: add support for cppc cpufreq driver Richael Zhuang
2021-07-08  2:34                 ` [dpdk-dev] [PATCH v6 1/2] power: add support for cppc cpufreq Richael Zhuang
2021-07-08  8:27                   ` David Hunt
2021-07-08 13:30                   ` David Marchand [this message]
2021-07-08 20:43                     ` David Marchand
2021-07-09  2:37                     ` Richael Zhuang
2021-07-09  3:34                   ` [dpdk-dev] [PATCH v7 0/2] power: add support for cppc cpufreq driver Richael Zhuang
2021-07-09  3:34                     ` [dpdk-dev] [PATCH v7 1/2] power: add support for cppc cpufreq Richael Zhuang
2021-07-09  9:10                       ` David Marchand
2021-07-09 10:35                         ` Richael Zhuang
2021-07-09  9:52                       ` David Hunt
2021-07-09 10:55                       ` [dpdk-dev] [PATCH v8 0/2] power: add support for cppc cpufreq driver Richael Zhuang
2021-07-09 10:55                         ` [dpdk-dev] [PATCH v8 1/2] power: add support for cppc cpufreq Richael Zhuang
2021-07-09 10:55                         ` [dpdk-dev] [PATCH v8 2/2] test/power: round cpuinfo cur freq only in CPPC cpufreq Richael Zhuang
2021-07-09 14:07                         ` [dpdk-dev] [PATCH v8 0/2] power: add support for cppc cpufreq driver David Marchand
2021-07-12  2:05                           ` Richael Zhuang
2021-07-09  3:34                     ` [dpdk-dev] [PATCH v7 2/2] test/power: round cpuinfo cur freq only in CPPC cpufreq Richael Zhuang
2021-07-08  2:34                 ` [dpdk-dev] [PATCH v6 " Richael Zhuang
2021-07-08  8:27                   ` David Hunt
2021-06-25  2:02             ` [dpdk-dev] [PATCH v5 2/2] test/power: round cpuinfo cur freq only when using " Richael Zhuang
2021-06-23  3:55         ` [dpdk-dev] [PATCH v4 " Richael Zhuang
2021-06-23 14:13           ` David Hunt
2021-05-12  3:57     ` [dpdk-dev] [PATCH v3 " Richael Zhuang

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='CAJFAV8xdC3DC-hqfycWJKWDun_pcf57uytvKBZ=yZRoLwYB-Sw@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=richael.zhuang@arm.com \
    --cc=yux.jiang@intel.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;
as well as URLs for NNTP newsgroup(s).