summaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
authorLijian.Zhang <Lijian.Zhang@arm.com>2020-04-27 10:46:06 +0800
committerLijian.Zhang <Lijian.Zhang@arm.com>2020-05-08 13:36:32 +0800
commit9ad8a2621baaf2ea1bf007ca29359a4b2838f076 (patch)
tree3e72688ef7d3a0cc14d54bfc8df79c52731cbf4d /src/vppinfra
parentec7012e51edef4aec2239cb5b3a249f46d9b2cb0 (diff)
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 <Lijian.Zhang@arm.com> Reviewed-by: Jieqiang Wang <Jieqiang.Wang@arm.com> Reviewed-by: Govindarajan Mohandoss <Govindarajan.Mohandoss@arm.com>
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/vector_neon.h2
1 files changed, 1 insertions, 1 deletions
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