[dpdk-dev] [PATCH v3 0/7] add packed ring vectorized datapath

2020-04-07 Thread Marvin Liu
7; by default v2: 1. more function blocks replaced by vector instructions 2. clean virtio_net_hdr by vector instruction 3. allow header room size change 4. add 'packed_vec' option in virtio_user vdev 5. fix build not check whether AVX512 enabled 6. doc update Marvin Liu (7): net

[dpdk-dev] [PATCH v3 7/7] doc: add packed vectorized datapath

2020-04-07 Thread Marvin Liu
Document packed virtqueue vectorized datapath selection logic in virtio net PMD. Add packed virtqueue vectorized datapath features to new ini file. Signed-off-by: Marvin Liu diff --git a/doc/guides/nics/features/virtio-packed_vec.ini b/doc/guides/nics/features/virtio-packed_vec.ini new file

[dpdk-dev] [PATCH] net/virtio: fix crash when device reconnecting

2020-04-13 Thread Marvin Liu
x27;t be freed or realloc in reinit process. Also moved virtio device initialization from configuration to start stage, which can reduce number of reinitialization times. Fixes: 6ebbf4109f35 ("net/virtio-user: fix packed ring server mode") Signed-off-by: Marvin Liu diff --git a/dri

[dpdk-dev] [PATCH] vhost: fix zmbuf buffer id invalid

2020-02-23 Thread Marvin Liu
zc mbufs should record available buffer id when doing dequeue zcopy. There's no guarantee that local queue avail index equal to buffer index. Fixes: d1eafb532268 ("vhost: add packed ring zcopy batch and single dequeue") Cc: sta...@dpdk.org Signed-off-by: Marvin Liu Reported

[dpdk-dev] [PATCH v2] vhost: fix packed ring zero-copy

2020-02-23 Thread Marvin Liu
Available buffer ID should be stored in the zmbuf in the packed-ring dequeue path. There's no guarantee that local queue avail index is equal to buffer ID. Fixes: d1eafb532268 ("vhost: add packed ring zcopy batch and single dequeue") Cc: sta...@dpdk.org Signed-off-by: Marvin L

[dpdk-dev] [PATCH v1 0/7] vectorize virtio packed ring datapath

2020-03-13 Thread Marvin Liu
. 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

[dpdk-dev] [PATCH v1 2/7] net/virtio-user: add LRO parameter

2020-03-13 Thread Marvin Liu
Packed ring vectorized rx function won't support GUEST_TSO4 and GUSET_TSO6. Adding "lro" parameter into virtio user vdev arguments can disable these features for vectorized path selection. Signed-off-by: Marvin Liu diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c

[dpdk-dev] [PATCH v1 1/7] net/virtio: add Rx free threshold setting

2020-03-13 Thread Marvin Liu
Introduce free threshold setting in Rx queue. Now default value of Rx free threshold is 32. Limiated threshold size to multiple of four as only vectorized packed Rx function will utilize it. Virtio driver will rearm Rx queue when more than threshold descs were dequeued. Signed-off-by: Marvin Liu

[dpdk-dev] [PATCH v1 3/7] net/virtio: add vectorized packed ring Rx function

2020-03-13 Thread Marvin Liu
-off-by: Marvin Liu diff --git a/drivers/net/virtio/Makefile b/drivers/net/virtio/Makefile index efdcb0d93..0458e8bf2 100644 --- a/drivers/net/virtio/Makefile +++ b/drivers/net/virtio/Makefile @@ -37,6 +37,36 @@ else ifneq ($(filter y,$(CONFIG_RTE_ARCH_ARM) $(CONFIG_RTE_ARCH_ARM64)),) SRCS

[dpdk-dev] [PATCH v1 6/7] net/virtio: add election for vectorized datapath

2020-03-13 Thread Marvin Liu
Packed ring vectorized datapath can be selected when requirements are fulfilled. 1. AVX512 is allowed by config file and compiler 2. VERSION_1 and in_order features are negotiated 3. ring size is power of two 4. LRO and mergeable feature disabled in Rx datapath Signed-off-by: Marvin Liu diff

[dpdk-dev] [PATCH v1 4/7] net/virtio: reuse packed ring xmit functions

2020-03-13 Thread Marvin Liu
Move xmit offload and packed ring xmit enqueue function to header file. These functions will be reused by packed ring vectorized Tx function. Signed-off-by: Marvin Liu diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index ac417232b..b8b4d3c25 100644 --- a

[dpdk-dev] [PATCH v1 7/7] net/virtio: support meson build

2020-03-13 Thread Marvin Liu
Signed-off-by: Marvin Liu diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build index 04c7fdf25..b0bddfd06 100644 --- a/drivers/net/virtio/meson.build +++ b/drivers/net/virtio/meson.build @@ -11,6 +11,7 @@ deps += ['kvargs', 'bus_pci'] if

[dpdk-dev] [PATCH v1 5/7] net/virtio: add vectorized packed ring Tx function

2020-03-13 Thread Marvin Liu
Optimize packed ring Tx datapath alike Rx datapath. Split Rx datapath into batch and single Tx functions. Signed-off-by: Marvin Liu diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h index 10e39670e..c9aaef0af 100644 --- a/drivers/net/virtio/virtio_ethdev.h

[dpdk-dev] [PATCH] vhost: cache guest/vhost physical address mapping

2020-03-16 Thread Marvin Liu
. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index 2087d1400..de2c09e7e 100644 --- a/lib/librte_vhost/vhost.h +++ b/lib/librte_vhost/vhost.h @@ -368,7 +368,9 @@ struct virtio_net { struct vhost_device_ops const *notify_ops; uint32_t

[dpdk-dev] [PATCH] vhost: fix packed ring zero-copy

2020-03-16 Thread Marvin Liu
Available buffer ID should be stored in the zmbuf in the packed-ring dequeue path. There's no guarantee that local queue avail index is equal to buffer ID. Fixes: d1eafb532268 ("vhost: add packed ring zcopy batch and single dequeue") Cc: sta...@dpdk.org Signed-off-by: Marvin L

[dpdk-dev] [PATCH v2 1/7] net/virtio: add Rx free threshold setting

2020-03-27 Thread Marvin Liu
Introduce free threshold setting in Rx queue, default value of it is 32. Limiated threshold size to multiple of four as only vectorized packed Rx function will utilize it. Virtio driver will rearm Rx queue when more than rx_free_thresh descs were dequeued. Signed-off-by: Marvin Liu diff --git a

[dpdk-dev] [PATCH v2 2/7] net/virtio-user: add vectorized packed ring parameter

2020-03-27 Thread Marvin Liu
Add new parameter "packed_vec" which can disable vectorized packed ring datapath explicitly. When "packed_vec" option is on, driver will check packed ring vectorized datapath prerequisites. If any one of them not matched, vectorized datapath won't be selected. Signed-

[dpdk-dev] [PATCH v2 4/7] net/virtio: reuse packed ring xmit functions

2020-03-27 Thread Marvin Liu
Move xmit offload and packed ring xmit enqueue function to header file. These functions will be reused by packed ring vectorized Tx function. Signed-off-by: Marvin Liu diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index ac417232b..b8b4d3c25 100644 --- a

[dpdk-dev] [PATCH v2 0/7] add packed ring vectorized datapath

2020-03-27 Thread Marvin Liu
by vector instruction 3. allow header room size change 4. add 'packed_vec' option in virtio_user vdev 5. fix build not check whether AVX512 enabled 6. doc update Marvin Liu (7): net/virtio: add Rx free threshold setting net/virtio-user: add vectorized packed ring parameter net/virtio: a

[dpdk-dev] [PATCH v2 3/7] net/virtio: add vectorized packed ring Rx function

2020-03-27 Thread Marvin Liu
structure to 16 bytes aligned, thus four elements will be saved in one batch. Signed-off-by: Marvin Liu diff --git a/drivers/net/virtio/Makefile b/drivers/net/virtio/Makefile index efdcb0d93..7bdb87c49 100644 --- a/drivers/net/virtio/Makefile +++ b/drivers/net/virtio/Makefile @@ -37,6 +37,34 @@ else

[dpdk-dev] [PATCH v2 5/7] net/virtio: add vectorized packed ring Tx datapath

2020-03-27 Thread Marvin Liu
Optimize packed ring Tx datapath alike Rx datapath. Split Tx datapath into batch and single Tx functions. Batch function further optimized by vector instructions. Signed-off-by: Marvin Liu diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h index 10e39670e

[dpdk-dev] [PATCH v2 6/7] net/virtio: add election for vectorized datapath

2020-03-27 Thread Marvin Liu
in Rx datapath Signed-off-by: Marvin Liu diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index f9d0ea70d..21570e5cf 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1518,9 +1518,12 @@ set_rxtx_funcs(struct

[dpdk-dev] [PATCH v2 7/7] doc: add packed vectorized datapath

2020-03-27 Thread Marvin Liu
Document packed virtqueue vectorized datapath selection logic in virtio net PMD. Add packed virtqueue vectorized datapath features to new ini file. Signed-off-by: Marvin Liu diff --git a/doc/guides/nics/features/virtio-packed_vec.ini b/doc/guides/nics/features/virtio-packed_vec.ini new file

[dpdk-dev] [PATCH] vhost: fix batch enqueue only handle few packets

2019-11-06 Thread Marvin Liu
After enqueue function finished, packet index has been increased. Batch enqueue function should retrieve mbuf structure pointed by that index. Fixes: 0294211bb6dc ("vhost: optimize packed ring enqueue") Signed-off-by: Marvin Liu --- lib/librte_vhost/virtio_net.c | 3 ++- 1 file

[dpdk-dev] [PATCH v7 00/13] vhost packed ring performance optimization

2019-10-21 Thread Marvin Liu
g/icc/gcc - Buffered dequeue used desc number changed to (RING_SZ - PKT_BURST) - Optimize dequeue used ring update when in_order negotiated Marvin Liu (13): vhost: add packed ring indexes increasing function vhost: add packed ring single enqueue vhost: try to unroll for each loop vhost

[dpdk-dev] [PATCH v7 01/13] vhost: add packed ring indexes increasing function

2019-10-21 Thread Marvin Liu
When enqueuing or dequeuing, the virtqueue's local available and used indexes are increased. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index c76d40115..02b3c91ff 100644 --- a/lib/librte_vhost/vhost.h +++

[dpdk-dev] [PATCH v7 02/13] vhost: add packed ring single enqueue

2019-10-21 Thread Marvin Liu
Add vhost enqueue function for single packet and meanwhile left space for flush used ring function. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 070d62bc0..4fb6552cc 100644 --- a/lib/librte_vhost

[dpdk-dev] [PATCH v7 06/13] vhost: add packed ring batch dequeue

2019-10-21 Thread Marvin Liu
Add batch dequeue function like enqueue function for packed ring, batch dequeue function will not support chained descritpors, single packet dequeue function will handle it. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index a2b9221e0..67724c342

[dpdk-dev] [PATCH v7 03/13] vhost: try to unroll for each loop

2019-10-21 Thread Marvin Liu
Create macro for adding unroll pragma before for each loop. Batch functions will be contained of several small loops which can be optimized by compilers' loop unrolling pragma. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile index 8623

[dpdk-dev] [PATCH v7 04/13] vhost: add packed ring batch enqueue

2019-10-21 Thread Marvin Liu
Batch enqueue function will first check whether descriptors are cache aligned. It will also check prerequisites in the beginning. Batch enqueue function do not support chained mbufs, single packet enqueue function will handle it. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff

[dpdk-dev] [PATCH v7 05/13] vhost: add packed ring single dequeue

2019-10-21 Thread Marvin Liu
Add vhost single packet dequeue function for packed ring and meanwhile left space for shadow used ring update function. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 4ddf26567..317be1aed 100644 --- a/lib

[dpdk-dev] [PATCH v7 07/13] vhost: flush enqueue updates by cacheline

2019-10-21 Thread Marvin Liu
Buffer vhost packed ring enqueue updates, flush ring descs if buffered content filled up one cacheline. Thus virtio can receive packets at a faster frequency. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index 67724c342..d59446442 100644 --- a/lib

[dpdk-dev] [PATCH v7 08/13] vhost: flush batched enqueue descs directly

2019-10-21 Thread Marvin Liu
Flush used elements when batched enqueue function is finished. Descriptor's flags are pre-calculated as they will be reset by vhost. Signed-off-by: Marvin Liu Reviewed-by: Gavin Hu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index d594

[dpdk-dev] [PATCH v7 09/13] vhost: buffer packed ring dequeue updates

2019-10-21 Thread Marvin Liu
Buffer used ring updates as many as possible in vhost dequeue function for coordinating with virtio driver. For supporting buffer, shadow used ring element should contain descriptor's flags. First shadowed ring index was recorded for calculating buffered number. Signed-off-by: Marvi

[dpdk-dev] [PATCH v7 11/13] vhost: add packed ring zcopy batch and single dequeue

2019-10-21 Thread Marvin Liu
Add vhost packed ring zero copy batch and single dequeue functions like normal dequeue path. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 2f90c3a7c..e053766f5 100644 --- a/lib/librte_vhost/virtio_net.c

[dpdk-dev] [PATCH v7 10/13] vhost: optimize packed ring enqueue

2019-10-21 Thread Marvin Liu
Optimize vhost device packed ring enqueue function by splitting batch and single functions. Packets can be filled into one desc will be handled by batch and others will be handled by single as before. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v7 13/13] vhost: optimize packed ring dequeue when in-order

2019-10-21 Thread Marvin Liu
When VIRTIO_F_IN_ORDER feature is negotiated, vhost can optimize dequeue function by only update first used descriptor. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index ca3a6551b..670790850 100644 --- a/lib

[dpdk-dev] [PATCH v7 12/13] vhost: optimize packed ring dequeue

2019-10-21 Thread Marvin Liu
Optimize vhost device packed ring dequeue function by splitting batch and single functions. No-chained and direct descriptors will be handled by batch and other will be handled by single as before. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v8 00/13] vhost packed ring performance optimization

2019-10-21 Thread Marvin Liu
compiler's pragma to unroll loop, distinguish clang/icc/gcc - Buffered dequeue used desc number changed to (RING_SZ - PKT_BURST) - Optimize dequeue used ring update when in_order negotiated Marvin Liu (13): vhost: add packed ring indexes increasing function vhost: add packed ring single en

[dpdk-dev] [PATCH v8 03/13] vhost: try to unroll for each loop

2019-10-21 Thread Marvin Liu
Create macro for adding unroll pragma before for each loop. Batch functions will be contained of several small loops which can be optimized by compilers' loop unrolling pragma. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile index 8623

[dpdk-dev] [PATCH v8 06/13] vhost: add packed ring batch dequeue

2019-10-21 Thread Marvin Liu
Add batch dequeue function like enqueue function for packed ring, batch dequeue function will not support chained descritpors, single packet dequeue function will handle it. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index a2b9221e0..67724c342

[dpdk-dev] [PATCH v8 01/13] vhost: add packed ring indexes increasing function

2019-10-21 Thread Marvin Liu
When enqueuing or dequeuing, the virtqueue's local available and used indexes are increased. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index c76d40115..02b3c91ff 100644 --- a/lib/librte_vhost/vhost.h +++

[dpdk-dev] [PATCH v8 04/13] vhost: add packed ring batch enqueue

2019-10-21 Thread Marvin Liu
Batch enqueue function will first check whether descriptors are cache aligned. It will also check prerequisites in the beginning. Batch enqueue function do not support chained mbufs, single packet enqueue function will handle it. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff

[dpdk-dev] [PATCH v8 05/13] vhost: add packed ring single dequeue

2019-10-21 Thread Marvin Liu
Add vhost single packet dequeue function for packed ring and meanwhile left space for shadow used ring update function. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 4ddf26567..87f2ae49e 100644 --- a/lib

[dpdk-dev] [PATCH v8 02/13] vhost: add packed ring single enqueue

2019-10-21 Thread Marvin Liu
Add vhost enqueue function for single packet and meanwhile left space for flush used ring function. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 070d62bc0..4fb6552cc 100644 --- a/lib/librte_vhost

[dpdk-dev] [PATCH v8 07/13] vhost: flush enqueue updates by cacheline

2019-10-21 Thread Marvin Liu
Buffer vhost packed ring enqueue updates, flush ring descs if buffered content filled up one cacheline. Thus virtio can receive packets at a faster frequency. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index 67724c342..d59446442 100644 --- a/lib

[dpdk-dev] [PATCH v8 08/13] vhost: flush batched enqueue descs directly

2019-10-21 Thread Marvin Liu
Flush used elements when batched enqueue function is finished. Descriptor's flags are pre-calculated as they will be reset by vhost. Signed-off-by: Marvin Liu Reviewed-by: Gavin Hu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index d594

[dpdk-dev] [PATCH v8 12/13] vhost: optimize packed ring dequeue

2019-10-21 Thread Marvin Liu
Optimize vhost device packed ring dequeue function by splitting batch and single functions. No-chained and direct descriptors will be handled by batch and other will be handled by single as before. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v8 11/13] vhost: add packed ring zcopy batch and single dequeue

2019-10-21 Thread Marvin Liu
Add vhost packed ring zero copy batch and single dequeue functions like normal dequeue path. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 1c63262ce..528e0fab1 100644 --- a/lib/librte_vhost/virtio_net.c

[dpdk-dev] [PATCH v8 09/13] vhost: buffer packed ring dequeue updates

2019-10-21 Thread Marvin Liu
Buffer used ring updates as many as possible in vhost dequeue function for coordinating with virtio driver. For supporting buffer, shadow used ring element should contain descriptor's flags. First shadowed ring index was recorded for calculating buffered number. Signed-off-by: Marvi

[dpdk-dev] [PATCH v8 10/13] vhost: optimize packed ring enqueue

2019-10-21 Thread Marvin Liu
Optimize vhost device packed ring enqueue function by splitting batch and single functions. Packets can be filled into one desc will be handled by batch and others will be handled by single as before. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v8 13/13] vhost: optimize packed ring dequeue when in-order

2019-10-21 Thread Marvin Liu
When VIRTIO_F_IN_ORDER feature is negotiated, vhost can optimize dequeue function by only update first used descriptor. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index ab6726996..5b8cb9e63 100644 --- a/lib

[dpdk-dev] [PATCH v9 01/13] vhost: add packed ring indexes increasing function

2019-10-24 Thread Marvin Liu
When enqueuing or dequeuing, the virtqueue's local available and used indexes are increased. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin --- lib/librte_vhost/vhost.h | 20 lib/librte_vhost/virtio_net.c | 18 +++--- 2 files changed, 23 inser

[dpdk-dev] [PATCH v9 00/13] vhost packed ring performance optimization

2019-10-24 Thread Marvin Liu
optimization v2: - Utilize compiler's pragma to unroll loop, distinguish clang/icc/gcc - Buffered dequeue used desc number changed to (RING_SZ - PKT_BURST) - Optimize dequeue used ring update when in_order negotiated Marvin Liu (13): vhost: add packed ring indexes increasing function vhost

[dpdk-dev] [PATCH v9 02/13] vhost: add packed ring single enqueue

2019-10-24 Thread Marvin Liu
Add vhost enqueue function for single packet and meanwhile left space for flush used ring function. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin --- lib/librte_vhost/virtio_net.c | 80 +++ 1 file changed, 80 insertions(+) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v9 03/13] vhost: try to unroll for each loop

2019-10-24 Thread Marvin Liu
Create macro for adding unroll pragma before for each loop. Batch functions will be contained of several small loops which can be optimized by compilers' loop unrolling pragma. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin --- lib/librte_vhost/Makefile| 18 ++

[dpdk-dev] [PATCH v9 09/13] vhost: buffer packed ring dequeue updates

2019-10-24 Thread Marvin Liu
Buffer used ring updates as many as possible in vhost dequeue function for coordinating with virtio driver. For supporting buffer, shadow used ring element should contain descriptor's flags. First shadowed ring index was recorded for calculating buffered number. Signed-off-by: Marvi

[dpdk-dev] [PATCH v9 07/13] vhost: flush enqueue updates by cacheline

2019-10-24 Thread Marvin Liu
Buffer vhost packed ring enqueue updates, flush ring descs if buffered content filled up one cacheline. Thus virtio can receive packets at a faster frequency. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin --- lib/librte_vhost/vhost.h | 2 + lib/librte_vhost/virtio_net.c | 101

[dpdk-dev] [PATCH v9 05/13] vhost: add packed ring single dequeue

2019-10-24 Thread Marvin Liu
Add vhost single packet dequeue function for packed ring and meanwhile left space for shadow used ring update function. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin --- lib/librte_vhost/virtio_net.c | 55 +++ 1 file changed, 55 insertions(+) diff

[dpdk-dev] [PATCH v9 06/13] vhost: add packed ring batch dequeue

2019-10-24 Thread Marvin Liu
Add batch dequeue function like enqueue function for packed ring, batch dequeue function will not support chained descritpors, single packet dequeue function will handle it. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin --- lib/librte_vhost/vhost.h | 3 + lib/librte_vhost

[dpdk-dev] [PATCH v9 08/13] vhost: flush batched enqueue descs directly

2019-10-24 Thread Marvin Liu
Flush used elements when batched enqueue function is finished. Descriptor's flags are pre-calculated as they will be reset by vhost. Signed-off-by: Marvin Liu Reviewed-by: Gavin Hu Reviewed-by: Maxime Coquelin --- lib/librte_vhost/vhost.h | 3 +++ lib/librte_vhost/virtio_net.c

[dpdk-dev] [PATCH v9 04/13] vhost: add packed ring batch enqueue

2019-10-24 Thread Marvin Liu
Batch enqueue function will first check whether descriptors are cache aligned. It will also check prerequisites in the beginning. Batch enqueue function do not support chained mbufs, single packet enqueue function will handle it. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin --- lib

[dpdk-dev] [PATCH v9 10/13] vhost: optimize packed ring enqueue

2019-10-24 Thread Marvin Liu
Optimize vhost device packed ring enqueue function by splitting batch and single functions. Packets can be filled into one desc will be handled by batch and others will be handled by single as before. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin --- lib/librte_vhost/virtio_net.c

[dpdk-dev] [PATCH v9 13/13] vhost: optimize packed ring dequeue when in-order

2019-10-24 Thread Marvin Liu
When VIRTIO_F_IN_ORDER feature is negotiated, vhost can optimize dequeue function by only update first used descriptor. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin --- lib/librte_vhost/virtio_net.c | 64 +-- 1 file changed, 62 insertions(+), 2

[dpdk-dev] [PATCH v9 11/13] vhost: add packed ring zcopy batch and single dequeue

2019-10-24 Thread Marvin Liu
Add vhost packed ring zero copy batch and single dequeue functions like normal dequeue path. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin --- lib/librte_vhost/virtio_net.c | 120 ++ 1 file changed, 120 insertions(+) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v9 12/13] vhost: optimize packed ring dequeue

2019-10-24 Thread Marvin Liu
Optimize vhost device packed ring dequeue function by splitting batch and single functions. No-chained and direct descriptors will be handled by batch and other will be handled by single as before. Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin --- lib/librte_vhost/virtio_net.c | 236

[dpdk-dev] [PATCH] vhost: fix vhost user virtqueue not accessable

2019-10-25 Thread Marvin Liu
Log feature is disabled in vhost user, so that log address was invalid when checking. Add feature bit check can skip useless address check. Fixes: 04cfc7fdbfca ("vhost: translate incoming log address to gpa") Signed-off-by: Marvin Liu --- lib/librte_vhost/vhost_user.c | 16 +

[dpdk-dev] [PATCH 2/2] vhost: do not limit packed ring size

2019-10-27 Thread Marvin Liu
Virtio spec only set rule that packed ring maximum size is up to 2^15 entries. Do not limit packed ring size to power of two. Signed-off-by: Marvin Liu --- lib/librte_vhost/vhost_user.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH 1/2] net/virtio: do not limit packed ring size

2019-10-27 Thread Marvin Liu
Virtio spec only set rule that packed ring maximum size is up to 2^15 entries. Do not limit packed ring size to power of two. Signed-off-by: Marvin Liu --- drivers/net/virtio/virtio_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio

[dpdk-dev] [PATCH] net/virtio: fix promisc mode enable failure

2019-10-28 Thread Marvin Liu
As doc mentioned, promisc and multicast are by-default supported in virtio pmd. Mac/vlan filter are supported by best effort. These control messages should return pass. Fixes: f9b9d1a55775 ("net/virtio-user: add multiple queues in device emulation") Cc: sta...@dpdk.org Signed-off-by:

[dpdk-dev] [PATCH v2] net/virtio: fix multicast and promisc mode enable failure

2019-10-28 Thread Marvin Liu
As doc mentioned, promisc and multicast are by-default supported in virtio pmd. Mac/vlan filter are supported by best effort. These control messages should return pass. Fixes: f9b9d1a55775 ("net/virtio-user: add multiple queues in device emulation") Cc: sta...@dpdk.org Signed-off-by:

[dpdk-dev] [PATCH v3] net/virtio: fix multicast and promisc mode enable failure

2019-10-28 Thread Marvin Liu
As doc mentioned, promisc and multicast are by-default supported in virtio pmd. Mac/vlan filter are supported by best effort. These control messages should return pass. Fixes: f9b9d1a55775 ("net/virtio-user: add multiple queues in device emulation") Cc: sta...@dpdk.org Signed-off-by:

[dpdk-dev] [PATCH v2 2/2] vhost: do not limit packed ring size

2019-10-29 Thread Marvin Liu
Virtio spec only set rule that packed ring maximum size is up to 2^15 entries. Should not limit packed ring size to power of two. Fixes: 708e14d8b9ac ("vhost: advertize packed ring layout support") Cc: sta...@dpdk.org Signed-off-by: Marvin Liu --- lib/librte_vhost/vhost_u

[dpdk-dev] [PATCH v2 1/2] net/virtio: do not limit packed ring size

2019-10-29 Thread Marvin Liu
Virtio spec only set rule that packed ring maximum size is up to 2^15 entries. Should not limit packed ring size to power of two. Fixes: aea29aa5d37b ("net/virtio: enable packed virtqueues by default") Cc: sta...@dpdk.org Signed-off-by: Marvin Liu --- drivers/net/virtio/virtio_et

[dpdk-dev] [PATCH v4] net/virtio: fix multicast and promisc mode enable failure

2019-10-29 Thread Marvin Liu
As doc mentioned, promisc and multicast are by-default supported in virtio pmd. Mac/vlan filter are supported by best effort. These control messages should return success. Fixes: f9b9d1a55775 ("net/virtio-user: add multiple queues in device emulation") Cc: sta...@dpdk.org Signed-off-

[dpdk-dev] [PATCH v2] vhost: fix vhost user virtqueue not accessible

2019-10-29 Thread Marvin Liu
Log feature is disabled in vhost user, so that log address was invalid when checking. Check whether log address is valid can workaround it. Also log address should be translated in packed ring virtqueue. Fixes: 04cfc7fdbfca ("vhost: translate incoming log address to gpa") Signed-off-

[dpdk-dev] [PATCH v3] vhost: fix vhost user virtqueue not accessible

2019-10-30 Thread Marvin Liu
Log feature is disabled in vhost user, so that log address was invalid when checking. Check whether log address is valid can workaround it. Also log address should be translated in packed ring virtqueue. Fixes: 04cfc7fdbfca ("vhost: translate incoming log address to gpa") Signed-off-

[dpdk-dev] [PATCH v5] net/virtio: fix multicast and promisc mode enable failure

2019-10-30 Thread Marvin Liu
evice emulation") Cc: sta...@dpdk.org Signed-off-by: Marvin Liu --- drivers/net/virtio/virtio_user/virtio_user_dev.c | 8 drivers/net/virtio/virtio_user_ethdev.c | 4 2 files changed, 12 insertions(+) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/d

[dpdk-dev] [PATCH v4] vhost: fix vhost user virtqueue not accessible

2019-11-03 Thread Marvin Liu
Log feature is disabled in vhost user, so that log address was invalid when checking. Check whether log address is valid can work around it. Log address should also be translated in packed ring virtqueue. Fixes: 04cfc7fdbfca ("vhost: translate incoming log address to gpa") Signed-off-

[dpdk-dev] [PATCH] vhost: fix dirty page logging missing

2019-11-03 Thread Marvin Liu
Packets data are directly copied when doing batch enqueue, add missed dirty page logging after memory copy. Fixes: ad3df6dcc0fc ("vhost: add packed ring batch enqueue") Signed-off-by: Marvin Liu --- lib/librte_vhost/virtio_net.c | 4 1 file changed, 4 insertions(+) diff -

[dpdk-dev] [PATCH v6] net/virtio-user: fix failures when setting filters

2019-11-05 Thread Marvin Liu
As doc mentioned, Rx/Mac/vlan filters are all supported by best effort. These control commands should return success. Fixes: f9b9d1a55775 ("net/virtio-user: add multiple queues in device emulation") Cc: sta...@dpdk.org Signed-off-by: Marvin Liu --- drivers/net/virtio/v

[dpdk-dev] [RFC] vhost packed ring performance optimization

2019-07-08 Thread Marvin Liu
done, single core vhost PvP performance with 64B packet on Xeon 8180 can boost 35%, loopback performance measured by virtio user pmd can boost over 45%. Marvin Liu (13): add vhost normal enqueue function add vhost packed ring fast enqueue function add vhost packed ring normal dequeue

[dpdk-dev] [RFC PATCH 03/13] add vhost packed ring normal dequeue function

2019-07-08 Thread Marvin Liu
Rewrite vhost dequeue function which without used ring update. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index b877510da..410837122 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -1613,6 +1613,62

[dpdk-dev] [RFC PATCH 04/13] add vhost packed ring fast dequeue function

2019-07-08 Thread Marvin Liu
Add fast dequeue function just like enqueue function, fast dequeue function will not support chained nor indirect descriptors, normal function will handle that. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index f24026acd..329a7658b 100644 --- a/lib

[dpdk-dev] [RFC PATCH 05/13] add enqueue shadow used descs update and flush functions

2019-07-08 Thread Marvin Liu
Split vhost enqueue and dequeue shadow used ring update function. Vhost enqueue shadow used descs update will be calculated by cache line. Enqueue sshadow used descs update will be buffered until exceed one cache line. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/vhost.h b/lib

[dpdk-dev] [RFC PATCH 02/13] add vhost packed ring fast enqueue function

2019-07-08 Thread Marvin Liu
In fast enqueue function, will first check whether descriptors are cache aligned. Fast enqueue function will check prerequisites in the beginning. Fast enqueue function do not support chained mbufs, normal function will handle that. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost

[dpdk-dev] [RFC PATCH 01/13] add vhost normal enqueue function

2019-07-08 Thread Marvin Liu
Rewrite vhost enqueue function and meanwhile left space for later flush enqeueue shadow used descriptors changes. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 5b85b832d..003aec1d4 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib

[dpdk-dev] [RFC PATCH 06/13] add vhost fast enqueue flush function

2019-07-08 Thread Marvin Liu
Vhost fast enqueue function will flush used ring immediately. Descriptor's flag is pre-calculated by macro. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index b8198747e..d084fe364 100644 --- a/lib/librte_vhost/vhost.h +++ b/lib/librte_vhost/vh

[dpdk-dev] [RFC PATCH 07/13] add vhost dequeue shadow descs update function

2019-07-08 Thread Marvin Liu
Vhost dequeue function will buffer used descriptors as many as possible, so that shadow used element should itself contain descriptor index and wrap counter. First shadowed ring index also be recorded. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h

[dpdk-dev] [RFC PATCH 08/13] add vhost fast dequeue flush function

2019-07-08 Thread Marvin Liu
Vhost fast dequeue function will flush used ring immediately. Descriptor's flag is pre-calculated by macro. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 83ed2d599..cd51ed47a 100644 --- a/lib/librte_vhost/virtio_net.c +++

[dpdk-dev] [RFC PATCH 12/13] support inorder in vhost dequeue path

2019-07-08 Thread Marvin Liu
When inorder feature bit is negotiated, just update first used descriptor with last descriptor index. It can reflect all used descriptors. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 0f9292eb0..6bcf565f0 100644 --- a/lib

[dpdk-dev] [RFC PATCH 11/13] replace vhost dequeue packed ring function

2019-07-08 Thread Marvin Liu
Vhost dequeue function will try to handle packed descriptors four by four. If packed descriptors can't be handled by fast path, will try normal path. Loop will skip skip when normal path can't receive packet. Zero copy function is following same logic. Signed-off-by: Marvin Liu diff -

[dpdk-dev] [RFC PATCH 10/13] add vhost fast zero copy dequeue packed ring function

2019-07-08 Thread Marvin Liu
Modified vhost zero copy dequeue function which followed fast dequeue function. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index a3b1e85fe..7094944cf 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c

[dpdk-dev] [RFC PATCH 09/13] replace vhost enqueue packed ring function

2019-07-08 Thread Marvin Liu
Vhost enqueue function will try to handle packed descriptors four by four. If packed descriptors can't be handled by fast path, will try normal path. Loop will skip when normal path can't emit packet. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/virtio_net.c b/lib/li

[dpdk-dev] [RFC PATCH 13/13] remove useless vhost functions

2019-07-08 Thread Marvin Liu
Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 6bcf565f0..df8dcbe1f 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -97,72 +97,6 @@ update_shadow_used_ring_split(struct vhost_virtqueue *vq, vq

[dpdk-dev] [PATCH v4 02/14] vhost: unify unroll pragma parameter

2019-10-08 Thread Marvin Liu
Add macro for unifying Clang/ICC/GCC unroll pragma format. Batch functions were contained of several small loops which optimized by compiler’s loop unrolling pragma. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile index 8623e91c0..30839a001 100644

[dpdk-dev] [PATCH v4 04/14] vhost: add single packet dequeue function

2019-10-08 Thread Marvin Liu
Add vhost single packet dequeue function for packed ring and meanwhile left space for shadow used ring update function. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 5e08f7d9b..17aabe8eb 100644 --- a/lib/librte_vhost/virtio_net.c

[dpdk-dev] [PATCH v4 00/14] vhost packed ring performance optimization

2019-10-08 Thread Marvin Liu
desc number changed to (RING_SZ - PKT_BURST) - Optimize dequeue used ring update when in_order negotiated Marvin Liu (14): vhost: add single packet enqueue function vhost: unify unroll pragma parameter vhost: add batch enqueue function for packed ring vhost: add single packet dequeue fun

[dpdk-dev] [PATCH v4 01/14] vhost: add single packet enqueue function

2019-10-08 Thread Marvin Liu
Add vhost enqueue function for single packet and meanwhile left space for flush used ring function. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 5b85b832d..520c4c6a8 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost

[dpdk-dev] [PATCH v4 03/14] vhost: add batch enqueue function for packed ring

2019-10-08 Thread Marvin Liu
Batch enqueue function will first check whether descriptors are cache aligned. It will also check prerequisites in the beginning. Batch enqueue function not support chained mbufs, single packet enqueue function will handle it. Signed-off-by: Marvin Liu diff --git a/lib/librte_vhost/vhost.h b

<    1   2   3   4   5   >