From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0078.outbound.protection.outlook.com [65.55.169.78]) by dpdk.org (Postfix) with ESMTP id EFE7C924F for ; Sun, 6 Dec 2015 16:25:06 +0100 (CET) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@caviumnetworks.com; Received: from localhost.localdomain.localdomain (122.167.201.216) by BY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143) with Microsoft SMTP Server (TLS) id 15.1.337.19; Sun, 6 Dec 2015 15:25:02 +0000 From: Jerin Jacob To: Date: Sun, 6 Dec 2015 20:54:29 +0530 Message-ID: <1449415470-25545-2-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1449415470-25545-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1449415470-25545-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.167.201.216] X-ClientProxiedBy: BM1PR01CA0027.INDPRD01.PROD.OUTLOOK.COM (25.163.198.162) To BY1PR0701MB1724.namprd07.prod.outlook.com (25.162.111.143) X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 2:vaRzTv/4I2wbDd0uU3fCixdrd9OLGqFv5aVuAUSYZ3hcXkc/EP3P944CejF/FuZr8GxjIJ1LrxAPMDVDCIao7dlljQQXOJpJB2CkKRzYbI0oB8Bdrkez7wWhrG99AraRnjnUEpCx6ErEdz/8hCfFVA==; 3:0WiTPdWC1yNgSmav25HAeYi7z0ekvlV0ClmJ+J21iO1Gp3+NbF8LthDF7d3fTRmfjin6p3D8gwgjb3EibHgpKx7o2Fe2ZR+zNQPhA1G71h5kYlX27IeKJkK2VrV12DW3; 25:ucJOowdJl6rYjiAyIfNRShzPzNkBjjEXruhE1UTUdwd48uLlpQpAuMg6pkKkruKHWPZ1BMCpENMTNc9P3RLRrip5QusLCyaPDgg7khi4JMYFsH/UgxbMwYjvHINl2YehGGfkfv1kSslhx8TwvCxfC3zAytji2YrY1aCkkx4kzYz1sJO/3pki082kh/7rCcsM8ocoCwYZIK4I2+UguZwyYoAbQ3Xo6R+2YCdUlppupNunoFAYS8xQU4axYwOuD6hHVfpa26TVE3byyLtZbZTmgQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 20:Lop2OFwFyC+vAeVJYTdpBfVnopNYZ3gp9jyrWB0YGCWHnKyxUfeLk/slMhz29JkLx0TLnNs8UuWcfdDiTnzstZxpoXd6XVdiBLF8l0kANS10wrAYaYwBsWGzpbqLmnIu268lbP9x19wv9WVdlPaa3EHnod0dw/i102LPHXagNcfqbzVG5B5BYviDQUBcuYDFMmrwZMoFz0njnbl+8KDkyxcyoFJH/hA6OHGRzz+/jL8oGyfxnKuHMYnw0+HZ7FRptlRcxj1CTtc821c7fOVeLCvNLhvR25+cmjyXbORuewn5CPIJ0bB0ldnFslIaKPwygKPJ4Xb/4M3lLRjyRSGUP9Bg5um+9evcbyAElG7pQ+S6lwwpZ/HyeXqAxAtH3MvsTbyXqzSpUFI5UOzbs6R0WiECq75tfK9+IX5Tulx4sH2W5VBbcl+3FV3pdeToW/xnXsXPPGsEa+G8vrm9yoFE/Bm5ejTljh/mZNcovfcGybuxsl+GCvDVZXI3JrnM4h0YqYQfMhcmXdfpNqE5QW+/7zlffFYxyCLQK97jNsfNLBS7YJISEP5uEtwSJnn1tuPCqIYQqL7bybH5GGvs2aalk/cELCBlmFt4b3bhHf07EGo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236414709691187); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046); SRVR:BY1PR0701MB1724; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 4:SdsDiBhGtU93RCPcySuF2FL9uqhd1f4IZCxv/lQ6/HSGaJt9BoX7TT0VjC+8DPWQjp3yLLIjDMcRE6r47lhtvyFOrXNHk55/7C8v8EcOu8hhn/7Rwj3eTExRBD7Azzs/E82MbW6F0WU0n8MQCRBprrVO53AjGxd7L8L8TbnMiLEF6hq4BQsPh8MsHD1vMw57O0kBYw17aWXedNQkAgoGsixx08xRl0ZW/ZnE4sWGU3yOuWUy5f6qUM0ErNGX/j7c6KCK0TrEVZTrCnRjqGZuEbBMGsLqAsUogLfkqnNdfBTPyqiJ+EemmoCCLpZ97PQDvW9QaCQIYdWY2MslGx/uuUUupOIwRamI4wsFw/ir7SIocjim/rOoep3/N8lronrGYD3/F5Yc1s+lPMnZgX9JHqHc0wdMxZG0iBiATKDVDvhZfoW6bkncv2Ju57yHKG2k X-Forefront-PRVS: 0782EC617F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(199003)(189002)(107886002)(5001960100002)(40100003)(47776003)(76176999)(122386002)(81156007)(5008740100001)(48376002)(101416001)(97736004)(110136002)(50466002)(5003940100001)(33646002)(106356001)(105586002)(2351001)(42186005)(5004730100002)(77096005)(19580405001)(229853001)(19580395003)(36756003)(189998001)(92566002)(87976001)(50226001)(4001430100002)(66066001)(50986999)(2950100001)(586003)(3846002)(6116002)(86362001)(1096002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1724; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1724; 23:FTOBVjtkYazQbgD3rpaiAgbUmK9pN5/1KgHQreR?= =?us-ascii?Q?TaHpihnJ90jGGlv6sMMt2PSKZquHu9bZvjQxsZFlI4hXi54zor4DHr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iLxNsTKM2pDF+aiy3ycx++Z?= =?us-ascii?Q?ghR6rgfqMuX54cGOcGXzeJrYOz2xkm7ul4P0LL3rFOgMGp58RGHb29eJ4Nf3?= =?us-ascii?Q?tD7svRwh5ar5Fm4bTJCKezffIXsy+qJarInfFKtUHINfWOj8HK39oxybGiVm?= =?us-ascii?Q?igOVtLp00EQI0Q045H+SsfTEsrycoRQkm?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 5:a9Ey9AwH+V+ReEugHO7QZj+gAT6jCwUM0ADrawJGJj3cHzP8CqwuB4etUdldV3Xe95epQiI6Q7qX9vPTDblulGlC+6v0YhdirVRZuhsTevmKZEgyvd0GpwdfrxasHoCuAAWo2yjphO2utKvuJlNtAg==; 24:gbtXn1obbB/pdzef/1AIJNTY6QqckGQ4ZrZWeJBnn4Ae4tthMfXu+Mxms5t1dglD/l5v29ucud7sIIRgj6vpLgMho7vb8CLzM0fa18OWew4= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2015 15:25:02.8043 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1724 Subject: [dpdk-dev] [PATCH 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: Sun, 06 Dec 2015 15:25:07 -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 --- lib/librte_eal/common/include/arch/arm/rte_prefetch_32.h | 5 +++++ lib/librte_eal/common/include/arch/arm/rte_prefetch_64.h | 5 +++++ lib/librte_eal/common/include/arch/ppc_64/rte_prefetch.h | 5 +++++ lib/librte_eal/common/include/arch/tile/rte_prefetch.h | 5 +++++ lib/librte_eal/common/include/arch/x86/rte_prefetch.h | 5 +++++ lib/librte_eal/common/include/generic/rte_prefetch.h | 12 ++++++++++++ 6 files changed, 37 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..3157224 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,11 @@ 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) +{ + 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..cab6fe0 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,11 @@ 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) +{ + 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..19d3c6e 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,11 @@ 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) +{ + 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..95c3fbc 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