patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Boyer, Andrew" <Andrew.Boyer@amd.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "Boyer, Andrew" <Andrew.Boyer@amd.com>,
	"dev@dpdk.org" <dev@dpdk.org>, "Patel, Neel" <Neel.Patel@amd.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [PATCH 04/13] net/ionic: fix missing volatile type for cqe pointers
Date: Mon, 5 Feb 2024 13:33:11 +0000	[thread overview]
Message-ID: <0D66E753-A5A3-4F4A-A532-1BE2FD55493D@amd.com> (raw)
In-Reply-To: <20240202202636.450b1b38@hermes.local>



> On Feb 2, 2024, at 11:26 PM, Stephen Hemminger <stephen@networkplumber.org> wrote:
> 
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
> On Fri, 2 Feb 2024 11:32:29 -0800
> Andrew Boyer <andrew.boyer@amd.com> wrote:
> 
>> From: Neel Patel <neel.patel@amd.com>
>> 
>> This memory may be changed by the hardware, so the volatile
>> keyword is required for correctness.
>> 
>> Fixes: e86a6fcc7cf3 ("net/ionic: add optimized non-scattered Rx/Tx")
>> cc: stable@dpdk.org
>> 
>> Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
>> Signed-off-by: Neel Patel <neel.patel@amd.com>
> 
> In general barriers are better than volatile.
> Volatile is a compiler not hardware construct really.
> 
> https://www.kernel.org/doc/html/latest/process/volatile-considered-harmful.html

Thanks for looking. The goal here is to prevent inappropriate compiler optimization.

From the link you posted:

> Pointers to data structures in coherent memory which might be modified by I/O devices can, sometimes, legitimately be volatile. A ring buffer used by a network adapter, where that adapter changes pointers to indicate which descriptors have been processed, is an example of this type of situation.


Doesn't that sound like what we are doing?

Thanks,
Andrew


  reply	other threads:[~2024-02-05 13:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240202193238.62669-1-andrew.boyer@amd.com>
2024-02-02 19:32 ` Andrew Boyer
2024-02-03  4:26   ` Stephen Hemminger
2024-02-05 13:33     ` Boyer, Andrew [this message]
2024-02-02 19:32 ` [PATCH 07/13] net/ionic: fix RSS query routine Andrew Boyer
2024-02-02 19:32 ` [PATCH 10/13] net/ionic: fix device close sequence to avoid crash Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 04/13] net/ionic: fix missing volatile type for cqe pointers Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 07/13] net/ionic: fix RSS query routine Andrew Boyer
2024-02-07  2:18 ` [PATCH v2 10/13] net/ionic: fix device close sequence to avoid crash Andrew Boyer
     [not found] ` <20240207031317.32293-1-andrew.boyer@amd.com>
2024-02-07  3:13   ` [PATCH v3 04/13] net/ionic: fix missing volatile type for cqe pointers Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 07/13] net/ionic: fix RSS query routine Andrew Boyer
2024-02-07  3:13   ` [PATCH v3 10/13] net/ionic: fix device close sequence to avoid crash Andrew Boyer

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=0D66E753-A5A3-4F4A-A532-1BE2FD55493D@amd.com \
    --to=andrew.boyer@amd.com \
    --cc=Neel.Patel@amd.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    /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).