From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <hejianet@gmail.com>
Received: from mail-pg0-f42.google.com (mail-pg0-f42.google.com [74.125.83.42])
 by dpdk.org (Postfix) with ESMTP id 639741B670
 for <dev@dpdk.org>; Fri,  3 Nov 2017 03:55:50 +0100 (CET)
Received: by mail-pg0-f42.google.com with SMTP id b192so1316628pga.2
 for <dev@dpdk.org>; Thu, 02 Nov 2017 19:55:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=subject:from:to:cc:references:message-id:date:user-agent
 :mime-version:in-reply-to:content-transfer-encoding;
 bh=32Uy0z4lWHx8F3AXRWbN4Lg4E1y2FqxgCv4op7fviQs=;
 b=qw7cnPq1Bg/MAwvbVhqNj8Ajz5vtxeFpIZtiSg1mXug1S/ev0fCsXQZzPcUsGOVifw
 W3uuUX98pds1a4dbQVOxLR+zKT8ei9PtVbHemFgvNH0P3Tq9eBKJ4B8qKvrToWP7Sm6u
 yNT2Sd8Ho+ujgOc0yRyUfUIuUvz9kBCUqSf9D5Enh80iS6qzd4LLAEVZ93WuyaRm92FU
 FUXq7BZgfS8gaKcOnimaSjH5OTcM8RDVDQBmEIxLCY65zW3FgaPcPdolJ/Qr96fZhPsR
 3wpcv4ZRvWRD70wdh3dkB2R50ryTL8/MzZmYYTdNgx4Cx/OirvAqIicKao0oGwNBO3za
 tFqA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:subject:from:to:cc:references:message-id:date
 :user-agent:mime-version:in-reply-to:content-transfer-encoding;
 bh=32Uy0z4lWHx8F3AXRWbN4Lg4E1y2FqxgCv4op7fviQs=;
 b=oGOK5HU+3bB79Jy4FYfhAVSfX7MQp+nCE9U9R05dvwCdW3rzYDrMs/WiqXL1pPJrVR
 fvvdGLcLzhfP7syCYVY+BWDaRhu6vauY3gwChzVqX2zxW18k6wEF488Ngkg+76xdAKQQ
 A0Q3aR2y5WCDc0fFuPMA6vzSHiT0IMcnFYWETEHHR93tEtCpbEAScfz4bqJ0C3wpcAhT
 /7BuHuWkMc/tSWlzxktnyYo8ssu6Ezi6t/u4dgD4ddqgK2HfZlN5xmkcOdhk5ADUnuoR
 XiT5xEFNKH6PjIEofr2wRM/rSpsV3qLTOJcoSESH2JZg1GbgQEQujfirhz98ypODMF7c
 KazQ==
X-Gm-Message-State: AMCzsaU3pGyw+bxylmFoUkrJ6Ay+1HSWo8Ai4gBE1hGQ/O3/1Cc0mjip
 wBb3z/mEippBUy9GXNvS1gA=
X-Google-Smtp-Source: ABhQp+RSBjKJ6fxAZ08Y3tt15Y/84BbBxb9He+xwOFxOe4Q+YK6yUA7kDVO48ojRi+9ac9myhfaSKw==
X-Received: by 10.159.244.138 with SMTP id y10mr5307613plr.399.1509677749585; 
 Thu, 02 Nov 2017 19:55:49 -0700 (PDT)
Received: from [0.0.0.0] (67.209.179.165.16clouds.com. [67.209.179.165])
 by smtp.gmail.com with ESMTPSA id u46sm7719610pgn.80.2017.11.02.19.55.41
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 02 Nov 2017 19:55:48 -0700 (PDT)
From: Jia He <hejianet@gmail.com>
To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Cc: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
 "Zhao, Bing" <ilovethull@163.com>, Olivier MATZ <olivier.matz@6wind.com>,
 "dev@dpdk.org" <dev@dpdk.org>,
 "jia.he@hxt-semitech.com" <jia.he@hxt-semitech.com>,
 "jie2.liu@hxt-semitech.com" <jie2.liu@hxt-semitech.com>,
 "bing.zhao@hxt-semitech.com" <bing.zhao@hxt-semitech.com>,
 "Richardson, Bruce" <bruce.richardson@intel.com>, jianbo.liu@arm.com,
 hemant.agrawal@nxp.com
References: <2601191342CEEE43887BDE71AB9772585FAAB570@IRSMSX103.ger.corp.intel.com>
 <3e580cd7-2854-d855-be9c-7c4ce06e3ed5@gmail.com>
 <20171020054319.GA4249@jerin>
 <ab7154a2-a9f8-f12e-b6a0-2805c2065e2e@gmail.com>
 <20171023100617.GA17957@jerin>
 <b0e6eae2-e61b-1946-ac44-d781225778e5@gmail.com>
 <20171025132642.GA13977@jerin>
 <b54ce545-b75d-9813-209f-4125bd76c7db@gmail.com>
 <20171031111433.GA21742@jerin>
 <69adfb00-4582-b362-0540-d1d9d6bcf6aa@gmail.com>
 <20171101190420.GA21407@jerin>
 <8bc4095d-301e-3e99-9644-27848d97e9bc@gmail.com>
Message-ID: <fc05d426-a48a-4887-7365-85822d3996ac@gmail.com>
Date: Fri, 3 Nov 2017 10:55:40 +0800
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101
 Thunderbird/52.4.0
MIME-Version: 1.0
In-Reply-To: <8bc4095d-301e-3e99-9644-27848d97e9bc@gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Subject: Re: [dpdk-dev] [PATCH] ring: guarantee ordering of cons/prod
 loading when doing enqueue/dequeue
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <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: Fri, 03 Nov 2017 02:55:50 -0000

Hi Jerin


On 11/2/2017 4:57 PM, Jia He Wrote:
>
> Hi, Jerin
> please see my performance test below
> On 11/2/2017 3:04 AM, Jerin Jacob Wrote:
> [...]
>> Should it be like instead?
>>
>> +#else
>> +        *old_head = __atomic_load_n(&r->cons.head, __ATOMIC_ACQUIRE);
>> +        const uint32_t prod_tail = __atomic_load_n(&r->prod.tail,
>> __ATOMIC_ACQUIRE);
>> It would be nice to see how much overhead it gives.ie back to back
>> __ATOMIC_ACQUIRE.
> I can NOT test ring_perf_autotest in our server because of the 
> something wrong in PMU counter.
> All the return value of rte_rdtsc is 0 with and without your provided 
> ko module. I am still
> investigating the reason.
>

Hi Jerin

As for the root cause of rte_rdtsc issue, it might be due to the pmu 
counter frequency is too low

in our arm64 server("Amberwing" from qualcom)

[586990.057779] arch_timer_get_cntfrq()=20000000

Only 20MHz instead of 100M/200MHz, and CNTFRQ_EL0 is not even writable 
in kernel space.

Maybe the code in ring_perf_autotest needs to be changed?

e.g.

     printf("SC empty dequeue: %.2F\n",
             (double)(sc_end-sc_start) / iterations);
     printf("MC empty dequeue: %.2F\n",
             (double)(mc_end-mc_start) / iterations);

Otherwise it is always 0 if the time difference divides by iterations.


-- 
Cheers,
Jia