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 EE253A04F5; Fri, 19 Jun 2020 09:37:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BE5D12C18; Fri, 19 Jun 2020 09:37:34 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 6A93AFEB for ; Fri, 19 Jun 2020 09:37:33 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05J7b15L013252; Fri, 19 Jun 2020 00:37:32 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=pfpt0818; bh=BqYw1jrzEcDOkGFUJAPdKFEnLsoC0j8t2EVEyBDsk3U=; b=b6nM7CIzP+roemEmslw82b8ip1iHGwBBLCplrtNawQNPNj77Whkxvm4XDSkKlWxMseIl kGE+yLbWnNYTD3Cu6jodVh9a96THVP3PKBmQfVx3qGZqpq/u8ErnHfTxCtrqv9yhnqA+ DcbDo4qYPCfK+VPI9SZp2F7UhVzQlag0+9SOeRcP+xrTr0V/vAvxBD1OAtr2l3vG7JQd t3COLeLxQGZTbGbtaTQ9VP+gIf3f8BvYWHTkzvLShSyXbVUT+2fcOGqtyLOoASQO40hi 07KMl4LEzy7H7fwRZCU6iCypN/nJszsdogx0xn+3XIrE2puf6j5+ZiG0GmYy2xrySiZH ww== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 31q658xrf2-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 19 Jun 2020 00:37:32 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 19 Jun 2020 00:37:31 -0700 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (104.47.46.55) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Fri, 19 Jun 2020 00:37:31 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qw97ONgfz36iwqDxooPfajLvmIPu63t0QU/uG5vWrC/y4wXDriM5P3wEeW0NIwObaV6WuRSgWCTgjABSPapBVvzIPEF/aLIF1gm6LdhsLx0znTbIPBGALrv79OG6/gesvniRMedUEl4VtjQS/eQR+qcuLuY5Vof2pHHBj15jTTWEBSDhqh9YHzNzSxVFZ0b/eF9fklzpj6M8Z+iUE54qoQBz/HesFSUVoWS9rGjEIbYm/req0dBHPHkfuNUWcAtdcy1hwM8dZr0c5jSETnkXgSIwpGE3pEt+SHdBoe2GzlEknJlv0shgW5Is1hSMFE0LsVSxLdvlupfc6OC936QH3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BqYw1jrzEcDOkGFUJAPdKFEnLsoC0j8t2EVEyBDsk3U=; b=akOD6k3EY7eicWwejWUh3h/waNRARRHNtRJ4CfVOZJ2oKRdn1FNWOfPCkOOxSVyexMZDaFfqF+OvpgzZXneAucSMSOiHPpuZ0kwZAVVfEREMHqTNdY5Z0V0fuPkXceBRQG3eJoW+4GLPFM38d0sVsnIcdzeek7KUWpF98O0DJfeNLWW5Bibd5hjYkOY9UhzXS6Wyl8i/vyhaLgU+Ee2zMiIOTKz+ZDYVtpd6a2wFjsB72UGLrKCgMkvb9JMwOfQlCqwiSeTbGFE4VQk63nrhK0ohRPnAfJfM85ek0RaCq86tfItDBUCFDQlHXF4WlMz6mVcJiLPsOzS0wgobcBAe2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BqYw1jrzEcDOkGFUJAPdKFEnLsoC0j8t2EVEyBDsk3U=; b=rHni4ojLEMY2w29faxYbRWC6Qx5jGNDAGGqVooXcF/T/k3kr+gNPkkJ1jvQrRLBWTYKrLCCaYc5VC6YF0z3n9GM5Pkfr6epoI0HNw7FlQEOXFpdg39J5a5fC1/DUpOr7je1U8xb5d4nRkzDR74c6DvX5im/t7Y3H4Ri0l2MoiDE= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=marvell.com; Received: from MWHPR18MB1070.namprd18.prod.outlook.com (2603:10b6:300:a5::11) by MW2PR18MB2298.namprd18.prod.outlook.com (2603:10b6:907:d::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22; Fri, 19 Jun 2020 07:37:29 +0000 Received: from MWHPR18MB1070.namprd18.prod.outlook.com ([fe80::e895:bdac:e157:2ed2]) by MWHPR18MB1070.namprd18.prod.outlook.com ([fe80::e895:bdac:e157:2ed2%11]) with mapi id 15.20.3109.023; Fri, 19 Jun 2020 07:37:29 +0000 Date: Fri, 19 Jun 2020 13:07:12 +0530 From: Harman Kalra To: Anatoly Burakov CC: , David Hunt , , , Message-ID: <20200619073710.GA96739@outlook.office365.com> References: <16cd5ba00d6675037804f671309b245643e173db.1592500565.git.anatoly.burakov@intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16cd5ba00d6675037804f671309b245643e173db.1592500565.git.anatoly.burakov@intel.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-ClientProxiedBy: PN1PR0101CA0012.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::22) To MWHPR18MB1070.namprd18.prod.outlook.com (2603:10b6:300:a5::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from outlook.office365.com (115.113.156.2) by PN1PR0101CA0012.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21 via Frontend Transport; Fri, 19 Jun 2020 07:37:27 +0000 X-Originating-IP: [115.113.156.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 76790f58-35f6-43fb-3ded-08d814239eb0 X-MS-TrafficTypeDiagnostic: MW2PR18MB2298: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0439571D1D X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +CV9lNrU/mGnm8zSFEYI0sgVF0fL2HdJ4Y5XudWY5HAdCbdDWVRM4FyeFA0Vt3Cvjh7lVujEGSM50uCaJzrIQQq5jrkynqGGht+DnxJm/VB8cIZeKEH96FYqUTi/maf4IEZYSxHwc4vm5QBS4AHPAi+OAqVNcGbaVrAJf/yMrsGX80Pa2cvHfX2wjHkm6Y93LLti5U+W4lQL+KzQFg+UGVHTm8I7OV+Fj3h/m/abILYJY1Z1jeWdS+uThfa6+eci6Rp3OHWYm8Dw0nAwAe3TQvAIXeaznaeDB7uxBeuP5XNgG54HdpvuMLYenkLr4rBWq0BAyIqpqDN/Vejr9NxWW57VUN/e3kEweMauidIE+LakNDSe/2an863sXDnTAGkk X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR18MB1070.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(39860400002)(396003)(346002)(376002)(136003)(956004)(6666004)(55016002)(9686003)(7696005)(1076003)(52116002)(478600001)(4326008)(5660300002)(86362001)(8676002)(6916009)(33656002)(8936002)(16526019)(316002)(186003)(66946007)(66556008)(66476007)(26005)(2906002)(55236004)(83380400001)(6506007)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 2/Ah2TQc54g5cYzQjFENlCb8T+fkvHzxrIPYKxFKlr91qEd1vqPZigxdNRyoz2zFqDDiwsaTVTKD/ZO/ZnsZu06UIHtNvumzBU90ts7njFgSBOikkobM2XRwhJh40B0gHLhNuHH1D85AwAvtbQuS3ex+Wilu93V7HYv7rGYoxdiuMNe7JKMzt0KpXgtTKGoD0eeZmP/0NlKEUBtIlpXsYf357AO9ttqqmP9mX24QVxurozA9XeHsXJFOyzodbHVoaFeo4VRQA2XU4+/uPa0L/Isvfbf3Lt2sTIOQcHoh9buCZGwFdt75uaqsoOA++8s9pf/Jy8o7sPo/Smjamh0hjifzw2BPi5/6WcnyisLTzH1MlVItnLKj4pdqpCnY1mTOoEi3cZFWVDO3Dq2RJDUXblI1PNBlreovHfPQiw5ccfSyYqVXO1+w7W/P3pYYT7LPFhpeqEMeKSdV0vD5G1ybBdzc90v9zXv+dM0gN0GfcRo= X-MS-Exchange-CrossTenant-Network-Message-Id: 76790f58-35f6-43fb-3ded-08d814239eb0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2020 07:37:29.4385 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2GzV6RVRgZNnurovzLol7j0CM8mEMY15oqD5MyvjJSd+EcUaKnH7otTajGbRdgaEJFmbfrPaZAjn1Jnxvp19MA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR18MB2298 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-19_04:2020-06-18, 2020-06-19 signatures=0 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 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 > 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