From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 24A71A0559; Tue, 17 Mar 2020 02:18:27 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC54F1C068; Tue, 17 Mar 2020 02:18:25 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id 6D4741C067 for ; Tue, 17 Mar 2020 02:18:24 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CAE121FB; Mon, 16 Mar 2020 18:18:23 -0700 (PDT) Received: from phil-VirtualBox.shanghai.arm.com (phil-VirtualBox.shanghai.arm.com [10.169.108.137]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 202D53F52E; Mon, 16 Mar 2020 18:18:19 -0700 (PDT) From: Phil Yang To: thomas@monjalon.net, harry.van.haaren@intel.com, konstantin.ananyev@intel.com, stephen@networkplumber.org, maxime.coquelin@redhat.com, dev@dpdk.org Cc: david.marchand@redhat.com, jerinj@marvell.com, hemant.agrawal@nxp.com, Honnappa.Nagarahalli@arm.com, gavin.hu@arm.com, ruifeng.wang@arm.com, joyce.kong@arm.com, nd@arm.com Date: Tue, 17 Mar 2020 09:17:31 +0800 Message-Id: <1584407863-774-1-git-send-email-phil.yang@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583999071-22872-1-git-send-email-phil.yang@arm.com> References: <1583999071-22872-1-git-send-email-phil.yang@arm.com> Subject: [dpdk-dev] [PATCH v3 00/12] generic rte atomic APIs deprecate proposal 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" DPDK provides generic rte_atomic APIs to do several atomic operations. These APIs are using the deprecated __sync built-ins and enforce full memory barriers on aarch64. However, full barriers are not necessary in many use cases. In order to address such use cases, C language offers C11 atomic APIs. The C11 atomic APIs provide finer memory barrier control by making use of the memory ordering parameter provided by the user. Various patches submitted in the past [2] and the patches in this series indicate significant performance gains on multiple aarch64 CPUs and no performance loss on x86. But the existing rte_atomic API implementations cannot be changed as the APIs do not take the memory ordering parameter. The only choice available is replacing the usage of the rte_atomic APIs with C11 atomic APIs. In order to make this change, the following steps are proposed: [1] deprecate rte_atomic APIs so that future patches do not use rte_atomic APIs (a script is added to flag the usages). [2] refactor the code that uses rte_atomic APIs to use c11 atomic APIs. This patchset contains: 1) the checkpatch script changes to flag rte_atomic API usage in patches. 2) changes to programmer guide describing writing efficient code for aarch64. 3) changes to various libraries to make use of c11 atomic APIs. We are planning to replicate this idea across all the other libraries, drivers, examples, test applications. In the next phase, we will add changes to the mbuf, the EAL interrupts and the event timer adapter libraries. v3: add libatomic dependency for 32-bit clang v2: 1. fix Clang '-Wincompatible-pointer-types' WARNING. 2. fix typos. Honnappa Nagarahalli (2): service: avoid race condition for MT unsafe service service: identify service running on another core correctly Phil Yang (10): doc: add generic atomic deprecation section devtools: prevent use of rte atomic APIs in future patches eal/build: add libatomic dependency for 32-bit clang build: remove redundant code vhost: optimize broadcast rarp sync with c11 atomic ipsec: optimize with c11 atomic for sa outbound sqn update service: remove rte prefix from static functions service: remove redundant code service: optimize with c11 one-way barrier service: relax barriers with C11 atomic operations devtools/checkpatches.sh | 9 ++ doc/guides/prog_guide/writing_efficient_code.rst | 60 +++++++- drivers/event/octeontx/meson.build | 5 - drivers/event/octeontx2/meson.build | 5 - drivers/event/opdl/meson.build | 5 - lib/librte_eal/common/rte_service.c | 175 ++++++++++++----------- lib/librte_eal/meson.build | 6 + lib/librte_ipsec/ipsec_sqn.h | 3 +- lib/librte_ipsec/sa.h | 2 +- lib/librte_rcu/meson.build | 5 - lib/librte_vhost/vhost.h | 2 +- lib/librte_vhost/vhost_user.c | 7 +- lib/librte_vhost/virtio_net.c | 16 ++- 13 files changed, 181 insertions(+), 119 deletions(-) -- 2.7.4