[dpdk-dev] [PATCH] doc/vhost: update zero copy perfromance tip

2018-04-26 Thread Junjie Chen
In VM2NIC case zero copy may need some tuning to get best performance. This patch describes the zero copy starved case and provides a tuning tip. Signed-off-by: Junjie Chen --- doc/guides/prog_guide/vhost_lib.rst | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff

[dpdk-dev] [PATCH v6 2/2] net/vhost: update license to SPDX format

2018-04-12 Thread Junjie Chen
Update license to SPDX, also add Intel license. Signed-off-by: Junjie Chen --- drivers/net/vhost/rte_eth_vhost.c | 34 +++--- drivers/net/vhost/rte_eth_vhost.h | 35 +++ 2 files changed, 6 insertions(+), 63 deletions(-) diff --git a

[dpdk-dev] [PATCH v6 2/2] net/vhost: update license to SPDX format

2018-04-12 Thread Junjie Chen
Update license to SPDX, also add Intel license. Signed-off-by: Junjie Chen --- drivers/net/vhost/rte_eth_vhost.c | 34 +++--- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index

[dpdk-dev] [PATCH v6 1/2] vhost: add support for interrupt mode

2018-04-12 Thread Junjie Chen
register a epoll event fd to associate rx queues with interrupt vectors. Signed-off-by: Junjie Chen --- Changes in v6: - rebase code to master Changes in v5: - update license to DPDK new license format - rebase code to master Changes in v4: - revert back license change Changes in v3: - handle failure

[dpdk-dev] [PATCH] net/i40e: update tx_free_threshold to improve zero copy performance

2018-04-11 Thread Junjie Chen
From: "Chen, Junjie" When vhost backend works in dequeue zero copy mode, nic locks virtio's buffer until there is less or equal than tx_free_threshold buffer remain and then free number of tx burst buffer. This causes packets drop in virtio side and impacts zero copy performance. So we need to in

[dpdk-dev] [PATCH] eal: force gcc to inline rte_movX function

2018-04-11 Thread Junjie Chen
From: "Chen, Junjie" Sometimes gcc does not inline the function despite keyword *inline*, we obeserve rte_movX is not inline when doing performance profiling, so use *always_inline* keyword to force gcc to inline the function. Signed-off-by: Chen, Junjie --- .../common/include/arch/x86/rte_mem

[dpdk-dev] [PATCH v3] net/vhost: fix vhost invalid state

2018-04-11 Thread Junjie Chen
* but by queues pointers or other separated variable(s). Fixes: 30a701a53737 ("net/vhost: fix crash when creating vdev dynamically") Signed-off-by: Junjie Chen Tested-by: Jens Freimann --- Changes in v3: - remove useless log in queue status showing Changes in v2: - use started to deter

[dpdk-dev] [PATCH v2] net/vhost: fix vhost invalid state

2018-04-10 Thread Junjie Chen
* but by queues pointers or other separated variable(s). Fixes: 30a701a53737 ("net/vhost: fix crash when creating vdev dynamically") Signed-off-by: Junjie Chen --- Changes in v2: - use started to determine vhost queues readiness - revert setting started to zero in destroy_device d

[dpdk-dev] [PATCH] net/vhost: fix vhost invalid state

2018-04-09 Thread Junjie Chen
* but by queues pointers or other separated variable(s). Fixes: 30a701a53737 ("net/vhost: fix crash when creating vdev dynamically") Signed-off-by: Junjie Chen --- drivers/net/vhost/rte_eth_vhost.c | 64 +++ 1 file changed, 38 insertions(+), 26

[dpdk-dev] [PATCH v5] vhost: add support for interrupt mode

2018-04-08 Thread Junjie Chen
register a epoll event fd to associate rx queues with interrupt vectors. Signed-off-by: Junjie Chen --- Changes in v5: - update license to DPDK new license format - rebase code to master Changes in v4: - revert back license change Changes in v3: - handle failure in the middle of intr setup. - use

[dpdk-dev] [PATCH v4] vhost: add support for interrupt mode

2018-04-03 Thread Junjie Chen
register a epoll event fd to associate rx queues with interrupt vectors. Signed-off-by: Junjie Chen --- Changes in v4: - revert back license change Changes in v3: - handle failure in the middle of intr setup. - use vhost API to enable interrupt. - rebase to check rxq existence. - update vhost API to

[dpdk-dev] [PATCH v3] vhost: add support for interrupt mode

2018-04-03 Thread Junjie Chen
register a epoll event fd to associate rx queues with interrupt vectors. Signed-off-by: Junjie Chen --- Changes in v3: - handle failure in the middle of intr setup. - use vhost API to enable interrupt. - rebase to check rxq existence. - update vhost API to support guest notification. Changes in v2

[dpdk-dev] [PATCH v3] net/vhost: fix segfault when creating vdev dynamically

2018-03-29 Thread Junjie Chen
When creating vdev dynamically, vhost pmd driver starts directly without checking TX/RX queues are ready or not, and thus causes segmentation fault when vhost library accesses queues. This patch adds a flag to check whether queues are setup or not, and adds queues setup into dev_start function to a

[dpdk-dev] [PATCH v2] net/vhost: fix segfault when creating vdev dynamically

2018-03-29 Thread Junjie Chen
it after setting up queue. Signed-off-by: Junjie Chen --- Changes in v2: - check queue status in new_device, create queue in dev_start if not setup yet drivers/net/vhost/rte_eth_vhost.c | 73 --- 1 file changed, 53 insertions(+), 20 deletions(-) diff --git a

[dpdk-dev] [PATCH v2] vhost: add support for interrupt mode

2018-03-28 Thread Junjie Chen
register a epoll event fd to associate rx queues with interrupt vectors. Signed-off-by: Junjie Chen --- Changes in v2: - update rx queue index - fill efd_counter_size for intr handler - update log drivers/net/vhost/rte_eth_vhost.c | 130 ++ 1 file changed, 130

[dpdk-dev] [PATCH] net/vhost: fix segfault when creating vdev dynamically

2018-03-27 Thread Junjie Chen
it after setting up queue. Fixes: aed0b12930b33("net/vhost: fix socket file deleted on stop") Signed-off-by: Junjie Chen --- drivers/net/vhost/rte_eth_vhost.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/net/vhost/rte_eth_vhost.c

[dpdk-dev] [PATCH v4] doc: add driver limitation for vhost dequeue zero copy

2018-03-14 Thread Junjie Chen
In vhost-switch example, when binding nic to vfio-pci with iommu enabled, dequeue zero copy cannot work in VM2NIC mode due to no iommu dma mapping is setup for guest memory currently. Signed-off-by: Junjie Chen --- Changes in V4: - make words more accurate Changes in V3: - update limitation to

[dpdk-dev] [PATCH v3] doc: add driver limitation for vhost dequeue zero copy

2018-03-08 Thread Junjie Chen
In vhost-switch example, when binding nic to vfio-pci with iommu enabled, dequeue zero copy cannot work in VM2NIC mode due to no iommu dma mapping is setup for guest memory currently. Signed-off-by: Junjie Chen --- Changes in V3: - update limitation to iommu Changes in V2: - add doc in vhost lib

[dpdk-dev] [PATCH v2] doc: add driver limitation for vhost dequeue zero copy

2018-02-26 Thread Junjie Chen
In vhost-switch example, when binding nic to vfio-pci, dequeue zero copy cannot work in VM2NIC mode due to no iommu dma mapping is setup for guest memory currently. Signed-off-by: Junjie Chen --- Changes in V2: - add doc in vhost lib doc/guides/prog_guide/vhost_lib.rst | 3 +++ doc/guides

[dpdk-dev] [PATCH] doc: add driver limitation for vhost dequeue zero copy

2018-02-23 Thread Junjie Chen
In vhost-switch example, when binding nic to vfio-pci, dequeue zero copy cannot work in VM2NIC mode due to no iommu dma mapping is setup for guest memory currently. Signed-off-by: Junjie Chen --- doc/guides/sample_app_ug/vhost.rst | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[dpdk-dev] [PATCH] vhost: add support for interrupt mode

2018-02-21 Thread Junjie Chen
register a epoll event fd to associate rx queues with interrupt vectors. Signed-off-by: Junjie Chen --- drivers/net/vhost/rte_eth_vhost.c | 116 ++ 1 file changed, 116 insertions(+) diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost

[dpdk-dev] [PATCH v2] vhost: dequeue zero copy should restore mbuf before return to pool

2018-01-17 Thread Junjie Chen
dequeue zero copy change buf_addr and buf_iova of mbuf, and return to mbuf pool without restore them, it breaks vm memory if others allocate mbuf from same pool since mbuf reset doesn't reset buf_addr and buf_iova. Signed-off-by: Junjie Chen --- v2 changes: Remove useless restore

[dpdk-dev] [PATCH] vhost: dequeue zero copy should restore mbuf before return to pool

2018-01-16 Thread Junjie Chen
dequeue zero copy change buf_addr and buf_iova of mbuf, and return to mbuf pool without restore them, it breaks vm memory if others allocate mbuf from same pool since mbuf reset doesn't reset buf_addr and buf_iova. Signed-off-by: Junjie Chen --- lib/librte_vhost/virtio_net.c

[dpdk-dev] [PATCH] vhost: do deep copy while reallocate vq

2018-01-14 Thread Junjie Chen
When vhost reallocate dev and vq for NUMA enabled case, it doesn't perform deep copy, which lead to 1) zmbuf list not valid 2) remote memory access. This patch is to re-initlize the zmbuf list and also do the deep copy. Signed-off-by: Junjie Chen --- lib/librte_vhost/vhost_user.c

[dpdk-dev] [PATCH v7] vhost: support virtqueue interrupt/notification suppression

2018-01-08 Thread Junjie Chen
interrupt when index reach used_event. The device can suppress notification in a manner analogous to the ways driver suppress interrupt. The device manipulates flags or avail_event in the used ring in the same way the driver manipulates flags or used_event in available ring. Signed-off-by: Junjie Chen

[dpdk-dev] [PATCH v2] examples/vhost: fix sending arp packet to self

2017-12-28 Thread Junjie Chen
ARP packets are not dropped when dest vdev is itself, which breaks RX ring inconspicuously. Fixes: 9c5ef51207c6 ("examples/vhost: handle broadcast packet") Signed-off-by: Junjie Chen --- v2: - Add fixline in commit message. examples/vhost/main.c | 3 ++- 1 file changed, 2 insert

[dpdk-dev] [PATCH] examples/vhost: fix sending arp packet to self

2017-12-28 Thread Junjie Chen
ARP packets are not dropped when dest vdev is itself, which breaks RX ring inconspicuously. Signed-off-by: Junjie Chen --- examples/vhost/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 89a61f0..10a7f5d 100644

[dpdk-dev] [PATCH v6] vhost: support virtqueue interrupt/notification suppression

2017-12-26 Thread Junjie Chen
feature in vhost. Signed-off-by: Junjie Chen v6: Use volatile qualifier to access avail event idx. v5: Remove updating avail event index in backend. v2-v4: Use definition of VIRTIO_F_EVENT_IDX from kernel. --- lib/librte_vhost/vhost.h | 3 +++ lib/librte_vhost/virtio_net.c | 46

[dpdk-dev] [PATCH v5] vhost: support virtqueue interrupt/notification suppression

2017-12-23 Thread Junjie Chen
feature in vhost. Signed-off-by: Junjie Chen v5: Remove updating avail event index in backend. v2-v4: Use definition of VIRTIO_F_EVENT_IDX from kernel. --- lib/librte_vhost/Makefile | 1 + lib/librte_vhost/vhost.h | 3 +++ lib/librte_vhost/virtio_net.c | 47

[dpdk-dev] [PATCH] vhost: fix dequeue zero copy not work with virtio1

2017-12-13 Thread Junjie Chen
This fix dequeue zero copy can not work with Qemu version >= 2.7. Since from Qemu 2.7 virtio device use virtio-1 protocol, the zero copy code path forget to add offset to buffer address. Signed-off-by: Junjie Chen --- lib/librte_vhost/virtio_net.c | 3 ++- 1 file changed, 2 insertions(+)

[dpdk-dev] [PATCH v3] doc: add a restriction to multi-process support

2017-11-29 Thread Junjie Chen
This patch add a restriction to multi-process support: secondary processes should only run alongside primary process with same DPDK version, so that secondary processes can use the same hugepage mmap layout as primary process. Signed-off-by: Junjie Chen --- v3 changes: Use 'note' mark