From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw0-f176.google.com (mail-yw0-f176.google.com [209.85.161.176]) by dpdk.org (Postfix) with ESMTP id E10E32BB9 for ; Thu, 5 Jan 2017 06:31:45 +0100 (CET) Received: by mail-yw0-f176.google.com with SMTP id a10so334064674ywa.3 for ; Wed, 04 Jan 2017 21:31:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=v/FBbrvU9IyNEsXTd40dZsbs46SScqIhZYU3tB+N8Zw=; b=BK+dlaDHYC4k3tJvGzNN9nFQZwdPARfL74nF0Mli5XFTpqgr8Q7slbmZoUizNbzrUa UE2MWgYMmQYCptNBmYlpl20mrt81piMYDQ/yeNAqCQTpmA43kZBAvvLymzt77bXjqKUr PTS753x7zr41vHdvGaf9fpOPjhMgwAheENoq4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=v/FBbrvU9IyNEsXTd40dZsbs46SScqIhZYU3tB+N8Zw=; b=JQFYSC1UvH3J7NVpoUhnWphM7H7vHS9aBUrwrb5SBRv5r5NYNjcC6bZ7Kxi3qJ4NHw xR23DHiJeuCAsK8FwMaFJPnBd18bSUps3afztqKRCSB7G3WjZccM7vW4IQreC9WnOO8/ Y7eSrfJmPo0gVQ5mR+6CLcEyB0Xe95MbJ2qILKe5K1BFgC7S5IYK2T0cGl561RC5ITcz YRp9lJBqIdCdkxyh+5gUpuIdVu+REu4JDKg5nTwlfnFUSddcXqcNT7o5dMcC8NxqzDFA HgCjeN4Gyq6qDJB1v4jIBFBgCDzimsEaPC/B7h3+NCf0OPdIEyp/rckVFy02+T4gEEJ0 741g== X-Gm-Message-State: AIkVDXIPlVSZPvGM6wYslrMVvKBuEZejuwk4ytvaDSTvDJfss5tJj8ynhimlUSJcDjOlF32aaKbFQ94gufJnc8b1 X-Received: by 10.13.255.5 with SMTP id p5mr71977007ywf.60.1483594305198; Wed, 04 Jan 2017 21:31:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.221.65 with HTTP; Wed, 4 Jan 2017 21:31:44 -0800 (PST) In-Reply-To: <20170104100104.GA6578@localhost.localdomain> References: <1481680558-4003-1-git-send-email-jerin.jacob@caviumnetworks.com> <1482832175-27199-1-git-send-email-jerin.jacob@caviumnetworks.com> <1482832175-27199-10-git-send-email-jerin.jacob@caviumnetworks.com> <20170104100104.GA6578@localhost.localdomain> From: Jianbo Liu Date: Thu, 5 Jan 2017 13:31:44 +0800 Message-ID: To: Jerin Jacob Cc: dev@dpdk.org, "Ananyev, Konstantin" , Thomas Monjalon , Bruce Richardson , Jan Viktorin , Santosh Shukla Content-Type: text/plain; charset=UTF-8 Subject: Re: [dpdk-dev] [PATCH v2 09/29] eal/arm64: define I/O device memory barriers for arm64 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2017 05:31:46 -0000 On 4 January 2017 at 18:01, Jerin Jacob wrote: > On Tue, Jan 03, 2017 at 03:48:32PM +0800, Jianbo Liu wrote: >> On 27 December 2016 at 17:49, Jerin Jacob >> wrote: >> > CC: Jianbo Liu >> > Signed-off-by: Jerin Jacob >> > --- >> > lib/librte_eal/common/include/arch/arm/rte_atomic_64.h | 6 ++++++ >> > 1 file changed, 6 insertions(+) >> > >> > diff --git a/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h b/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h >> > index 78ebea2..ef0efc7 100644 >> > --- a/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h >> > +++ b/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h >> > @@ -88,6 +88,12 @@ static inline void rte_rmb(void) >> > >> > #define rte_smp_rmb() dmb(ishld) >> > >> > +#define rte_io_mb() rte_mb() >> > + >> > +#define rte_io_wmb() rte_wmb() >> > + >> > +#define rte_io_rmb() rte_rmb() >> > + >> >> I think it's better to use outer shareable dmb for io barrier, instead of dsb. > > Its is difficult to generalize. AFAIK, from the IO barrier perspective > dsb would be the right candidate. But just for the DMA barrier between IO may > be outer sharable dmb is enough. In-terms of performance implication, the > fastpath code(door bell write) has been changed to relaxed write in all > the drivers in this patchset and rte_io_* will be only > used by rte_[read/write]8/16/32/64 which will be in slow-path. > So, IMO, it better stick with dsb and its safe from the complete IO barrier > perspective. If so, why not use *mb() directly? > > At least on ThunderX, I couldn't see any performance difference between > using dsb(st) and dmb(oshst) for dma write barrier before the doorbell register > write in fastpath. In case there are platforms which has such performance difference, > may be could add rte_dma_wmb() and rte_dma_rmb() in future like Linux kernel > dma_wmb() and dma_rmb().(But i couldn't see all the driver are using it, > though) > But there is no io_*mb() in the kernel, so you want to be different?