All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: "Hunt, David" <david.hunt@intel.com>,
	Feifei Wang <feifei.wang2@arm.com>,
	 Ruifeng Wang <ruifeng.wang@arm.com>
Cc: dev@dpdk.org, nd@arm.com, Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [PATCH v1 3/3] examples/l3fwd-power: enable PMD power mgmt on Arm
Date: Mon, 3 Oct 2022 09:12:13 +0200	[thread overview]
Message-ID: <CAJFAV8yDparS_jXRBdx0mxhCWNZi-hWC=WmY5sE+GLs5SJH6wg@mail.gmail.com> (raw)
In-Reply-To: <9039d076-aad2-d741-5724-a163085b470d@intel.com>

On Mon, Aug 29, 2022 at 2:48 PM Hunt, David <david.hunt@intel.com> 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 <feifei.wang2@arm.com>
> > Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> > ---
> >   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.hunt@intel.com>


-- 
David Marchand


  reply	other threads:[~2022-10-03  7:12 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25  6:42 [PATCH v1 0/3] Enable PMD power management on Arm Feifei Wang
2022-08-25  6:42 ` [PATCH v1 1/3] eal: add 8 bits case for wait scheme Feifei Wang
2022-08-25  6:42 ` [PATCH v1 2/3] eal: add power mgmt support on Arm Feifei Wang
2022-08-25  6:42 ` [PATCH v1 3/3] examples/l3fwd-power: enable PMD power mgmt " Feifei Wang
2022-08-29 12:48   ` Hunt, David
2022-10-03  7:12     ` David Marchand [this message]
2022-10-11  7:56       ` 回复: " Feifei Wang
2022-10-20 20:41         ` Thomas Monjalon
2022-10-27  9:38           ` 回复: " Feifei Wang
2022-10-20 22:09   ` Stephen Hemminger
2022-10-27  9:43     ` 回复: " Feifei Wang
2022-11-07  7:04 ` [PATCH v2 0/3] Enable PMD power management " Feifei Wang
2022-11-07  7:04   ` [PATCH v2 1/3] eal: add 8 bits case for wait scheme Feifei Wang
2022-11-07  7:04   ` [PATCH v2 2/3] eal: add power mgmt support on Arm Feifei Wang
2022-11-07  7:04   ` [PATCH v2 3/3] examples/l3fwd-power: enable PMD power monitor " Feifei Wang
2022-11-07 16:01     ` Stephen Hemminger
2022-11-08  3:25       ` 回复: " Feifei Wang
2022-11-11  7:26 ` [PATCH v3 0/3] Enable PMD power management " Feifei Wang
2022-11-11  7:26   ` [PATCH v3 1/3] eal: add 8 bits case for wait scheme Feifei Wang
2022-11-11  7:26   ` [PATCH v3 2/3] eal: add power mgmt support on Arm Feifei Wang
2022-11-11  7:26   ` [PATCH v3 3/3] examples/l3fwd-power: enable PMD power monitor " Feifei Wang
2022-11-11  8:22     ` Thomas Monjalon
2022-11-11 10:21       ` 回复: " Feifei Wang
2022-11-11 10:20 ` [PATCH v4 0/4] Enable PMD power management " Feifei Wang
2022-11-11 10:20   ` [PATCH v4 1/4] eal: add 8 bits case for wait scheme Feifei Wang
2022-11-11 10:20   ` [PATCH v4 2/4] eal: add power mgmt support on Arm Feifei Wang
2022-11-11 10:20   ` [PATCH v4 3/4] power: add power monitor support check Feifei Wang
2022-11-11 10:20   ` [PATCH v4 4/4] examples/l3fwd-power: add power monitor wake up API Feifei Wang
2022-12-14  8:14 ` [PATCH v5 0/2] Enable PMD power management on Arm Feifei Wang
2022-12-14  8:14   ` [PATCH v5 1/2] eal: add 8 bits case for wait scheme Feifei Wang
2022-12-14  8:14   ` [PATCH v5 2/2] eal: add power mgmt support on Arm Feifei Wang
2023-02-17 16:23     ` Stephen Hemminger
2023-02-20  1:56       ` 回复: " Feifei Wang
2023-02-17  8:26   ` 回复: [PATCH v5 0/2] Enable PMD power management " Feifei Wang
2023-02-20  8:51 ` [PATCH v6 " Feifei Wang
2023-02-20  8:51   ` [PATCH v6 1/2] eal: add 8 bits case for wait scheme Feifei Wang
2023-02-20  8:51   ` [PATCH v6 2/2] eal: add power mgmt support on Arm Feifei Wang
2023-02-20 12:07   ` [PATCH v6 0/2] Enable PMD power management " David Marchand
2023-02-21  2:37     ` 回复: " Feifei Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJFAV8yDparS_jXRBdx0mxhCWNZi-hWC=WmY5sE+GLs5SJH6wg@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=feifei.wang2@arm.com \
    --cc=nd@arm.com \
    --cc=ruifeng.wang@arm.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.