[dpdk-dev] [PATCH v6 0/9] virtio 1.0 enabling for virtio pmd driver

2016-02-02 Thread Yuanhan Liu
On Tue, Feb 02, 2016 at 11:46:54AM +0100, Thomas Monjalon wrote: > Hi Yuanhan, > > I wanted to apply these patches but I see few checkpatch warnings, > inluding a typo. > Sometimes I fix them myself but I guess you would prefer checking it. Okay; I will fix them all. --yliu

[dpdk-dev] [PATCH v7 0/9] virtio 1.0 enabling for virtio pmd driver

2016-02-02 Thread Yuanhan Liu
n: Len=10 ==> Capabilities: [50] Vendor Specific Information: Len=10 ==> Capabilities: [40] Vendor Specific Information: Len=10 Kernel driver in use: virtio-pci Kernel modules: virtio_pci After that, there wasn't anything speical comparing to the old virtio 0.95 pmd driver. --- Y

[dpdk-dev] [PATCH v7 1/9] virtio: don't set vring address again at queue startup

2016-02-02 Thread Yuanhan Liu
As we have already set up it at virtio_dev_queue_setup(), and a vq restart will not reset the settings. Signed-off-by: Yuanhan Liu Tested-by: Qian Xu Reviewed-by: Tetsuya Mukawa Tested-by: Tetsuya Mukawa Acked-by: Huawei Xie --- drivers/net/virtio/virtio_rxtx.c | 15 --- 1 file

[dpdk-dev] [PATCH v7 2/9] virtio: define offset as size_t type

2016-02-02 Thread Yuanhan Liu
offset arg of vtpci_read/write_dev_config is derived from offsetof(), which is of size_t type, instead of uint64_t. So, define it as size_t type. Signed-off-by: Yuanhan Liu Tested-by: Qian Xu Reviewed-by: Tetsuya Mukawa Tested-by: Tetsuya Mukawa Acked-by: Huawei Xie --- drivers/net/virtio

[dpdk-dev] [PATCH v7 3/9] virtio: introduce struct virtio_pci_ops

2016-02-02 Thread Yuanhan Liu
ets hw->vtpci_ops to legacy_ops as we don't support 1.0 yet. Signed-off-by: Yuanhan Liu Tested-by: Qian Xu Reviewed-by: Tetsuya Mukawa Tested-by: Tetsuya Mukawa Acked-by: Huawei Xie --- v5: - define "src" arg of vtpci_write_dev_config() --- drivers/net/virtio/virtio_ethdev.c |

[dpdk-dev] [PATCH v7 4/9] virtio: move left pci stuff to virtio_pci.c

2016-02-02 Thread Yuanhan Liu
virtio_pci.c is a more proper place for pci stuff; virtio_ethdev is not. Signed-off-by: Yuanhan Liu Tested-by: Qian Xu Reviewed-by: Tetsuya Mukawa Tested-by: Tetsuya Mukawa Acked-by: Huawei Xie --- drivers/net/virtio/virtio_ethdev.c | 265 +--- drivers/net

[dpdk-dev] [PATCH v7 5/9] viritio: switch to 64 bit features

2016-02-02 Thread Yuanhan Liu
Switch to 64 bit features, which virtio 1.0 supports. While legacy virtio only supports 32 bit features, it complains aloud and quit when trying to setting > 32 bit features. Signed-off-by: Yuanhan Liu Tested-by: Qian Xu Reviewed-by: Tetsuya Mukawa Tested-by: Tetsuya Mukawa Acked-by: Hua

[dpdk-dev] [PATCH v7 6/9] virtio: retrieve hdr_size from hw->vtnet_hdr_size

2016-02-02 Thread Yuanhan Liu
ueue_burst() and virtio_recv_pkts(), leading a packet corruption. Instead, we should retrieve it from hw->vtnet_hdr_size; we will do proper settings at eth_virtio_dev_init() in later patches. Signed-off-by: Yuanhan Liu Tested-by: Qian Xu Reviewed-by: Tetsuya Mukawa Tested-by: Tetsuya

[dpdk-dev] [PATCH v7 7/9] eal: pci: export pci_[un]map_device

2016-02-02 Thread Yuanhan Liu
() will fail, which ends up with virtio pmd driver being skipped. Therefore, we can not set RTE_PCI_DRV_NEED_MAPPING blindly at virtio pmd driver. Therefore, this patch exports pci_map_device, and let virtio pmd call it when necessary. Cc: David Marchand Signed-off-by: Yuanhan Liu Tested

[dpdk-dev] [PATCH v7 8/9] virtio: add 1.0 support

2016-02-02 Thread Yuanhan Liu
works. Besides those changes, virtio 1.0 introduces a new status field: FEATURES_OK, which is set after features negotiation is done. Last, set the VIRTIO_F_VERSION_1 feature flag. Signed-off-by: Yuanhan Liu Tested-by: Qian Xu Reviewed-by: Tetsuya Mukawa Tested-by: Tetsuya Mukawa Acked-by: Huaw

[dpdk-dev] [PATCH v7 9/9] virtio: move VIRTIO_READ/WRITE_REG_X into virtio_pci.c

2016-02-02 Thread Yuanhan Liu
virtio_pci.c is the only file references those macros; move them there. Signed-off-by: Yuanhan Liu Tested-by: Qian Xu Reviewed-by: Tetsuya Mukawa Tested-by: Tetsuya Mukawa Acked-by: Huawei Xie --- drivers/net/virtio/virtio_pci.c | 19 +++ drivers/net/virtio/virtio_pci.h | 18

[dpdk-dev] [PATCH v6 1/8] eal: pci: add api to rd/wr pci bar region

2016-02-03 Thread Yuanhan Liu
On Tue, Feb 02, 2016 at 09:48:44PM +0530, Santosh Shukla wrote: > On Tue, Feb 2, 2016 at 9:21 PM, Santosh Shukla wrote: > > On Tue, Feb 2, 2016 at 2:19 PM, Yuanhan Liu > linux.intel.com> wrote: > >> On Tue, Feb 02, 2016 at 06:50:18AM +0100, David Marchand wrote: > >

[dpdk-dev] [PATCH v6 1/8] eal: pci: add api to rd/wr pci bar region

2016-02-03 Thread Yuanhan Liu
On Wed, Feb 03, 2016 at 03:20:09PM +0530, Santosh Shukla wrote: > On Tue, Feb 2, 2016 at 9:48 PM, Santosh Shukla wrote: > > On Tue, Feb 2, 2016 at 9:21 PM, Santosh Shukla > > wrote: > >> On Tue, Feb 2, 2016 at 2:19 PM, Yuanhan Liu >> linux.intel.com> wrote: &g

[dpdk-dev] PING: [PATCH v2] pmd/virtio: fix cannot start virtio dev after stop

2016-02-04 Thread Yuanhan Liu
the issue that virtio device cannot be started after stopped. > > > > The field, hw->started, should be changed by virtio_dev_start/stop instead > > of virtio_dev_close. > > > > Reported-by: Pavel Fedin > > Signed-off-by: Jianfeng Tan > > Acked-by: Yuanh

[dpdk-dev] [PATCH v8 1/2] ethdev: Add a new event type to notify a queue state changed event

2016-02-06 Thread Yuanhan Liu
/**< queue state changed interrupt */ Though it's defined to be a generic event, you might need to note in the comment that vhost-pmd is the only user so far. Anyway, it looks good to me: Reviewed-by: Yuanhan Liu --yliu

[dpdk-dev] [PATCH v8 2/2] vhost: Add VHOST PMD

2016-02-06 Thread Yuanhan Liu
mp/sock0 \ > -netdev vhost-user,id=net0,chardev=chr0,vhostforce,queues=1 \ > -device virtio-net-pci,netdev=net0,mq=on > > Signed-off-by: Tetsuya Mukawa > Acked-by: Ferruh Yigit Acked-by: Yuanhan Liu Thanks. --yliu

[dpdk-dev] [PATCH v2 1/1] vhost: fix leak of fds and mmaps

2016-02-06 Thread Yuanhan Liu
Hey Rich, Sorry for the long delay; I barely forgot it :( On Tue, Jan 19, 2016 at 10:13:23AM -0800, Rich Lane wrote: > On Sun, Jan 17, 2016 at 11:58 PM, Yuanhan Liu > wrote: > > On Sun, Jan 17, 2016 at 11:57:18AM -0800, Rich Lane wrote: > > +/* > > + *

[dpdk-dev] [PATCH] vhost: remove vhost_net_device_ops

2016-02-15 Thread Yuanhan Liu
On Wed, Feb 10, 2016 at 11:27:08AM -0800, Rich Lane wrote: > The indirection is unnecessary because there is only one implementation of the > vhost common code. Removing it makes the code more readable. This is a good cleanup! A minor nit is that I saw few long lines exceeding 80 chars.

[dpdk-dev] [PATCH v3 4/4] virtio: use pci ioport api

2016-02-16 Thread Yuanhan Liu
On Mon, Feb 15, 2016 at 02:24:26PM +0100, David Marchand wrote: > Move all os / arch specifics to eal. Great stuff; something I want to do long time ago! So, thank you, and Acked-by: Yuanhan Liu --yliu

[dpdk-dev] [PATCH v3 3/4] eal: introduce pci ioport api

2016-02-16 Thread Yuanhan Liu
On Mon, Feb 15, 2016 at 02:24:25PM +0100, David Marchand wrote: > +/** > + * A structure used to access io resources for a pci device. > + * rte_pci_ioport is arch, os, driver specific, and should not be used > outside > + * of pci ioport api. > + */ > +struct rte_pci_ioport { > + struct

[dpdk-dev] [PATCH v7 2/4] virtio: Introduce config RTE_VIRTIO_INC_VECTOR

2016-02-16 Thread Yuanhan Liu
On Mon, Feb 15, 2016 at 04:48:36PM +0530, Santosh Shukla wrote: > Hi Yuanhan, > > On Mon, Feb 15, 2016 at 4:27 PM, Yuanhan Liu > wrote: > > On Mon, Feb 15, 2016 at 03:22:11PM +0530, Santosh Shukla wrote: > >> Hi Yuanhan, > >> > >> I guess you are bac

[dpdk-dev] dpdk: vhost/virtio staging/testing tree

2016-02-16 Thread Yuanhan Liu
On Fri, Feb 12, 2016 at 01:54:21PM +0200, Victor Kaplansky wrote: > Hi! Hi Victor, > Since I was maintaining an internal tree with patches related to > vhost/virtio, I decided to make this staging tree public. It is > useful to me and I hope it will be useful to others. > > Collecting patches

[dpdk-dev] [PATCH v3 3/4] eal: introduce pci ioport api

2016-02-16 Thread Yuanhan Liu
On Tue, Feb 16, 2016 at 07:09:49AM +0100, David Marchand wrote: > On Tue, Feb 16, 2016 at 3:36 AM, Yuanhan Liu > wrote: > > On Mon, Feb 15, 2016 at 02:24:25PM +0100, David Marchand wrote: > >> +/** > >> + * A structure used to access io resources for a pci device. &

[dpdk-dev] [PATCH v2] vhost: remove vhost_net_device_ops

2016-02-17 Thread Yuanhan Liu
On Tue, Feb 16, 2016 at 02:45:04PM -0800, Rich Lane wrote: > The indirection is unnecessary because there is only one implementation > of the vhost common code. Removing it makes the code more readable. > > Signed-off-by: Rich Lane Acked-by: Yuanhan Liu Thanks. --yliu

[dpdk-dev] [PATCH 0/5 for 2.3] vhost rxtx refactor

2016-02-18 Thread Yuanhan Liu
On Wed, Feb 17, 2016 at 11:50:22PM +0100, Thomas Monjalon wrote: > Hi Yuanhan, > > 2015-12-03 14:06, Yuanhan Liu: > > Vhost rxtx code is derived from vhost-switch example, which is very > > likely the most messy code in DPDK. Unluckily, the move also brings > > over th

[dpdk-dev] [PATCH] vhost: add missing build dependency on librte_net

2016-02-18 Thread Yuanhan Liu
or directory > > Fixes: d0cf91303d73 ("vhost: add Tx offload capabilities") > Signed-off-by: Panu Matilainen Acked-by: Yuanhan Liu Thanks. BTW, please cc me for virtio/vhost patches next time, otherwise, it's easily got overlooked: too many emails. --yliu

[dpdk-dev] [PATCH v2 0/7] vhost rxtx refactor

2016-02-18 Thread Yuanhan Liu
esc fields, to make vhost robust and be protected from malicious guest or abnormal use cases. It's key data path changes, and I have done some test to make sure it doesn't break something. However, more test are welcome! --- Yuanhan Liu (7): vhost: refactor rte_vhost_dequeue_burst vhost

[dpdk-dev] [PATCH v2 1/7] vhost: refactor rte_vhost_dequeue_burst

2016-02-18 Thread Yuanhan Liu
_avail and desc_offset var: desc_avail = desc->len - vq->vhost_hlen; desc_offset = vq->vhost_hlen; This refactor makes the code much more readable (IMO), yet it reduces binary code size (nearly 2K). Signed-off-by: Yuanhan Liu --- v2: - fix potential NULL dereference bug of var &

[dpdk-dev] [PATCH v2 2/7] vhost: refactor virtio_dev_rx

2016-02-18 Thread Yuanhan Liu
This is a simple refactor, as there isn't any twisted logic in old code. Here I just broke the code and introduced two helper functions, reserve_avail_buf() and copy_mbuf_to_desc() to make the code more readable. Also, it saves nearly 1K bytes of binary code size. Signed-off-by: Yuanhan Liu

[dpdk-dev] [PATCH v2 3/7] vhost: refactor virtio_dev_merge_rx

2016-02-18 Thread Yuanhan Liu
); } This patch reduces quite many lines of code, therefore, make it much more readable. Signed-off-by: Yuanhan Liu --- lib/librte_vhost/vhost_rxtx.c | 390 ++ 1 file changed, 163 insertions(+), 227 deletions(-) diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib

[dpdk-dev] [PATCH v2 4/7] vhost: do not use rte_memcpy for virtio_hdr copy

2016-02-18 Thread Yuanhan Liu
rte_memcpy() is inlined, it increases the binary code size linearly every time we call it at a different place. Replacing the two rte_memcpy() with directly copy saves nearly 12K bytes of code size! Signed-off-by: Yuanhan Liu --- lib/librte_vhost/vhost_rxtx.c | 17 + 1 file changed, 13

[dpdk-dev] [PATCH v2 5/7] vhost: don't use unlikely for VIRTIO_NET_F_MRG_RXBUF detection

2016-02-18 Thread Yuanhan Liu
VIRTIO_NET_F_MRG_RXBUF is a default feature supported by vhost. Adding unlikely for VIRTIO_NET_F_MRG_RXBUF detection doesn't make sense to me at all. Signed-off-by: Yuanhan Liu --- lib/librte_vhost/vhost_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v2 6/7] vhost: do sanity check for desc->len

2016-02-18 Thread Yuanhan Liu
igger this issue, as all huge pages are reset to 0 during DPDK re-init, leading to desc->len being 0. Therefore, this patch does a sanity check for desc->len, to make vhost robust. Reported-by: Rich Lane Signed-off-by: Yuanhan Liu --- lib/librte_vhost/vhost_rxtx.c | 9 + 1 file c

[dpdk-dev] [PATCH v2 7/7] vhost: do sanity check for desc->next

2016-02-18 Thread Yuanhan Liu
A malicious guest may easily forge some illegal vring desc buf. To make our vhost robust, we need make sure desc->next will not go beyond the vq->desc[] array. Suggested-by: Rich Lane Signed-off-by: Yuanhan Liu --- lib/librte_vhost/vhost_rxtx.c | 15 +++ 1 file chang

[dpdk-dev] [PATCH] vhost: add missing build dependency on librte_net

2016-02-18 Thread Yuanhan Liu
On Thu, Feb 18, 2016 at 03:39:26PM +0200, Panu Matilainen wrote: > On 02/18/2016 03:25 PM, Yuanhan Liu wrote: > >On Thu, Feb 18, 2016 at 11:47:43AM +0200, Panu Matilainen wrote: > >>Commit d0cf91303d73 added dependency on librte_net headers to vhost > >>but did not add

[dpdk-dev] [PATCH] vhost: add missing build dependency on librte_net

2016-02-19 Thread Yuanhan Liu
On Thu, Feb 18, 2016 at 04:07:52PM +0200, Panu Matilainen wrote: > >I didn't see the author was cc'ed from my email client: > > > > Date: Thu, 18 Feb 2016 11:47:43 +0200 > > From: Panu Matilainen > > To: dev at dpdk.org > > Subject: [dpdk-dev] [PATCH] vhost: add missing build

[dpdk-dev] [PATCH v7 2/4] virtio: Introduce config RTE_VIRTIO_INC_VECTOR

2016-02-19 Thread Yuanhan Liu
On Fri, Feb 19, 2016 at 10:16:42AM +0530, Santosh Shukla wrote: > On Tue, Feb 16, 2016 at 8:35 AM, Yuanhan Liu > wrote: > > On Mon, Feb 15, 2016 at 04:48:36PM +0530, Santosh Shukla wrote: > >> Hi Yuanhan, > >> > >> On Mon, Feb 15, 2016 at 4:27 PM, Yuanhan

[dpdk-dev] [PATCH v3 6/8] vhost: handle VHOST_USER_SEND_RARP request

2016-02-19 Thread Yuanhan Liu
On Fri, Feb 19, 2016 at 02:11:36PM +0800, Tan, Jianfeng wrote: > Hi Yuanhan, > > On 1/29/2016 12:58 PM, Yuanhan Liu wrote: > >While in former patch we enabled GUEST_ANNOUNCE feature, so that the > >guest OS will broadcast a GARP message after migration to notify the &g

[dpdk-dev] [PATCH RFC 2/4] vhost: make buf vector for scatter RX local.

2016-02-19 Thread Yuanhan Liu
On Fri, Feb 19, 2016 at 09:32:41AM +0300, Ilya Maximets wrote: > Array of buf_vector's is just an array for temporary storing information > about available descriptors. It used only locally in virtio_dev_merge_rx() > and there is no reason for that array to be shared. > > Fix that by allocating

[dpdk-dev] [PATCH RFC 4/4] doc: add note about rte_vhost_enqueue_burst thread safety.

2016-02-19 Thread Yuanhan Liu
On Fri, Feb 19, 2016 at 09:32:43AM +0300, Ilya Maximets wrote: > Signed-off-by: Ilya Maximets > --- > doc/guides/prog_guide/thread_safety_dpdk_functions.rst | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/doc/guides/prog_guide/thread_safety_dpdk_functions.rst >

[dpdk-dev] [PATCH v3 6/8] vhost: handle VHOST_USER_SEND_RARP request

2016-02-19 Thread Yuanhan Liu
On Fri, Feb 19, 2016 at 03:03:26PM +0800, Yuanhan Liu wrote: > On Fri, Feb 19, 2016 at 02:11:36PM +0800, Tan, Jianfeng wrote: > > What I suggest here is to move user_send_rarp() to rte_vhost_dequeue_burst() > > using a flag to control, so that this arp packet can be broadcasted in

[dpdk-dev] [PATCH] doc: fix vhost bad section number references

2016-02-22 Thread Yuanhan Liu
On Sat, Feb 20, 2016 at 12:12:50PM +0100, Mauricio Vasquez B wrote: > Section numbers were "hard-coded". This patch adds them as hyperlinks. Good catch. Thanks. Acked-by: Yuanhan Liu --yliu

[dpdk-dev] [PATCH v3 2/8] vhost: introduce vhost_log_write

2016-02-22 Thread Yuanhan Liu
On Fri, Feb 19, 2016 at 03:26:36PM +0100, Thomas Monjalon wrote: > 2016-01-29 12:57, Yuanhan Liu: > > Introduce vhost_log_write() helper function to log the dirty pages we > > touched. Page size is harded code to 4096 (VHOST_LOG_PAGE), and each > > log is presented by 1 bi

[dpdk-dev] [PATCH v3 0/8] vhost-user live migration support

2016-02-22 Thread Yuanhan Liu
On Mon, Feb 22, 2016 at 10:56:42AM +0100, Thomas Monjalon wrote: > > > Patches 2 and 3 have been merged to avoid a compilation error. > > > Applied, thanks > > > > Actually, there was a ongoing discussion about patch 6, the handling > > of VHOST_USER_SEND_RARP request: > > > >

[dpdk-dev] [PATCH] vhost: broadcast RARP pkt by injecting it to receiving mbuf array

2016-02-22 Thread Yuanhan Liu
[0]: http://dpdk.org/ml/archives/dev/2016-February/033527.html Another note is that while preparing this version, I found that DPDK has some ARP related structures and macros defined. So, use them instead of the one from standard header files here. Cc: Thibaut Collet Suggested-by: Jianfeng Tan

[dpdk-dev] [dpdk-virtio] DPDK stopped working on virtio

2016-02-23 Thread Yuanhan Liu
On Mon, Feb 22, 2016 at 11:15:57AM -0800, Clarylin L wrote: > I am running DPDK application (testpmd) within a VM based on virtio. With > the same hypervisor and same DPDK code, it used to work well. But it > stopped working since last week. The VM's port could not receive anything. > I ran

[dpdk-dev] [dpdk-virtio] DPDK stopped working on virtio

2016-02-23 Thread Yuanhan Liu
hink of. > or anything else I need to look into and check? My VM is running on > Ubuntu KVM. The vhost and virtio log? --yliu > > On Mon, Feb 22, 2016 at 7:50 PM, Yuanhan Liu > wrote: > > On Mon, Feb 22, 2016 at 11:15:57AM -0800, Clarylin L wrote: > >

[dpdk-dev] [PATCH] vhost: broadcast RARP pkt by injecting it to receiving mbuf array

2016-02-24 Thread Yuanhan Liu
On Wed, Feb 24, 2016 at 08:15:36AM +, Qiu, Michael wrote: > On 2/22/2016 10:35 PM, Yuanhan Liu wrote: > > Broadcast RARP packet by injecting it to receiving mbuf array at > > rte_vhost_dequeue_burst(). > > > > Commit 33226236a35e ("vhost: handle request to s

[dpdk-dev] DPDK's vhost-user logging capability

2016-03-25 Thread Yuanhan Liu
On Wed, Mar 23, 2016 at 03:34:09PM +, shesha Sreenivasamurthy (shesha) wrote: > Hi All, > > I was going over vhost-user migration capability in DPDK in lieu of a Cisco's > multi-q DPDK vhost-user application. I see that log_base address is > implemented > as per virtio_net device. However,

[dpdk-dev] [PATCH 0/4] vhost vlan tag and TSO fixes/cleanups

2016-03-25 Thread Yuanhan Liu
by default for some drivers. Patch 4 is a vlan tag fix reported by Qian. --- Yuanhan Liu (4): vhost: remove unnecessary return vhost: complete TSO settings examples/vhost: remove unnessary settings for TX offload examples/vhost: fix wrong vlan_tag examples/vhost/main.c

[dpdk-dev] [PATCH 1/4] vhost: remove unnecessary return

2016-03-25 Thread Yuanhan Liu
Signed-off-by: Yuanhan Liu --- lib/librte_vhost/vhost_rxtx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c index b4da665..7d1224c 100644 --- a/lib/librte_vhost/vhost_rxtx.c +++ b/lib/librte_vhost/vhost_rxtx.c @@ -123,8 +123,6

[dpdk-dev] [PATCH 2/4] vhost: complete TSO settings

2016-03-25 Thread Yuanhan Liu
v4_hdr->hdr_checksum = 0 for IPv4. - calculate the pseudo header checksum without taking ip_len in account, and set it in the TCP header Here we complete the left part in vhost side, so that an user (such as OVS) can do minimal (or even no) changes to get TSO enabled. Signed-off-by

[dpdk-dev] [PATCH 3/4] examples/vhost: remove unnessary settings for TX offload

2016-03-25 Thread Yuanhan Liu
We now got all required settings to make TSO work at vhost lib. We also don't need to calculate the pseudo header checksum just for the checksum offloading case, as the TCP/IP stack would have done that. So, those settings are not necessary; remove them. Signed-off-by: Yuanhan Liu --- examples

[dpdk-dev] [PATCH 4/4] examples/vhost: fix wrong vlan_tag

2016-03-25 Thread Yuanhan Liu
While the last arg of virtio_tx_route() asks a vlan tag, we currently feed it with device_fh, which is wrong. Fix it. Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application") Reported-by: Qian Xu Signed-off-by: Yuanhan Liu --- examples/vhost/main.c | 6 -- 1 fi

[dpdk-dev] [PATCH 2/4] vhost: complete TSO settings

2016-03-25 Thread Yuanhan Liu
On Fri, Mar 25, 2016 at 02:01:32PM +0800, Yuanhan Liu wrote: > Commit d0cf91303d73 ("vhost: add Tx offload capabilities") has only > done partial settings for enabling TSO, and left the following part > to the application, say vhost-switch example, by commit 9fd72e3cbd29 >

[dpdk-dev] [PATCH v2 0/4] vhost vlan tag and TSO fixes/cleanups

2016-03-25 Thread Yuanhan Liu
her chance to look at the TSO implementation a bit deeper, and then came up with this small patch set, which includes a TSO cleanup and fix. Patch 4 is a vlan tag fix reported from Qian. --- Yuanhan Liu (4): vhost: remove unnecessary return examples/vhost: remove unnecessary pseudo checksum calc

[dpdk-dev] [PATCH v2 1/4] vhost: remove unnecessary return

2016-03-25 Thread Yuanhan Liu
Signed-off-by: Yuanhan Liu --- lib/librte_vhost/vhost_rxtx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c index b4da665..7d1224c 100644 --- a/lib/librte_vhost/vhost_rxtx.c +++ b/lib/librte_vhost/vhost_rxtx.c @@ -123,8 +123,6

[dpdk-dev] [PATCH v2 2/4] examples/vhost: remove unnecessary pseudo checksum calc

2016-03-25 Thread Yuanhan Liu
For checksum offloading only case, the TCP/IP stack would have calculated the pseudo checksum. Therefore, we don't need to re-calculate it again here; remove it. Signed-off-by: Yuanhan Liu --- examples/vhost/main.c | 41 ++--- 1 file changed, 6 insertions

[dpdk-dev] [PATCH v2 3/4] examples/vhost: fix offload settings

2016-03-25 Thread Yuanhan Liu
Signed-off-by: Yuanhan Liu --- examples/vhost/main.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index ceabbce..86e5c24 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -1163,10 +1163,13 @@ static void virtio_

[dpdk-dev] [PATCH v2 4/4] examples/vhost: fix wrong vlan_tag

2016-03-25 Thread Yuanhan Liu
While the last arg of virtio_tx_route() asks a vlan tag, we currently feed it with device_fh, which is wrong. Fix it. Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application") Reported-by: Qian Xu Signed-off-by: Yuanhan Liu --- examples/vhost/main.c | 6 -- 1 fi

[dpdk-dev] [PATCH] scripts: check commit formatting

2016-03-30 Thread Yuanhan Liu
On Tue, Mar 29, 2016 at 11:29:46PM +0200, Thomas Monjalon wrote: > The git messages have three parts: > 1/ the headline > 2/ the explanations > 3/ the footer tags > > The headline helps to quickly browse an history or catch instantly the > purpose of a commit. Making it short with some consistent

[dpdk-dev] [PATCH] scripts: check commit formatting

2016-03-30 Thread Yuanhan Liu
On Wed, Mar 30, 2016 at 03:27:40PM +0100, Bruce Richardson wrote: > On Wed, Mar 30, 2016 at 09:46:34AM +0800, Yuanhan Liu wrote: > > On Tue, Mar 29, 2016 at 11:29:46PM +0200, Thomas Monjalon wrote: > > > The git messages have three parts: > > > 1/ the headline > &

[dpdk-dev] [PATCH v2] virtio: fix modify drv_flags for specific device

2016-05-02 Thread Yuanhan Liu
On Thu, Apr 28, 2016 at 06:08:59PM +, Jianfeng Tan wrote: > Issue: virtio's drv_flags are decided by devices types (modern vs legacy), > and which kernel driver is used, and the negotiated features (especially > VIRTIO_NET_STATUS) with backend, which makes it possible to multiple > virtio

[dpdk-dev] [PATCH v2 0/8] vhost/example cleanup/fix

2016-05-02 Thread Yuanhan Liu
refactoring stuff. Note that I'm going to apply it before the end of this week, if no objections. v2: - some checkpatch fixes - cleaned the code about device statistics --- Yuanhan Liu (8): examples/vhost: remove the non-working zero copy code examples/vhost: remove unused macro

[dpdk-dev] [PATCH v2 2/8] examples/vhost: remove unused macro and struct

2016-05-02 Thread Yuanhan Liu
on. Fixes: 4d50b6acbd95 ("examples/vhost: adapt Tx routing to lib") Signed-off-by: Yuanhan Liu --- examples/vhost/main.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 9452bab..9445100 100644 --- a/examples/vhost/main.c

[dpdk-dev] [PATCH v2 1/8] examples/vhost: remove the non-working zero copy code

2016-05-02 Thread Yuanhan Liu
It's reported that it's has not been working for a long while. And due to it's complex, it's better to redesign it than to fix it to make it work again. Signed-off-by: Yuanhan Liu --- v2: remove macro PRINT_PACKET; will not be used anymore --- doc/guides/sample_app_ug/vhost.rst | 36

[dpdk-dev] [PATCH v2 4/8] examples/vhost: use mac compare helper function directly

2016-05-02 Thread Yuanhan Liu
rte_ether.h already provides a helper function to do mac address compare. No need to define our own, use it directly. Signed-off-by: Yuanhan Liu --- examples/vhost/main.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/examples/vhost/main.c b/examples/vhost

[dpdk-dev] [PATCH v2 3/8] examples/vhost: use tailq to link vhost devices

2016-05-02 Thread Yuanhan Liu
To simplify code and logic. Signed-off-by: Yuanhan Liu --- examples/vhost/main.c | 457 -- examples/vhost/main.h | 32 ++-- 2 files changed, 126 insertions(+), 363 deletions(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index

[dpdk-dev] [PATCH v2 5/8] examples/vhost: handle broadcast packet

2016-05-02 Thread Yuanhan Liu
, to fix above arp table issue. Signed-off-by: Yuanhan Liu --- examples/vhost/main.c | 39 +-- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index bfcabf3..7448e4f 100644 --- a/examples/vhost/main.c

[dpdk-dev] [PATCH v2 6/8] examples/vhost: fix mbuf allocation failure

2016-05-02 Thread Yuanhan Liu
72e3cbd29 ("examples/vhost: add virtio offload") Fixes: 5499c1fc9baa ("examples/vhost: fix mbuf allocation") Signed-off-by: Yuanhan Liu --- examples/vhost/main.c | 79 ++- 1 file changed, 59 insertions(+), 20 deletions(-) diff

[dpdk-dev] [PATCH v2 7/8] examples/vhost: switch_worker cleanup

2016-05-02 Thread Yuanhan Liu
(). Signed-off-by: Yuanhan Liu --- examples/vhost/main.c | 253 +++--- 1 file changed, 136 insertions(+), 117 deletions(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index dbb42ee..66d3bf2 100644 --- a/examples/vhost/main.c +++ b

[dpdk-dev] [PATCH v2 8/8] examples/vhost: embed statistics into vhost_dev struct

2016-05-02 Thread Yuanhan Liu
Embed dev_statistics into vhost_dev strcuct, which could clean the code a bit. Signed-off-by: Yuanhan Liu --- examples/vhost/main.c | 87 +++ examples/vhost/main.h | 11 +-- 2 files changed, 40 insertions(+), 58 deletions(-) diff --git

[dpdk-dev] [PATCH 00/16] vhost ABI/API refactoring

2016-05-02 Thread Yuanhan Liu
aximets (1): vhost: make buf vector for scatter Rx local Yuanhan Liu (15): vhost: declare backend with int type vhost: set/reset dev flags internally vhost: declare device_fh as int example/vhost: make a copy of virtio device id vhost: rename device_fh to vid vhost: get de

[dpdk-dev] [PATCH 01/16] vhost: declare backend with int type

2016-05-02 Thread Yuanhan Liu
It's an fd; so define it as "int", which could also save the unncessary (int) case. Signed-off-by: Yuanhan Liu --- lib/librte_vhost/rte_virtio_net.h | 2 +- lib/librte_vhost/virtio-net.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/li

[dpdk-dev] [PATCH 02/16] vhost: set/reset dev flags internally

2016-05-02 Thread Yuanhan Liu
it. Signed-off-by: Yuanhan Liu --- drivers/net/vhost/rte_eth_vhost.c | 2 -- examples/vhost/main.c | 3 --- lib/librte_vhost/vhost_user/virtio-net-user.c | 11 +++ lib/librte_vhost/virtio-net.c | 21 ++--- 4 files changed, 21

[dpdk-dev] [PATCH 03/16] vhost: declare device_fh as int

2016-05-02 Thread Yuanhan Liu
Firstly, "int" would be big enough: we don't need 64 bit to represent a virtio-net device id. Secondly, this could let us avoid the ugly "%" PRIu64 ".." stuff. And since ctx.fh is derived from device_fh, declare it as int, too. Signed-off-by: Yuanhan L

[dpdk-dev] [PATCH 04/16] example/vhost: make a copy of virtio device id

2016-05-02 Thread Yuanhan Liu
Make a copy of virtio device id (device_fh) from the virtio_net struct, so that we could have less dependency on the virtio_net struct. Signed-off-by: Yuanhan Liu --- examples/vhost/main.c | 59 --- examples/vhost/main.h | 1 + 2 files changed

[dpdk-dev] [PATCH 08/16] vhost: query pmd internal by vid

2016-05-02 Thread Yuanhan Liu
Query internal by vid instead of "ifname", to avoid the dependency of virtio_net struct. Signed-off-by: Yuanhan Liu --- drivers/net/vhost/rte_eth_vhost.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/net/vhost/rte_eth_vhost.c b/d

[dpdk-dev] [PATCH 09/16] vhost: add few more functions

2016-05-02 Thread Yuanhan Liu
host" name change to keep the consistency of other functions. - rte_vhost_get_queue_num Exports the "virt_qp_nb" field. - rte_vhost_get_numa_node Exports the numa node from where the virtio net device is allocated. Signed-off-by: Yuanhan Liu --- drivers/net/vhost/rte_eth_vhost.c |

[dpdk-dev] [PATCH 10/16] vhost: export vid as the only interface to applications

2016-05-02 Thread Yuanhan Liu
With all the previous prepare works, we are just one step away from the final ABI refactoring. That is, to change current API to let them stick to vid instead of the old virtio_net dev. Signed-off-by: Yuanhan Liu --- drivers/net/vhost/rte_eth_vhost.c | 61

[dpdk-dev] [PATCH 11/16] vhost: hide internal structs/macros/functions

2016-05-02 Thread Yuanhan Liu
We are now safe to move all those internal structs/macros/functions to vhost-net.h, to hide them from external access. This patch also breaks long lines and removes some redundant comments. Signed-off-by: Yuanhan Liu --- lib/librte_vhost/rte_virtio_net.h | 128

[dpdk-dev] [PATCH 13/16] vhost: remove virtio-net.h

2016-05-02 Thread Yuanhan Liu
It barely has anything useful there, just 2 functions prototype. Here move them to vhost-net.h, and delete it. Signed-off-by: Yuanhan Liu --- lib/librte_vhost/vhost-net.h | 3 ++ lib/librte_vhost/vhost_cuse/virtio-net-cdev.c | 1 - lib/librte_vhost/vhost_rxtx.c

[dpdk-dev] [PATCH 14/16] vhost: reserve few more space for future extension

2016-05-02 Thread Yuanhan Liu
for a long while. Another reason to choose 5 is for cache alignment: 5 makes the struct 64 bytes for 64 bit machine. With this, it's confidence to say that we might be able to be free from the ABI violation forever. Signed-off-by: Yuanhan Liu --- lib/librte_vhost/rte_virtio_net.h | 2 ++ 1 file

[dpdk-dev] [PATCH 15/16] vhost: per device vhost_hlen

2016-05-02 Thread Yuanhan Liu
Virtio net header length is set per device, but not per queue. So, there is no reason to store it in vhost_virtqueue struct, instead, we should store it in virtio_net struct, to make one copy only. Signed-off-by: Yuanhan Liu --- lib/librte_vhost/vhost-net.h | 2 +- lib/librte_vhost

[dpdk-dev] [PATCH 16/16] vhost: make buf vector for scatter Rx local

2016-05-02 Thread Yuanhan Liu
inside virtio_dev_merge_rx(). Signed-off-by: Ilya Maximets Signed-off-by: Yuanhan Liu --- lib/librte_vhost/vhost-net.h | 1 - lib/librte_vhost/vhost_rxtx.c | 41 ++--- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/lib/librte_vhost/vhost-net.h

[dpdk-dev] [PATCH 1/3] vhost: pre update used ring for Tx and Rx

2016-05-02 Thread Yuanhan Liu
"used->idx". (I'm not 100% certain I don't miss anything, though). Cc: Michael S. Tsirkin Signed-off-by: Yuanhan Liu --- lib/librte_vhost/vhost_rxtx.c | 58 +-- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/lib/librte_vhost/vhost

[dpdk-dev] [PATCH 2/3] vhost: optimize dequeue for small packets

2016-05-02 Thread Yuanhan Liu
e yet?". This could save one check for small packets, that just have one data desc buffer and need one mbuf to store it. Signed-off-by: Yuanhan Liu --- lib/librte_vhost/vhost_rxtx.c | 52 ++- 1 file changed, 36 insertions(+), 16 deletions(-) diff -

[dpdk-dev] [PATCH 3/3] vhost: arrange virtio_net fields for better cache sharing

2016-05-02 Thread Yuanhan Liu
-off-by: Yuanhan Liu --- lib/librte_vhost/vhost-net.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_vhost/vhost-net.h b/lib/librte_vhost/vhost-net.h index 9dec83c..3b0ffe7 100644 --- a/lib/librte_vhost/vhost-net.h +++ b/lib/librte_vhost/vhost-net.h @@ -123,16

[dpdk-dev] [PATCH v2] virtio: fix modify drv_flags for specific device

2016-05-04 Thread Yuanhan Liu
On Tue, May 03, 2016 at 10:05:01AM +0200, David Marchand wrote: > Hello Tan, > > On Thu, Apr 28, 2016 at 8:08 PM, Jianfeng Tan > wrote: > > Issue: virtio's drv_flags are decided by devices types (modern vs legacy), > > and which kernel driver is used, and the negotiated features (especially > >

[dpdk-dev] [PATCH] virtio: split virtio rx/tx queue

2016-05-04 Thread Yuanhan Liu
On Wed, May 04, 2016 at 08:50:27AM +0800, Huawei Xie wrote: > -int virtio_dev_queue_setup(struct rte_eth_dev *dev, > - int queue_type, > - uint16_t queue_idx, > +static int > +virtio_dev_cq_queue_setup(struct rte_eth_dev *dev, While it's good to split Rx/Tx

[dpdk-dev] [PATCH] virtio: split virtio rx/tx queue

2016-05-04 Thread Yuanhan Liu
On Thu, May 05, 2016 at 01:54:25AM +, Xie, Huawei wrote: > On 5/5/2016 7:59 AM, Yuanhan Liu wrote: > > On Wed, May 04, 2016 at 08:50:27AM +0800, Huawei Xie wrote: > >> -int virtio_dev_queue_setup(struct rte_eth_dev *dev, > >> - int queue_type, >

[dpdk-dev] [PATCH v3 1/2] virtio: cleanup virtio_dev_queue_setup()

2016-05-04 Thread Yuanhan Liu
On Fri, Apr 29, 2016 at 12:48:45AM +, Jianfeng Tan wrote: > + if (queue_type < VTNET_RQ || queue_type > VTNET_CQ) { > + PMD_INIT_LOG(ERR, "invalid queue type: %d", queue_type); > + return -EINVAL; > } I'm thinking this check is not necessary. We can make sure

[dpdk-dev] [PATCH v3 2/2] virtio: fix memory leak of virtqueue memzones

2016-05-04 Thread Yuanhan Liu
ping... On Thu, Apr 28, 2016 at 10:33:08PM -0700, Yuanhan Liu wrote: > On Fri, Apr 29, 2016 at 12:48:46AM +, Jianfeng Tan wrote: > > @@ -447,6 +453,7 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev, > > > > hw->vtpci_ops->setup_queue(hw, vq); &g

[dpdk-dev] [PATCH] virtio: split virtio rx/tx queue

2016-05-04 Thread Yuanhan Liu
On Thu, May 05, 2016 at 03:29:44AM +, Xie, Huawei wrote: > On 5/5/2016 11:03 AM, Yuanhan Liu wrote: > > On Thu, May 05, 2016 at 01:54:25AM +, Xie, Huawei wrote: > >> On 5/5/2016 7:59 AM, Yuanhan Liu wrote: > >>> On Wed, May 04, 2016 at 08:50:27AM +0800,

[dpdk-dev] [PATCH 0/6] vhost: add vhost-user client mode and reconnect ability

2016-05-07 Thread Yuanhan Liu
K restarts. --- Yuanhan Liu (6): vhost: rename structs for enabling client mode vhost: add vhost-user client mode vhost: add reconnect ability vhost: workaround stale vring base examples/vhost: add client and reconnect option vhost: add pmd client and reconnect option drivers

[dpdk-dev] [PATCH 1/6] vhost: rename structs for enabling client mode

2016-05-07 Thread Yuanhan Liu
fd_ctx", but I think it's obviously better to rename it to "vhost_user_connection", as it does represent a connection, a connection between the backend (DPDK) and the frontend (QEMU). Similarly, few more renames are taken, such as "vserver_new_vq_conn" to "vhost_user

[dpdk-dev] [PATCH 2/6] vhost: add vhost-user client mode

2016-05-07 Thread Yuanhan Liu
, connect for client. Signed-off-by: Yuanhan Liu --- drivers/net/vhost/rte_eth_vhost.c| 2 +- examples/vhost/main.c| 2 +- lib/librte_vhost/rte_virtio_net.h| 11 +- lib/librte_vhost/vhost_user/vhost-net-user.c | 215

[dpdk-dev] [PATCH 3/6] vhost: add reconnect ability

2016-05-07 Thread Yuanhan Liu
. - when QEMU reboots, without reconnecting, you can't re-establish the connection without restarting DPDK app. This patch make it work well for both above cases. It simply creates a new thread, and keep trying calling "connect()", until it succeeds. Signed-off-by: Yuanhan Liu --- lib/li

[dpdk-dev] [PATCH 4/6] vhost: workaround stale vring base

2016-05-07 Thread Yuanhan Liu
. So, instead of getting the stale vring base from QEMU, Huawei suggested we could get a proper one from used->idx. Cc: "Michael S. Tsirkin" Suggested-by: "Xie, Huawei" Signed-off-by: Yuanhan Liu --- Note that a right way to handle reconnect from abnormal quit would

[dpdk-dev] [PATCH 5/6] examples/vhost: add client and reconnect option

2016-05-07 Thread Yuanhan Liu
Add --client and --reconnect option to enable the client mode and reconnect mode, respectively. --rconnect works only when --client is given as well. Signed-off-by: Yuanhan Liu --- examples/vhost/main.c | 23 +-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git

<    5   6   7   8   9   10   11   12   >