From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by dpdk.org (Postfix) with ESMTP id 7DC251B281 for ; Wed, 8 Nov 2017 10:57:03 +0100 (CET) Received: by mail-pg0-f65.google.com with SMTP id v78so1410382pgb.5 for ; Wed, 08 Nov 2017 01:57:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=W5DZ2BkednwtfqDIvneAeVIvgqxaLMT7pEwYVPdyhsQ=; b=EXf/T7f/4b4UQmdhqzgtxTQJ3vkAdawkuuHzCL+NQzX2RuJBHEGrdMGTU2RNuioE+T BmNU66oNDM8JZ3c9bjkGW/tWMsN2gAWazg04unIlzCLMNip42D937JO/d4pbZ+paCh0m QBr/BbDFrsrNvI64Qf3B1JCKFFtTxNIhqoZilXJx4xHvzJp0owIj+ZLdt2sJVJovwZfJ z9IUFPEg0s8uoP6XE/v92VVjM6l0Yks6J3llGHzeYcdUn7JY4bfMLkUhB2/Z/ueFtSwy JK5ZKwctfzDIaCUFHggxL/+c0Aab9cGtzjIDwxEKrWNKjiDraK6HEPD5ggruQZmIr9gv p4Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=W5DZ2BkednwtfqDIvneAeVIvgqxaLMT7pEwYVPdyhsQ=; b=cwvBpR4NDAmlpeWy7OPsBtPkMACnDwpagbt7cThqUK05Y+KDzqAO7N+1Gn71C9tWut sFGU+7ze1d7ML1OlRwveLYMTJcCFCXCs4uYLKh3RaNxSpcNshGj6tuE+b0Iof/5yBgnJ OyKriNkfyDbwGnhB+SUAlbPaY9qXUCS7+lYyoqa4pxPVPSNK9VbINGKrmbZpPi7WLPM1 3qEI/oS5PfgiTDptbacjO7eka64Pfuplv3CfnIWlw32OfjalPwv82F7Pau+toEe6L03z YK5Vdynf/eMCRGhxL8sUpfDN2VrDHxlpk1kJ4+prh8J3frsJLjPO6BG8NCJZu50PhdYT yYcA== X-Gm-Message-State: AJaThX7SN3O5mYRqXn1TJb0ZyVuHV7mw6KBBqCkCCmYLunXtRETMOVi4 /WOcgY0BAeH32Y2shtWf8Qs= X-Google-Smtp-Source: ABhQp+S1E3CgV687SizHC2isAzj3yLTtVzCMeMAibZihp1DO8nvJzA0GEKqSYZolOsAu+a8TCl7X+A== X-Received: by 10.98.144.129 with SMTP id q1mr385623pfk.38.1510135022580; Wed, 08 Nov 2017 01:57:02 -0800 (PST) Received: from nfv-demo01.hxtcorp.net ([38.106.11.25]) by smtp.gmail.com with ESMTPSA id a19sm7678826pfh.30.2017.11.08.01.56.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Nov 2017 01:57:02 -0800 (PST) From: Jia He To: jerin.jacob@caviumnetworks.com, dev@dpdk.org, olivier.matz@6wind.com Cc: konstantin.ananyev@intel.com, bruce.richardson@intel.com, jianbo.liu@arm.com, hemant.agrawal@nxp.com, Jia He Date: Wed, 8 Nov 2017 09:54:37 +0000 Message-Id: <1510134881-22987-1-git-send-email-hejianet@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510118764-29697-1-git-send-email-hejianet@gmail.com> References: <1510118764-29697-1-git-send-email-hejianet@gmail.com> Subject: [dpdk-dev] [PATCH v4 0/4] fix race condition in enqueue/dequeue because of cpu reorder 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: Wed, 08 Nov 2017 09:57:03 -0000 We watched a rte panic of mbuf_autotest in our qualcomm arm64 server due to a possible race condition. To fix this race, there are 2 options as suggested by Jerin: 1. use rte_smp_rmb 2. use load_acquire/store_release(refer to [2]). CONFIG_RTE_RING_USE_C11_MEM_MODEL is provided, and by default it is "y" only on arm64 so far. The reason why providing 2 options is due to the performance benchmark difference in different arm machines. Already fuctionally tested on the machines as follows: - on X86 - on arm64 with CONFIG_RTE_RING_USE_C11_MEM_MODEL=y - on arm64 with CONFIG_RTE_RING_USE_C11_MEM_MODEL=n --- Changelog: 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