DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ed Czeck <ed.czeck@atomicrules.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3 2/7] net/ark: HW API part 1 of 3
Date: Tue, 21 Mar 2017 17:30:29 -0700	[thread overview]
Message-ID: <20170321173029.15af2a76@xeon-e3> (raw)
In-Reply-To: <CALZ3GujU86qSU81Ks+-V9v6XxyKBnL7WB9ukZMZGD66JEqynvw@mail.gmail.com>

On Tue, 21 Mar 2017 20:13:48 -0400
Ed Czeck <ed.czeck@atomicrules.com> wrote:

> Hi Stephen,
> 
> Yes I understand the paranoid issue of volatile modifier, which is the
> reason it was coded in this manner.
> 
> The struct with volatile are memory mapped IO structures.  These structure
> are not instantiated in memory and hence do not incur concurrent (host)
> software access.  The a vast majority of the fields as read-only (as viewed
> by the host.)  The concurrency model is that hardware is the producer, and
> the host the consumer.  There is no handshake other than the host must not
> expect the memory location to remain constant -- that is optimization off.
> 
> As for performance, these structures are not in any critical path, so he
> optimization path is correctness not performance.
> 
> Do you have a recommendation for changing this code without using the
> volatile modifier?  I have requirements from the hardware in the pattern of:
> write a 1 to location x
> read from location y until it become 0
> write a 0 to location x
> How can this work without a volatile modified on x and y?
> 
> Best,
> Ed.

Learn to use explicit memory barriers. DPDK has rmb()/wmb() just like kernel.

Once again good explanation of memory barriers in kernel doc.

  reply	other threads:[~2017-03-22  0:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 21:43 [dpdk-dev] [PATCH v3 1/7] net/ark: PMD for Atomic Rules Arkville driver stub Ed Czeck
2017-03-21 21:43 ` [dpdk-dev] [PATCH v3 2/7] net/ark: HW API part 1 of 3 Ed Czeck
2017-03-21 22:15   ` Stephen Hemminger
2017-03-22  0:13     ` Ed Czeck
2017-03-22  0:30       ` Stephen Hemminger [this message]
2017-03-22 14:36         ` Ed Czeck
2017-03-21 21:43 ` [dpdk-dev] [PATCH v3 3/7] net/ark: HW API part 2 " Ed Czeck
2017-03-21 21:43 ` [dpdk-dev] [PATCH v3 4/7] net/ark: HW API part 3 " Ed Czeck
2017-03-21 21:43 ` [dpdk-dev] [PATCH v3 5/7] net/ark: Packet TX support initial version Ed Czeck
2017-03-21 21:43 ` [dpdk-dev] [PATCH v3 6/7] net/ark: Packet RX " Ed Czeck
2017-03-21 21:43 ` [dpdk-dev] [PATCH v3 7/7] net/ark: Arkville PMD component integration Ed Czeck
2017-03-22 18:16 ` [dpdk-dev] [PATCH v3 1/7] net/ark: PMD for Atomic Rules Arkville driver stub Ferruh Yigit
2017-03-23  1:09   ` Ed Czeck

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=20170321173029.15af2a76@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=ed.czeck@atomicrules.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).