From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0096.outbound.protection.outlook.com [157.56.111.96]) by dpdk.org (Postfix) with ESMTP id CE7D293FA for ; Fri, 12 Feb 2016 12:14:48 +0100 (CET) Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain.localdomain (122.167.12.50) by BN3PR0701MB1720.namprd07.prod.outlook.com (10.163.39.19) with Microsoft SMTP Server (TLS) id 15.1.403.16; Fri, 12 Feb 2016 11:14:42 +0000 From: Jerin Jacob To: Date: Fri, 12 Feb 2016 16:43:50 +0530 Message-ID: <1455275631-30507-2-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1455275631-30507-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1449415470-25545-1-git-send-email-jerin.jacob@caviumnetworks.com> <1455275631-30507-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.167.12.50] X-ClientProxiedBy: PN1PR01CA0008.INDPRD01.PROD.OUTLOOK.COM (25.164.137.15) To BN3PR0701MB1720.namprd07.prod.outlook.com (25.163.39.19) X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 2:nTSR+hh+XdIHQJsKPXXGObLu/0VAkM3EOXKFO97CTQS9scnXI+gEBLQi5jfF3GkdOzuRRbyxER5ALzN14+iuEbR76rF26O8ZrGbFhwh6jsNuO4B7r649Z8p2E3yHYDCztNgoB+rqyUlo0YCkeNoc4g==; 3:8+E4LDHCadFguhWQcR+tTgPQCx0QDxmk16jGJlh0p1iducHEjenMdRuqjgadDhX3pNq6vgaXHfCIq2RxWRIaWkiKlj43R7/rz5+t1syWjce4okRf9ciaoKuSJjJt7N+i; 25:Y3ds4maDnGlk7gHMkIYbvx+NjdQzN735hhKiNFcVXEpYTyT/Vz08aCTV2GSRxCt2yDEIji77chSdMUgZwVKYK+MWSa434a0q2FACRtGXMonDbV9ZDym24APIvEzn3argunW2yh+H6nLzlKrxVOTdiwp3GNAhOAPNFrRbibZr0TwH36Xxt649gAqDFkEiAW0G8wUtWYy83d2rGGIwXR1oBHMWAiEME0Q2XRAJK+PX3Cd0FDarj8N/0Ln6i82ZQVjJtj7dIKvuGOM6+yV0d3Uy3MA5u3rXDIEE/rERJdc37+9uA7vrnC2YxEahhSQA+f5o X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1720; X-MS-Office365-Filtering-Correlation-Id: bea7b7c1-bc7f-49ac-3225-08d3339db7dc X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 20:K6DpAtYckCZsu8xZfHF/0BjIIFwzC5WTOc4KIuo+W407q+CVzi2I3dTDPgSaZdUQDs64Py08ipWxB0i13THPgDXCKGiroY1YCOUSW0/XKyj7E3oP4MNK2DY+pl+F6xBoKYBOJXaFIp439HGuvPBBaZmmgvsr2GSnjBri3Ww1+Vdmrl+o1spR3Th/kYR+MQuJ+sBZe8d5a0IyyAnH5Xkj13XDpF8FuP6OjX0z3NQQsLakCEXi+szDEEFq6DbIdY8Yq4LeqpXgr/LLM2TBuviTvVAgGJdYdANRErIGx734wblMzrmKx91OhRhuoSgKcP6YCIsqDIvOpit9Gfnncoz9LcHkw3kuOAAt9N9StZ2qovegaAT/HaG60IYz61XkEivtwk4GN3NykYu50jNiOsDFeZe2whDqEAJIDmaCTp16yCi3xwc4gIhqEbsrqo26s+Z/JJkz0BUtRZTOMh9UuKbuJjeyIHoZws2fsFsFqdAinb8SKnM0hv0WlBdyxkbB6h6KRz/p6eJBJa02ZFpkI5FY9+zPKKSUa4VU12FY5wh2Vvgftt455DMJ/lIWB7y0DIZBhfZl3TK2hCKojnvz/LeMXn2a1U4kyoTvwT2K4b9YnUk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:BN3PR0701MB1720; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1720; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 4:8N6UhYlKI1illLM3h6euyJBgoLHRyWB3qWMRJrUkOoW1fxeYTx2Xit1Ezsl+2Ji4vXzbLDWQqmkWIQ0pmPkzHcA3Nd9h0ZyQAT1LckDWAgHQI22X06grXXDM3y/SC0FbwSAxmZtzpN95WQlq6DGQsR0BRkO9FZ7iL3w5EstaLEgUz/FUsGWoxZNCjUvbuZ1ocAfiKxlq9MVsd6iweK3c6UbkWmZt2cMmbleHGpcGd/mT6FMQUFp0dKr93/wwDd3HFEetLvcCn5sxzza4csPhbcqS8E9RVfWyF+lXN/0p9BDmI9X5EzN4n66rOHtJzuzCNLXqKU7uwRPj2NpYvPEwmm5qcz7HcWlvmOeYOuxBVB1TjOm7yjy7/Rl4+gkbXyeJ X-Forefront-PRVS: 0850800A29 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(48376002)(5008740100001)(36756003)(2950100001)(86362001)(586003)(33646002)(3846002)(42186005)(4001430100002)(50226001)(77096005)(1096002)(47776003)(6116002)(66066001)(5003940100001)(110136002)(189998001)(40100003)(76176999)(50986999)(19580405001)(107886002)(2351001)(50466002)(2906002)(19580395003)(5001960100002)(4326007)(229853001)(87976001)(5004730100002)(122386002)(92566002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1720; H:localhost.localdomain.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1720; 23:u0LRNadTq/U2dPdV4CFJh5tKJEjhJ4+sZ2mL6Bi?= =?us-ascii?Q?fvLOfDkqJCtX/5FnlRCuy3GfzeHv97aHngwtVVGBdURaHMIFuHTGSaAHtb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BVQsYQMrTbl5UgfAh+KYQYjD/PFlcFImcgha8?= =?us-ascii?Q?/oC4osyHA5POM3y+qq0l+/GNlUTZLEgwqOvWpiHgm3t6Ytg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1720; 5:fE7BfKAXE/HRActJv5gcYAYbgd0WjnZ/+ACKX7pGrE8pIu0EPeoN4OBQHv8n5v1gTLwS5En43Tgp8eIYQkyqh/CniUpuUPQ6nzed9k+7rrpKwBETZNGzG+H+aJw20iDazElB5CUy+vMQ2+lpfKV9VQ==; 24:Xc91/ozRZENJNlOi/dHAK9DYnisSe9Kb9Z/gCvYYJfJ0vVdS+pWXNfViG6NAGSOoA9HSsfizV0jtAaoi/Xn74zevaCMaNg+XHTzg+wm6U2k= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2016 11:14:42.7226 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1720 Cc: viktorin@rehivetech.com Subject: [dpdk-dev] [PATCH v2 1/2] eal: introduce rte_prefetch_non_temporal X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 11:14:49 -0000 non-temporal/transient/stream version of rte_prefetch0() The non-temporal prefetch is intended as a prefetch hint that processor will use the prefetched data only once or short period, unlike the rte_prefetch0() function which imply that prefetched data to use repeatedly. Signed-off-by: Jerin Jacob Acked-by: Jan Viktorin --- lib/librte_eal/common/include/arch/arm/rte_prefetch_32.h | 6 ++++++ lib/librte_eal/common/include/arch/arm/rte_prefetch_64.h | 5 +++++ lib/librte_eal/common/include/arch/ppc_64/rte_prefetch.h | 6 ++++++ lib/librte_eal/common/include/arch/tile/rte_prefetch.h | 6 ++++++ lib/librte_eal/common/include/arch/x86/rte_prefetch.h | 5 +++++ lib/librte_eal/common/include/generic/rte_prefetch.h | 12 ++++++++++++ 6 files changed, 40 insertions(+) diff --git a/lib/librte_eal/common/include/arch/arm/rte_prefetch_32.h b/lib/librte_eal/common/include/arch/arm/rte_prefetch_32.h index b716384..5aeed22 100644 --- a/lib/librte_eal/common/include/arch/arm/rte_prefetch_32.h +++ b/lib/librte_eal/common/include/arch/arm/rte_prefetch_32.h @@ -54,6 +54,12 @@ static inline void rte_prefetch2(const volatile void *p) asm volatile ("pld [%0]" : : "r" (p)); } +static inline void rte_prefetch_non_temporal(const volatile void *p) +{ + /* non-temporal version not available, fallback to rte_prefetch0 */ + rte_prefetch0(p); +} + #ifdef __cplusplus } #endif diff --git a/lib/librte_eal/common/include/arch/arm/rte_prefetch_64.h b/lib/librte_eal/common/include/arch/arm/rte_prefetch_64.h index f9cc62e..3ed46a4 100644 --- a/lib/librte_eal/common/include/arch/arm/rte_prefetch_64.h +++ b/lib/librte_eal/common/include/arch/arm/rte_prefetch_64.h @@ -54,6 +54,11 @@ static inline void rte_prefetch2(const volatile void *p) asm volatile ("PRFM PLDL3KEEP, [%0]" : : "r" (p)); } +static inline void rte_prefetch_non_temporal(const volatile void *p) +{ + asm volatile ("PRFM PLDL1STRM, [%0]" : : "r" (p)); +} + #ifdef __cplusplus } #endif diff --git a/lib/librte_eal/common/include/arch/ppc_64/rte_prefetch.h b/lib/librte_eal/common/include/arch/ppc_64/rte_prefetch.h index fea3be1..bcc7185 100644 --- a/lib/librte_eal/common/include/arch/ppc_64/rte_prefetch.h +++ b/lib/librte_eal/common/include/arch/ppc_64/rte_prefetch.h @@ -54,6 +54,12 @@ static inline void rte_prefetch2(const volatile void *p) asm volatile ("dcbt 0,%[p],1" : : [p] "r" (p)); } +static inline void rte_prefetch_non_temporal(const volatile void *p) +{ + /* non-temporal version not available, fallback to rte_prefetch0 */ + rte_prefetch0(p); +} + #ifdef __cplusplus } #endif diff --git a/lib/librte_eal/common/include/arch/tile/rte_prefetch.h b/lib/librte_eal/common/include/arch/tile/rte_prefetch.h index c94075c..7a1bb93 100644 --- a/lib/librte_eal/common/include/arch/tile/rte_prefetch.h +++ b/lib/librte_eal/common/include/arch/tile/rte_prefetch.h @@ -54,6 +54,12 @@ static inline void rte_prefetch2(const volatile void *p) __builtin_prefetch((const void *)(uintptr_t)p, 0, 1); } +static inline void rte_prefetch_non_temporal(const volatile void *p) +{ + /* non-temporal version not available, fallback to rte_prefetch0 */ + rte_prefetch0(p); +} + #ifdef __cplusplus } #endif diff --git a/lib/librte_eal/common/include/arch/x86/rte_prefetch.h b/lib/librte_eal/common/include/arch/x86/rte_prefetch.h index 8e6e02c..5dac47e 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_prefetch.h +++ b/lib/librte_eal/common/include/arch/x86/rte_prefetch.h @@ -55,6 +55,11 @@ static inline void rte_prefetch2(const volatile void *p) asm volatile ("prefetcht2 %[p]" : : [p] "m" (*(const volatile char *)p)); } +static inline void rte_prefetch_non_temporal(const volatile void *p) +{ + asm volatile ("prefetchnta %[p]" : : [p] "m" (*(const volatile char *)p)); +} + #ifdef __cplusplus } #endif diff --git a/lib/librte_eal/common/include/generic/rte_prefetch.h b/lib/librte_eal/common/include/generic/rte_prefetch.h index 725715f..07e409e 100644 --- a/lib/librte_eal/common/include/generic/rte_prefetch.h +++ b/lib/librte_eal/common/include/generic/rte_prefetch.h @@ -68,4 +68,16 @@ static inline void rte_prefetch1(const volatile void *p); */ static inline void rte_prefetch2(const volatile void *p); +/** + * Prefetch a cache line into all cache levels (non-temporal/transient version) + * + * The non-temporal prefetch is intended as a prefetch hint that processor will + * use the prefetched data only once or short period, unlike the + * rte_prefetch0() function which imply that prefetched data to use repeatedly. + * + * @param p + * Address to prefetch + */ +static inline void rte_prefetch_non_temporal(const volatile void *p); + #endif /* _RTE_PREFETCH_H_ */ -- 2.1.0