diff mbox series

[v7] eal/arm64: fix rdtsc precise version

Message ID 4099DE2E54AFAD489356C6C9161D53339729FF27@DGGEML502-MBX.china.huawei.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers show
Series [v7] eal/arm64: fix rdtsc precise version | expand

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/checkpatch warning coding style issues

Commit Message

Linhaifeng March 12, 2020, 1:08 a.m. UTC
In order to get more accurate the cntvct_el0 reading,
SW must invoke isb.

Fixes: ccad39ea0712 ("eal/arm: add cpu cycle operations for ARMv8")
Cc: stable@dpdk.org

Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Jerin Jacob <jerinjacobk@gmail.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Signed-off-by: Haifeng Lin <haifeng.lin@huawei.com>
---
 lib/librte_eal/common/include/arch/arm/rte_cycles_64.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Marchand March 13, 2020, 10:06 a.m. UTC | #1
On Thu, Mar 12, 2020 at 2:09 AM Linhaifeng <haifeng.lin@huawei.com> wrote:
>
> In order to get more accurate the cntvct_el0 reading,
> SW must invoke isb.
>
> Fixes: ccad39ea0712 ("eal/arm: add cpu cycle operations for ARMv8")
> Cc: stable@dpdk.org
>
> Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
> Signed-off-by: Haifeng Lin <haifeng.lin@huawei.com>

Applied.
diff mbox series

Patch

diff --git a/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h b/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h
index 68e7c7338..da557b6a1 100644
--- a/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h
+++ b/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h
@@ -62,7 +62,7 @@  rte_rdtsc(void)
 static inline uint64_t
 rte_rdtsc_precise(void)
 {
-	rte_mb();
+	asm volatile("isb" : : : "memory");
 	return rte_rdtsc();
 }