DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dharmik Thakkar <Dharmik.Thakkar@arm.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "thomas@monjalon.net" <thomas@monjalon.net>,
	"dev@dpdk.org" <dev@dpdk.org>, nd <nd@arm.com>,
	Ruifeng Wang <Ruifeng.Wang@arm.com>,
	"david.marchand@redhat.com" <david.marchand@redhat.com>
Subject: Re: [dpdk-dev] [PATCH] checkpatch: enable volatile warning
Date: Mon, 16 Aug 2021 13:28:30 +0000	[thread overview]
Message-ID: <3F9575F7-D720-4853-ABF0-5F242B21F4C6@arm.com> (raw)
In-Reply-To: <20210310071017.157a4105@hermes.local>

Hi,

Apologies for the delayed response!

> On Mar 10, 2021, at 9:10 AM, Stephen Hemminger <stephen@networkplumber.org> wrote:
> 
> On Wed, 10 Mar 2021 12:10:01 +0100
> Thomas Monjalon <thomas@monjalon.net> wrote:
> 
>> 10/03/2021 12:04, Dharmik Thakkar:
>>> Enable volatile considered harmful warning since use of volatile
>>> is suspect.
>>> 
>>> Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
>>> Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
>>> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>  
>> 
>> git grep -w volatile | wc -l
>> 	1796
>> 
>> How much is it suspect?
>> 
>> 
> 
> Many seem to be unsafe.
>   testpmd: uses flags values in unsafe manner
>      it also uses volatile when accessing hardware registers
> 
>   test-alarm is expecting that alarm() is a signal
>       (it is not)
> 
>   test-atomic is ok
>   test-barrier is doing barriers and not using __atomic
> 
>   drivers use volatile to mark hardware registers.
> 
> It is still true volatile is not enough are not weak memory model.

Agree, and this warning should help avoid such unsafe / incorrect use of volatile for future patches.

      reply	other threads:[~2021-08-16 13:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 11:04 Dharmik Thakkar
2021-03-10 11:10 ` Thomas Monjalon
2021-03-10 15:10   ` Stephen Hemminger
2021-08-16 13:28     ` Dharmik Thakkar [this message]

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=3F9575F7-D720-4853-ABF0-5F242B21F4C6@arm.com \
    --to=dharmik.thakkar@arm.com \
    --cc=Ruifeng.Wang@arm.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=nd@arm.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /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).