Hi, Stephen

> -----邮件原件-----
> 发件人: Stephen Hemminger <step...@networkplumber.org>
> 发送时间: Tuesday, November 8, 2022 12:02 AM
> 收件人: Feifei Wang <feifei.wa...@arm.com>
> 抄送: David Hunt <david.h...@intel.com>; dev@dpdk.org;
> david.march...@redhat.com; tho...@monjalon.net; nd <n...@arm.com>;
> Ruifeng Wang <ruifeng.w...@arm.com>
> 主题: Re: [PATCH v2 3/3] examples/l3fwd-power: enable PMD power
> monitor on Arm
> 
> On Mon,  7 Nov 2022 15:04:49 +0800
> Feifei Wang <feifei.wa...@arm.com> wrote:
> 
> > +                           /* 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();
> 
> This can be done in a simpler an cleaner manner with a continue statement
> earlier in the loop.
> 
> diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
> index fd3ade330f82..115535fd4cd7 100644
> --- a/examples/l3fwd-power/main.c
> +++ b/examples/l3fwd-power/main.c
> @@ -2984,6 +2984,16 @@ main(int argc, char **argv)
>                       }
> 
>                       if (app_mode == APP_MODE_PMD_MGMT
> && !baseline_enabled) {
> +#ifdef 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
> lcors.
> +                              */
> +                             if (lcore_id == rte_get_main_lcore())
> +                                     continue;
> +#endif
>                               /* Set power_pmd_mgmt configs passed by
> user */
> 
>       rte_power_pmd_mgmt_set_emptypoll_max(max_empty_polls);
>                               ret =
> rte_power_pmd_mgmt_set_pause_duration(pause_duration);

Thanks for the comment.
There maybe some problems for this change. This is due to that we just want to 
disable power monitor
feature on the main core when "app_mode == APP_MODE_PMD_MGMT && pmgmt_type == 
RTE_POWER_MGMT_TYPE_MONITOR".
When “pmgmt_type == RTE_POWER_MGMT_TYPE_PAUSE || pmgmt_type == 
RTE_POWER_MGMT_TYPE_SCALE", main core
power management mode can be enabled.

Best Regards
Feifei

Reply via email to