mbox series

[v1,0/7] vectorize virtio packed ring datapath

Message ID 20200313174230.74661-1-yong.liu@intel.com (mailing list archive)
Headers
Series vectorize virtio packed ring datapath |

Message

Marvin Liu March 13, 2020, 5:42 p.m. UTC
  This patch set introduced vectorized datapath for packed ring.

The size of packed ring descriptor is 16Bytes. Four batched descriptors
can just placed into one cacheline. AVX512 instructions can well handle
this kind of data. Packed ring TX datapath can fully transformed into
vectorized datapath. Rx datapath also can be vectorized by limiated
features(TSO and mergeable).

Marvin Liu (7):
  net/virtio: add Rx free threshold setting
  net/virtio-user: add LRO parameter
  net/virtio: add vectorized packed ring Rx function
  net/virtio: reuse packed ring xmit functions
  net/virtio: add vectorized packed ring Tx function
  net/virtio: add election for vectorized datapath
  net/virtio: support meson build

 drivers/net/virtio/Makefile                   |  30 +
 drivers/net/virtio/meson.build                |   1 +
 drivers/net/virtio/virtio_ethdev.c            |  35 +-
 drivers/net/virtio/virtio_ethdev.h            |   6 +
 drivers/net/virtio/virtio_pci.h               |   2 +
 drivers/net/virtio/virtio_rxtx.c              | 201 ++----
 drivers/net/virtio/virtio_rxtx_packed_avx.c   | 606 ++++++++++++++++++
 .../net/virtio/virtio_user/virtio_user_dev.c  |   8 +-
 .../net/virtio/virtio_user/virtio_user_dev.h  |   2 +-
 drivers/net/virtio/virtio_user_ethdev.c       |  17 +-
 drivers/net/virtio/virtqueue.h                | 165 ++++-
 11 files changed, 903 insertions(+), 170 deletions(-)
 create mode 100644 drivers/net/virtio/virtio_rxtx_packed_avx.c
  

Comments

Marvin Liu April 26, 2020, 2:19 a.m. UTC | #1
This patch set introduced vectorized path for packed ring.

The size of packed ring descriptor is 16Bytes. Four batched descriptors
are just placed into one cacheline. AVX512 instructions can well handle
this kind of data. Packed ring TX path can fully transformed into
vectorized path. Packed ring Rx path can be vectorized when requirements
met(LRO and mergeable disabled).

New option RTE_LIBRTE_VIRTIO_INC_VECTOR will be introduced in this
patch set. This option will unify split and packed ring vectorized
path default setting. Meanwhile user can specify whether enable
vectorized path at runtime by 'vectorized' parameter of virtio user
vdev.

v10:
* reuse packed ring xmit cleanup

v9:
* replace RTE_LIBRTE_VIRTIO_INC_VECTOR with vectorized devarg
* reorder patch sequence

v8:
* fix meson build error on ubuntu16.04 and suse15

v7:
* default vectorization is disabled
* compilation time check dependency on rte_mbuf structure
* offsets are calcuated when compiling
* remove useless barrier as descs are batched store&load
* vindex of scatter is directly set
* some comments updates
* enable vectorized path in meson build

v6:
* fix issue when size not power of 2

v5:
* remove cpuflags definition as required extensions always come with
  AVX512F on x86_64
* inorder actions should depend on feature bit
* check ring type in rx queue setup
* rewrite some commit logs
* fix some checkpatch warnings

v4:
* rename 'packed_vec' to 'vectorized', also used in split ring
* add RTE_LIBRTE_VIRTIO_INC_VECTOR config for virtio ethdev
* check required AVX512 extensions cpuflags
* combine split and packed ring datapath selection logic
* remove limitation that size must power of two
* clear 12Bytes virtio_net_hdr

v3:
* remove virtio_net_hdr array for better performance
* disable 'packed_vec' by default

v2:
* more function blocks replaced by vector instructions
* clean virtio_net_hdr by vector instruction
* allow header room size change
* add 'packed_vec' option in virtio_user vdev 
* fix build not check whether AVX512 enabled
* doc update

Tested-by: Wang, Yinan <yinan.wang@intel.com>

Marvin Liu (9):
  net/virtio: add Rx free threshold setting
  net/virtio: inorder should depend on feature bit
  net/virtio: add vectorized devarg
  net/virtio-user: add vectorized devarg
  net/virtio: reuse packed ring functions
  net/virtio: add vectorized packed ring Rx path
  net/virtio: add vectorized packed ring Tx path
  net/virtio: add election for vectorized path
  doc: add packed vectorized path

 doc/guides/nics/virtio.rst                  |  52 +-
 drivers/net/virtio/Makefile                 |  35 ++
 drivers/net/virtio/meson.build              |  14 +
 drivers/net/virtio/virtio_ethdev.c          | 137 ++++-
 drivers/net/virtio/virtio_ethdev.h          |   6 +
 drivers/net/virtio/virtio_pci.h             |   3 +-
 drivers/net/virtio/virtio_rxtx.c            | 349 ++---------
 drivers/net/virtio/virtio_rxtx_packed_avx.c | 623 ++++++++++++++++++++
 drivers/net/virtio/virtio_user_ethdev.c     |  32 +-
 drivers/net/virtio/virtqueue.c              |   7 +-
 drivers/net/virtio/virtqueue.h              | 307 +++++++++-
 11 files changed, 1210 insertions(+), 355 deletions(-)
 create mode 100644 drivers/net/virtio/virtio_rxtx_packed_avx.c