From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [RFC PATCH v2 2/3] lib: add bitrate statistics library Date: Thu, 27 Oct 2016 18:12:20 -0700 Message-ID: <20161027181220.752e90ea@xeon-e3> References: <1477616671-9547-1-git-send-email-remy.horton@intel.com> <1477616671-9547-3-git-send-email-remy.horton@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Remy Horton Return-path: Received: from mail-pf0-f174.google.com (mail-pf0-f174.google.com [209.85.192.174]) by dpdk.org (Postfix) with ESMTP id 573FF2904 for ; Fri, 28 Oct 2016 03:12:09 +0200 (CEST) Received: by mail-pf0-f174.google.com with SMTP id e6so26964100pfk.3 for ; Thu, 27 Oct 2016 18:12:09 -0700 (PDT) In-Reply-To: <1477616671-9547-3-git-send-email-remy.horton@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, 28 Oct 2016 09:04:30 +0800 Remy Horton wrote: > + > +struct rte_stats_bitrate_s { > + uint64_t last_ibytes; > + uint64_t last_obytes; > + uint64_t peak_ibits; > + uint64_t peak_obits; > + uint64_t ewma_ibits; > + uint64_t ewma_obits; > +}; > + Reader/write access of 64 bit values is not safe on 32 bit platforms. I think you need to add a generation counter (see Linux kernel syncp) to handle 32 bit architecture. If done correctly, it would be a nop on 64 bit platforms.