From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v3 2/7] net/ark: HW API part 1 of 3 Date: Tue, 21 Mar 2017 15:15:52 -0700 Message-ID: <20170321151552.2d172477@xeon-e3> References: <1490132621-7851-1-git-send-email-ed.czeck@atomicrules.com> <1490132621-7851-2-git-send-email-ed.czeck@atomicrules.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Ed Czeck Return-path: Received: from mail-pf0-f181.google.com (mail-pf0-f181.google.com [209.85.192.181]) by dpdk.org (Postfix) with ESMTP id B406311C5 for ; Tue, 21 Mar 2017 23:15:59 +0100 (CET) Received: by mail-pf0-f181.google.com with SMTP id 20so37464780pfk.2 for ; Tue, 21 Mar 2017 15:15:59 -0700 (PDT) In-Reply-To: <1490132621-7851-2-git-send-email-ed.czeck@atomicrules.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, 21 Mar 2017 17:43:36 -0400 Ed Czeck wrote: > + volatile uint32_t ctrl; > + volatile uint32_t stats_clear; > + volatile uint32_t cplh_max; You are using a lot of 'volatile' in this driver. In general volatile should be reserved for known software shared data structures rather than every device register and statistics. I.e volatile is an inefficient replacement for proper use of barriers. The DPDK is not as stringent as Linux kernel (the kernel community considers almost all use of volatile a bug). See kernel document. process/volatile-considered-harmful.rst Do you understand that volatile requires compiler to generate the most paranoid code possible. Basically every reference turns into a barrier.