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 CE1C6A0524; Wed, 2 Jun 2021 13:14:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BAC024069F; Wed, 2 Jun 2021 13:14:53 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 1073640689 for ; Wed, 2 Jun 2021 13:14:51 +0200 (CEST) IronPort-SDR: GnJKxLDABFWohMonD9lmMT9Mv1iMmnBYkXs3qRrp4ngrGgbIEMySfB4jWoE6dXhzxjUJbGW9ng 2rb4zkI1YdAw== X-IronPort-AV: E=McAfee;i="6200,9189,10002"; a="190876067" X-IronPort-AV: E=Sophos;i="5.83,242,1616482800"; d="scan'208";a="190876067" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2021 04:14:50 -0700 IronPort-SDR: pQ8MBhmu3D3PfeWcCWI1kh/oEBRTOE69QHU7+3m8laFeCfMVae01hv0Xe5Kol7W4p+iHs1f5Jl KGL+8e+dCAqg== X-IronPort-AV: E=Sophos;i="5.83,242,1616482800"; d="scan'208";a="550096732" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.233.20]) ([10.213.233.20]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2021 04:14:50 -0700 To: David Hunt , dev@dpdk.org References: <20210531113008.3087-1-david.hunt@intel.com> From: "Burakov, Anatoly" Message-ID: <81c2cc28-6ce4-0043-d80b-23823c573302@intel.com> Date: Wed, 2 Jun 2021 12:14:46 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210531113008.3087-1-david.hunt@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v1] 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 31-May-21 12:30 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 > --- > examples/l3fwd-power/main.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c > index f8dfed1634..34b0eaa401 100644 > --- a/examples/l3fwd-power/main.c > +++ b/examples/l3fwd-power/main.c > @@ -1617,7 +1617,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 +1714,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 +1730,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) { > + pmgmt_type = -1; > + return 0; > + } I don't particularly like the enum abuse, type safety exists for a reason :) perhaps just add a bool that enables/disables this? you're effectively doing that anyway with pmgmt_type >= 0. > /* unknown PMD power management mode */ > return -1; > } > @@ -2767,7 +2772,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) && > + (pmgmt_type >= 0)) { > ret = rte_power_ethdev_pmgmt_queue_enable( > lcore_id, portid, queueid, > pmgmt_type); > -- Thanks, Anatoly