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
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
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
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
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 |
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
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
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
() 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
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
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
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:
> >
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
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
/**< 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
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
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:
> > +/*
> > + *
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.
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
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
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
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
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.
&
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
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
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
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
_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 &
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
);
}
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
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
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
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
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
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
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
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
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
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
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
>
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
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
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
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:
> >
> >
[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
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
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:
> >
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
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,
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
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
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
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
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
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
>
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
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
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
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_
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
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
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
> &
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
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
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
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
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
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
, 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
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
().
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
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
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
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
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
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
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
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
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 |
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
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
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
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
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
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
"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
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 -
-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
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
> >
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
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,
>
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
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
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,
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
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
, 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
.
- 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
.
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
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
901 - 1000 of 1146 matches
Mail list logo