From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CBED8A04A5; Fri, 19 Jun 2020 11:56:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 048591B9BF; Fri, 19 Jun 2020 11:56:17 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id BDA791B13C for ; Fri, 19 Jun 2020 11:56:14 +0200 (CEST) IronPort-SDR: hbfZ3ogOt76APQtwQ3dzC/a7D0NRxSBeztPqCjFe+AYu84fIbo8YvpG+X4uIO2ETWT+umIpgdL hvBnJy/Fq3jA== X-IronPort-AV: E=McAfee;i="6000,8403,9656"; a="123171139" X-IronPort-AV: E=Sophos;i="5.75,254,1589266800"; d="scan'208";a="123171139" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jun 2020 02:56:13 -0700 IronPort-SDR: FSylULOnkEUowSvj3yDscUUdqiYYxznoJJ5U8APB33cihTzgzX++FI40tUwJEbZQUaKoY0J3qN rEx5tHvdJ9KA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,254,1589266800"; d="scan'208";a="277951714" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.236.243]) ([10.213.236.243]) by orsmga006.jf.intel.com with ESMTP; 19 Jun 2020 02:56:12 -0700 To: Harman Kalra Cc: dev@dpdk.org, David Hunt , reshma.pattan@intel.com, jerinjacobk@gmail.com, yinan.wang@intel.com References: <16cd5ba00d6675037804f671309b245643e173db.1592500565.git.anatoly.burakov@intel.com> <20200619073710.GA96739@outlook.office365.com> From: "Burakov, Anatoly" Message-ID: Date: Fri, 19 Jun 2020 10:56:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200619073710.GA96739@outlook.office365.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [EXT] [PATCH v2 7/7] l3fwd-power: add auto-selection of default mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 19-Jun-20 8:37 AM, Harman Kalra wrote: > On Thu, Jun 18, 2020 at 06:18:29PM +0100, Anatoly Burakov wrote: >> External Email >> >> ---------------------------------------------------------------------- >> Currently, the application does support running without the power >> library being initialized, but it has to be specifically requested. On >> platforms without support for frequency scaling using the power library, >> we can just enable interrupt-only mode by default. >> >> Signed-off-by: Anatoly Burakov >> Suggested-by: Jerin Jacob >> --- > > Application probed the platform for frequency scaling support, since > octeontx2 doesnt support it, interrupt-only mode got enabled by default. > > Tested-by: Harman Kalra Perhaps there should be a log indicating which one was picked. There's a wrong comment in this particular patch as well, so i'll fix that while i'm at it :) Thanks! > >> examples/l3fwd-power/main.c | 16 +++++++++++++++- >> 1 file changed, 15 insertions(+), 1 deletion(-) >> >> diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c >> index 51acbfd87d..a66599e734 100644 >> --- a/examples/l3fwd-power/main.c >> +++ b/examples/l3fwd-power/main.c >> @@ -2412,6 +2412,20 @@ launch_timer(unsigned int lcore_id) >> return 0; >> } >> >> +static int >> +autodetect_mode(void) >> +{ >> + /* >> + * Empty poll and telemetry modes have to be specifically requested to >> + * be enabled, but we can auto-detect between legacy mode with or >> + * without interrupts. Both ACPI and pstate can be used. >> + */ >> + if (rte_power_check_env_supported(PM_ENV_ACPI_CPUFREQ)) >> + return APP_MODE_LEGACY; >> + if (rte_power_check_env_supported(PM_ENV_PSTATE_CPUFREQ)) >> + return APP_MODE_LEGACY; >> + return APP_MODE_INTERRUPT; >> +} >> >> int >> main(int argc, char **argv) >> @@ -2449,7 +2463,7 @@ main(int argc, char **argv) >> rte_exit(EXIT_FAILURE, "Invalid L3FWD parameters\n"); >> >> if (app_mode == APP_MODE_DEFAULT) >> - app_mode = APP_MODE_LEGACY; >> + app_mode = autodetect_mode(); >> >> /* only legacy and empty poll mode rely on power library */ >> if ((app_mode == APP_MODE_LEGACY || app_mode == APP_MODE_EMPTY_POLL) && >> -- >> 2.17.1 -- Thanks, Anatoly