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 EBEE4A0C48; Thu, 8 Jul 2021 15:36:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6738040696; Thu, 8 Jul 2021 15:36:18 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id A2DAB4014F for ; Thu, 8 Jul 2021 15:36:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625751375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PoACGDM1ExDtVH570HDUqAsMwkAi6jYP3nalcVwHuMA=; b=U4g2aJZFw2t1RLiNBJzkLAsvGnqvUlBOi4SWEv6HwT1wq7v7KXYpHzSlCYxQ4h7nQ+qB+I I4nPIGLi7Yu+CtZ3mibmnuOi53gDsFOuFH46PMgyo4Nt57hYeqiqmgUIwlbLJBYYD9fPNs 5UzMlgr7F3OglSQLJfbAZsEoUTMzB08= Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-225-UuuRDPRINgapuZFbUhvGVg-1; Thu, 08 Jul 2021 09:36:14 -0400 X-MC-Unique: UuuRDPRINgapuZFbUhvGVg-1 Received: by mail-pj1-f71.google.com with SMTP id d1-20020a17090ae281b0290170ba1f9948so6124164pjz.7 for ; Thu, 08 Jul 2021 06:36:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PoACGDM1ExDtVH570HDUqAsMwkAi6jYP3nalcVwHuMA=; b=CyqfIdA209Yhi+pFQxdKSTcb+tbJgMe8A67BhZAeYmIVAidz5makgcYJVRZErebQj2 Txd1xJ+SaBKF9nu0odY/BWdFw/e0XlHxe84zKI2uTSLN10f94FKsQ1/A+pEUkKwYfc2r 4tqq6ss87tMkOUJybM21gYepDCCGwkYjjno2/6m69IM7sdZ4bbUGB1sZ2b8fT8+7/ovP inojhruyRXvNoxyjrRRZXJ6LxJPeyCn0OpnehBkgB7cJQ0AX4djhDFW3QAsejogsmMnM FzplcuzscVPy7EtCd9IfHPbr/bLx0z/9vB6DDRxr4qy9+1SF6kCdiRKuPhA+ooZecri0 zquQ== X-Gm-Message-State: AOAM531ZXxJ1njlRaFUUgF/F7PjlK2XhJnJTMc40gxmVL+pdC5/h/590 +eWNun6FKL+YHxLeePZdGDuonnGU6brDKfvUbM6Fz5NCFoFN21SIVqEERX6PMS50hAzmL+WBO/L cmBeonf0Gc3acW07/0go= X-Received: by 2002:a67:df85:: with SMTP id x5mr28122037vsk.17.1625751021309; Thu, 08 Jul 2021 06:30:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPtmEK9wee3YE+9Du8TY5SskZTXXDhsm1sYk2XDsUoyMZPDY4IDi7lLggUYRXtkC3irPeN5OCggbrd7CGSVDk= X-Received: by 2002:a67:df85:: with SMTP id x5mr28122000vsk.17.1625751021047; Thu, 08 Jul 2021 06:30:21 -0700 (PDT) MIME-Version: 1.0 References: <20210625020206.42284-2-richael.zhuang@arm.com> <20210708023447.20495-1-richael.zhuang@arm.com> <20210708023447.20495-2-richael.zhuang@arm.com> In-Reply-To: <20210708023447.20495-2-richael.zhuang@arm.com> From: David Marchand Date: Thu, 8 Jul 2021 15:30:09 +0200 Message-ID: To: Richael Zhuang Cc: dev , Yu Jiang , David Hunt Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v6 1/2] power: add support for cppc cpufreq 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 Sender: "dev" On Thu, Jul 8, 2021 at 4:35 AM Richael Zhuang 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 > --- > 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 > +#include > +#include > +#include > +#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