vppinfra: fix u32x4_byte_swap on Arm 50/26950/1
authorLijian.Zhang <Lijian.Zhang@arm.com>
Mon, 27 Apr 2020 02:46:06 +0000 (10:46 +0800)
committerLijian.Zhang <Lijian.Zhang@arm.com>
Fri, 8 May 2020 05:36:32 +0000 (13:36 +0800)
commit9ad8a2621baaf2ea1bf007ca29359a4b2838f076
tree3e72688ef7d3a0cc14d54bfc8df79c52731cbf4d
parentec7012e51edef4aec2239cb5b3a249f46d9b2cb0
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>
src/vppinfra/vector_neon.h