回复: [PATCH v2 3/3] examples/l3fwd-power: enable PMD power monitor on Arm
Feifei Wang
Feifei.Wang2 at arm.com
Tue Nov 8 04:25:40 CET 2022
Hi, Stephen
> -----邮件原件-----
> 发件人: Stephen Hemminger <stephen at networkplumber.org>
> 发送时间: Tuesday, November 8, 2022 12:02 AM
> 收件人: Feifei Wang <Feifei.Wang2 at arm.com>
> 抄送: David Hunt <david.hunt at intel.com>; dev at dpdk.org;
> david.marchand at redhat.com; thomas at monjalon.net; nd <nd at arm.com>;
> Ruifeng Wang <Ruifeng.Wang at 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.wang2 at 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
More information about the dev
mailing list