From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <mauricio.vasquezbernal@studenti.polito.it>
Received: from compass.polito.it (compass.polito.it [130.192.55.110])
 by dpdk.org (Postfix) with ESMTP id 7CC219604
 for <dev@dpdk.org>; Tue, 10 May 2016 11:13:10 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by compass.polito.it (Postfix) with ESMTP id 4941A100158
 for <dev@dpdk.org>; Tue, 10 May 2016 11:13:10 +0200 (CEST)
Authentication-Results: compass.polito.it (amavisd-new);
 dkim=pass (1024-bit key) reason="pass (just generated, assumed good)"
 header.d=studenti.polito.it
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=
 studenti.polito.it; h=content-type:content-type:to:from:from
 :subject:subject:message-id:date:date:received:mime-version
 :received:received:received; s=y2k10; t=1462871589; bh=K38ZgXmqw
 wIlmkOhAVC4csKTwv0jirFm8cQHDLnDRgU=; b=RCAZ454TsKT0khzAm9cKCFi9k
 LpSpJuDAy7ekKqpkuxQ3zRAZzmfIsLvE405sggLswPNRINfG7DWHtY0POEvlgStz
 dfzjTXCKKssW4ux8380tWsUQ2No4CFvLZ5BmZhmaSvKW39cwIHomM43ubBnd3eSf
 G0KCvxA8Mx2B/M7JsQ=
X-Virus-Scanned: amavisd-new at studenti.polito.it
X-Spam-Flag: NO
X-Spam-Score: -5.872
X-Spam-Level: 
X-Spam-Status: No, score=-5.872 tagged_above=-100 required=3.5
 tests=[ALL_TRUSTED=-5, AWL=0.627, BAYES_00=-1.5, HTML_MESSAGE=0.001]
 autolearn=ham
Received: from compass.polito.it ([127.0.0.1])
 by localhost (compass.polito.it [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id dYkWgvzRljXs for <dev@dpdk.org>;
 Tue, 10 May 2016 11:13:09 +0200 (CEST)
Received: from mail-lf0-f42.google.com (mail-lf0-f42.google.com
 [209.85.215.42])
 (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 (Authenticated sender: s203403@studenti.polito.it)
 by compass.polito.it (Postfix) with ESMTPSA id 3A3B910012D
 for <dev@dpdk.org>; Tue, 10 May 2016 11:13:09 +0200 (CEST)
Received: by mail-lf0-f42.google.com with SMTP id u64so7523399lff.3
 for <dev@dpdk.org>; Tue, 10 May 2016 02:13:09 -0700 (PDT)
X-Gm-Message-State: AOPr4FVP7wRSUEJ3pc+MAgKrVQn/4cSd8CgJMZ4N8UAxDVGB8YVforwSJ2YhbK5gUD2o9YIA/dn73/bs8hfscA==
MIME-Version: 1.0
X-Received: by 10.25.23.86 with SMTP id n83mr17366939lfi.159.1462871588828;
 Tue, 10 May 2016 02:13:08 -0700 (PDT)
Received: by 10.25.4.200 with HTTP; Tue, 10 May 2016 02:13:08 -0700 (PDT)
Date: Tue, 10 May 2016 11:13:08 +0200
X-Gmail-Original-Message-ID: <CAPwdgqjR1eSt5ewcdm93WNT-ZX7ychWUSdSZvbU22Rapat3ybQ@mail.gmail.com>
Message-ID: <CAPwdgqjR1eSt5ewcdm93WNT-ZX7ychWUSdSZvbU22Rapat3ybQ@mail.gmail.com>
From: =?UTF-8?Q?Mauricio_V=C3=A1squez?=
 <mauricio.vasquezbernal@studenti.polito.it>
To: Bruce Richardson <bruce.richardson@intel.com>, dev@dpdk.org
Content-Type: text/plain; charset=UTF-8
X-Content-Filtered-By: Mailman/MimeDel 2.1.15
Subject: [dpdk-dev] Ring PMD: why are stats counters atomic?
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 10 May 2016 09:13:10 -0000

Hello,

Per-queue stats counters are defined as rte_atomic64_t, in the tx/rx
functions, they are atomically increased if the rings have the multiple
consumers/producer flag enabled.

According to the design principles, the application should not invoke those
functions on the same queue on different cores, then I think that atomic
increasing is not necessary.

Is there something wrong with my reasoning?, If not, I am willing to send a
patch.

Thank you very much,

Mauricio V,