> -----邮件原件----- > 发件人: Thomas Monjalon <tho...@monjalon.net> > 发送时间: Friday, October 21, 2022 4:42 AM > 收件人: David Marchand <david.march...@redhat.com> > 抄送: Hunt, David <david.h...@intel.com>; Ruifeng Wang > <ruifeng.w...@arm.com>; dev@dpdk.org; nd <n...@arm.com>; Feifei > Wang <feifei.wa...@arm.com> > 主题: Re: 回复: [PATCH v1 3/3] examples/l3fwd-power: enable PMD power > mgmt on Arm > > 11/10/2022 09:56, Feifei Wang: > > David Marchand <david.march...@redhat.com> > > > > 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.
Ok, Understand. Thanks for the explanation. > > > 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. Yes, I think what we need to do is not a create a new API, it is to look for a correct location to call 'rte_power_monitor_wakeup'. > > > > > > > > > > > > + /** > > > > > + * wake_up api does not need input parameter on Arm, > > > > > + * so 0 is meaningless here. > > > > > + */ > > > > > + rte_power_monitor_wakeup(0); #endif > > > > > quit_signal = true; > > > > > + } > >