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 77D1AA0542; Mon, 29 Aug 2022 14:48:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2CC364069D; Mon, 29 Aug 2022 14:48:45 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id E32444003C for ; Mon, 29 Aug 2022 14:48:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661777323; x=1693313323; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=9jQy888YOnGHWx76yec54rXERREoOBmB980kq8eul0Y=; b=AHmV+NUTKiJtbSRtVsbMP0yTGGePLt8VihxLym/T2rV36lpvuZ1LK/QI jQPJbovjJCSLE2fMq0pKYehQcMwD37+zicTDHALTFDiBVU38BtWDiOMnb j8R5M5E9UKhw9P6ijDU5raluSw+7vMF0J/CZ1+NiFVFZIlnsfPpfHHh07 qblPGLGVU1pRDmK+03e8XWhn1Ht69eo5GwOgT/dMx5xtk5My75A07lFDs zuUNIEexMNE012VkqUjCHitwxU2XLB4IS7SnPKmCImUl2FzbDLydhZkxu pBgZBdiQzmKG1hUZqpZtLMnc76FlX4zDIJH6D0jFNazZtnmaZcY8cSCTB w==; X-IronPort-AV: E=McAfee;i="6500,9779,10454"; a="274632532" X-IronPort-AV: E=Sophos;i="5.93,272,1654585200"; d="scan'208";a="274632532" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2022 05:48:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,272,1654585200"; d="scan'208";a="588154080" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga006.jf.intel.com with ESMTP; 29 Aug 2022 05:48:41 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 29 Aug 2022 05:48:41 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Mon, 29 Aug 2022 05:48:41 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Mon, 29 Aug 2022 05:48:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QW4cr5J9lZy3EgQ7yNsOkMjMq4duvX3+k0Y1DlVPH6vIuunPtO3JL1515jJqkokkYM8WxiVPl5Oh0nDD+Y1NeFCiC+FUpTTYe0NjT96P9gUiVup52T7J4Q0Y2IgpTsIaxLKUIPffWErStI4RP2eN6kIcvV65rU5kQJZGaXou1t3vfXp0PEpcx7w/85/zGWrebYtHs7n6BrOcoC0ITV1FDT3XKY+HQmwnDMqwhtv3pf7UniesvnEFORNT75X3pbfWQyYxIQ/YxGPAcBc8MYnnWvoxOpL3rT5KY6hs0lGzSJdQYIOZFiYo/gAB99w78zMrUV3iQnEicXEEXlzxWPiiuQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vOY1kGW9wVSH2SaNc74oNMAG2YCxI7h+sSoGvLnAElY=; b=Ji3mvLTYNWrPbPYE48Vn6FSgT1pwtxWD8W8/vXMsbUPcuYWbWSvKK4DXSnP13/3YvvoKtEhB6h0v+z5RA8DqheEXFLwDP/gVqm7d8MsSdDULF7WJ3xfNHFoc/MpeKgb6mkm3PiQMR17zSQXPvOR1fbf+1ptItnd1XNAGfen9Qig/xSHwp+3AbBxpsbDA3XwV5kL1BbvZHLmRAAo8pN35qbXGSwoK+jnKMzjCpgR8PoDeWypTj+1xZRBx05l6fNVyxU0avjA3gOvi1jajKcXm9ot2KovEtStLxej6Yvhb6ylWQFOLyTP36yQv2n9eeQpsDjqJx8G/XHsSEbJL9Mx1Sw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from BYAPR11MB3799.namprd11.prod.outlook.com (2603:10b6:a03:fb::19) by BN6PR11MB1539.namprd11.prod.outlook.com (2603:10b6:405:f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.21; Mon, 29 Aug 2022 12:48:38 +0000 Received: from BYAPR11MB3799.namprd11.prod.outlook.com ([fe80::4959:604c:ca50:38b5]) by BYAPR11MB3799.namprd11.prod.outlook.com ([fe80::4959:604c:ca50:38b5%5]) with mapi id 15.20.5566.021; Mon, 29 Aug 2022 12:48:38 +0000 Message-ID: <9039d076-aad2-d741-5724-a163085b470d@intel.com> Date: Mon, 29 Aug 2022 13:48:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v1 3/3] examples/l3fwd-power: enable PMD power mgmt on Arm Content-Language: en-US To: Feifei Wang CC: , , Ruifeng Wang References: <20220825064251.2637274-1-feifei.wang2@arm.com> <20220825064251.2637274-4-feifei.wang2@arm.com> From: "Hunt, David" In-Reply-To: <20220825064251.2637274-4-feifei.wang2@arm.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DU2PR04CA0024.eurprd04.prod.outlook.com (2603:10a6:10:3b::29) To BYAPR11MB3799.namprd11.prod.outlook.com (2603:10b6:a03:fb::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bf00ebc2-f9d5-46f6-a6b3-08da89bccb36 X-MS-TrafficTypeDiagnostic: BN6PR11MB1539:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IS7eu1JwuZbq18dYlIIEhNhd5lt2siMyWt5Ln2P94V28txDoyWkqDIo0PhyJS1dVMcS0fwsdV3cFi0U7f+uUb8uF6r/bpbc/OGcBgyjzSqfWPmANBRw81etkrNSuVedDQAC8+c18iQ7k0k/cIpEc8jyxnMKmcKPyjpb4Im5BiHDZuO5oWQYLjQHD4MVXfNJydtrJ+sb7NsoVcjDrIVpz6DmFEfoe6FTgPfB/2n28r0W3VMnqFwUeDT6IWDa24tk5GYWhwxzrEqFso1S4m9PuTilRTCpPYAAELOmW3SSoaw/qi4B6GsiDGTPm0U4mWYjnYeBeQjirxAbGGGAL+c6p2/o+/TmzokADHf0VYZJyWG7JOubSavFr3UKGbrLtYq0rsgjCgN70buCz0HyFwPjN+u/iOX34LoX5aXGwKXGdRv97N7z6UTpFolUuWE9wzWmytJbnhg8XPnuAT57WY5sGzwV2p0KIOjW1CPOxlWlnubCyDDGLIlEM/TUrVpvPbV39dT81za9rjmaTi0Av1KvxgYoyQ18b/uh0eQ2Pz5g9p0+YT200F1aPk6ALvDDnrQF2qFlEf9HFVQV4Z6idlYeC4Zj9Bfvg2wluAnwbI5x4zVfopIsW5QgLbYIaExjSkBO7kSSYSaQzhUC3Zh82P5p++FJoLE3ROUPRYf/T8Ybq9KOZURUzS12ef/vnX/1Jg4tAxwS+4v61xW9AJN2JhtLaEd22JWDUwwXyoMU3eAg3a/Pgk17A79paRsLmkmXmj82cvAf6KwbfQE+YQ77uB18Vof+UYGKrg9Y+kBVawvk+raU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3799.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(346002)(366004)(39860400002)(376002)(396003)(136003)(82960400001)(86362001)(31696002)(6486002)(4326008)(66476007)(66556008)(8676002)(66946007)(41300700001)(5660300002)(8936002)(478600001)(38100700002)(316002)(6916009)(186003)(2616005)(2906002)(26005)(53546011)(83380400001)(6506007)(6666004)(6512007)(36756003)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WldtWEQxZnFRbVFJWkpDV3BsRmh2SVFvMEJrMzd4RG9VL3NiMGVNOGQvMWhK?= =?utf-8?B?NUU3YUUxcUxHd2tiNyt5OElCZ2xxTWEwa1JOdGZQbE1pNStmUlJMWnBmamhW?= =?utf-8?B?b2tnWWdONEZicVpObWVOVWFlcEdDVFRZN08rUi9nVXVkNU9FV2x4RFVCcURh?= =?utf-8?B?eVB1Vkp3RGVveHVocVc1aG9QUTc0SFpJb0F6NmVNR0cveEQvbmdnUU1LL1Bn?= =?utf-8?B?OVJwUEJta0o3cTFMV2RNeTh4TEFqWmpNK0RpdUNIMVQ3ZTRPa3d0aVFUZkhu?= =?utf-8?B?RGlyaVluNk8vY0kvdmRCRWY0cVdXczF2ZXlHY1BOaVM4WVJybDFEWkRRbVc3?= =?utf-8?B?WlZyaDhGdlVWbCtW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: bf00ebc2-f9d5-46f6-a6b3-08da89bccb36 X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3799.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2022 12:48:38.5215 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: G7FzRS+GUF6WO4Ri9h6L+E3TJFTDL8TDHOTxT4RGycLCXAhCpMYGQMlA442gBXS+NmFX4Zkoi2/8T2El3yLuCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1539 X-OriginatorOrg: intel.com 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 On 25/08/2022 07:42, Feifei Wang wrote: > For Arm aarch, power monitor uses WFE instruction to enable, which can > not exit automatically within the time limit. This means > 'rte_power_monitor_wakeup' API needs to be called to wake up sleep cores > if there is no store operation to monitored address. > > Furthermore, we disable power monitor feature on the main core so that it > can be used to wake up other sleeping cores when it receives SIGINT > siginal. > > Signed-off-by: Feifei Wang > Reviewed-by: Ruifeng Wang > --- > examples/l3fwd-power/main.c | 30 +++++++++++++++++++++++++++++- > 1 file changed, 29 insertions(+), 1 deletion(-) > > diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c > index 887c6eae3f..2bd0d700f0 100644 > --- a/examples/l3fwd-power/main.c > +++ b/examples/l3fwd-power/main.c > @@ -432,8 +432,16 @@ static void > signal_exit_now(int sigtype) > { > > - if (sigtype == SIGINT) > + if (sigtype == SIGINT) { > +#if defined(RTE_ARCH_ARM64) > + /** > + * wake_up api does not need input parameter on Arm, > + * so 0 is meaningless here. > + */ > + rte_power_monitor_wakeup(0); > +#endif > quit_signal = true; > + } > > } > > @@ -2885,6 +2893,25 @@ main(int argc, char **argv) > "Error setting scaling freq max: err=%d, lcore %d\n", > ret, lcore_id); > > +#if defined(RTE_ARCH_ARM64) > + /* Ensure the main lcore does not enter the power-monitor state, > + * so that it can be used to wake up other lcores on ARM. > + * This is due to WFE instruction has no timeout wake-up mechanism, > + * and if users want to exit actively, the main lcore is needed > + * to send SEV instruction to wake up other lcores. > + */ > + unsigned int main_lcore = rte_get_main_lcore(); > + if (lcore_id != main_lcore || > + pmgmt_type != RTE_POWER_MGMT_TYPE_MONITOR) { > + ret = rte_power_ethdev_pmgmt_queue_enable( > + lcore_id, portid, queueid, > + pmgmt_type); > + if (ret < 0) > + rte_exit(EXIT_FAILURE, > + "rte_power_ethdev_pmgmt_queue_enable: err=%d, port=%d\n", > + ret, portid); > + } > +#else > ret = rte_power_ethdev_pmgmt_queue_enable( > lcore_id, portid, queueid, > pmgmt_type); > @@ -2892,6 +2919,7 @@ main(int argc, char **argv) > rte_exit(EXIT_FAILURE, > "rte_power_ethdev_pmgmt_queue_enable: err=%d, port=%d\n", > ret, portid); > +#endif > } > } > } Hi Feifei, Acked-by: David Hunt