From patchwork Sat Jun 27 19:12:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honnappa Nagarahalli X-Patchwork-Id: 191954 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1574733ilg; Sat, 27 Jun 2020 12:12:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVa+DZTIEgipsEHoO62rmB5GO5d/FUrwKN1ETNtRrXNKUkfc0w5pM0wTiqEFhZCowaucwE X-Received: by 2002:a50:f28e:: with SMTP id f14mr10125223edm.100.1593285139560; Sat, 27 Jun 2020 12:12:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593285139; cv=none; d=google.com; s=arc-20160816; b=WUt7oTWGOGrzR7FlQwC/yAChgK0HV5gRlK0F4g/JMNuEc2ox7a4eo6+GaDzx/U4ZCv D9ccAXjbuBoBOX4pUfZccptoYe66ot/Om4XYwbh0ZbdYoQiSt5aUB6YF9ZNl5/I5k/ad 98LosLVCJrLgInX3m6Kd1Qrbfotc1yOU0fwfzwX2SEUbxvt5K5iJ9ArqgWBVnRm5Dwzn h4oEbU2hu3TyC0H6mDBSZZxM8XIwM+rJzabiYAsSOcF2XOt1DeVWzR6iRGH09wnypPaf lq5Qz1ie78tMiFDzh7+9KWny/c4p14w7HRJ8bSAOvXwhdIG8goc9axj7CmETHuwbLPgH uWNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=vtrAlAcMQ6OCzYu6EUfjr3Bh9rxabjZneKbP9VHfrXU=; b=UzLebtTet/zapTAlRxOCGxCki/8IJFkwah1dPRUrA4IKX+oF0wXKOyI81qVV/wLp5/ AultsFd7QYqDezI1OHKcSi+ScKaoB0rklB+TL8ruyRsd+e5gscMVYT/2JBDFX3rQlKYR jv+ITQFhvczjfeBSrtTubigINhd+OadpFiavkKihq5KNPuHzC6AXnwNuWD3eLOWU4WTt 9GVS/Z+IaMTgV0I9c48yWtX5hmrHCaig7ijovCCgL1LsYQz2r+YR1Sg9KWtV5bTksKUq rNxm56eK2uQMOeIVuTNIm0ICaq5h2yApRV8zIB3kS04xJIG7GR1u8CVIRiSMsvzrDeH0 Y1qA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id rs1si10082688ejb.64.2020.06.27.12.12.18; Sat, 27 Jun 2020 12:12:19 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CFE651C00E; Sat, 27 Jun 2020 21:12:17 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id DF2122AB for ; Sat, 27 Jun 2020 21:12:15 +0200 (CEST) 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 0DCC3D6E; Sat, 27 Jun 2020 12:12:15 -0700 (PDT) Received: from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com [10.118.12.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EE20E3F71E; Sat, 27 Jun 2020 12:12:14 -0700 (PDT) From: Honnappa Nagarahalli To: dev@dpdk.org, honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com, jerinj@marvell.com, hemant.agrawal@nxp.com, ajit.khaparde@broadcom.com, igorch@amazon.com, thomas@monjalon.net, viacheslavo@mellanox.com, arybchenko@solarflare.com, bruce.richardson@intel.com Cc: nd@arm.com Date: Sat, 27 Jun 2020 14:12:08 -0500 Message-Id: <20200627191208.34520-1-honnappa.nagarahalli@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200410164127.54229-1-gavin.hu@arm.com> References: <20200410164127.54229-1-gavin.hu@arm.com> Subject: [dpdk-dev] [PATCH v2] eal: adjust barriers for IO on Armv8-a 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" Change the barrier APIs for IO to reflect that Armv8-a is other-multi-copy atomicity memory model. Armv8-a memory model has been strengthened to require other-multi-copy atomicity. This property requires memory accesses from an observer to become visible to all other observers simultaneously [3]. This means a) A write arriving at an endpoint shared between multiple CPUs is visible to all CPUs b) A write that is visible to all CPUs is also visible to all other observers in the shareability domain This allows for using cheaper DMB instructions in the place of DSB for devices that are visible to all CPUs (i.e. devices that DPDK caters to). Please refer to [1], [2] and [3] for more information. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=22ec71615d824f4f11d38d0e55a88d8956b7e45f [2] https://www.youtube.com/watch?v=i6DayghhA8Q [3] https://www.cl.cam.ac.uk/~pes20/armv8-mca/ Signed-off-by: Honnappa Nagarahalli Tested-by: Ruifeng Wang --- lib/librte_eal/arm/include/rte_atomic_64.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.17.1 Acked-by: Jerin Jacob for this patch diff --git a/lib/librte_eal/arm/include/rte_atomic_64.h b/lib/librte_eal/arm/include/rte_atomic_64.h index 7b7099cdc..e42f69edc 100644 --- a/lib/librte_eal/arm/include/rte_atomic_64.h +++ b/lib/librte_eal/arm/include/rte_atomic_64.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2015 Cavium, Inc - * Copyright(c) 2019 Arm Limited + * Copyright(c) 2020 Arm Limited */ #ifndef _RTE_ATOMIC_ARM64_H_ @@ -19,11 +19,11 @@ extern "C" { #include #include -#define rte_mb() asm volatile("dsb sy" : : : "memory") +#define rte_mb() asm volatile("dmb osh" : : : "memory") -#define rte_wmb() asm volatile("dsb st" : : : "memory") +#define rte_wmb() asm volatile("dmb oshst" : : : "memory") -#define rte_rmb() asm volatile("dsb ld" : : : "memory") +#define rte_rmb() asm volatile("dmb oshld" : : : "memory") #define rte_smp_mb() asm volatile("dmb ish" : : : "memory") @@ -37,9 +37,9 @@ extern "C" { #define rte_io_rmb() rte_rmb() -#define rte_cio_wmb() asm volatile("dmb oshst" : : : "memory") +#define rte_cio_wmb() rte_wmb() -#define rte_cio_rmb() asm volatile("dmb oshld" : : : "memory") +#define rte_cio_rmb() rte_rmb() /*------------------------ 128 bit atomic operations -------------------------*/