From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jianbo Liu Subject: Re: [PATCH v2 1/8] eal: introduce DMA memory barriers Date: Tue, 16 Jan 2018 10:47:07 +0800 Message-ID: <20180116024706.GA14652@arm.com> References: <20171227042824.33373-1-yskoh@mellanox.com> <20180116011050.18866-1-yskoh@mellanox.com> <20180116011050.18866-2-yskoh@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com, jerin.jacob@caviumnetworks.com, dev@dpdk.org To: Yongseok Koh Return-path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40061.outbound.protection.outlook.com [40.107.4.61]) by dpdk.org (Postfix) with ESMTP id 9EF3412001 for ; Tue, 16 Jan 2018 03:48:33 +0100 (CET) Content-Disposition: inline In-Reply-To: <20180116011050.18866-2-yskoh@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The 01/15/2018 17:10, Yongseok Koh wrote: > This commit introduces rte_dma_wmb() and rte_dma_rmb(), in order to > guarantee the ordering of coherent shared memory between the CPU and a DM= A > capable device. > > Signed-off-by: Yongseok Koh Acked-by: Jianbo Liu > --- > lib/librte_eal/common/include/generic/rte_atomic.h | 18 ++++++++++++++++= ++ > 1 file changed, 18 insertions(+) > > diff --git a/lib/librte_eal/common/include/generic/rte_atomic.h b/lib/lib= rte_eal/common/include/generic/rte_atomic.h > index 16af5ca57..2e0503ce6 100644 > --- a/lib/librte_eal/common/include/generic/rte_atomic.h > +++ b/lib/librte_eal/common/include/generic/rte_atomic.h > @@ -98,6 +98,24 @@ static inline void rte_io_wmb(void); > */ > static inline void rte_io_rmb(void); > > +/** > + * Write memory barrier for coherent memory between lcore and IO device > + * > + * Guarantees that the STORE operations on coherent memory that > + * precede the rte_dma_wmb() call are visible to I/O device before the > + * STORE operations that follow it. > + */ > +static inline void rte_dma_wmb(void); > + > +/** > + * Read memory barrier for coherent memory between lcore and IO device > + * > + * Guarantees that the LOAD operations on coherent memory updated by > + * IO device that precede the rte_dma_rmb() call are visible to CPU > + * before the LOAD operations that follow it. > + */ > +static inline void rte_dma_rmb(void); > + > #endif /* __DOXYGEN__ */ > > /** > -- > 2.11.0 > -- IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.