From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id C80B4C4332F for ; Thu, 20 Oct 2022 20:41:41 +0000 (UTC) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9B5EA410D1; Thu, 20 Oct 2022 22:41:39 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id 9362140FAE for ; Thu, 20 Oct 2022 22:41:38 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id CC6EE5C0112; Thu, 20 Oct 2022 16:41:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 20 Oct 2022 16:41:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1666298496; x= 1666384896; bh=eWADXQlV8LmkS5w5dboElwYJ2VTEQ7c30a7fS5jtF20=; b=O XM4OxItUu9z/vpCJ2th3EVBYA9whU5uBpJYwij/vtgDjKgN+zbOdnhbrj2yQwZlY Y0DPD8dZ+5q9lvvaQAhKXAIvfB13l9rLjnGv5VDV+fmfkyYxSdZJ97HnMK8aqTZt gF9ZhtNz4BMdvFXre1byxcZ5nBvX5iR2aYlGuho1vet6BawH/L5bdpOxUk/+xsFi 2pLcMnYFJHVWT+SbBr3Ev60xWFs8mB9HPCzZckHdO4YaTngJArXRZJvhhXdIpm6q yAoLza+YNot+wHXhujvSD+Ht9GOcs9pMmxxGXLOgSepb56RCRi8b1hl4FWAmdrwt T5rg5gkRCW+0jFhukX2yA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1666298496; x= 1666384896; bh=eWADXQlV8LmkS5w5dboElwYJ2VTEQ7c30a7fS5jtF20=; b=U VJ9p0Lihg7bPW/5k4cTwnxapD/pcJAda6MnGg2h5lW2U4DCiGbkncOdr4jR8ZOYF oR0bDyV7sTAXCiTceO6ByPrj76MosLq8ljtIotLYpet5e4MIU5rgPj0HSr+ZCq2l z0MYuugj0rHzsDRodZZvN3rG+H6jUv/kE05k28n6KJwBjxQVvvLR4qaDfTw56j2d GogqA0vwflkasFB1ukMSvJWK302G9RfGv9FoOCuyXDk8ZUUyh0NXd4Jv1sIMk7s/ OhFXNl4IWlczBT21g4bUgV1HM/GcxdU5b0dudiHU1M7XzEs1X9nRju8cFxmpjGFA nieKQaBsX1huz9+5O4QIg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeliedgudehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhho mhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqne cuggftrfgrthhtvghrnheptdejieeifeehtdffgfdvleetueeffeehueejgfeuteeftddt ieekgfekudehtdfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 20 Oct 2022 16:41:35 -0400 (EDT) From: Thomas Monjalon To: David Marchand Cc: "Hunt, David" , Ruifeng Wang , dev@dpdk.org, nd , Feifei Wang Subject: Re: =?UTF-8?B?5Zue5aSNOg==?= [PATCH v1 3/3] examples/l3fwd-power: enable PMD power mgmt on Arm Date: Thu, 20 Oct 2022 22:41:33 +0200 Message-ID: <4960501.eGJsNajkDb@thomas> In-Reply-To: References: <20220825064251.2637274-1-feifei.wang2@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 11/10/2022 09:56, Feifei Wang: > David Marchand > > > On 25/08/2022 07:42, Feifei Wang wrote: > > > > --- 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) > > > > Having a arch specific behavior in the application shows that there is > > something wrong either in the API, or in the Arm implementation of the API. > > I don't think this is a good solution. > > > > Can't we find a better alternative? By changing the API probably? > Sorry I do not understand ' shows that there is something wrong either in the API' David means the application developer should not have to be aware of the arch differences. When you use an API, you don't check how it is implemented, and you are not supposed to use #ifdef. The API must be arch-agnostic. > Here we call ' rte_power_monitor_wakeup' API is due to that we need to wake > up all cores from WFE instructions in arm, and then l3fwd can exit correctly. > > This is due to that arm arch is different from x86, if there is no packets received, x86's > 'UMONITOR' can automatically exit from energy-saving state after waiting for a period of time. > But arm's 'WFE' can not exit automatically. It will wait 'SEV' instructions in wake_up API to wake > up it. > > Finally, if user want to exit l3fwd by 'SIGINT' in arm, main core should firstly call 'wake_up' API > to force worker cores to exit from energy-saving state. > Otherwise, the worker will stay in the energy-saving state forever if no packet is received. Please find a way to have a common API, even if the API implementation is empty in x86 case. > > > > > > > > + /** > > > > + * wake_up api does not need input parameter on Arm, > > > > + * so 0 is meaningless here. > > > > + */ > > > > + rte_power_monitor_wakeup(0); #endif > > > > quit_signal = true; > > > > + }