DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Tianfei" <tianfei.zhang@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	"Huang, Wei" <wei.huang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "Xu, Rosen" <rosen.xu@intel.com>,
	"Zhang, Qi Z" <qi.z.zhang@intel.com>,
	"stable@dpdk.org" <stable@dpdk.org>,
	"Yigit, Ferruh" <ferruh.yigit@intel.com>
Subject: RE: [PATCH v3] raw/ifpga: fix pthread cannot join
Date: Fri, 21 Jan 2022 08:02:54 +0000	[thread overview]
Message-ID: <BN9PR11MB5483AC1BB1CFE617FB05CFE9E35B9@BN9PR11MB5483.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220120074643.10aa0926@hermes.local>



> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Thursday, January 20, 2022 11:47 PM
> To: Huang, Wei <wei.huang@intel.com>
> Cc: dev@dpdk.org; Xu, Rosen <rosen.xu@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; stable@dpdk.org; Zhang, Tianfei
> <tianfei.zhang@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: Re: [PATCH v3] raw/ifpga: fix pthread cannot join
> 
> On Thu, 20 Jan 2022 00:58:14 -0500
> Wei Huang <wei.huang@intel.com> 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	other threads:[~2022-01-21  8:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19  5:54 [PATCH v1] " Wei Huang
2022-01-19 10:45 ` Xu, Rosen
2022-01-20  2:35 ` [PATCH v2] " Wei Huang
2022-01-20  5:58   ` [PATCH v3] " Wei Huang
2022-01-20  8:08     ` David Marchand
2022-01-20 15:46     ` Stephen Hemminger
2022-01-21  8:02       ` Zhang, Tianfei [this message]
2022-01-21  1:29     ` [PATCH v4] " Wei Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN9PR11MB5483AC1BB1CFE617FB05CFE9E35B9@BN9PR11MB5483.namprd11.prod.outlook.com \
    --to=tianfei.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=rosen.xu@intel.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=wei.huang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).