[v2,0/5] vhost add vectorized data path
mbox series

Message ID 20200921064837.15957-1-yong.liu@intel.com
Headers show
Series
  • vhost add vectorized data path
Related show

Message

Liu, Yong Sept. 21, 2020, 6:48 a.m. UTC
Packed ring format is imported since virtio spec 1.1. All descriptors
are compacted into one single ring when packed ring format is on. It is
straight forward that ring operations can be accelerated by utilizing
SIMD instructions. 

This patch set will introduce vectorized data path in vhost library. If
vectorized option is on, operations like descs check, descs writeback,
address translation will be accelerated by SIMD instructions. Vhost
application can choose whether using vectorized acceleration, it is 
like external buffer and zero copy features. 

If platform or ring format not support vectorized function, vhost will
fallback to use default batch function. There will be no impact in current
data path.

v2:
* add vIOMMU support
* add dequeue offloading
* rebase code

Marvin Liu (5):
  vhost: add vectorized data path
  vhost: reuse packed ring functions
  vhost: prepare memory regions addresses
  vhost: add packed ring vectorized dequeue
  vhost: add packed ring vectorized enqueue

 doc/guides/nics/vhost.rst           |   5 +
 doc/guides/prog_guide/vhost_lib.rst |  12 +
 drivers/net/vhost/rte_eth_vhost.c   |  17 +-
 lib/librte_vhost/meson.build        |  16 ++
 lib/librte_vhost/rte_vhost.h        |   1 +
 lib/librte_vhost/socket.c           |   5 +
 lib/librte_vhost/vhost.c            |  11 +
 lib/librte_vhost/vhost.h            | 235 +++++++++++++++++++
 lib/librte_vhost/vhost_user.c       |  11 +
 lib/librte_vhost/vhost_vec_avx.c    | 338 ++++++++++++++++++++++++++++
 lib/librte_vhost/virtio_net.c       | 257 ++++-----------------
 11 files changed, 692 insertions(+), 216 deletions(-)
 create mode 100644 lib/librte_vhost/vhost_vec_avx.c

Comments

Maxime Coquelin Oct. 6, 2020, 1:34 p.m. UTC | #1
Hi,

On 9/21/20 8:48 AM, Marvin Liu wrote:
> Packed ring format is imported since virtio spec 1.1. All descriptors
> are compacted into one single ring when packed ring format is on. It is
> straight forward that ring operations can be accelerated by utilizing
> SIMD instructions. 
> 
> This patch set will introduce vectorized data path in vhost library. If
> vectorized option is on, operations like descs check, descs writeback,
> address translation will be accelerated by SIMD instructions. Vhost
> application can choose whether using vectorized acceleration, it is 
> like external buffer and zero copy features. 
> 
> If platform or ring format not support vectorized function, vhost will
> fallback to use default batch function. There will be no impact in current
> data path.

As a pre-requisite, I'd like some performance numbers in both loopback
and PVP to figure out if adding such complexity is worth it, given we
will have to support it for at least one year.

Thanks,
Maxime

> v2:
> * add vIOMMU support
> * add dequeue offloading
> * rebase code
> 
> Marvin Liu (5):
>   vhost: add vectorized data path
>   vhost: reuse packed ring functions
>   vhost: prepare memory regions addresses
>   vhost: add packed ring vectorized dequeue
>   vhost: add packed ring vectorized enqueue
> 
>  doc/guides/nics/vhost.rst           |   5 +
>  doc/guides/prog_guide/vhost_lib.rst |  12 +
>  drivers/net/vhost/rte_eth_vhost.c   |  17 +-
>  lib/librte_vhost/meson.build        |  16 ++
>  lib/librte_vhost/rte_vhost.h        |   1 +
>  lib/librte_vhost/socket.c           |   5 +
>  lib/librte_vhost/vhost.c            |  11 +
>  lib/librte_vhost/vhost.h            | 235 +++++++++++++++++++
>  lib/librte_vhost/vhost_user.c       |  11 +
>  lib/librte_vhost/vhost_vec_avx.c    | 338 ++++++++++++++++++++++++++++
>  lib/librte_vhost/virtio_net.c       | 257 ++++-----------------
>  11 files changed, 692 insertions(+), 216 deletions(-)
>  create mode 100644 lib/librte_vhost/vhost_vec_avx.c
>
Liu, Yong Oct. 8, 2020, 6:20 a.m. UTC | #2
> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Tuesday, October 6, 2020 9:34 PM
> To: Liu, Yong <yong.liu@intel.com>; Xia, Chenbo <chenbo.xia@intel.com>;
> Wang, Zhihong <zhihong.wang@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [PATCH v2 0/5] vhost add vectorized data path
> 
> Hi,
> 
> On 9/21/20 8:48 AM, Marvin Liu wrote:
> > Packed ring format is imported since virtio spec 1.1. All descriptors
> > are compacted into one single ring when packed ring format is on. It is
> > straight forward that ring operations can be accelerated by utilizing
> > SIMD instructions.
> >
> > This patch set will introduce vectorized data path in vhost library. If
> > vectorized option is on, operations like descs check, descs writeback,
> > address translation will be accelerated by SIMD instructions. Vhost
> > application can choose whether using vectorized acceleration, it is
> > like external buffer and zero copy features.
> >
> > If platform or ring format not support vectorized function, vhost will
> > fallback to use default batch function. There will be no impact in current
> > data path.
> 
> As a pre-requisite, I'd like some performance numbers in both loopback
> and PVP to figure out if adding such complexity is worth it, given we
> will have to support it for at least one year.
> 


Thanks for suggestion, will add some reference numbers in next version.

> Thanks,
> Maxime
> 
> > v2:
> > * add vIOMMU support
> > * add dequeue offloading
> > * rebase code
> >
> > Marvin Liu (5):
> >   vhost: add vectorized data path
> >   vhost: reuse packed ring functions
> >   vhost: prepare memory regions addresses
> >   vhost: add packed ring vectorized dequeue
> >   vhost: add packed ring vectorized enqueue
> >
> >  doc/guides/nics/vhost.rst           |   5 +
> >  doc/guides/prog_guide/vhost_lib.rst |  12 +
> >  drivers/net/vhost/rte_eth_vhost.c   |  17 +-
> >  lib/librte_vhost/meson.build        |  16 ++
> >  lib/librte_vhost/rte_vhost.h        |   1 +
> >  lib/librte_vhost/socket.c           |   5 +
> >  lib/librte_vhost/vhost.c            |  11 +
> >  lib/librte_vhost/vhost.h            | 235 +++++++++++++++++++
> >  lib/librte_vhost/vhost_user.c       |  11 +
> >  lib/librte_vhost/vhost_vec_avx.c    | 338
> ++++++++++++++++++++++++++++
> >  lib/librte_vhost/virtio_net.c       | 257 ++++-----------------
> >  11 files changed, 692 insertions(+), 216 deletions(-)
> >  create mode 100644 lib/librte_vhost/vhost_vec_avx.c
> >