> -----Original Message-----
> From: Stephen Hemminger <[email protected]>
> Sent: Thursday, January 20, 2022 11:47 PM
> To: Huang, Wei <[email protected]>
> Cc: [email protected]; Xu, Rosen <[email protected]>; Zhang, Qi Z
> <[email protected]>; [email protected]; Zhang, Tianfei
> <[email protected]>; Yigit, Ferruh <[email protected]>
> Subject: Re: [PATCH v3] raw/ifpga: fix pthread cannot join
> 
> On Thu, 20 Jan 2022 00:58:14 -0500
> Wei Huang <[email protected]> wrote:
> 
> > diff --git a/drivers/raw/ifpga/ifpga_rawdev.c
> > b/drivers/raw/ifpga/ifpga_rawdev.c
> > index 8d9db58..2bc569b 100644
> > --- a/drivers/raw/ifpga/ifpga_rawdev.c
> > +++ b/drivers/raw/ifpga/ifpga_rawdev.c
> > @@ -497,7 +497,7 @@ static int set_surprise_link_check_aer(
> >     int gsd_enable, ret;
> >  #define MS 1000
> >
> > -   while (1) {
> > +   while (ifpga_monitor_start) {
> 
> This will work on x86 CPU but not on CPU's with weak memory ordering like
> ARM.
> 
> You need to use atomic_builtin when accessing a flag shared between threads
> that is not being protected by a lock.

We submitted a v5 patch for your suggestion, but got a " coding style issues" 
which said that: 
Warning in drivers/raw/ifpga/ifpga_rawdev.c:
Using rte_atomicNN_xxx

We look at the devtools/checkpatches.sh script, it mentioned that rte_atomic 
APIs are forbidden.

ifpga_monitor_start just a flags to enable and disable the threads not share 
with threads. When the driver init it will start the thread, 
when the driver remove it want to stop the thread. I don't think it will has a 
concurrency issue on this scenario.



Reply via email to