[PATCH v2] eal/linux: register mp hotplug callback after memory init

2023-06-08 Thread Zhihong Wang
Secondary would crash if it tries to handle mp requests before memory init, since globals such as eth_dev_shared_data_lock are not accessible to it at this moment. v2: add signed-off-by Signed-off-by: Zhihong Wang Acked-by: Anatoly Burakov --- lib/eal/linux/eal.c | 12 ++-- 1 file

[PATCH] eal/linux: register mp hotplug callback after memory init

2023-05-30 Thread Zhihong Wang
Secondary would crash if it tries to handle mp requests before memory init, since globals such as eth_dev_shared_data_lock are not accessible to it at this moment. --- lib/eal/linux/eal.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/eal/linux/eal.c b/lib/eal

[PATCH] ring: fix overflow in memory size calcuation

2021-12-13 Thread Zhihong Wang
Parameters count and esize are both unsigned int, and their product can legally exceed unsigned int and lead to runtime access violation. Fixes: cc4b218790f6 ("ring: support configurable element size") Cc: sta...@dpdk.org Signed-off-by: Zhihong Wang --- lib/ring/rte_ring.c | 2

[dpdk-dev] [PATCH] app/testpmd: configurable number of flows in flowgen

2021-08-19 Thread Zhihong Wang
Make number of flows in flowgen configurable by setting parameter --flowgen-flows=N. Signed-off-by: Zhihong Wang --- Depends-on: series-18277 ("app/testpmd: flowgen fixes and improvements") app/test-pmd/flowgen.c| 22 ++ app/test-pmd/pa

[dpdk-dev] [PATCH v5 4/4] app/testpmd: use per-core variable in flowgen

2021-08-13 Thread Zhihong Wang
Use per-core variable for flow indexing to solve cache contention in multi-core scenarios. Signed-off-by: Zhihong Wang Acked-by: Xiaoyun Li --- v5: replace modulo operation to improve performance v4: use loop local variable to improve performance app/test-pmd/flowgen.c | 9 +++-- 1 file

[dpdk-dev] [PATCH v5 3/4] app/testpmd: record rx_burst and fwd_dropped in flowgen

2021-08-13 Thread Zhihong Wang
Call inc_rx_burst_stats for rx operation, and record fwd_dropped. Signed-off-by: Zhihong Wang Acked-by: Xiaoyun Li --- app/test-pmd/flowgen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c index 96d0cc79df..229794ee9c 100644 --- a/app/test

[dpdk-dev] [PATCH v5 2/4] app/testpmd: use rte_ipv4_cksum in flowgen

2021-08-13 Thread Zhihong Wang
Use the rte_ipv4_cksum API to replace local ip_sum implementation. Signed-off-by: Zhihong Wang Acked-by: Xiaoyun Li --- app/test-pmd/flowgen.c | 25 + 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c index

[dpdk-dev] [PATCH v5 1/4] app/testpmd: fix tx retry in flowgen

2021-08-13 Thread Zhihong Wang
Fix tx_pkt number in tx retry logic. Fixes: bf56fce1fb45 ("app/testpmd: add retry option") Cc: sta...@dpdk.org Signed-off-by: Zhihong Wang Acked-by: Xiaoyun Li --- app/test-pmd/flowgen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/flowg

[dpdk-dev] [PATCH v5 0/4] app/testpmd: flowgen fixes and improvements

2021-08-13 Thread Zhihong Wang
ip header cksum Zhihong Wang (4): app/testpmd: fix tx retry in flowgen app/testpmd: use rte_ipv4_cksum in flowgen app/testpmd: record rx_burst and fwd_dropped in flowgen app/testpmd: use per-core variable in flowgen app/test-pmd/flowgen.c | 47

[dpdk-dev] [PATCH v4 4/4] app/testpmd: use per-core variable in flowgen

2021-08-12 Thread Zhihong Wang
Use per-core variable for flow indexing to solve cache contention in multi-core scenarios. v4: use loop local variable to improve performance Signed-off-by: Zhihong Wang --- app/test-pmd/flowgen.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/flowgen.c b

[dpdk-dev] [PATCH v4 3/4] app/testpmd: record rx_burst and fwd_dropped in flowgen

2021-08-12 Thread Zhihong Wang
Call inc_rx_burst_stats for rx operation, and record fwd_dropped. Signed-off-by: Zhihong Wang --- app/test-pmd/flowgen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c index 96d0cc79df..229794ee9c 100644 --- a/app/test-pmd/flowgen.c +++ b

[dpdk-dev] [PATCH v4 2/4] app/testpmd: use rte_ipv4_cksum in flowgen

2021-08-12 Thread Zhihong Wang
Use the rte_ipv4_cksum API to replace local ip_sum implementation. Signed-off-by: Zhihong Wang --- app/test-pmd/flowgen.c | 25 + 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c index f2e6255c36..96d0cc79df

[dpdk-dev] [PATCH v4 1/4] app/testpmd: fix tx retry in flowgen

2021-08-12 Thread Zhihong Wang
Fix tx_pkt number in tx retry logic. Fixes: bf56fce1fb4 ("app/testpmd: add retry option") Cc: sta...@dpdk.org Signed-off-by: Zhihong Wang --- app/test-pmd/flowgen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowg

[dpdk-dev] [PATCH v4 0/4] app/testpmd: flowgen fixes and improvements

2021-08-12 Thread Zhihong Wang
This series fixes a tx retry defect and improves multi-core performance by using per-core variable for flow indexing. v4: use loop local variable to improve performance v3: split changes and keep original flow generation logic v2: fix assigning ip header cksum Zhihong Wang (4): app/testpmd

[dpdk-dev] [PATCH v3 4/4] app/testpmd: use per-core variable in flowgen

2021-08-12 Thread Zhihong Wang
Use per-core variable for flow indexing to solve cache contention in multi-core scenarios. Signed-off-by: Zhihong Wang --- app/test-pmd/flowgen.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c index 229794ee9c

[dpdk-dev] [PATCH v3 3/4] app/testpmd: record rx_burst and fwd_dropped in flowgen

2021-08-12 Thread Zhihong Wang
Call inc_rx_burst_stats for rx operation, and record fwd_dropped. Signed-off-by: Zhihong Wang --- app/test-pmd/flowgen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c index 96d0cc79df..229794ee9c 100644 --- a/app/test-pmd/flowgen.c +++ b

[dpdk-dev] [PATCH v3 2/4] app/testpmd: use rte_ipv4_cksum in flowgen

2021-08-12 Thread Zhihong Wang
Use the rte_ipv4_cksum API to replace local ip_sum implementation. Signed-off-by: Zhihong Wang --- app/test-pmd/flowgen.c | 25 + 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c index f2e6255c36..96d0cc79df

[dpdk-dev] [PATCH v3 1/4] app/testpmd: fix tx retry in flowgen

2021-08-12 Thread Zhihong Wang
Fix tx_pkt number in tx retry logic. Fixes: bf56fce1fb4 ("app/testpmd: add retry option") Cc: sta...@dpdk.org Signed-off-by: Zhihong Wang --- app/test-pmd/flowgen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowg

[dpdk-dev] [PATCH v3 0/4] app/testpmd: flowgen fixes and improvements

2021-08-12 Thread Zhihong Wang
This series fixes a tx retry defect and improves multi-core performance by using per-core variable for flow indexing. v3: split changes and keep original flow generation logic v2: fix assigning ip header cksum Zhihong Wang (4): app/testpmd: fix tx retry in flowgen app/testpmd: use

[dpdk-dev] [PATCH v2] app/testpmd: flowgen support ip and udp fields

2021-08-08 Thread Zhihong Wang
This patch aims to: 1. Add flexibility by supporting IP & UDP src/dst fields 2. Improve multi-core performance by using per-core vars v2: fix assigning ip header cksum Signed-off-by: Zhihong Wang --- app/test-pmd/flowgen.c | 137 +++-- 1

[dpdk-dev] [PATCH] app/testpmd: flowgen support ip and udp fields

2021-08-08 Thread Zhihong Wang
This patch aims to: 1. Add flexibility by supporting IP & UDP src/dst fields 2. Improve multi-core performance by using per-core vars Signed-off-by: Zhihong Wang --- app/test-pmd/flowgen.c | 137 +++-- 1 file changed, 86 insertions(+), 51 delet

[dpdk-dev] [PATCH] maintainers: resign from virtio and vhost

2020-10-14 Thread Zhihong Wang
I'm resigning from DPDK virtio and vhost maintainer as I'm leaving Intel. Sincerely thank Maxime, Chenbo and the community for all the support. Signed-off-by: Zhihong Wang --- MAINTAINERS | 3 --- 1 file changed, 3 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index cdaf0b05c.

[dpdk-dev] [PATCH] doc: update release notes for vdpa

2018-05-25 Thread Zhihong Wang
Signed-off-by: Zhihong Wang --- doc/guides/rel_notes/release_18_05.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/doc/guides/rel_notes/release_18_05.rst b/doc/guides/rel_notes/release_18_05.rst index 40eec3a49..44180bb44 100644 --- a/doc/guides/rel_notes/release_18_05.rst +++ b

[dpdk-dev] [PATCH] doc: update release notes for vhost interrupt mode

2018-05-25 Thread Zhihong Wang
Signed-off-by: Zhihong Wang --- doc/guides/rel_notes/release_18_05.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/doc/guides/rel_notes/release_18_05.rst b/doc/guides/rel_notes/release_18_05.rst index 40eec3a49..eda6cf411 100644 --- a/doc/guides/rel_notes/release_18_05.rst +++ b

[dpdk-dev] [PATCH] doc: add doc for vdpa

2018-05-25 Thread Zhihong Wang
Signed-off-by: Zhihong Wang --- doc/guides/prog_guide/vhost_lib.rst | 59 + 1 file changed, 59 insertions(+) diff --git a/doc/guides/prog_guide/vhost_lib.rst b/doc/guides/prog_guide/vhost_lib.rst index 92dcdb587..77af4d775 100644 --- a/doc/guides/prog_guide

[dpdk-dev] [PATCH v5 5/5] vhost: add apis for live migration

2018-04-02 Thread Zhihong Wang
need to be read from the virtio_net structure and set into the device. Signed-off-by: Zhihong Wang Reviewed-by: Maxime Coquelin --- lib/librte_vhost/rte_vhost.h | 51 +++ lib/librte_vhost/rte_vhost_version.map | 3 ++ lib/librte_vhost/vhost.c | 63

[dpdk-dev] [PATCH v5 4/5] vhost: adapt vhost lib for selective datapath

2018-04-02 Thread Zhihong Wang
This patch adapts vhost lib for selective datapath by calling device ops at the corresponding stage. Signed-off-by: Zhihong Wang --- Changes in v5: 1. Improve sanity check. --- Changes in v4: 1. Remove the "engine" concept in the lib. --- Changes in v2: 1. Ensure negotiated ca

[dpdk-dev] [PATCH v5 1/5] vhost: export vhost feature definitions

2018-04-02 Thread Zhihong Wang
This patch exports vhost-user protocol features to support device driver development. Signed-off-by: Zhihong Wang Reviewed-by: Maxime Coquelin --- Changes in v3: 1. Keep macro names the same as in the spec. lib/librte_vhost/rte_vhost.h | 30 ++ lib/librte_vhost

[dpdk-dev] [PATCH v5 0/5] vhost: support selective datapath

2018-04-02 Thread Zhihong Wang
otiated capabilities are supported in vhost-user lib. 2. Add APIs for live migration. 3. Configure the data path at the right time. 4. Add VFIO related vDPA device ops. 5. Rebase on dpdk-next-virtio. Zhihong Wang (5): vhost: export vhost feature definitions vhost: support selective d

[dpdk-dev] [PATCH v5 3/5] vhost: add apis for datapath configuration

2018-04-02 Thread Zhihong Wang
This patch adds APIs for datapath configuration. The did of the vhost-user socket can be set to identify the backend device, in this case each vhost-user socket can have only 1 connection. The did is set to -1 by default when the software datapath is used. Signed-off-by: Zhihong Wang

[dpdk-dev] [PATCH v5 2/5] vhost: support selective datapath

2018-04-02 Thread Zhihong Wang
. get_notify_area: Called to get the notify area info of the queue. Signed-off-by: Zhihong Wang --- Changes in v5: 1. Rename the vDPA device ops to follow convention. 2. Improve sanity check. --- Changes in v4: 1. Remove the "engine" concept in the lib. --- Changes in v2: 1

[dpdk-dev] [PATCH v4 4/5] vhost: adapt vhost lib for selective datapath

2018-03-30 Thread Zhihong Wang
This patch adapts vhost lib for selective datapath by calling device ops at the corresponding stage. Signed-off-by: Zhihong Wang --- Changes in v4: 1. Remove the "engine" concept in the lib. --- Changes in v2: 1. Ensure negotiated capabilities are supported in vhost-user lib. 2.

[dpdk-dev] [PATCH v4 5/5] vhost: add apis for live migration

2018-03-30 Thread Zhihong Wang
need to be read from the virtio_net structure and set into the device. Signed-off-by: Zhihong Wang --- lib/librte_vhost/rte_vhost.h | 51 +++ lib/librte_vhost/rte_vhost_version.map | 3 ++ lib/librte_vhost/vhost.c | 63

[dpdk-dev] [PATCH v4 3/5] vhost: add apis for datapath configuration

2018-03-30 Thread Zhihong Wang
This patch adds APIs for datapath configuration. The did of the vhost-user socket can be set to identify the backend device, in this case each vhost-user socket can have only 1 connection. The did is set to -1 by default when the software datapath is used. Signed-off-by: Zhihong Wang

[dpdk-dev] [PATCH v4 0/5] vhost: support selective datapath

2018-03-30 Thread Zhihong Wang
ed in vhost-user lib. 2. Add APIs for live migration. 3. Configure the data path at the right time. 4. Add VFIO related vDPA device ops. 5. Rebase on dpdk-next-virtio. Zhihong Wang (5): vhost: export vhost feature definitions vhost: support selective datapath vhost: add apis for da

[dpdk-dev] [PATCH v4 2/5] vhost: support selective datapath

2018-03-30 Thread Zhihong Wang
. get_notify_area: Called to get the notify area info of the queue. Signed-off-by: Zhihong Wang --- Changes in v4: 1. Remove the "engine" concept in the lib. --- Changes in v2: 1. Add VFIO related vDPA device ops. lib/librte_vhost/Makefile | 4 +- lib/librte_vhost/

[dpdk-dev] [PATCH v4 1/5] vhost: export vhost feature definitions

2018-03-30 Thread Zhihong Wang
This patch exports vhost-user protocol features to support device driver development. Signed-off-by: Zhihong Wang --- Changes in v3: 1. Keep macro names the same as in the spec. lib/librte_vhost/rte_vhost.h | 30 ++ lib/librte_vhost/vhost.h | 2 -- lib

[dpdk-dev] [PATCH v3 5/5] vhost: add apis for live migration

2018-03-19 Thread Zhihong Wang
need to be read from the virtio_net structure and set into the device. Signed-off-by: Zhihong Wang --- lib/librte_vhost/rte_vhost.h | 51 +++ lib/librte_vhost/rte_vhost_version.map | 3 ++ lib/librte_vhost/vhost.c | 63

[dpdk-dev] [PATCH v3 4/5] vhost: adapt vhost lib for selective datapath

2018-03-19 Thread Zhihong Wang
This patch adapts vhost lib for selective datapath by calling device ops at the corresponding stage. Signed-off-by: Zhihong Wang --- Changes in v2: 1. Ensure negotiated capabilities are supported in vhost-user lib. 2. Configure the data path at the right time. lib/librte_vhost/rte_vhost.h

[dpdk-dev] [PATCH v3 1/5] vhost: export vhost feature definitions

2018-03-19 Thread Zhihong Wang
This patch exports vhost-user protocol features to support device driver development. Signed-off-by: Zhihong Wang --- Changes in v3: 1. Keep macro names the same as in the spec. lib/librte_vhost/rte_vhost.h | 30 ++ lib/librte_vhost/vhost.h | 2 -- lib

[dpdk-dev] [PATCH v3 2/5] vhost: support selective datapath

2018-03-19 Thread Zhihong Wang
get the VFIO group fd of the device. g. get_vfio_device_fd: Called to get the VFIO device fd of the device. h. get_notify_area: Called to get the notify area info of the queue. Signed-off-by: Zhihong Wang --- Changes in v2: 1. Add VFIO related vDPA device ops. lib/librte_vhost

[dpdk-dev] [PATCH v3 3/5] vhost: add apis for datapath configuration

2018-03-19 Thread Zhihong Wang
to use. Each vhost-user socket can have only 1 connection in this case. Signed-off-by: Zhihong Wang --- lib/librte_vhost/rte_vhost.h | 70 ++ lib/librte_vhost/rte_vhost_version.map | 6 +++ lib/librte_vhost/socket.c | 65

[dpdk-dev] [PATCH v3 0/5] vhost: support selective datapath

2018-03-19 Thread Zhihong Wang
duced. --- Changes in v2: 1. Ensure negotiated capabilities are supported in vhost-user lib. 2. Add APIs for live migration. 3. Configure the data path at the right time. 4. Add VFIO related vDPA device ops. 5. Rebase on dpdk-next-virtio. Zhihong Wang (5): vhost: export vhost fe

[dpdk-dev] [PATCH v2 6/6] vhost: export new apis

2018-03-05 Thread Zhihong Wang
This patch exports new APIs as experimental. Signed-off-by: Zhihong Wang --- lib/librte_vhost/rte_vdpa.h| 16 +++- lib/librte_vhost/rte_vhost.h | 33 ++--- lib/librte_vhost/rte_vhost_version.map | 19 +++ 3 files

[dpdk-dev] [PATCH v2 5/6] vhost: add apis for live migration

2018-03-05 Thread Zhihong Wang
need to be read from the virtio_net structure and set into the device. Signed-off-by: Zhihong Wang --- lib/librte_vhost/rte_vhost.h | 49 ++ lib/librte_vhost/vhost.c | 63 2 files changed, 112 insertions(+) diff --git

[dpdk-dev] [PATCH v2 4/6] vhost: adapt vhost lib for selective datapath

2018-03-05 Thread Zhihong Wang
This patch adapts vhost lib for selective datapath by calling device ops at the corresponding stage. Signed-off-by: Zhihong Wang --- Changes in v2: 1. Ensure negotiated capabilities are supported in vhost-user lib. 2. Configure the data path at the right time. lib/librte_vhost/rte_vhost.h

[dpdk-dev] [PATCH v2 3/6] vhost: add apis for datapath configuration

2018-03-05 Thread Zhihong Wang
to use. Each vhost-user socket can have only 1 connection in this case. Signed-off-by: Zhihong Wang --- lib/librte_vhost/rte_vhost.h | 64 +++ lib/librte_vhost/socket.c| 65 lib/librte_vhost/vhost.c | 50

[dpdk-dev] [PATCH v2 2/6] vhost: support selective datapath

2018-03-05 Thread Zhihong Wang
get the VFIO group fd of the device. g. get_vfio_device_fd: Called to get the VFIO device fd of the device. h. get_notify_area: Called to get the notify area info of the queue. Signed-off-by: Zhihong Wang --- Changes in v2: 1. Add VFIO related vDPA device ops. lib/librte_vhost

[dpdk-dev] [PATCH v2 1/6] vhost: export vhost feature definitions

2018-03-05 Thread Zhihong Wang
This patch exports vhost-user protocol features to support device driver development. Signed-off-by: Zhihong Wang --- lib/librte_vhost/rte_vhost.h | 8 lib/librte_vhost/vhost.h | 4 +--- lib/librte_vhost/vhost_user.c | 9 + lib/librte_vhost/vhost_user.h | 20

[dpdk-dev] [PATCH v2 0/6] vhost: support selective datapath

2018-03-05 Thread Zhihong Wang
migration. 3. Configure the data path at the right time. 4. Add VFIO related vDPA device ops. 5. Rebase on dpdk-next-virtio. Zhihong Wang (6): vhost: export vhost feature definitions vhost: support selective datapath vhost: add apis for datapath configuration vhost: adapt vhost lib

[dpdk-dev] [PATCH 5/7] vhost: adapt vhost lib for selective datapath

2018-02-02 Thread Zhihong Wang
This patch adapts vhost lib for selective datapath by calling device ops at the corresponding stage. Signed-off-by: Zhihong Wang --- lib/librte_vhost/socket.c | 3 +++ lib/librte_vhost/vhost.c | 5 + lib/librte_vhost/vhost_user.c | 48

[dpdk-dev] [PATCH 6/7] vhost: get callfd before device setup

2018-02-02 Thread Zhihong Wang
From: Xiao Wang This patch is to make sure device is configured with all needed guest info. According to QEMU vhost message sequence, the real callfd comes just before SET_VRING_ENABLE. Signed-off-by: Xiao Wang --- lib/librte_vhost/vhost_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 delet

[dpdk-dev] [PATCH 7/7] vhost: export new apis

2018-02-02 Thread Zhihong Wang
This patch exports new APIs as experimental. Signed-off-by: Zhihong Wang --- lib/librte_vhost/rte_vdpa.h| 16 +++- lib/librte_vhost/rte_vhost.h | 30 -- lib/librte_vhost/rte_vhost_version.map | 18 ++ 3 files changed

[dpdk-dev] [PATCH 4/7] vhost: add apis for datapath configuration

2018-02-02 Thread Zhihong Wang
to use. Each vhost-user socket can have only 1 connection in this case. Signed-off-by: Zhihong Wang --- lib/librte_vhost/rte_vhost.h | 68 lib/librte_vhost/socket.c| 65 ++ lib/librte_vhost/vhost.c | 44

[dpdk-dev] [PATCH 3/7] vhost: support selective datapath

2018-02-02 Thread Zhihong Wang
. vring_state_set: Called to change the state of the vring in the actual device when vring state changes. d. feature_set: Called to set the negotiated features to device. e. migration_done: Called to allow the device to response to RARP sending. Signed-off-by: Zhihong Wang --- lib

[dpdk-dev] [PATCH 2/7] vhost: export vhost feature definitions

2018-02-02 Thread Zhihong Wang
This patch exports vhost-user protocol features to support device driver development. Signed-off-by: Zhihong Wang --- lib/librte_vhost/rte_vhost.h | 8 lib/librte_vhost/vhost.h | 4 +--- lib/librte_vhost/vhost_user.c | 9 + lib/librte_vhost/vhost_user.h | 20

[dpdk-dev] [PATCH 0/7] vhost: support selective datapath

2018-02-02 Thread Zhihong Wang
. d. Register vhost-user callbacks. e. Start to wait for connection. 4. When connection comes and virtio device data structure is negotiated, configure the device with all needed info. Zhihong Wang (7): vhost: make capabilities configurable vhost: expose vhost feature definitions

[dpdk-dev] [PATCH 1/7] vhost: make capabilities configurable

2018-02-02 Thread Zhihong Wang
: Zhihong Wang --- lib/librte_vhost/rte_vhost.h | 50 lib/librte_vhost/socket.c | 77 +++ lib/librte_vhost/vhost_user.c | 48 --- 3 files changed, 164 insertions(+), 11 deletions(-) diff --git a/lib

[dpdk-dev] [PATCH] vhost: fix ANY_LAYOUT definition for old kernels

2018-01-30 Thread Zhihong Wang
This patch fixes compile failure with old kernels which have no VIRTIO_F_ANY_LAYOUT defined. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost.h | 4 1 file changed, 4 insertions(+) diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index ba80584..646aad3 100644 --- a

[dpdk-dev] [PATCH] vhost: fix ANY_LAYOUT declaration

2018-01-18 Thread Zhihong Wang
The VIRTIO_F_ANY_LAYOUT feature indicates the device accepts arbitrary descriptor layouts. The vhost-user lib already supports it, but the feature declaration is missing. This patch fixes the mismatch. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost.h | 1 + 1 file changed, 1 insertion

[dpdk-dev] [PATCH RFC 2/2] vhost: support selective datapath

2017-12-22 Thread Zhihong Wang
This patch introduces support for selective datapath in DPDK vhost-user lib to enable acceleration. The default selection is the existing software implementation, while more options are available when more engines are present. Signed-off-by: Zhihong Wang --- lib/librte_vhost/Makefile | 4

[dpdk-dev] [PATCH RFC 1/2] vhost: make capabilities configurable

2017-12-22 Thread Zhihong Wang
This patch makes vhost device capabilities configurable to adopt various engines. Such capabilities include supported features, protocol features, queue number. APIs are introduced to let app configure these capabilities. Signed-off-by: Zhihong Wang --- lib/librte_vhost/rte_vhost.h | 50

[dpdk-dev] [PATCH RFC 0/2] vhost: support selective datapath

2017-12-22 Thread Zhihong Wang
data structure is created, set the eid and did in the new_device callback. Zhihong Wang (2): vhost: make capabilities configurable vhost: support selective datapath lib/librte_vhost/Makefile | 4 +- lib/librte_vhost/rte_vdpa.h | 126 ++ lib

[dpdk-dev] [PATCH v3] vhost: support rx_queue_count

2017-05-25 Thread Zhihong Wang
This patch implements the ops rx_queue_count for vhost PMD by adding a helper function rte_vhost_rx_queue_count in vhost lib. The ops rx_queue_count gets vhost RX queue avail count and helps to understand the queue fill level. Signed-off-by: Zhihong Wang Acked-by: Ciara Loftus --- Changes in

[dpdk-dev] [PATCH v2] vhost: support rx_queue_count

2017-05-23 Thread Zhihong Wang
This patch implements the ops rx_queue_count for vhost PMD by adding a helper function rte_vhost_rx_queue_count in vhost lib. The ops rx_queue_count gets vhost RX queue avail count and helps to understand the queue fill level. Signed-off-by: Zhihong Wang --- Changes in v2: 1. Fixed a typo in

[dpdk-dev] [PATCH] vhost: support rx_queue_count

2017-05-22 Thread Zhihong Wang
This patch implements the ops rx_queue_count for vhost PMD by adding a helper function rte_vhost_rx_queue_count in vhost lib. The ops ops rx_queue_count gets vhost RX queue avail count and helps to understand the queue fill level. Signed-off-by: Zhihong Wang --- drivers/net/vhost

[dpdk-dev] [PATCH v2] config: make AVX and AVX512 configurable

2017-04-27 Thread Zhihong Wang
marked as experimental for now, will enable it after enough field test and possible optimization. Signed-off-by: Zhihong Wang --- Changes in v2: 1. Add comments and explanation. --- config/common_base | 8 mk/rte.cpuflags.mk | 6 ++ 2 files changed, 14 insertions(+) diff --gi

[dpdk-dev] [PATCH] config: make AVX and AVX512 configurable

2017-04-26 Thread Zhihong Wang
Making AVX and AVX512 configurable is useful for performance and power testing. The similar kernel patch at https://patchwork.kernel.org/patch/9618883/. Signed-off-by: Zhihong Wang --- config/common_base | 6 ++ mk/rte.cpuflags.mk | 6 ++ 2 files changed, 12 insertions(+) diff --git a

[dpdk-dev] [PATCH v2] eal: optimize aligned rte_memcpy

2016-12-07 Thread Zhihong Wang
, then "start" on one side and "start tx_first 32" on the other. Signed-off-by: Zhihong Wang --- .../common/include/arch/x86/rte_memcpy.h | 81 +- 1 file changed, 78 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/common/include/arch

[dpdk-dev] [PATCH] vhost: optimize vhost memcpy

2016-12-02 Thread Zhihong Wang
, by using loopback traffic between Vhost and Virtio. For example, increase TXONLY_DEF_PACKET_LEN to the requested packet size in testpmd.h, rebuild and start testpmd in both host and guest, then "start" on one side and "start tx_first 32" on the other. Signed-off-by: Zh

[dpdk-dev] [PATCH v6 6/6] vhost: optimize cache access

2016-09-19 Thread Zhihong Wang
an be saved per packet by this patch alone. Taking 64B packets traffic for example, this means about 60% efficiency improvement for the enqueue operation. Signed-off-by: Zhihong Wang --- Changes in v3: 1. Remove unnecessary memset which causes frontend stall on SNB & IVB. 2. Rename variables

[dpdk-dev] [PATCH v6 5/6] vhost: batch update used ring

2016-09-19 Thread Zhihong Wang
This patch enables batch update of the used ring for better efficiency. Signed-off-by: Zhihong Wang --- Changes in v6: 1. Introduce a function for used ring write. --- Changes in v4: 1. Free shadow used ring in the right place. 2. Add failure check for shadow used ring malloc. lib

[dpdk-dev] [PATCH v6 4/6] vhost: add desc prefetch

2016-09-19 Thread Zhihong Wang
This patch adds descriptor prefetch to hide cache access latency. Signed-off-by: Zhihong Wang --- lib/librte_vhost/virtio_net.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 0ada32b..f32a143 100644 --- a/lib

[dpdk-dev] [PATCH v6 3/6] vhost: remove useless volatile

2016-09-19 Thread Zhihong Wang
This patch removes useless volatile attribute to allow compiler optimization. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index c2dfc3c..9707dfc 100644 --- a/lib

[dpdk-dev] [PATCH v6 2/6] vhost: rewrite enqueue

2016-09-19 Thread Zhihong Wang
queue: * virtio_dev_merge_rx for mrg_rxbuf turned on cases. * virtio_dev_rx for mrg_rxbuf turned off cases. Having 2 callback paths increases maintenance effort. Also, the performance of the existing code is not optimal, especially when the mrg_rxbuf feature turned on. Signed-off-by: Zhihong Wang --- Ch

[dpdk-dev] [PATCH v6 1/6] vhost: fix windows vm hang

2016-09-19 Thread Zhihong Wang
. 2. Start a Windows VM image with qemu and connect to the vhost port. 3. Start io forwarding with tx_first in host testpmd. For 16.07 code, the Windows VM will hang once any packets are enqueued. Cc: Signed-off-by: Zhihong Wang --- Changes in v5: 1. Add details in commit log. lib

[dpdk-dev] [PATCH v6 0/6] vhost: optimize enqueue

2016-09-19 Thread Zhihong Wang
n into several small ones. 2. Use multiple patches to explain each optimization. 3. Add comments. Zhihong Wang (6): vhost: fix windows vm hang vhost: rewrite enqueue vhost: remove useless volatile vhost: add desc prefetch vhost: batch update used ring vhost: optimize cache access li

[dpdk-dev] [PATCH v5 6/6] vhost: optimize cache access

2016-09-08 Thread Zhihong Wang
This patch reorders the code to delay virtio header write to optimize cache access efficiency for cases where the mrg_rxbuf feature is turned on. It reduces CPU pipeline stall cycles significantly. Signed-off-by: Zhihong Wang --- Changes in v3: 1. Remove unnecessary memset which causes

[dpdk-dev] [PATCH v5 5/6] vhost: batch update used ring

2016-09-08 Thread Zhihong Wang
This patch enables batch update of the used ring for better efficiency. Signed-off-by: Zhihong Wang --- Changes in v4: 1. Free shadow used ring in the right place. 2. Add failure check for shadow used ring malloc. lib/librte_vhost/vhost.c | 20 -- lib/librte_vhost/vhost.h

[dpdk-dev] [PATCH v5 4/6] vhost: add desc prefetch

2016-09-08 Thread Zhihong Wang
This patch adds descriptor prefetch to hide cache access latency. Signed-off-by: Zhihong Wang --- lib/librte_vhost/virtio_net.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 6f63968..b38f18f 100644 --- a/lib

[dpdk-dev] [PATCH v5 3/6] vhost: remove useless volatile

2016-09-08 Thread Zhihong Wang
This patch removes useless volatile attribute to allow compiler optimization. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index c2dfc3c..9707dfc 100644 --- a/lib

[dpdk-dev] [PATCH v5 2/6] vhost: rewrite enqueue

2016-09-08 Thread Zhihong Wang
This patch implements the vhost logic from scratch into a single function designed for high performance and better maintainability. This is the baseline version of the new code, more optimization will be added in the following patches in this patch set. Signed-off-by: Zhihong Wang --- Changes

[dpdk-dev] [PATCH v5 1/6] vhost: fix windows vm hang

2016-09-08 Thread Zhihong Wang
. 2. Start a Windows VM image with qemu and connect to the vhost port. 3. Start io forwarding with tx_first in host testpmd. For 16.07 code, the Windows VM will hang once any packets are enqueued. Cc: Signed-off-by: Zhihong Wang --- Changes in v5: 1. Add details in commit log. lib

[dpdk-dev] [PATCH v5 0/6] vhost: optimize enqueue

2016-09-08 Thread Zhihong Wang
& IVB. 2. Rename variables to follow naming convention. 3. Rewrite enqueue and delete the obsolete in the same patch. --- Changes in v2: 1. Split the big function into several small ones. 2. Use multiple patches to explain each optimization. 3. Add comments. Zhihong Wang (6): vhost:

[dpdk-dev] [PATCH v4 6/6] vhost: optimize cache access

2016-08-29 Thread Zhihong Wang
2. Rename variables to follow naming convention. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost_rxtx.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c index ddc7b21..fc5dc4a 100644 --- a

[dpdk-dev] [PATCH v4 5/6] vhost: batch update used ring

2016-08-29 Thread Zhihong Wang
This patch enables batch update of the used ring for better efficiency. --- Changes in v4: 1. Free shadow used ring in the right place. 2. Add failure check for shadow used ring malloc. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost-net.h | 4 +++ lib/librte_vhost/vhost_rxtx.c

[dpdk-dev] [PATCH v4 4/6] vhost: add desc prefetch

2016-08-29 Thread Zhihong Wang
This patch adds descriptor prefetch to hide cache access latency. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost_rxtx.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c index 629e8ae..927896c 100644 --- a/lib

[dpdk-dev] [PATCH v4 3/6] vhost: remove useless volatile

2016-08-29 Thread Zhihong Wang
This patch removes useless volatile attribute to allow compiler optimization. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost-net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost-net.h b/lib/librte_vhost/vhost-net.h index 38593a2..51fdf3d

[dpdk-dev] [PATCH v4 2/6] vhost: rewrite enqueue

2016-08-29 Thread Zhihong Wang
for clearer logic. 2. Add PRINT_PACKET for debugging. --- Changes in v3: 1. Rewrite enqueue and delete the obsolete in the same patch. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost_rxtx.c | 525 -- 1 file changed, 145 insertions(+), 380

[dpdk-dev] [PATCH v4 1/6] vhost: fix windows vm hang

2016-08-29 Thread Zhihong Wang
port. 3. Start io forwarding with tx_first in host testpmd. For 16.07 code, the Windows VM will hang once any packets are enqueued. Cc: Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost_rxtx.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib

[dpdk-dev] [PATCH v4 0/6] vhost: optimize enqueue

2016-08-29 Thread Zhihong Wang
ple patches to explain each optimization. 3. Add comments. Zhihong Wang (6): vhost: fix windows vm hang vhost: rewrite enqueue vhost: remove useless volatile vhost: add desc prefetch vhost: batch update used ring vhost: optimize cache access lib/librte_vhost/vhost-net.h | 6 +- li

[dpdk-dev] [PATCH v3 5/5] vhost: optimize cache access

2016-08-19 Thread Zhihong Wang
2. Rename variables to follow naming convention. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost_rxtx.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c index c4abaf1..e3ba4e0 100644 --- a

[dpdk-dev] [PATCH v3 4/5] vhost: batch update used ring

2016-08-19 Thread Zhihong Wang
This patch enables batch update of the used ring for better efficiency. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost-net.h | 4 +++ lib/librte_vhost/vhost_rxtx.c | 68 +-- lib/librte_vhost/virtio-net.c | 15 -- 3 files changed, 68

[dpdk-dev] [PATCH v3 3/5] vhost: add desc prefetch

2016-08-19 Thread Zhihong Wang
This patch adds descriptor prefetch to hide cache access latency. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost_rxtx.c | 5 + 1 file changed, 5 insertions(+) diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c index b09a9c3..7523b2d 100644 --- a/lib

[dpdk-dev] [PATCH v3 2/5] vhost: remove useless volatile

2016-08-19 Thread Zhihong Wang
This patch removes useless volatile attribute to allow compiler optimization. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost-net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost-net.h b/lib/librte_vhost/vhost-net.h index 38593a2..51fdf3d

[dpdk-dev] [PATCH v3 1/5] vhost: rewrite enqueue

2016-08-19 Thread Zhihong Wang
This patch implements the vhost logic from scratch into a single function designed for high performance and better maintainability. --- Changes in v3: 1. Rewrite enqueue and delete the obsolete in the same patch. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost_rxtx.c | 537

[dpdk-dev] [PATCH v3 0/5] vhost: optimize enqueue

2016-08-19 Thread Zhihong Wang
1. Split the big function into several small ones. 2. Use multiple patches to explain each optimization. 3. Add comments. Zhihong Wang (5): vhost: rewrite enqueue vhost: remove useless volatile vhost: add desc prefetch vhost: batch update used ring vhost: optimize cache acc

[dpdk-dev] [PATCH v2 6/6] vhost: optimize cache access

2016-08-18 Thread Zhihong Wang
This patch reorders the code to delay virtio header write to optimize cache access efficiency for cases where the mrg_rxbuf feature is turned on. It reduces CPU pipeline stall cycles significantly. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost_rxtx.c | 23 --- 1

[dpdk-dev] [PATCH v2 5/6] vhost: batch update used ring

2016-08-18 Thread Zhihong Wang
This patch enables batch update of the used ring for better efficiency. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost-net.h | 4 +++ lib/librte_vhost/vhost_rxtx.c | 68 +-- lib/librte_vhost/virtio-net.c | 15 -- 3 files changed, 68

[dpdk-dev] [PATCH v2 4/6] vhost: add desc prefetch

2016-08-18 Thread Zhihong Wang
This patch adds descriptor prefetch to hide cache access latency. Signed-off-by: Zhihong Wang --- lib/librte_vhost/vhost_rxtx.c | 5 + 1 file changed, 5 insertions(+) diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c index 939957d..7db83d0 100644 --- a/lib

  1   2   >