From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jia He Subject: [PATCH v5 0/1] fix race condition in enqueue/dequeue because of cpu reorder Date: Fri, 10 Nov 2017 01:51:08 +0000 Message-ID: <1510278669-8489-1-git-send-email-hejianet@gmail.com> References: <1510118764-29697-1-git-send-email-hejianet@gmail.com> Cc: konstantin.ananyev@intel.com, bruce.richardson@intel.com, jianbo.liu@arm.com, hemant.agrawal@nxp.com, Jia He To: jerin.jacob@caviumnetworks.com, dev@dpdk.org, olivier.matz@6wind.com Return-path: Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by dpdk.org (Postfix) with ESMTP id 3B00D1B3DC for ; Fri, 10 Nov 2017 02:51:33 +0100 (CET) Received: by mail-pf0-f196.google.com with SMTP id e64so5633320pfk.9 for ; Thu, 09 Nov 2017 17:51:33 -0800 (PST) In-Reply-To: <1510118764-29697-1-git-send-email-hejianet@gmail.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" We watched a rte panic of mbuf_autotest in our qualcomm arm64 server due to a possible race condition. To fix this race condition, rmb() is needed to add between the 2 loads. Already fuctionally tested on the machines as follows: - on X86 - on arm64 --- Changelog V5: split it into 2 patchset due to the milestone concerns, this is the 1st one V4: split into small patches V3: arch specific implementation for enqueue/dequeue barrier V2: let users choose whether using load_acquire/store_release V1: rte_smp_rmb() between 2 loads Jia He (4): eal/arm64: remove the braces {} for dmb() and dsb() ring: guarantee load/load order in enqueue and dequeue ring: introduce new header file to include common functions ring: introduce new header file to support C11 memory model config/common_armv8a_linuxapp | 2 + .../common/include/arch/arm/rte_atomic_64.h | 4 +- lib/librte_eventdev/rte_event_ring.h | 6 +- lib/librte_ring/Makefile | 4 +- lib/librte_ring/rte_ring.h | 161 ++--------------- lib/librte_ring/rte_ring_c11_mem.h | 185 ++++++++++++++++++++ lib/librte_ring/rte_ring_generic.h | 194 +++++++++++++++++++++ 7 files changed, 404 insertions(+), 152 deletions(-) create mode 100644 lib/librte_ring/rte_ring_c11_mem.h create mode 100644 lib/librte_ring/rte_ring_generic.h -- 2.7.4