From 9ad8a2621baaf2ea1bf007ca29359a4b2838f076 Mon Sep 17 00:00:00 2001 From: "Lijian.Zhang" Date: Mon, 27 Apr 2020 10:46:06 +0800 Subject: vppinfra: fix u32x4_byte_swap on Arm Fix the endianness conversion function u32x4_byte_swap() on Arm. Here's an example of using this function with and without the fix. This issue is seen using Mellanox NIC RDMA driver on Arm servers. The packet length cannot be parsed correctly. Testing code: u32x4 s = {0x12345678, 0x23456789, 0x3456789a, 0x456789ab}; u32x4 ss = u32x4_byte_swap (s); Without the code change: (gdb) p /x s $1 = {0x12345678, 0x23456789, 0x3456789a, 0x456789ab} (gdb) p /x ss $2 = {0x23456789, 0x12345678, 0x456789ab, 0x3456789a} With the code change: (gdb) p /x s $3 = {0x12345678, 0x23456789, 0x3456789a, 0x456789ab} (gdb) p /x ss $4 = {0x78563412, 0x89674523, 0x9a785634, 0xab896745} Type: fix Change-Id: Ie5f263e94331783940e7c00397092a64e4fc4279 Signed-off-by: Lijian Zhang Reviewed-by: Jieqiang Wang Reviewed-by: Govindarajan Mohandoss --- src/vppinfra/vector_neon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vppinfra') diff --git a/src/vppinfra/vector_neon.h b/src/vppinfra/vector_neon.h index d80c691e3d9..15af098730e 100644 --- a/src/vppinfra/vector_neon.h +++ b/src/vppinfra/vector_neon.h @@ -106,7 +106,7 @@ u16x8_byte_swap (u16x8 v) static_always_inline u32x4 u32x4_byte_swap (u32x4 v) { - return vrev64q_u32 (v); + return (u32x4) vrev32q_u8 ((u8x16) v); } static_always_inline u8x16 -- cgit 1.2.3-korg