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 2E730A0093; Mon, 3 Oct 2022 09:12:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D8CEF40695; Mon, 3 Oct 2022 09:12:29 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id D363B40693 for ; Mon, 3 Oct 2022 09:12:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664781148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=W4LrF6tWWGRe/IzLMk5l6HsGxaWWNcmoBxJsqhPejZI=; b=hcxnee/1LTYjnBbfxclq6fNLS79+7XsXG0tRMe96v8Eip2Y8qEI6QHWnRx9K++iBMYvN2M zOl3g81+Nv5hdMk5t6MeZrrkXVRdnMEC/ieJr5tx31PC5WqWdAjPeNKGpxeFMGlmLBFfHX 44wy5SeQveEXQTBbSXcJ67JF5HJ1vG4= Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-247-l6rOxvDTObOSxRmHYjzCFw-1; Mon, 03 Oct 2022 03:12:26 -0400 X-MC-Unique: l6rOxvDTObOSxRmHYjzCFw-1 Received: by mail-pg1-f197.google.com with SMTP id i22-20020a63e456000000b0043c096be700so6446861pgk.1 for ; Mon, 03 Oct 2022 00:12:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=W4LrF6tWWGRe/IzLMk5l6HsGxaWWNcmoBxJsqhPejZI=; b=4/TkTDdBKVpxiNQyZrW0xTKuVdZJUOitSianw+oNWPfLRwVhrSfre4MRRIjC40o88Q S0pFP9PhNAGsevC8ExdXMQh9mfOWI3IG0RgItUZKgExYQqPBjNJZs6oHr08/BY9USBRL kMGDr3FvlXOR2DN0c9ImpUQlRyxrL16+HMvU0xlJhXMk1j+vjkMJMsQLM/qX8MSDZqh4 K94ToW0GbSBPHa1DKfvc3dk7t/mQx6sIDgb4dAMm5kNx3xBha4p+VnlyKa0SsMUZJvVT acPiF2zM8Cu7p60s+KkMIpzW9oafL0qk2LIpNNlUb4b9K1mpc9rdjrDZjsb7xfDY+jiQ BoXQ== X-Gm-Message-State: ACrzQf2v6OCf/nraCAHoJntinZ7koSGXRu3ZUNWS+cIqv2VSsUj9F1TQ Q0sFeOwWgIlfkDhltNizAbUuy9Bqc96v4gdqVKoOrl8BQ1hbBUNNSOj99l/jGEkA9YiqWOQlzqb qaMlLVT8KyorE7UW+IFE= X-Received: by 2002:a62:c584:0:b0:558:2095:e5ed with SMTP id j126-20020a62c584000000b005582095e5edmr21184685pfg.64.1664781145041; Mon, 03 Oct 2022 00:12:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5N03Pb5OivRFjoClOaajxkosybCvrF+FG+CZl4hikEbKj3odfd6P8PCWiCJaj2KINyf0v5LQumsUEI3+3mlcI= X-Received: by 2002:a62:c584:0:b0:558:2095:e5ed with SMTP id j126-20020a62c584000000b005582095e5edmr21184665pfg.64.1664781144677; Mon, 03 Oct 2022 00:12:24 -0700 (PDT) MIME-Version: 1.0 References: <20220825064251.2637274-1-feifei.wang2@arm.com> <20220825064251.2637274-4-feifei.wang2@arm.com> <9039d076-aad2-d741-5724-a163085b470d@intel.com> In-Reply-To: <9039d076-aad2-d741-5724-a163085b470d@intel.com> From: David Marchand Date: Mon, 3 Oct 2022 09:12:13 +0200 Message-ID: Subject: Re: [PATCH v1 3/3] examples/l3fwd-power: enable PMD power mgmt on Arm To: "Hunt, David" , Feifei Wang , Ruifeng Wang Cc: dev@dpdk.org, nd@arm.com, Thomas Monjalon X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 Mon, Aug 29, 2022 at 2:48 PM Hunt, David wrote: > 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) 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? > > + /** > > + * 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 -- David Marchand