vhost: restrict pointer aliasing for packed ring
authorJoyce Kong <joyce.kong@arm.com>
Fri, 10 Jul 2020 02:38:50 +0000 (10:38 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Fri, 10 Jul 2020 13:43:41 +0000 (15:43 +0200)
commit58902736a4c956b42d4e1e44186cba340d0b84fe
treee06d16ca694fdad127e698d009e90267e505f923
parentc92b936fbd0eb88ea0c64da50f9ad3be73c83b73
vhost: restrict pointer aliasing for packed ring

Restrict pointer aliasing to allow the compiler to vectorize loop
more aggressively.

With this patch, a 9.6% improvement is observed in throughput for
the packed virtio-net PVP case, and a 2.8% improvement in throughput
for the packed virtio-user PVP case. All performance data are measured
on ThunderX-2 platform under 0.001% acceptable packet loss with 1 core
on both vhost and virtio side.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Acked-by: Adrián Moreno <amorenoz@redhat.com>
drivers/net/virtio/virtio_rxtx_simple_neon.c
lib/librte_vhost/virtio_net.c