Hi, Van Haaren

> -----邮件原件-----
> 发件人: Van Haaren, Harry <[email protected]>
> 发送时间: 2020年12月21日 17:57
> 收件人: Feifei Wang <[email protected]>; Rao, Nikhil
> <[email protected]>
> 抄送: [email protected]; nd <[email protected]>; [email protected];
> [email protected]; [email protected]
> 主题: RE: [PATCH] examples/eventdev: move eth stop to the end
> 
> > -----Original Message-----
> > From: Feifei Wang <[email protected]>
> > Sent: Monday, December 21, 2020 5:35 AM
> > To: Van Haaren, Harry <[email protected]>; Rao, Nikhil
> > <[email protected]>; Pavan Nikhilesh
> > <[email protected]>
> > Cc: [email protected]; [email protected]; Feifei Wang <[email protected]>;
> > [email protected]; [email protected]
> > Subject: [PATCH] examples/eventdev: move eth stop to the end
> 
> Suggested title improvement?
> examples/eventdev_pipeline: refactor ethdev port stop
That's OK. I will apply this in the next version.
> 
> > Move eth stop code from "signal_handler" function to the end of "main"
> > function. There are two reasons for this:
> >
> > First, this improves code maintenance and makes code look simple and
> clear.
> > Based on this change, after receiving the interrupt signal, "fdata->done"
> > is set as 1. Then the main thread will wait all worker lcores to jump
> > out of the loop. Finally, the main thread will stop and then close eth dev
> port.
> >
> > Second, for older version, the main thread first stops eth dev port
> > and then waits the end of worker lcore. This may cause errors because
> > it may stop the eth dev port which worker lcores are using. This
> > moving change can fix this by waiting all worker threads to exit and then
> stop the eth dev port.
> 
> I'm OK with the above changes, and agree that moving eth dev port close to
> after lcores return is a worthy change.
> 
> > In the meanwhile, remove wmb in signal_handler.
> >
> > This is because when the main lcore receive the stop signal, it stores
> > 1 into fdata->done. And then the worker lcores load "fdata->done" and
> > jump out of the loop to stop running. Nothing should be stored after
> > updating
> > fdata->done, so the wmb is unnecessary.
> >
> > Fixes: 085edac2ca38 ("examples/eventdev_pipeline: support Tx adapter")
> > Cc: [email protected]
> > Cc: [email protected]
> >
> > Suggested-by: Ruifeng Wang <[email protected]>
> > Signed-off-by: Feifei Wang <[email protected]>
> > Reviewed-by: Ruifeng Wang <[email protected]>
> > Reviewed-by: Honnappa Nagarahalli <[email protected]>
> 
> +Cc Jerin for Eventdev tree;
> -Cc Pavan's old email address
Thanks very much for this change.
> 
> Ack-ed by: Harry van Haaren <[email protected]>

Best Regards
Feifei

Reply via email to