mbox series

[v2,0/6] Restrict pointer aliasing with a common wrapper

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

Message

Joyce Kong July 6, 2020, 7:49 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.

Joyce Kong (6):
  lib/eal: add a wrapper to define restricted pointers
  net/virtio: restrict pointer aliasing for NEON vpmd
  lib/vhost: restrict pointer aliasing for packed vpmd
  net/i40e: replace restrict with rte restrict
  examples/performance-thread: replace restrict with wrapper
  net/mlx5: replace restrict keyword with rte restrict

 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

Morten Brørup July 9, 2020, 1:52 p.m. UTC | #1
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Joyce Kong
> Sent: Monday, July 6, 2020 9:49 AM
> 
> 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.
> 
> Joyce Kong (6):
>   lib/eal: add a wrapper to define restricted pointers
>   net/virtio: restrict pointer aliasing for NEON vpmd
>   lib/vhost: restrict pointer aliasing for packed vpmd
>   net/i40e: replace restrict with rte restrict
>   examples/performance-thread: replace restrict with wrapper
>   net/mlx5: replace restrict keyword with rte restrict
> 
>  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(-)
> 
> --
> 2.27.0
> 

If you are hunting for more places to add __rte_restrict, I will suggest rte_memcpy.h.
  
Joyce Kong July 10, 2020, 3:17 a.m. UTC | #2
> -----Original Message-----
> From: Morten Brørup <mb@smartsharesystems.com>
> Sent: Thursday, July 9, 2020 9:53 PM
> To: Joyce Kong <Joyce.Kong@arm.com>; maxime.coquelin@redhat.com;
> jerinj@marvell.com; zhihong.wang@intel.com; xiaolong.ye@intel.com;
> beilei.xing@intel.com; jia.guo@intel.com; john.mcnamara@intel.com;
> matan@mellanox.com; shahafs@mellanox.com; viacheslavo@mellanox.com;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Phil Yang
> <Phil.Yang@arm.com>; Ruifeng Wang <Ruifeng.Wang@arm.com>
> Cc: dev@dpdk.org; nd <nd@arm.com>
> Subject: RE: [dpdk-dev] [PATCH v2 0/6] Restrict pointer aliasing with a
> commonwrapper
> 
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Joyce Kong
> > Sent: Monday, July 6, 2020 9:49 AM
> >
> > 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.
> >
> > Joyce Kong (6):
> >   lib/eal: add a wrapper to define restricted pointers
> >   net/virtio: restrict pointer aliasing for NEON vpmd
> >   lib/vhost: restrict pointer aliasing for packed vpmd
> >   net/i40e: replace restrict with rte restrict
> >   examples/performance-thread: replace restrict with wrapper
> >   net/mlx5: replace restrict keyword with rte restrict
> >
> >  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(-)
> >
> > --
> > 2.27.0
> >
> 
> If you are hunting for more places to add __rte_restrict, I will suggest
> rte_memcpy.h.
> 
I will try to do this after the common patch is ok.
Thanks.