mbox series

[v3,0/3] restrict pointer aliasing with a common wrapper

Message ID 20200710023850.43898-1-joyce.kong@arm.com (mailing list archive)
Headers
Series restrict pointer aliasing with a common wrapper |

Message

Joyce Kong July 10, 2020, 2:38 a.m. UTC
  As the 'restrict' keyword is recognized in C99, this patchset is to
add a wrapper defining '__rte_restrict' which can be supported by
all compilers. Then replace the existing 'restrict' and '__restrict'
in different vpmds, and optimize vhost/virtio with restricted pointer
aliasing for more aggressive loops vectorization.

The vhost/virtio optimization patches were benchmarked by running PVP
case on ThunderX2 platform and showed positive performance results.

v3:
  1.Correct the compiling issue on GCC 4.8.5.
  2.Squash the replacement patches and wrapper definition into one
    patch.(suggested by David Marchand)

v2:
  Add a common wrapper for restricted pointer aliasing to be supported
  by all compilers.(suggested by Maxime Coquelin)

Joyce Kong (3):
  lib/eal: add a common wrapper for restricted pointers
  net/virtio: restrict pointer aliasing for NEON vpmd
  lib/vhost: restrict pointer aliasing for packed vpmd

 drivers/net/i40e/i40e_rxtx_vec_neon.c         |  17 +-
 drivers/net/mlx5/mlx5_rxtx.c                  | 208 +++++++++---------
 drivers/net/virtio/virtio_rxtx_simple_neon.c  |   5 +-
 .../pthread_shim/pthread_shim.c               |  12 +-
 lib/librte_eal/include/rte_common.h           |  10 +
 lib/librte_vhost/virtio_net.c                 |  14 +-
 6 files changed, 139 insertions(+), 127 deletions(-)
  

Comments

David Marchand July 10, 2020, 2:05 p.m. UTC | #1
On Fri, Jul 10, 2020 at 4:42 AM Joyce Kong <joyce.kong@arm.com> wrote:
>
> As the 'restrict' keyword is recognized in C99, this patchset is to
> add a wrapper defining '__rte_restrict' which can be supported by
> all compilers. Then replace the existing 'restrict' and '__restrict'
> in different vpmds, and optimize vhost/virtio with restricted pointer
> aliasing for more aggressive loops vectorization.
>
> The vhost/virtio optimization patches were benchmarked by running PVP
> case on ThunderX2 platform and showed positive performance results.
>
> v3:
>   1.Correct the compiling issue on GCC 4.8.5.
>   2.Squash the replacement patches and wrapper definition into one
>     patch.(suggested by David Marchand)
>
> v2:
>   Add a common wrapper for restricted pointer aliasing to be supported
>   by all compilers.(suggested by Maxime Coquelin)
>
> Joyce Kong (3):
>   lib/eal: add a common wrapper for restricted pointers
>   net/virtio: restrict pointer aliasing for NEON vpmd
>   lib/vhost: restrict pointer aliasing for packed vpmd
>
>  drivers/net/i40e/i40e_rxtx_vec_neon.c         |  17 +-
>  drivers/net/mlx5/mlx5_rxtx.c                  | 208 +++++++++---------
>  drivers/net/virtio/virtio_rxtx_simple_neon.c  |   5 +-
>  .../pthread_shim/pthread_shim.c               |  12 +-
>  lib/librte_eal/include/rte_common.h           |  10 +
>  lib/librte_vhost/virtio_net.c                 |  14 +-
>  6 files changed, 139 insertions(+), 127 deletions(-)
>

The changes are quite mechanical for the existing drivers.

On the vhost/virtio side, Maxime is off but Adrian had a look at the
generic bits.
The gains in vhost/virtio patches are interesting.

So I went and took those patches through the main branch.

Series applied, thanks Joyce.