From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9+bINixcuLfKb3JmTWySzL8ywfj8jX8O39IMv6xyixY=; b=0bTd5IL77pEBRVZleKnJ+LtOf3HDYzDzYmNRHxEd76+B6VWku7tESqOV8xcBblAOvS Gg0IYJRVBFrwFp27iOJLIBkTWmwkf3SRmQWP5Ad74kuQSSAb5+VekVP5qwjJyXpGfVKO 8RUzQvN/0dwM+HIfIxMYhiOvBqu7oqSVx8xdqCVggV7urkF5lWW5aOIwjRFhx21YcfHo XJjitkqlzwok/T65jrQpiB/p7HAYstNVbBC5HEHbVIVQpZxX5kC040Zg1UPFva61pM61 94tLEPfzQtgAZN5i6vAhN6hcpqV7DVy7t/cwggtFQexa00OeObjS4WKpvE7V1tC7eJtF Aw0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9+bINixcuLfKb3JmTWySzL8ywfj8jX8O39IMv6xyixY=; b=J958BbjHB7QGoyeDoC8hvLYNwYWl7bDlzDx41++74wZnyOClshW3BD/5CqCc6Di/3/ /5zb788BwRndUjbFyYflWOheFxcHcMNymhiyxyihgLYg/EYEw0JpVaPMLcO2uYXxGOWK qwcHIYTv01Kr4WCORn0gEi95Nwy/jR9xPvF4aTEeKzldRtFdK+R5Pmpiotsll4ExleFp iSNZdJRpbvw7OPsIs+6OBNCDN/RVPtq8F6cRgGr3qOamsYMT8Ym1USMXP6eIEY6RYgoh zE58dSrlKFr9xQ+FXkW1CElgZUEtRHYBzDX+kJ+H/U4lEt5emd8CfAMIS3PURhj0dwlH xMXw== X-Gm-Message-State: ABUngvd/MbcW5pqJGwNcuzDQWgdWEYZsZabYihxfNtiUFg528xf/bTz+k+ZhWrtJQBA7bQ== X-Received: by 10.99.111.2 with SMTP id k2mr16556552pgc.136.1477617128668; Thu, 27 Oct 2016 18:12:08 -0700 (PDT) Received: from xeon-e3 (static-50-53-69-251.bvtn.or.frontiernet.net. [50.53.69.251]) by smtp.gmail.com with ESMTPSA id o185sm7257860pfb.24.2016.10.27.18.12.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Oct 2016 18:12:08 -0700 (PDT) Date: Thu, 27 Oct 2016 18:12:20 -0700 From: Stephen Hemminger To: Remy Horton Message-ID: <20161027181220.752e90ea@xeon-e3> In-Reply-To: <1477616671-9547-3-git-send-email-remy.horton@intel.com> 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 Subject: Re: [dpdk-dev] [RFC PATCH v2 2/3] lib: add bitrate statistics library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2016 01:12:09 -0000 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.