Re: [Qemu-devel] [dpdk-dev] [ovs-dev] [PATCH RFC] netdev-dpdk: Fix device obtain mac address when received first packet in vhost type

2017-11-27 Thread Yuanhan Liu
On Fri, Nov 24, 2017 at 05:59:09PM +0800, Chen Hailin wrote: > Hi Aaron Conole && Jianfeng, > > The stp could not work in ovs-dpdk vhostuser. > Because the attached vhost device doesn't have MAC address. > > Now we have two ways to solve this problem. > 1. The vhost learns MAC address from packet

Re: [Qemu-devel] [RFC v3 1/3] vhost-user: Add MTU protocol feature and op

2016-11-30 Thread Yuanhan Liu
On Wed, Nov 30, 2016 at 11:10:15AM +0100, Maxime Coquelin wrote: > +#define VHOST_USER_PROTOCOL_F_MTU4 > > Message types > - > @@ -470,6 +471,18 @@ Message types >The first 6 bytes of the payload contain the mac address of the guest > to >allow the vhost

Re: [Qemu-devel] [dpdk-dev] dpdk/vpp and cross-version migration for vhost

2016-11-24 Thread Yuanhan Liu
On Thu, Nov 24, 2016 at 09:30:49AM +, Kevin Traynor wrote: > On 11/24/2016 06:31 AM, Yuanhan Liu wrote: > > On Tue, Nov 22, 2016 at 04:53:05PM +0200, Michael S. Tsirkin wrote: > >>>> You keep assuming that you have the VM started first and > >>>> figure o

Re: [Qemu-devel] dpdk/vpp and cross-version migration for vhost

2016-11-23 Thread Yuanhan Liu
On Tue, Nov 22, 2016 at 04:53:05PM +0200, Michael S. Tsirkin wrote: > > > You keep assuming that you have the VM started first and > > > figure out things afterwards, but this does not work. > > > > > > Think about a cluster of machines. You want to start a VM in > > > a way that will ensure compa

Re: [Qemu-devel] dpdk/vpp and cross-version migration for vhost

2016-11-22 Thread Yuanhan Liu
On Thu, Nov 17, 2016 at 07:37:09PM +0200, Michael S. Tsirkin wrote: > On Thu, Nov 17, 2016 at 05:49:36PM +0800, Yuanhan Liu wrote: > > On Thu, Nov 17, 2016 at 09:47:09AM +0100, Maxime Coquelin wrote: > > > > > > > > > On 11/17/2016 09:29 AM, Yuanhan Liu wro

Re: [Qemu-devel] dpdk/vpp and cross-version migration for vhost

2016-11-17 Thread Yuanhan Liu
On Thu, Nov 17, 2016 at 09:47:09AM +0100, Maxime Coquelin wrote: > > > On 11/17/2016 09:29 AM, Yuanhan Liu wrote: > >As usaual, sorry for late response :/ > > > >On Thu, Oct 13, 2016 at 08:50:52PM +0300, Michael S. Tsirkin wrote: > >>Hi! > >>So it lo

Re: [Qemu-devel] dpdk/vpp and cross-version migration for vhost

2016-11-17 Thread Yuanhan Liu
As usaual, sorry for late response :/ On Thu, Oct 13, 2016 at 08:50:52PM +0300, Michael S. Tsirkin wrote: > Hi! > So it looks like we face a problem with cross-version > migration when using vhost. It's not new but became more > acute with the advent of vhost user. > > For users to be able to mig

Re: [Qemu-devel] [dpdk-dev] [PATCH 1/2] vhost: enable any layout feature

2016-10-11 Thread Yuanhan Liu
On Tue, Oct 11, 2016 at 02:57:49PM +0800, Yuanhan Liu wrote: > > > > > > There was an example: the vhost enqueue optmization patchset from > > > > > > Zhihong [0] uses memset, and it introduces more than 15% drop (IIRC) Though it doesn't matter now, b

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-10 Thread Yuanhan Liu
On Mon, Oct 10, 2016 at 07:39:59AM +0300, Michael S. Tsirkin wrote: > > > > > > 1. why is this memset expensive? > > > > > > > > > > I don't have the exact answer, but just some rough thoughts: > > > > > > > > > > It's an external clib function: there is a call stack and the > > > > > IP register w

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-10 Thread Yuanhan Liu
On Tue, Oct 11, 2016 at 08:39:54AM +0200, Maxime Coquelin wrote: > > > On 10/11/2016 08:04 AM, Yuanhan Liu wrote: > >On Mon, Oct 10, 2016 at 04:54:39PM +0200, Maxime Coquelin wrote: > >> > >> > >>On 10/10/2016 04:42 PM, Yuanhan Liu wrote: > >&g

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-10 Thread Yuanhan Liu
On Mon, Oct 10, 2016 at 04:54:39PM +0200, Maxime Coquelin wrote: > > > On 10/10/2016 04:42 PM, Yuanhan Liu wrote: > >On Mon, Oct 10, 2016 at 02:40:44PM +0200, Maxime Coquelin wrote: > >>>>>At that time, a packet always use 2 descs. Since indirect desc is >

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-10 Thread Yuanhan Liu
own. That should also be > >>>part of the reason why performance is slightly worse than before. > >>> > >>> --yliu > >> > >>I'm not sure I get what you are saying > >> > >>>commit 1d41d77cf81c448c1b09e1e859bfd300e2054

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Yuanhan Liu
On Mon, Oct 10, 2016 at 07:17:06AM +0300, Michael S. Tsirkin wrote: > On Mon, Oct 10, 2016 at 12:05:31PM +0800, Yuanhan Liu wrote: > > On Fri, Sep 30, 2016 at 10:16:43PM +0300, Michael S. Tsirkin wrote: > > > > > And the same is done is done in DPDK: > > >

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Yuanhan Liu
means code it up. It's added by following commit, which yields about 10% performance boosts for PVP case (with 64B packet size). At that time, a packet always use 2 descs. Since indirect desc is enabled (by default) now, the assumption is not true then. What's worse, it might even s

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Yuanhan Liu
On Thu, Sep 29, 2016 at 10:05:22PM +0200, Maxime Coquelin wrote: > >so doing this unconditionally would be a spec violation, but if you see > >value in this, we can add a feature bit. > Right it would be a spec violation, so it should be done conditionally. > If a feature bit is to be added, what a

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Yuanhan Liu
On Mon, Oct 10, 2016 at 06:46:44AM +0300, Michael S. Tsirkin wrote: > On Mon, Oct 10, 2016 at 11:37:44AM +0800, Yuanhan Liu wrote: > > On Thu, Sep 29, 2016 at 11:21:48PM +0300, Michael S. Tsirkin wrote: > > > On Thu, Sep 29, 2016 at 10:05:22PM +0200, Max

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Yuanhan Liu
On Mon, Oct 10, 2016 at 06:04:32AM +0300, Michael S. Tsirkin wrote: > > > So I guess at this point, we can teach vhost-user in qemu > > > that version 1 implies any_layout but only for machine types > > > qemu 2.8 and up. It sets a bad precedent but oh well. > > > > It should work. > > > > --

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Yuanhan Liu
On Mon, Oct 10, 2016 at 02:20:22AM +0300, Michael S. Tsirkin wrote: > On Wed, Sep 28, 2016 at 10:28:48AM +0800, Yuanhan Liu wrote: > > On Tue, Sep 27, 2016 at 10:56:40PM +0300, Michael S. Tsirkin wrote: > > > On Tue, Sep 27, 2016 at 11:11:58AM +0800, Yuanhan Liu wrote: > >

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-10-09 Thread Yuanhan Liu
On Thu, Sep 29, 2016 at 11:21:48PM +0300, Michael S. Tsirkin wrote: > On Thu, Sep 29, 2016 at 10:05:22PM +0200, Maxime Coquelin wrote: > > > > > > On 09/29/2016 07:57 PM, Michael S. Tsirkin wrote: > Yes but two points. > > 1. why is this memset expensive? I don't have the exact answer, but just

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-09-27 Thread Yuanhan Liu
On Tue, Sep 27, 2016 at 10:56:40PM +0300, Michael S. Tsirkin wrote: > On Tue, Sep 27, 2016 at 11:11:58AM +0800, Yuanhan Liu wrote: > > On Mon, Sep 26, 2016 at 10:24:55PM +0300, Michael S. Tsirkin wrote: > > > On Mon, Sep 26, 2016 at 11:01:58AM -0700, Stephen Hemminger wrote: >

Re: [Qemu-devel] [PATCH 1/2] vhost: enable any layout feature

2016-09-26 Thread Yuanhan Liu
On Mon, Sep 26, 2016 at 10:24:55PM +0300, Michael S. Tsirkin wrote: > On Mon, Sep 26, 2016 at 11:01:58AM -0700, Stephen Hemminger wrote: > > I assume that if using Version 1 that the bit will be ignored Yes, but I will just quote what you just said: what if the guest virtio device is a legacy devi

Re: [Qemu-devel] [PATCH v2 22/23] vhost-user: wait until backend init is completed

2016-06-30 Thread Yuanhan Liu
On Thu, Jun 30, 2016 at 05:22:43AM -0400, Marc-André Lureau wrote: > Hi > > - Original Message - > > On Fri, Jun 24, 2016 at 03:51:09PM +0200, marcandre.lur...@redhat.com wrote: > > > From: Marc-André Lureau > > > > > > The chardev waits for an initial connection before starting qemu, >

Re: [Qemu-devel] [PATCH v2 22/23] vhost-user: wait until backend init is completed

2016-06-29 Thread Yuanhan Liu
On Fri, Jun 24, 2016 at 03:51:09PM +0200, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > The chardev waits for an initial connection before starting qemu, > vhost-user wants the backend negotiation to be completed. vhost-user is > started in the net_vhost_user_event callback, wh

Re: [Qemu-devel] [PATCH 07/10] vhost-net: save & restore vhost-user acked features

2016-06-06 Thread Yuanhan Liu
On Tue, May 10, 2016 at 06:03:57PM +0200, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > The initial vhost-user connection sets the features to be negotiated > with the driver. Renegotiation isn't possible without device reset. > > To handle reconnection of vhost-user backend,

Re: [Qemu-devel] [PATCH 00/10] RFCv3: vhost-user: simple reconnection support

2016-05-23 Thread Yuanhan Liu
On Sun, May 15, 2016 at 12:42:12PM +0300, Michael S. Tsirkin wrote: > > FYI, I have a follow up series (~20 patches, > > https://github.com/elmarco/qemu/tree/vhost-user-reconnect) doing > > mostly cleanups and extra checks for disconnection at run time. In > > particular, it should avoid some obvio

Re: [Qemu-devel] [PATCH 02/10] vubr: add client mode

2016-05-10 Thread Yuanhan Liu
Hi, Just to let you know that as a client, it need to add the reconnect ability, as the QEMU (as the server) may restart as well. Well, I'm thinking that you may think it's an example bridge only, so, let it be simple. Then I'm sorry for the noise. --yliu On Tue, May 10, 2016 at 06:03:52

Re: [Qemu-devel] [PATCH 00/10] RFCv3: vhost-user: simple reconnection support

2016-05-10 Thread Yuanhan Liu
Hi Marc, I was also thinking we should do it in this way first. That simplfies things. So, feel free to add: Tested-by: Yuanhan Liu Reviewed-by: Yuanhan Liu (well, I didn't review the test case carefully). Thanks. --yliu On Tue, May 10, 2016 at 06:03:50PM +0200, marcandr

Re: [Qemu-devel] [PATCH 11/18] vhost-user: add shutdown support

2016-05-04 Thread Yuanhan Liu
Hello, On Wed, May 04, 2016 at 10:13:49PM +0300, Michael S. Tsirkin wrote: > How do you avoid it? > > > > Management is required to make this robust, auto-reconnect > > > is handy for people bypassing management. > > > > tbh, I don't like autoreconnect. My previous series didn't include > > this

Re: [Qemu-devel] [PATCH 11/18] vhost-user: add shutdown support

2016-05-02 Thread Yuanhan Liu
On Mon, May 02, 2016 at 03:04:30PM +0300, Michael S. Tsirkin wrote: > On Mon, May 02, 2016 at 01:29:18PM +0200, Marc-André Lureau wrote: > > Hi > > > > On Mon, May 2, 2016 at 12:45 PM, Michael S. Tsirkin wrote: > > > 1. Graceful disconnect > > > - One should be able to do vmstop, disconnect, conn

Re: [Qemu-devel] [PATCH 11/18] vhost-user: add shutdown support

2016-05-02 Thread Yuanhan Liu
On Mon, May 02, 2016 at 01:45:31PM +0300, Michael S. Tsirkin wrote: > On Sun, May 01, 2016 at 02:04:42PM -0700, Yuanhan Liu wrote: > > On Sun, May 01, 2016 at 02:37:19PM +0300, Michael S. Tsirkin wrote: > > > On Fri, Apr 29, 2016 at 10:48:35AM -0700, Yuanhan Liu wrote

Re: [Qemu-devel] [PATCH 11/18] vhost-user: add shutdown support

2016-05-01 Thread Yuanhan Liu
On Sun, May 01, 2016 at 02:37:19PM +0300, Michael S. Tsirkin wrote: > On Fri, Apr 29, 2016 at 10:48:35AM -0700, Yuanhan Liu wrote: > > > But, I > > > would worry first about a backend that crashes that it may corrupt the > > > VM memory too... > > > >

Re: [Qemu-devel] [PATCH 11/18] vhost-user: add shutdown support

2016-04-29 Thread Yuanhan Liu
On Fri, Apr 29, 2016 at 12:40:09PM +0200, Marc-André Lureau wrote: > Hi > > On Thu, Apr 28, 2016 at 7:23 AM, Yuanhan Liu > wrote: > > On Fri, Apr 01, 2016 at 01:16:21PM +0200, marcandre.lur...@redhat.com wrote: > >> From: Marc-André Lureau

Re: [Qemu-devel] [PATCH 11/18] vhost-user: add shutdown support

2016-04-27 Thread Yuanhan Liu
On Fri, Apr 01, 2016 at 01:16:21PM +0200, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Signed-off-by: Marc-André Lureau > --- > docs/specs/vhost-user.txt | 15 +++ > hw/virtio/vhost-user.c| 16 > 2 files changed, 31 insertions(+) > > diff --

Re: [Qemu-devel] [PATCH 04/18] char: add wait support for reconnect

2016-04-27 Thread Yuanhan Liu
On Fri, Apr 01, 2016 at 01:16:14PM +0200, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > Until now, 'wait' was solely used for listening sockets. However, it can > also be useful for 'reconnect' socket kind, where the first open must > succeed before continuing. > > This allows

Re: [Qemu-devel] [PATCH 11/18] vhost-user: add shutdown support

2016-04-13 Thread Yuanhan Liu
On Wed, Apr 13, 2016 at 11:43:56PM +0200, Marc-André Lureau wrote: > On Wed, Apr 13, 2016 at 7:32 PM, Yuanhan Liu > wrote: > >> > >> > I'm asking because I found a seg fault issue sometimes, > >> > due to opaque is NULL. > > >

Re: [Qemu-devel] [PATCH 11/18] vhost-user: add shutdown support

2016-04-13 Thread Yuanhan Liu
On Wed, Apr 13, 2016 at 05:51:15AM -0400, Marc-André Lureau wrote: > Hi > > - Original Message - > > Hi Marc, > > > > First of all, sorry again for late response! > > > > Last time I tried with your first version, I found few issues related > > with reconnect, mainly on the acked_feautre

Re: [Qemu-devel] [PATCH 18/18] test: add shutdown support vubr test

2016-04-12 Thread Yuanhan Liu
On Fri, Apr 01, 2016 at 01:16:28PM +0200, marcandre.lur...@redhat.com wrote: > +static void > +vubr_handle_slave_reply(VhostUserMsg *vmsg) > +{ > +DPRINT( > +"== Vhost slave reply from QEMU > ==\n"); > +DPRINT("Request: %s (%d)\n", vubr_slave_req

Re: [Qemu-devel] [PATCH 11/18] vhost-user: add shutdown support

2016-04-12 Thread Yuanhan Liu
Hi Marc, First of all, sorry again for late response! Last time I tried with your first version, I found few issues related with reconnect, mainly on the acked_feautres lost. While checking your new code, I found that you've already solved that, which is great. So, I tried harder this time, your

Re: [Qemu-devel] [PATCH RFC 00/14] vhost-user: shutdown and reconnection

2016-03-29 Thread Yuanhan Liu
On Tue, Mar 29, 2016 at 12:52:32PM +0200, Marc-André Lureau wrote: > Hi > > On Tue, Mar 29, 2016 at 10:10 AM, Yuanhan Liu > wrote: > > Backend crash may be not that normal in production usage, it is in > > development stage. It would be handy if we can handle that as wel

Re: [Qemu-devel] [PATCH RFC 00/14] vhost-user: shutdown and reconnection

2016-03-29 Thread Yuanhan Liu
On Fri, Mar 25, 2016 at 07:00:15PM +0100, Marc-André Lureau wrote: > Hi > > On Thu, Mar 24, 2016 at 8:10 AM, Yuanhan Liu > wrote: > >> > The following series starts from the idea that the slave can request a > >> > "managed" shutdown inste

Re: [Qemu-devel] [PATCH RFC 00/14] vhost-user: shutdown and reconnection

2016-03-24 Thread Yuanhan Liu
On Thu, Nov 26, 2015 at 12:33:22PM +0200, Michael S. Tsirkin wrote: > On Wed, Sep 09, 2015 at 01:09:52AM +0200, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > In a previous series "Add feature to start QEMU without vhost-user > > backend", Tetsuya Mukawa proposed to allow

Re: [Qemu-devel] chardev: vhost-user: reconnect issue when QEMU as server

2016-03-09 Thread Yuanhan Liu
On Wed, Mar 09, 2016 at 04:04:45PM +0100, Marc-André Lureau wrote: > Hi > > On Wed, Mar 9, 2016 at 2:29 PM, Yuanhan Liu > wrote: > > I could spend more time to dig it. But before that, I want to know > > how you guys think about it? Does that proposal makes sense to

[Qemu-devel] chardev: vhost-user: reconnect issue when QEMU as server

2016-03-09 Thread Yuanhan Liu
Hi, Currently, the typical usage of vhost-user is QEMU as the client, while the backend (say DPDK vhost-user) be the server. There is a major drawback: the restart of the backend (say, upgrade) needs restart the QEMU. The obvious solution would be let QEMU be the server and the backend be the cli

Re: [Qemu-devel] [PATCH] vhost: drop dead code

2015-12-02 Thread Yuanhan Liu
On Wed, Dec 02, 2015 at 01:50:35PM +0200, Michael S. Tsirkin wrote: > We dropped the implementation of vhost_dev_query, > drop it from the header file as well. > > Signed-off-by: Michael S. Tsirkin Reviewed-by: Yuanhan Liu --yliu > --- > include/hw/virtio/vhost

Re: [Qemu-devel] [PATCH] Revert "vhost: send SET_VRING_ENABLE at start/stop"

2015-11-26 Thread Yuanhan Liu
On Thu, Nov 26, 2015 at 06:52:56PM +0200, Michael S. Tsirkin wrote: > On Thu, Nov 26, 2015 at 09:46:08AM +0800, Yuanhan Liu wrote: > > On Wed, Nov 25, 2015 at 02:42:05PM +0200, Michael S. Tsirkin wrote: > > > This reverts commit 3a12f32229a046f4d4ab0a3a52fb01d2d5a1ab76. >

Re: [Qemu-devel] [PATCH] Revert "vhost: send SET_VRING_ENABLE at start/stop"

2015-11-25 Thread Yuanhan Liu
d is > wrong. Reviewed-by: Yuanhan Liu BTW, we should also update the spec about ring stop, right? --yliu > > Reported-by: Thibaut Collet > Cc: Yuanhan Liu > Signed-off-by: Michael S. Tsirkin > --- > hw/virtio/vhost.c | 9 - > 1 file changed, 9 deletions(-)

Re: [Qemu-devel] [PATCH for-2.5 1/1] vhost-user: do not send SET_VRING_ENABLE at start

2015-11-24 Thread Yuanhan Liu
On Tue, Nov 24, 2015 at 11:23:34PM +0200, Michael S. Tsirkin wrote: > On Tue, Nov 24, 2015 at 10:05:27PM +0100, Thibaut Collet wrote: > > On Tue, Nov 24, 2015 at 9:52 PM, Michael S. Tsirkin wrote: > > > On Tue, Nov 24, 2015 at 05:10:36PM +0100, Thibaut Collet wrote: > > >> This patch reverts parti

Re: [Qemu-devel] [PATCH for-2.5] vhost-user: clarify start and enable

2015-11-23 Thread Yuanhan Liu
gt; This is important for MQ, because a Linux guest expects TX > packets to be completed even if it disables some queues > temporarily. Thanks for the clarification. And Reviewed-by: Yuanhan Liu --yliu > > Cc: Yuanhan Liu > Cc: Victor Kaplansky > Signed-off-by: Michae

Re: [Qemu-devel] [PATCH v4 0/5] handle vhost reset/start/stop correctly

2015-11-13 Thread Yuanhan Liu
On Fri, Nov 13, 2015 at 12:24:52PM +0200, Michael S. Tsirkin wrote: > On Fri, Nov 13, 2015 at 10:03:29AM +0800, Yuanhan Liu wrote: > > On Thu, Nov 12, 2015 at 04:44:19PM +0200, Michael S. Tsirkin wrote: > > > On Thu, Nov 12, 2015 at 10:08:15PM +0800, Yuanhan Liu wrote: > >

[Qemu-devel] [PATCH 1/2] vhost: let SET_VRING_ENABLE message depends on protocol feature

2015-11-12 Thread Yuanhan Liu
But not depend on PROTOCOL_F_MQ feature bit. So that we could use SET_VRING_ENABLE to sign the backend on stop, even if MQ is disabled. That's reasonable, since we will have one queue pair at least. Signed-off-by: Yuanhan Liu --- hw/virtio/vhost-user.c | 2 +- 1 file changed, 1 insertion(

[Qemu-devel] [PATCH 2/2] vhost: don't send RESET_OWNER at stop

2015-11-12 Thread Yuanhan Liu
First of all, RESET_OWNER message is sent incorrectly, as it's sent before GET_VRING_BASE. And the reset message would let the later call get nothing correct. And, sending SET_VRING_ENABLE at stop, which has already been done, makes more sense than RESET_OWNER. Signed-off-by: Yuanha

Re: [Qemu-devel] [PATCH v4 0/5] handle vhost reset/start/stop correctly

2015-11-12 Thread Yuanhan Liu
On Thu, Nov 12, 2015 at 04:44:19PM +0200, Michael S. Tsirkin wrote: > On Thu, Nov 12, 2015 at 10:08:15PM +0800, Yuanhan Liu wrote: > > On Thu, Nov 12, 2015 at 03:33:41PM +0200, Michael S. Tsirkin wrote: > > > On Wed, Nov 11, 2015 at 09:24:36PM +0800, Yuanhan Liu wrote: > &

Re: [Qemu-devel] [PATCH v4 0/5] handle vhost reset/start/stop correctly

2015-11-12 Thread Yuanhan Liu
On Thu, Nov 12, 2015 at 03:33:41PM +0200, Michael S. Tsirkin wrote: > On Wed, Nov 11, 2015 at 09:24:36PM +0800, Yuanhan Liu wrote: > > > > Patch 1 rename RESET_DEVICE back to RESET_OWNER > > > > Patch 2 introduced a new function: vhost_net_reset(), which is invoked >

[Qemu-devel] [PATCH v4 5/5] vhost: send SET_VRING_ENABLE at start/stop

2015-11-11 Thread Yuanhan Liu
Send SET_VRING_ENABLE at start/stop, to give the backend an explicit sign of our state. Signed-off-by: Yuanhan Liu --- hw/virtio/vhost.c | 9 + 1 file changed, 9 insertions(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index be48511..0e956b5 100644 --- a/hw/virtio/vhost.c +++ b

[Qemu-devel] [PATCH v4 4/5] vhost: send SET_PROTOCOL_FEATURES at start

2015-11-11 Thread Yuanhan Liu
So that the backend can restore the protocol features after a reset. Signed-off-by: Yuanhan Liu --- hw/virtio/vhost.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index de29968..be48511 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c

[Qemu-devel] [PATCH v4 1/5] vhost: rename RESET_DEVICE backto RESET_OWNER

2015-11-11 Thread Yuanhan Liu
This patch basically reverts commit d1f8b30e. It turned out that it breaks stuff, so revert it: http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg00949.html CC: "Michael S. Tsirkin" Reported-by: Paolo Bonzini Signed-off-by: Yuanhan Liu --- docs/specs/vhost-user

[Qemu-devel] [PATCH v4 0/5] handle vhost reset/start/stop correctly

2015-11-11 Thread Yuanhan Liu
to send this version. --- Yuanhan Liu (5): vhost: rename RESET_DEVICE backto RESET_OWNER vhost: reset vhost net when virtio_net_reset happens vhost: introduce vhost_set/get_protocol_features callbacks vhost: send SET_PROTOCOL_FEATURES at start vhost: send SET_VRING_ENABLE at start/stop docs/

[Qemu-devel] [PATCH v4 3/5] vhost: introduce vhost_set/get_protocol_features callbacks

2015-11-11 Thread Yuanhan Liu
Signed-off-by: Yuanhan Liu --- hw/virtio/vhost-user.c| 7 +++ include/hw/virtio/vhost-backend.h | 6 ++ 2 files changed, 13 insertions(+) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 4766f98..2d8bdbd 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio

[Qemu-devel] [PATCH v4 2/5] vhost: reset vhost net when virtio_net_reset happens

2015-11-11 Thread Yuanhan Liu
When a virtio net driver is unloaded (unbind), virtio_net_reset happens. For vhost net, we should also send a message (RESET_OWNER) to the backend to do some proper reset settings. Signed-off-by: Yuanhan Liu --- hw/net/vhost_net.c | 20 ++-- hw/net/virtio-net.c | 14

Re: [Qemu-devel] [PATCH] vhost-user: set link down when the char device is closed

2015-11-10 Thread Yuanhan Liu
Thanks. Reviewed-by: Yuanhan Liu --yliu On Wed, Nov 11, 2015 at 02:53:29PM +0800, Wen Congyang wrote: > Signed-off-by: Wen Congyang > --- > net/vhost-user.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/vhost-user.c b/net/vh

Re: [Qemu-devel] [PULL 12/22] vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE

2015-11-08 Thread Yuanhan Liu
On Fri, Nov 06, 2015 at 10:01:58AM +, Peter Maydell wrote: > On 6 November 2015 at 01:34, Yuanhan Liu wrote: > > On Thu, Nov 05, 2015 at 11:42:15AM +, Peter Maydell wrote: > >> On 3 October 2015 at 17:33, Michael S. Tsirkin wrote: > >> > On Fri, Oct 02, 2

Re: [Qemu-devel] [PULL 12/22] vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE

2015-11-05 Thread Yuanhan Liu
On Thu, Nov 05, 2015 at 11:42:15AM +, Peter Maydell wrote: > On 3 October 2015 at 17:33, Michael S. Tsirkin wrote: > > On Fri, Oct 02, 2015 at 06:18:51PM +0200, Paolo Bonzini wrote: > >> > >> > >> On 24/09/2015 15:20, Michael S. Tsirkin wrote: > >

[Qemu-devel] [PATCH v3 1/3] vhost: rename VHOST_RESET_DEVICE back to VHOST_RESET_OWNER

2015-10-23 Thread Yuanhan Liu
It turned out that it breaks stuff (VHOST_RESET_OWNER is not defined), so revert it: http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg00949.html CC: "Michael S. Tsirkin" Reported-by: Paolo Bonzini Signed-off-by: Yuanhan Liu --- docs/specs/vhost-user.txt | 4 ++--

[Qemu-devel] [PATCH v3 2/3] doc: vhost-user: request naming fix

2015-10-23 Thread Yuanhan Liu
They are VHOST_USER_XXX instead of VHOST_XXX messages. Also, add VHOST_USER_GET_QUEUE_NUM to the section that requries replies. Cc: Michael S. Tsirkin Signed-off-by: Yuanhan Liu --- docs/specs/vhost-user.txt | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff

[Qemu-devel] [PATCH v3 0/3] vhost-user mq sequel works

2015-10-23 Thread Yuanhan Liu
later. Patch 2 is a minor fix or request naming in vhost-user spec Patch 3 adds the vhost-user mq unit test --- Yuanhan Liu (3): vhost: rename VHOST_RESET_DEVICE back to VHOST_RESET_OWNER doc: vhost-user: request naming fix vhost-user-test: add multiple queue test docs/specs/vhost-user.txt

[Qemu-devel] [PATCH v3 3/3] vhost-user-test: add multiple queue test

2015-10-23 Thread Yuanhan Liu
Setting VHOST_USER_PROTOCOL_F_MQ protocol feature bit to claim that we support MQ feature, and simply assume we support 2 queue pairs at most. Cc: Michael S. Tsirkin Cc: Jason Wang Signed-off-by: Yuanhan Liu --- tests/vhost-user-test.c | 23 +-- 1 file changed, 21

Re: [Qemu-devel] [PATCH v2 5/5] vhost: send VHOST_USER_SET_VRING_ENABLE at start/stop

2015-10-21 Thread Yuanhan Liu
On Wed, Oct 21, 2015 at 05:11:44PM +0300, Michael S. Tsirkin wrote: > On Wed, Oct 21, 2015 at 09:43:16PM +0800, Yuanhan Liu wrote: > > On Wed, Oct 21, 2015 at 01:39:11PM +0300, Michael S. Tsirkin wrote: > > > On Wed, Oct 21, 2015 at 05:07:18PM +0800, Yuanhan Liu w

Re: [Qemu-devel] [PATCH v2 1/5] Revert "vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE"

2015-10-21 Thread Yuanhan Liu
On Wed, Oct 21, 2015 at 05:13:49PM +0300, Michael S. Tsirkin wrote: > On Wed, Oct 21, 2015 at 09:04:17PM +0800, Yuanhan Liu wrote: > > On Wed, Oct 21, 2015 at 01:40:59PM +0300, Michael S. Tsirkin wrote: > > > On Wed, Oct 21, 2015 at 05:07:14PM +0800, Yuanhan Liu wrote: > >

Re: [Qemu-devel] [PATCH v2 5/5] vhost: send VHOST_USER_SET_VRING_ENABLE at start/stop

2015-10-21 Thread Yuanhan Liu
On Wed, Oct 21, 2015 at 01:39:11PM +0300, Michael S. Tsirkin wrote: > On Wed, Oct 21, 2015 at 05:07:18PM +0800, Yuanhan Liu wrote: > > Send VHOST_USER_SET_VRING_ENABLE at start/stop when multiple queue > > is negotiated, to inform the backend that we are ready or not. > > OK

Re: [Qemu-devel] [PATCH v2 1/5] Revert "vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE"

2015-10-21 Thread Yuanhan Liu
On Wed, Oct 21, 2015 at 01:40:59PM +0300, Michael S. Tsirkin wrote: > On Wed, Oct 21, 2015 at 05:07:14PM +0800, Yuanhan Liu wrote: > > This reverts commit d1f8b30ec8dde0318fd1b98d24a64926feae9625. > > > > It turned out that it breaks stuff, so revert it: > > >

Re: [Qemu-devel] [PATCH 1/3] Revert "vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE"

2015-10-21 Thread Yuanhan Liu
On Wed, Oct 21, 2015 at 12:15:52PM +0300, Michael S. Tsirkin wrote: > On Wed, Oct 21, 2015 at 04:55:16PM +0800, Yuanhan Liu wrote: > > On Fri, Oct 16, 2015 at 10:47:49AM +0300, Michael S. Tsirkin wrote: > > > On Fri, Oct 16, 2015 at 03:32:56PM +0800, Yuanhan Liu wrote: > >

Re: [Qemu-devel] [PATCH 1/3] Revert "vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE"

2015-10-21 Thread Yuanhan Liu
On Fri, Oct 16, 2015 at 10:47:49AM +0300, Michael S. Tsirkin wrote: > On Fri, Oct 16, 2015 at 03:32:56PM +0800, Yuanhan Liu wrote: > > On Fri, Oct 16, 2015 at 10:21:40AM +0300, Michael S. Tsirkin wrote: > > > On Fri, Oct 16, 2015 at 03:18:59PM +0800, Yuanhan Liu wrote: > >

[Qemu-devel] [PATCH v2 5/5] vhost: send VHOST_USER_SET_VRING_ENABLE at start/stop

2015-10-21 Thread Yuanhan Liu
Send VHOST_USER_SET_VRING_ENABLE at start/stop when multiple queue is negotiated, to inform the backend that we are ready or not. And exclude VHOST_USER_GET_QUEUE_NUM as one time request, as we need to get max_queues for each vhost_dev. Suggested-by: Michael S. Tsirkin Signed-off-by: Yuanhan

[Qemu-devel] [PATCH v2 4/5] Revert "vhost-user: Send VHOST_RESET_OWNER on vhost stop"

2015-10-21 Thread Yuanhan Liu
ned-off-by: Yuanhan Liu --- hw/net/vhost_net.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 804f5c9..95da5f8 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -293,13 +293,6 @@ static void vhost_net_stop_one(struct vhos

[Qemu-devel] [PATCH v2 1/5] Revert "vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE"

2015-10-21 Thread Yuanhan Liu
This reverts commit d1f8b30ec8dde0318fd1b98d24a64926feae9625. It turned out that it breaks stuff, so revert it: http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg00949.html CC: "Michael S. Tsirkin" Reported-by: Paolo Bonzini Signed-off-by: Yuanhan Liu --- docs/s

[Qemu-devel] [PATCH v2 2/5] doc: vhost-user: request naming fix

2015-10-21 Thread Yuanhan Liu
They are VHOST_USER_XXX instead of VHOST_XXX messages. Also, add VHOST_USER_GET_QUEUE_NUM to the section that requries replies. Cc: Michael S. Tsirkin Signed-off-by: Yuanhan Liu --- docs/specs/vhost-user.txt | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a

[Qemu-devel] [PATCH v2 3/5] vhost-user-test: add multiple queue test

2015-10-21 Thread Yuanhan Liu
Setting VHOST_USER_PROTOCOL_F_MQ protocol feature bit to claim that we support MQ feature, and simply assume we support 0xff queue pairs at most. Cc: Michael S. Tsirkin Cc: Jason Wang Signed-off-by: Yuanhan Liu --- v2: use macro to define the max queues we support --- tests/vhost-user-test.c

Re: [Qemu-devel] [PATCH 1/3] Revert "vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE"

2015-10-16 Thread Yuanhan Liu
On Fri, Oct 16, 2015 at 11:15:23AM +0300, Michael S. Tsirkin wrote: > On Fri, Oct 16, 2015 at 04:04:09PM +0800, Yuanhan Liu wrote: > > On Fri, Oct 16, 2015 at 10:47:49AM +0300, Michael S. Tsirkin wrote: > > > On Fri, Oct 16, 2015 at 03:32:56PM +0800, Yuanhan Liu wrote: > >

Re: [Qemu-devel] [PATCH 1/3] Revert "vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE"

2015-10-16 Thread Yuanhan Liu
On Fri, Oct 16, 2015 at 10:47:49AM +0300, Michael S. Tsirkin wrote: > On Fri, Oct 16, 2015 at 03:32:56PM +0800, Yuanhan Liu wrote: > > On Fri, Oct 16, 2015 at 10:21:40AM +0300, Michael S. Tsirkin wrote: > > > On Fri, Oct 16, 2015 at 03:18:59PM +0800, Yuanhan Liu wrote: > >

Re: [Qemu-devel] [PATCH 3/3] vhost-user-test: add multiple queue test

2015-10-16 Thread Yuanhan Liu
On Fri, Oct 16, 2015 at 10:20:08AM +0300, Michael S. Tsirkin wrote: > On Fri, Oct 16, 2015 at 03:19:01PM +0800, Yuanhan Liu wrote: > > Setting VHOST_USER_PROTOCOL_F_MQ protocol feature bit to claim that we > > support MQ feature, and simply assume we support 2 queue pairs at

Re: [Qemu-devel] [PATCH 1/3] Revert "vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE"

2015-10-16 Thread Yuanhan Liu
On Fri, Oct 16, 2015 at 10:21:40AM +0300, Michael S. Tsirkin wrote: > On Fri, Oct 16, 2015 at 03:18:59PM +0800, Yuanhan Liu wrote: > > This reverts commit d1f8b30ec8dde0318fd1b98d24a64926feae9625. > > > > It turned out that it breaks stuff, so revert it: > > >

[Qemu-devel] [PATCH 1/3] Revert "vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE"

2015-10-16 Thread Yuanhan Liu
This reverts commit d1f8b30ec8dde0318fd1b98d24a64926feae9625. It turned out that it breaks stuff, so revert it: http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg00949.html CC: "Michael S. Tsirkin" Reported-by: Paolo Bonzini Signed-off-by: Yuanhan Liu --- docs/s

[Qemu-devel] [PATCH 2/3] doc: vhost-user: request naming fix

2015-10-16 Thread Yuanhan Liu
They are VHOST_USER_XXX instead of VHOST_XXX messages. Also, add VHOST_USER_GET_QUEUE_NUM to the section that requries replies. Cc: Michael S. Tsirkin Signed-off-by: Yuanhan Liu --- docs/specs/vhost-user.txt | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a

[Qemu-devel] [PATCH 3/3] vhost-user-test: add multiple queue test

2015-10-16 Thread Yuanhan Liu
Setting VHOST_USER_PROTOCOL_F_MQ protocol feature bit to claim that we support MQ feature, and simply assume we support 2 queue pairs at most. Cc: Michael S. Tsirkin Cc: Jason Wang Signed-off-by: Yuanhan Liu --- tests/vhost-user-test.c | 18 -- 1 file changed, 16 insertions

Re: [Qemu-devel] [PULL 12/22] vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE

2015-10-07 Thread Yuanhan Liu
On Sat, Oct 03, 2015 at 07:33:16PM +0300, Michael S. Tsirkin wrote: > On Fri, Oct 02, 2015 at 06:18:51PM +0200, Paolo Bonzini wrote: > > > > > > On 24/09/2015 15:20, Michael S. Tsirkin wrote: > > > From: Yuanhan Liu > > > > > > Quote from M

[Qemu-devel] [PATCH v12 5/7] vhost: introduce vhost_backend_get_vq_index method

2015-09-24 Thread Yuanhan Liu
d-off-by: Yuanhan Liu Reviewed-by: Jason Wang Tested-by: Marcel Apfelbaum --- hw/virtio/vhost-backend.c | 10 +- hw/virtio/vhost-user.c| 12 ++-- hw/virtio/vhost.c | 15 ++- include/hw/virtio/vhost-backend.h | 2 ++ 4 files changed, 27 in

[Qemu-devel] [PATCH v12 3/7] vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE

2015-09-24 Thread Yuanhan Liu
e, instead of per-queue or something else. Suggested-by: Michael S. Tsirkin Signed-off-by: Yuanhan Liu Reviewed-by: Marcel Apfelbaum Tested-by: Marcel Apfelbaum --- docs/specs/vhost-user.txt | 4 ++-- hw/net/vhost_net.c | 2 +- hw/virtio/vhost-user.c | 6 +++--- linux-headers/linu

[Qemu-devel] [PATCH v12 7/7] vhost-user: add a new message to disable/enable a specific virt queue.

2015-09-24 Thread Yuanhan Liu
1 to max virt queue pair. Signed-off-by: Changchun Ouyang Signed-off-by: Yuanhan Liu Reviewed-by: Jason Wang Tested-by: Marcel Apfelbaum --- docs/specs/vhost-user.txt | 12 +++- hw/net/vhost_net.c| 18 ++ hw/net/virtio-net.c

[Qemu-devel] [PATCH v12 4/7] vhost-user: add VHOST_USER_GET_QUEUE_NUM message

2015-09-24 Thread Yuanhan Liu
done in the following patch. Signed-off-by: Yuanhan Liu Reviewed-by: Marcel Apfelbaum Tested-by: Marcel Apfelbaum --- v12: mark VHOST_USER_GET_QUEUE_NUM as a message need reply. --- docs/specs/vhost-user.txt | 12 hw/net/vhost_net.c| 12 hw/virtio/vhost-user.c

[Qemu-devel] [PATCH v12 2/7] vhost-user: add protocol feature negotiation

2015-09-24 Thread Yuanhan Liu
From: "Michael S. Tsirkin" Support a separate bitmask for vhost-user protocol features, and messages to get/set protocol features. Invoke them at init. No features are defined yet. [ leverage vhost_user_call for request handling -- Yuanhan Liu ] Signed-off-by: Michael S. Tsirkin

[Qemu-devel] [PATCH v12 6/7] vhost-user: add multiple queue support

2015-09-24 Thread Yuanhan Liu
imply ignore them when they are not sent the first time. Signed-off-by: Nikolay Nikolaev Signed-off-by: Changchun Ouyang Signed-off-by: Yuanhan Liu Reviewed-by: Jason Wang Tested-by: Marcel Apfelbaum --- v12: rename vhost_user_one_time_request() to vhost_user_dev_request().

[Qemu-devel] [PATCH v12 0/7] vhost-user multiple queue support

2015-09-24 Thread Yuanhan Liu
event handler once. Which is also suggested by Jason Wang. Thanks. --yliu --- Changchun Ouyang (2): vhost-user: add multiple queue support vhost-user: add a new message to disable/enable a specific virt queue. Michael S. Tsirkin (1): vhost-user: add protocol feature negotia

[Qemu-devel] [PATCH v12 1/7] vhost-user: use VHOST_USER_XXX macro for switch statement

2015-09-24 Thread Yuanhan Liu
So that we could let vhost_user_call to handle extented requests, such as VHOST_USER_GET/SET_PROTOCOL_FEATURES, instead of invoking vhost_user_read/write and constructing the msg again by ourself. Signed-off-by: Yuanhan Liu Reviewed-by: Marcel Apfelbaum Tested-by: Marcel Apfelbaum --- hw

Re: [Qemu-devel] [PATCH v11 2/7] vhost-user: add protocol feature negotiation

2015-09-24 Thread Yuanhan Liu
On Thu, Sep 24, 2015 at 01:13:24PM +0300, Marcel Apfelbaum wrote: > >diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c > >index 1d76b94..9d32d76 100644 > >--- a/hw/net/vhost_net.c > >+++ b/hw/net/vhost_net.c > >@@ -152,8 +152,10 @@ struct vhost_net *vhost_net_init(VhostNetOptions > >*options) >

Re: [Qemu-devel] [PATCH v11 2/7] vhost-user: add protocol feature negotiation

2015-09-24 Thread Yuanhan Liu
On Thu, Sep 24, 2015 at 01:13:24PM +0300, Marcel Apfelbaum wrote: > On 09/23/2015 07:19 AM, Yuanhan Liu wrote: > >From: "Michael S. Tsirkin" > > > >Support a separate bitmask for vhost-user protocol features, > >and messages to get/set protocol features.

Re: [Qemu-devel] [PATCH v11 6/7] vhost-user: add multiple queue support

2015-09-23 Thread Yuanhan Liu
On Thu, Sep 24, 2015 at 01:34:31PM +0800, Jason Wang wrote: > > > Some nitpicks and comments. If you plan to send another version, please > consider to fix them. I will, but I'd like to hold a while before getting more comments from Michael; I don't want to repost a whole new version too often f

Re: [Qemu-devel] [PATCH v11 6/7] vhost-user: add multiple queue support

2015-09-22 Thread Yuanhan Liu
On Wed, Sep 23, 2015 at 12:20:00PM +0800, Yuanhan Liu wrote: > From: Changchun Ouyang > [...] > static void net_vhost_user_event(void *opaque, int event) > { > -VhostUserState *s = opaque; > +const char *name = opaque; > +NetClientState *ncs[MAX_QUEUE_NUM]; >

[Qemu-devel] [PATCH v11 5/7] vhost: introduce vhost_backend_get_vq_index method

2015-09-22 Thread Yuanhan Liu
Minusing the idx with the base(dev->vq_index) for vhost-kernel, and then adding it back for vhost-user doesn't seem right. Here introduces a new method vhost_backend_get_vq_index() for getting the right vq index for following vhost messages calls. Suggested-by: Jason Wang Signed-off-by:

[Qemu-devel] [PATCH v11 4/7] vhost-user: add VHOST_USER_GET_QUEUE_NUM message

2015-09-22 Thread Yuanhan Liu
done in the following patch. Signed-off-by: Yuanhan Liu --- v11: define a dummy vhost_net_get_max_queues when !CONFIG_VHOST_NET. --- docs/specs/vhost-user.txt | 11 +++ hw/net/vhost_net.c| 12 hw/virtio/vhost-user.c| 15 ++- include/hw/virtio/vhost.h

[Qemu-devel] [PATCH v11 3/7] vhost: rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE

2015-09-22 Thread Yuanhan Liu
Quote from Michael: We really should rename VHOST_RESET_OWNER to VHOST_RESET_DEVICE. Suggested-by: Michael S. Tsirkin Signed-off-by: Yuanhan Liu --- docs/specs/vhost-user.txt | 4 ++-- hw/net/vhost_net.c | 2 +- hw/virtio/vhost-user.c | 6 +++--- linux-headers/linux

  1   2   >