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 79B92A0566; Tue, 10 Mar 2020 18:49:56 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 218261C001; Tue, 10 Mar 2020 18:49:56 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id 555661BFFE for ; Tue, 10 Mar 2020 18:49:54 +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 CA3FA1FB; Tue, 10 Mar 2020 10:49:53 -0700 (PDT) Received: from phil-VirtualBox.arm.com (A010647.Arm.com [10.170.243.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2189A3F534; Tue, 10 Mar 2020 10:49:49 -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: Wed, 11 Mar 2020 01:49:01 +0800 Message-Id: <1583862551-2049-1-git-send-email-phil.yang@arm.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH 00/10] 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 [1] 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. Honnappa Nagarahalli (2): service: avoid race condition for MT unsafe service service: identify service running on another core correctly Phil Yang (8): doc: add generic atomic deprecation section devtools: prevent use of rte atomic APIs in future patches 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 +++++++- lib/librte_eal/common/rte_service.c | 175 ++++++++++++----------- lib/librte_ipsec/ipsec_sqn.h | 3 +- lib/librte_ipsec/sa.h | 2 +- lib/librte_vhost/vhost.h | 2 +- lib/librte_vhost/vhost_user.c | 7 +- lib/librte_vhost/virtio_net.c | 16 ++- 8 files changed, 175 insertions(+), 99 deletions(-) -- 2.7.4