From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ed Czeck Subject: Re: [PATCH v3 2/7] net/ark: HW API part 1 of 3 Date: Tue, 21 Mar 2017 20:13:48 -0400 Message-ID: References: <1490132621-7851-1-git-send-email-ed.czeck@atomicrules.com> <1490132621-7851-2-git-send-email-ed.czeck@atomicrules.com> <20170321151552.2d172477@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: dev@dpdk.org To: Stephen Hemminger Return-path: Received: from mail-qk0-f173.google.com (mail-qk0-f173.google.com [209.85.220.173]) by dpdk.org (Postfix) with ESMTP id EC5571075 for ; Wed, 22 Mar 2017 01:14:09 +0100 (CET) Received: by mail-qk0-f173.google.com with SMTP id p64so147659899qke.1 for ; Tue, 21 Mar 2017 17:14:09 -0700 (PDT) In-Reply-To: <20170321151552.2d172477@xeon-e3> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.