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 55EF5A0C41; Wed, 23 Jun 2021 16:14:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A4A940141; Wed, 23 Jun 2021 16:14:50 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 790544003F for ; Wed, 23 Jun 2021 16:14:48 +0200 (CEST) IronPort-SDR: BOE5WmDI6ybeKC3EMl52rxlLKHAUwiB1BR3Wx7apcjktVz4PzU5T4JX7ZKT67yuaE9+2eKQuTC XaC5sc836H9Q== X-IronPort-AV: E=McAfee;i="6200,9189,10024"; a="187651280" X-IronPort-AV: E=Sophos;i="5.83,294,1616482800"; d="scan'208";a="187651280" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2021 07:14:46 -0700 IronPort-SDR: BQI3uL3DrDuc0gUoOCP85qclBBfZVLpusLlAJaaW/CryTV0kb06dNu00Ml/EgJW/RaOVCuFTZG Modoikg2fygQ== X-IronPort-AV: E=Sophos;i="5.83,294,1616482800"; d="scan'208";a="556157527" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.203.112]) ([10.213.203.112]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2021 07:14:45 -0700 To: David Hunt , dev@dpdk.org References: <20210531113008.3087-1-david.hunt@intel.com> <20210622140750.6208-1-david.hunt@intel.com> <2c7d7f4d-bf2b-7698-53ee-b8133d8013cb@intel.com> From: "Burakov, Anatoly" Message-ID: Date: Wed, 23 Jun 2021 15:14:43 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <2c7d7f4d-bf2b-7698-53ee-b8133d8013cb@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2] examples/power: add baseline mode to PMD power 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 23-Jun-21 1:09 PM, David Hunt wrote: > > On 23/6/2021 11:14 AM, Burakov, Anatoly wrote: >> On 22-Jun-21 3:07 PM, David Hunt wrote: >>> The PMD Power Management scheme currently has 3 modes, >>> scale, monitor and pause. However, it would be nice to >>> have a baseline mode for easy comparison of power savings >>> with and without these modes. >>> >>> This patch adds a 'baseline' mode were the pmd power >>> management is not enabled. Use --pmg-mgmt=baseline. >>> >>> Signed-off-by: David Hunt >>> >>> --- >>> changes in v2 >>> * added a bool for baseline mode rather than abusing enums >>> --- >>>   examples/l3fwd-power/main.c | 14 ++++++++++++-- >>>   1 file changed, 12 insertions(+), 2 deletions(-) >>> >>> diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c >>> index f8dfed1634..aeb2411e62 100644 >>> --- a/examples/l3fwd-power/main.c >>> +++ b/examples/l3fwd-power/main.c >>> @@ -207,6 +207,7 @@ enum appmode { >>>   enum appmode app_mode; >>>     static enum rte_power_pmd_mgmt_type pmgmt_type; >>> +bool baseline_enabled; >>>     enum freq_scale_hint_t >>>   { >>> @@ -1617,7 +1618,7 @@ print_usage(const char *prgname) >>>           " empty polls, full polls, and core busyness to telemetry\n" >>>           " --interrupt-only: enable interrupt-only mode\n" >>>           " --pmd-mgmt MODE: enable PMD power management mode. " >>> -        "Currently supported modes: monitor, pause, scale\n", >>> +        "Currently supported modes: baseline, monitor, pause, scale\n", >>>           prgname); >>>   } >>>   @@ -1714,6 +1715,7 @@ parse_pmd_mgmt_config(const char *name) >>>   #define PMD_MGMT_MONITOR "monitor" >>>   #define PMD_MGMT_PAUSE   "pause" >>>   #define PMD_MGMT_SCALE   "scale" >>> +#define PMD_MGMT_BASELINE  "baseline" >>>         if (strncmp(PMD_MGMT_MONITOR, name, sizeof(PMD_MGMT_MONITOR)) >>> == 0) { >>>           pmgmt_type = RTE_POWER_MGMT_TYPE_MONITOR; >>> @@ -1729,6 +1731,10 @@ parse_pmd_mgmt_config(const char *name) >>>           pmgmt_type = RTE_POWER_MGMT_TYPE_SCALE; >>>           return 0; >>>       } >>> +    if (strncmp(PMD_MGMT_BASELINE, name, sizeof(PMD_MGMT_BASELINE)) >>> == 0) { >>> +        baseline_enabled = true; >>> +        return 0; >>> +    } >>>       /* unknown PMD power management mode */ >>>       return -1; >>>   } >>> @@ -2528,6 +2534,9 @@ main(int argc, char **argv) >>>       /* init RTE timer library to be used late */ >>>       rte_timer_subsystem_init(); >>>   +    /* if we're running pmd-mgmt mode, don't default to baseline >>> mode */ >>> +    baseline_enabled = false; >>> + >>>       /* parse application arguments (after the EAL ones) */ >>>       ret = parse_args(argc, argv); >>>       if (ret < 0) >>> @@ -2767,7 +2776,8 @@ main(int argc, char **argv) >>>                            "Fail to add ptype cb\n"); >>>               } >>>   -            if (app_mode == APP_MODE_PMD_MGMT) { >>> +            if ((app_mode == APP_MODE_PMD_MGMT) && >>> +                    (baseline_enabled == false)) { >> >> Nitpicking, !baseline_enabled >> > Thanks, Anatoly. I don't feel a re-spin is needed for this, but I'll > take this format into consideration for future patches, OK? Yep, i'm fine either way. Maybe someone can fix it on apply :) > > >> Otherwise, >> >> Acked-by: Anatoly Burakov >> >> -- Thanks, Anatoly