Re: [Qemu-devel] [PATCH V4 00/22] Multiqueue virtio-net

2013-01-31 Thread Jason Wang
On 01/31/2013 09:44 PM, Eric Blake wrote: > On 01/31/2013 12:00 AM, Jason Wang wrote: >> On 01/31/2013 02:29 AM, Eric Blake wrote: >>> On 01/30/2013 04:12 AM, Jason Wang wrote: >>> >>>> With this changes, user could start a multiqueue virtio-net device thro

Re: [Qemu-devel] [PATCH V4 00/22] Multiqueue virtio-net

2013-01-31 Thread Jason Wang
On 01/31/2013 10:36 PM, Michael S. Tsirkin wrote: > On Thu, Jan 31, 2013 at 04:21:49PM +0200, Michael S. Tsirkin wrote: >> On Wed, Jan 30, 2013 at 07:12:19PM +0800, Jason Wang wrote: >>> Hello all: >>> >>> This seires is an update of last version of multiqu

[Qemu-devel] [PATCH V4 RESEND 00/22] Multiqueue virtio-net

2013-01-31 Thread Jason Wang
410.53 378.69 9412.61 286.18 9409.75 278.31 4096 4 9487.35 374.1 9556.91 288.81 9441.94 221.64 16384 1 9380.43 403.8 9379.78 399.13 9382.42 393.55 16384 2 9367.69 406.93 9415.04 312.68 9409.29 300.9 16384 4 9391.96 405.17 9695.12 310.54 9423.76 223.47 Jason Wang (22): net: tap: using bool inste

[Qemu-devel] [PATCH V4 RESEND 03/22] net: introduce qemu_get_queue()

2013-01-31 Thread Jason Wang
To support multiqueue, the patch introduce a helper qemu_get_queue() which is used to get the NetClientState of a device. The following patches would refactor this helper to support multiqueue. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- hw/cadence_gem.c|9

[Qemu-devel] [PATCH V4 RESEND 07/22] net: introduce qemu_net_client_setup()

2013-01-31 Thread Jason Wang
This patch separates the setup of NetClientState from its allocation, this will allow allocating an arrays of NetClientState and does the initialization one by one which is what multiqueue needs. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- net/net.c | 29

[Qemu-devel] [PATCH V4 RESEND 08/22] net: introduce NetClientState destructor

2013-01-31 Thread Jason Wang
To allow allocating an array of NetClientState and free it once, this patch introduces destructor of NetClientState. Which could do type specific free, which could be used by multiqueue to free the array once. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- include/net/net.h

[Qemu-devel] [PATCH V4 RESEND 14/22] tap: introduce a helper to get the name of an interface

2013-01-31 Thread Jason Wang
its name after creating the first queue. Only linux has this support since it's the only platform that supports multiqueue tap. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- include/net/tap.h |1 + net/tap-aix.c |5 + net/tap-bsd.c |5 + ne

[Qemu-devel] [PATCH V4 RESEND 19/22] virtio-net: separate virtqueue from VirtIONet

2013-01-31 Thread Jason Wang
To support multiqueue virtio-net, the first step is to separate the virtqueue related fields from VirtIONet to a new structure VirtIONetQueue. The following patches will add an array of VirtIONetQueue to VirtIONet based on this patch. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin

[Qemu-devel] [PATCH V4 RESEND 15/22] tap: multiqueue support

2013-01-31 Thread Jason Wang
e multiqueue nic support, an N peers of NetClientState were built up. A new parameter, mq_required were introduce in tap_open() to create multiqueue tap fds. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- include/net/tap.h |1 - net/tap-aix.c |3 +- net/tap-bsd.c

[Qemu-devel] [PATCH V4 RESEND 17/22] virtio: introduce virtio_del_queue()

2013-01-31 Thread Jason Wang
Some device (such as virtio-net) needs the ability to destroy or re-order the virtqueues, this patch adds a helper to do this. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- hw/virtio.c |9 + hw/virtio.h |2 ++ 2 files changed, 11 insertions(+), 0 deletions

[Qemu-devel] [PATCH V4 RESEND 13/22] tap: support enabling or disabling a queue

2013-02-01 Thread Jason Wang
only done when the tap was enabled. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- include/net/tap.h |2 ++ net/tap-win32.c | 10 ++ net/tap.c | 43 --- 3 files changed, 52 insertions(+), 3 deletions(-) diff --git

[Qemu-devel] [PATCH V4 RESEND 21/22] virtio-net: migration support for multiqueue

2013-02-01 Thread Jason Wang
This patch add migration support for multiqueue virtio-net. Instead of bumping the version, we conditionally send the info of multiqueue only when the device support more than one queue to maintain the backward compatibility. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- hw

[Qemu-devel] [PATCH V4 RESEND 12/22] tap: add Linux multiqueue support

2013-02-01 Thread Jason Wang
is only supported in Linux, return error on other platforms. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- net/tap-aix.c | 10 ++ net/tap-bsd.c | 10 ++ net/tap-haiku.c | 10 ++ net/tap-linux.c | 51

[Qemu-devel] [PATCH V4 RESEND 22/22] virtio-net: compat multiqueue support

2013-02-01 Thread Jason Wang
Disable multiqueue support for pre 1.4. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- hw/pc_piix.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/hw/pc_piix.c b/hw/pc_piix.c index ba09714..0af436c 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c

[Qemu-devel] [PATCH V4 RESEND 09/22] net: multiqueue support

2013-02-01 Thread Jason Wang
allowed. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- hw/dp8393x.c|2 +- hw/mcf_fec.c|2 +- hw/qdev-properties-system.c | 46 +++--- hw/qdev-properties.h|6 +- include/net/net.h | 18 +-- net/net.c

[Qemu-devel] [PATCH V4 RESEND 06/22] net: introduce qemu_find_net_clients_except()

2013-02-01 Thread Jason Wang
In multiqueue, all NetClientState that belongs to the same netdev or nic has the same id. So this patches introduces an helper qemu_find_net_clients_except() which finds all NetClientState with the same id. This will be used by multiqueue networking. Signed-off-by: Jason Wang Signed-off-by

[Qemu-devel] [PATCH V4 RESEND 05/22] net: intorduce qemu_del_nic()

2013-02-01 Thread Jason Wang
-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- hw/e1000.c |2 +- hw/eepro100.c|2 +- hw/ne2000.c |2 +- hw/pcnet-pci.c |2 +- hw/rtl8139.c |2 +- hw/usb/dev-network.c |2 +- hw/virtio-net.c |2 +- hw/xen_nic.c

Re: [Qemu-devel] [PATCH V4 RESEND 00/22] Multiqueue virtio-net

2013-02-01 Thread Jason Wang
On 02/01/2013 03:39 PM, Jason Wang wrote: > Hello all: > > This seires is an update of last version of multiqueue virtio-net support. Hi Anthony: This series is not applied cleanly on master, could you please pick those for 1.4? Thanks

[Qemu-devel] [PATCH V4 RESEND 02/22] net: tap: use abort() instead of assert(0)

2013-02-01 Thread Jason Wang
Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- net/tap-linux.c |4 ++-- net/tap-win32.c |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/tap-linux.c b/net/tap-linux.c index 059f5f3..0a6acc7 100644 --- a/net/tap-linux.c +++ b/net/tap-linux.c

[Qemu-devel] [PATCH V4 RESEND 01/22] net: tap: using bool instead of bitfield

2013-02-01 Thread Jason Wang
Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- hw/virtio-net.c |2 +- include/net/tap.h |4 ++-- net/tap-win32.c |6 +++--- net/tap.c | 38 ++ 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/hw

[Qemu-devel] [PATCH V4 RESEND 20/22] virtio-net: multiqueue support

2013-02-01 Thread Jason Wang
This patch implements both userspace and vhost support for multiple queue virtio-net (VIRTIO_NET_F_MQ). This is done by introducing an array of VirtIONetQueue to VirtIONet. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- hw/virtio-net.c | 301

[Qemu-devel] [PATCH V4 RESEND 10/22] tap: import linux multiqueue constants

2013-02-01 Thread Jason Wang
IFF_DETACH_QUEUE, the queue were disabled in the linux kernel. When doing this ioctl with IFF_ATTACH_QUEUE, the queue were enabled in the linux kernel. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- net/tap-linux.h |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git

[Qemu-devel] [PATCH V4 RESEND 11/22] tap: factor out common tap initialization

2013-02-01 Thread Jason Wang
This patch factors out the common initialization of tap into a new helper net_init_tap_one(). This will be used by multiqueue tap patches. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- net/tap.c | 130 ++--- 1 files

[Qemu-devel] [PATCH V4 RESEND 18/22] virtio: add a queue_index to VirtQueue

2013-02-01 Thread Jason Wang
Add a queue_index to VirtQueue and a helper to fetch it, this could be used by multiqueue supported device. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- hw/virtio.c |8 hw/virtio.h |1 + 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/hw

[Qemu-devel] [PATCH V4 RESEND 04/22] net: introduce qemu_get_nic()

2013-02-01 Thread Jason Wang
To support multiqueue, this patch introduces a helper qemu_get_nic() to get NICState from a NetClientState. The following patches would refactor this helper to support multiqueue. Signed-off-by: Jason Wang Signed-off-by: Michael S. Tsirkin --- hw/cadence_gem.c|8 hw

[Qemu-devel] scp during migration with vhost fails

2013-02-01 Thread Jason Wang
Hello all: During testing, I find doing scp during migration with vhost fails with warnings in guest like: Corrupted MAC on input. Disconnecting: Packet corrupt. lost connection Here's the bisect result: Commit a01672d3968cf91208666d371784110bfde9d4f8 kvm: convert to MemoryListener API is the

Re: [Qemu-devel] Headsup: windows virtio networking does not work on current git

2013-02-02 Thread Jason Wang
hen it's very likely not a driver problem. Thanks. > > Regards, > > Anthony Liguori Have a look at this issue. It was caused by multiqueue patch who adds a new field to virtio_net_cfg. Not sure multiqueue is the root cause since I also find even w/o multiqueue, a

Re: [Qemu-devel] [PATCHv2] virtio-net: remove mq feature flag

2013-02-04 Thread Jason Wang
round for buggy windows > guests. > > Signed-off-by: Michael S. Tsirkin Looks a nice fix. Acked-by: Jason Wang Tested with windows guest and Linux guest (both mq and sq). So: Tested-by: Jason Wang > --- > hw/pc_piix.c| 4 > hw/virtio-net.c | 8 +++- > hw/vi

Re: [Qemu-devel] [PATCH for-1.4] net: fix infinite loop on exit

2013-02-06 Thread Jason Wang
gt; { > -int i, queues = nic->conf->queues; > +int i, queues = MAX(nic->conf->queues, 1); > > /* If this is a peer NIC and peer has already been deleted, free it now. > */ > if (nic->peer_deleted) { Acked-by: Jason Wang Alternatively, we can set the conf->queues to 1 in qemu_new_nic() if we find it was 0. But this fix is ok enough. Thanks

Re: [Qemu-devel] [PATCH V4 RESEND 09/22] net: multiqueue support

2013-02-18 Thread Jason Wang
On 02/13/2013 05:21 AM, Alexander Graf wrote: > On 01.02.2013, at 08:39, Jason Wang wrote: > >> This patch adds basic multiqueue support for qemu. The idea is simple, an >> array >> of NetClientStates were introduced in NICState, parse_netdev() were extended >

Re: [Qemu-devel] High memory usage by multiqueue

2013-02-20 Thread Jason Wang
On 02/20/2013 02:59 AM, Edivaldo de Araujo Pereira wrote: > Dear Jason, > > In the last 2 weeks, I noticed a significant increase in the memory usage of > qemu. Just to assess the stability of my system, I usually run a kind of > stress test, every time I install a new kernel in my host or in a c

[Qemu-devel] [PATCH] tap: forbid creating multiqueue tap when hub is used

2013-02-20 Thread Jason Wang
Obviously, hub does not support multiqueue tap. So this patch forbids creating multiple queue tap when hub is used to prevent the crash when command line such as "-net tap,queues=2" is used. Signed-off-by: Jason Wang --- This patch is needed for 1.4 stable also. --- net/tap.c |6

Re: [Qemu-devel] [PATCH V4 RESEND 15/22] tap: multiqueue support

2013-02-20 Thread Jason Wang
On 02/11/2013 06:28 PM, Markus Armbruster wrote: > Commit 264986e2 extended NetdevTapOptions without updating the > documentation. Hasn't been addressed since. Must fix for 1.4, in my > opinion. Will send a patch to fix this. Thanks > > This is the offending patch: &g

Re: [Qemu-devel] [PATCH] tap: forbid creating multiqueue tap when hub is used

2013-02-20 Thread Jason Wang
On 02/20/2013 05:45 PM, Paolo Bonzini wrote: > Il 20/02/2013 10:18, Jason Wang ha scritto: >> Obviously, hub does not support multiqueue tap. So this patch forbids >> creating >> multiple queue tap when hub is used to prevent the crash when command line >> such >&g

[Qemu-devel] [PATCH RESEND for 1.4-stable] net: reduce memory allocation when multiqueue is not used

2013-02-20 Thread Jason Wang
1.5, we will use dynamic allocation instead. Cc: Edivaldo de Araujo Pereira Signed-off-by: Jason Wang --- RESEND since the previous mail misses the list. --- include/net/net.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index

[Qemu-devel] [PATCH] help: add docs for multiqueue tap options

2013-02-20 Thread Jason Wang
Cc: Markus Armbruster Cc: Jason Wang Signed-off-by: Jason Wang --- This patch is neede for 1.4 stable also. --- qapi-schema.json |6 ++ qemu-options.hx |4 +++- 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index 7275b5d

Re: [Qemu-devel] [PATCH] tap: forbid creating multiqueue tap when hub is used

2013-02-20 Thread Jason Wang
On 02/20/2013 09:08 PM, Stefan Hajnoczi wrote: > On Wed, Feb 20, 2013 at 05:18:08PM +0800, Jason Wang wrote: >> diff --git a/net/tap.c b/net/tap.c >> index 48c254e..1e14f59 100644 >> --- a/net/tap.c >> +++ b/net/tap.c >> @@ -693,6 +693,12 @@ int net_init_tap(co

[Qemu-devel] [PATCH V2] tap: forbid creating multiqueue tap when hub is used

2013-02-20 Thread Jason Wang
Obviously, hub does not support multiqueue tap. So this patch forbids creating multiple queue tap when hub is used to prevent the crash when command line such as "-net tap,queues=2" is used. Cc: qemu-sta...@nongnu.org Signed-off-by: Jason Wang --- Changes from V1: - Add a comment to e

Re: [Qemu-devel] [PATCH RESEND for 1.4-stable] net: reduce memory allocation when multiqueue is not used

2013-02-20 Thread Jason Wang
On 02/20/2013 09:01 PM, Stefan Hajnoczi wrote: > On Wed, Feb 20, 2013 at 06:11:33PM +0800, Jason Wang wrote: >> Edivaldo reports a problem that the array of NetClientState in NICState is >> too >> large - MAX_QUEUE_NUM(1024) which will waste memory even if multiqueue is not &

Re: [Qemu-devel] scp during migration with vhost fails

2013-02-21 Thread Jason Wang
On 02/20/2013 10:23 PM, Michael S. Tsirkin wrote: > On Fri, Feb 01, 2013 at 06:03:32PM +0800, Jason Wang wrote: >> Hello all: >> >> During testing, I find doing scp during migration with vhost fails with >> warnings in guest like: >> >> Corrupted MAC on

[Qemu-devel] [PATCH] net: reduce the unnecessary memory allocation of multiqueue

2013-02-21 Thread Jason Wang
VirtIONetQueue array in VirtIONet. Tested by myself, with single virtio-net-pci device. The memory allocation is almost the same as when multiqueue is not merged. Cc: Edivaldo de Araujo Pereira Cc: qemu-sta...@nongnu.org Signed-off-by: Jason Wang --- hw/virtio-net.c |6 -- include/net

Re: [Qemu-devel] scp during migration with vhost fails

2013-02-21 Thread Jason Wang
On 02/21/2013 12:48 AM, Michael S. Tsirkin wrote: > On Wed, Feb 20, 2013 at 04:23:52PM +0200, Michael S. Tsirkin wrote: >> On Fri, Feb 01, 2013 at 06:03:32PM +0800, Jason Wang wrote: >>> Hello all: >>> >>> During testing, I find doing scp during migration wi

Re: [Qemu-devel] [PATCH] help: add docs for multiqueue tap options

2013-02-21 Thread Jason Wang
On 02/21/2013 11:09 PM, Markus Armbruster wrote: > Jason Wang writes: > >> Cc: Markus Armbruster >> Cc: Jason Wang >> Signed-off-by: Jason Wang >> --- >> This patch is neede for 1.4 stable also. >> --- >> qapi-schema.json |6 ++ >>

Re: [Qemu-devel] [PATCH] help: add docs for multiqueue tap options

2013-02-21 Thread Jason Wang
On 02/21/2013 11:12 PM, Markus Armbruster wrote: > Jason Wang writes: > >> Cc: Markus Armbruster >> Cc: Jason Wang >> Signed-off-by: Jason Wang >> --- >> This patch is neede for 1.4 stable also. > Forgot to mention, the recommended way to nominate for

Re: [Qemu-devel] [PATCH] net: reduce the unnecessary memory allocation of multiqueue

2013-02-21 Thread Jason Wang
On 02/22/2013 06:32 AM, Anthony Liguori wrote: > Jason Wang writes: > >> Edivaldo reports a problem that the array of NetClientState in NICState is >> too >> large - MAX_QUEUE_NUM(1024) which will wastes memory even if multiqueue is >> not >> used. >>

[Qemu-devel] [PATCH V2] help: add docs for multiqueue tap options

2013-02-21 Thread Jason Wang
Cc: Markus Armbruster Cc: qemu-sta...@nongnu.org Signed-off-by: Jason Wang --- Changes from V1: - Add the missing docs for 'queues' (Markus) --- qapi-schema.json |8 qemu-options.hx |5 - 2 files changed, 12 insertions(+), 1 deletions(-) diff --git a/qapi-sch

Re: [Qemu-devel] [PATCH V2] help: add docs for multiqueue tap options

2013-02-22 Thread Jason Wang
On 02/22/2013 06:36 PM, Markus Armbruster wrote: > Jason Wang writes: > >> Cc: Markus Armbruster >> Cc: qemu-sta...@nongnu.org >> Signed-off-by: Jason Wang >> --- >> Changes from V1: >> - Add the missing docs for 'queues' (Markus) > V1 go

Re: [Qemu-devel] [PATCH] net: reduce the unnecessary memory allocation of multiqueue

2013-02-22 Thread Jason Wang
On 02/22/2013 09:18 PM, Anthony Liguori wrote: > Stefan Hajnoczi writes: > >> On Thu, Feb 21, 2013 at 05:45:57PM +0800, Jason Wang wrote: >>> @@ -1397,6 +1398,7 @@ void virtio_net_exit(VirtIODevice *vdev) >>> >>> g_free(n->mac_table.macs); >>

[Qemu-devel] [PATCH] help: add docs for missing 'queues' option of tap

2013-02-22 Thread Jason Wang
Cc: Markus Armbruster Cc: qemu-sta...@nongnu.org Signed-off-by: Jason Wang --- qapi-schema.json |2 ++ qemu-options.hx |3 ++- 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index cd7ea25..b3844e6 100644 --- a/qapi-schema.json +++ b

[Qemu-devel] [PATCH V2] net: reduce the unnecessary memory allocation of multiqueue

2013-02-22 Thread Jason Wang
VirtIONetQueue array in VirtIONet. Tested by myself, with single virtio-net-pci device. The memory allocation is almost the same as when multiqueue is not merged. Cc: Edivaldo de Araujo Pereira Cc: qemu-sta...@nongnu.org Signed-off-by: Jason Wang --- Changes from V1: - Fix use after free (Stefan

Re: [Qemu-devel] scp during migration with vhost fails

2013-02-22 Thread Jason Wang
On 02/21/2013 07:23 PM, Michael S. Tsirkin wrote: > On Thu, Feb 21, 2013 at 05:57:04PM +0800, Jason Wang wrote: >> On 02/21/2013 12:48 AM, Michael S. Tsirkin wrote: >>> On Wed, Feb 20, 2013 at 04:23:52PM +0200, Michael S. Tsirkin wrote: >>>> On Fri, Feb 01, 2013 a

Re: [Qemu-devel] scp during migration with vhost fails

2013-02-24 Thread Jason Wang
On 02/24/2013 05:54 AM, Michael S. Tsirkin wrote: > On Sat, Feb 23, 2013 at 10:49:29PM +0200, Michael S. Tsirkin wrote: >> On Fri, Feb 22, 2013 at 11:33:53PM +0800, Jason Wang wrote: >>> On 02/21/2013 07:23 PM, Michael S. Tsirkin wrote: >>>> On Thu, Feb 21, 2013 a

Re: [Qemu-devel] scp during migration with vhost fails

2013-02-24 Thread Jason Wang
On 02/25/2013 01:57 PM, Jason Wang wrote: > On 02/24/2013 05:54 AM, Michael S. Tsirkin wrote: >> On Sat, Feb 23, 2013 at 10:49:29PM +0200, Michael S. Tsirkin wrote: >>> On Fri, Feb 22, 2013 at 11:33:53PM +0800, Jason Wang wrote: >>>> On 02/21/2013 07:23 PM, Michael

Re: [Qemu-devel] scp during migration with vhost fails

2013-02-25 Thread Jason Wang
On 02/25/2013 06:01 PM, Michael S. Tsirkin wrote: > On Mon, Feb 25, 2013 at 02:11:44PM +0800, Jason Wang wrote: >> On 02/25/2013 01:57 PM, Jason Wang wrote: >>> On 02/24/2013 05:54 AM, Michael S. Tsirkin wrote: >>>> On Sat, Feb 23, 2013 at 10:49:29PM +0200, Michael

Re: [Qemu-devel] scp during migration with vhost fails

2013-02-26 Thread Jason Wang
On 02/26/2013 04:44 PM, Michael S. Tsirkin wrote: > On Tue, Feb 26, 2013 at 02:41:03PM +0800, Jason Wang wrote: >> On 02/25/2013 06:01 PM, Michael S. Tsirkin wrote: >>> On Mon, Feb 25, 2013 at 02:11:44PM +0800, Jason Wang wrote: >>>> On 02/25/2013 01:57 PM, Jason Wang

Re: [Qemu-devel] [PATCHv2 for-1.4] vhost: memory sync fixes

2013-02-26 Thread Jason Wang
ddress of a region, which might overflow to 0 > and cause us to skip the region when the region ends at > ~0x0ull. > > Signed-off-by: Michael S. Tsirkin > Tested-by: Jason Wang Also need for 1.3 Acked-by: Jason Wang > --- > hw/vhost.c | 49

Re: [Qemu-devel] [PATCHv2 for-1.4] e1000: unbreak the guest network migration to 1.3

2013-02-26 Thread Jason Wang
f-by: Michael S. Tsirkin Reviewed-by: Jason Wang Thanks. > --- > hw/e1000.c | 25 + > hw/pc_piix.c | 4 > 2 files changed, 29 insertions(+) > > diff --git a/hw/e1000.c b/hw/e1000.c > index d6fe815..876d421 100644 > --- a/hw/e1000.c

Re: [Qemu-devel] [PATCH 11/14] virtio-net: fix used len for tx

2012-09-24 Thread Jason Wang
On 09/25/2012 07:05 AM, Michael S. Tsirkin wrote: There is no out sg for TX, so used buf length for tx should always be 0. According to the spec, the len is "Total length of the descriptor chain which was used (written to)". So I wonder if we need to pass the len here, it looks useful for gue

Re: [Qemu-devel] [PATCH] rtl8139: implement 8139cp link status

2012-09-10 Thread Jason Wang
On 09/10/2012 03:59 PM, Amos Kong wrote: From: Jason Wang Add a link status chang callback and change the link status bit in BMSR & MSR accordingly. Tested in Linux/Windows guests. Signed-off-by: Jason Wang Signed-off-by: Amos Kong --- hw/rtl8139.c | 23 +-- 1 f

Re: [Qemu-devel] [PATCH] rtl8139: implement 8139cp link status

2012-09-13 Thread Jason Wang
On 09/10/2012 04:15 PM, Jason Wang wrote: On 09/10/2012 03:59 PM, Amos Kong wrote: From: Jason Wang Add a link status chang callback and change the link status bit in BMSR & MSR accordingly. Tested in Linux/Windows guests. Signed-off-by: Jason Wang Signed-off-by: Amos Kong --- hw/rtl81

Re: [Qemu-devel] [PATCH v2] rtl8139: implement 8139cp link status

2012-09-14 Thread Jason Wang
On 09/14/2012 03:30 PM, Stefan Hajnoczi wrote: On Fri, Sep 14, 2012 at 2:34 AM, Amos Kong wrote: On 13/09/12 20:29, Stefan Hajnoczi wrote: On Thu, Sep 13, 2012 at 9:51 AM, Amos Kong wrote: Regarding migration: do we migrate the NetClient->link_down field? If we only migrate the status registe

Re: [Qemu-devel] [PATCH v4 0/3] net: fix link status

2012-09-16 Thread Jason Wang
in virtio_net_load() Jason Wang (1): rtl8139: implement 8139cp link status hw/e1000.c | 11 +++ hw/rtl8139.c| 23 +-- hw/virtio-net.c |4 3 files changed, 36 insertions(+), 2 deletions(-) Reviewed-by: Jason Wang

[Qemu-devel] [PATCH] virito-net: remove layout assumption for multiqueue ctrl

2013-03-05 Thread Jason Wang
Follow commit 921ac5d0f3a0df869db5ce4edf752f51d8b1596a (virtio-net: remove layout assumptions for ctrl vq), this patch makes multiqueue ctrl handling not reply on the layout of descriptors. Signed-off-by: Jason Wang --- hw/virtio-net.c | 23 --- 1 files changed, 12

[Qemu-devel] [PATCH V7 0/5] Send the gratuitous by guest

2013-03-07 Thread Jason Wang
cated parameter - check virtio_net_started() instead of VIRTIO_NET_S_LINK_UP before issue the config update interrupt - move VIRTIO_NET_S_ANNOUNCE to 0x100 and supress guest config write to RO bits - cleanups suggested by Michael Tested with migration within 802.1Q. Jason Wang (5): runstate: intr

[Qemu-devel] [PATCH V7 1/5] runstate: introduce prelaunch-migrate state

2013-03-07 Thread Jason Wang
overs the case both w/ and w/o -S in destination. The first user of this is the support of doing announce by guest. Signed-off-by: Jason Wang --- migration.c |3 +-- qapi-schema.json |5 - vl.c |4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --

[Qemu-devel] [PATCH V7 2/5] net: announce self after vm is started

2013-03-07 Thread Jason Wang
Since we may want to send garp by guest if guest driver is capable of it. We need trigger this event after vm is started. So this patch do this when the state is changing from RUN_STATE_PRELAUNCH_MIGRATE to RUN_STATE_RUNINNG. Signed-off-by: Jason Wang --- migration.c |1 - vl.c

[Qemu-devel] [PATCH V7 4/5] virtio-net: notify guest to annouce itself

2013-03-07 Thread Jason Wang
d by a new feature bit VIRTIO_NET_F_ANNOUNCE. Signed-off-by: Jason Wang --- hw/virtio-net.c | 30 ++ hw/virtio-net.h | 15 ++- 2 files changed, 44 insertions(+), 1 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 009f09e..278c42c 10064

[Qemu-devel] [PATCH V7 3/5] net: model specific announcing support

2013-03-07 Thread Jason Wang
. Signed-off-by: Jason Wang --- include/net/net.h |2 ++ savevm.c |8 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index cb049a1..49031b4 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -44,6 +44,7

[Qemu-devel] [PATCH V7 5/5] virtio-net: compat guest announce

2013-03-07 Thread Jason Wang
Disable guest announce for pre-1.5. Signed-off-by: Jason Wang --- hw/pc.h |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/hw/pc.h b/hw/pc.h index f2c1b1c..2de7cd4 100644 --- a/hw/pc.h +++ b/hw/pc.h @@ -221,6 +221,10 @@ int e820_add_entry(uint64_t, uint64_t

Re: [Qemu-devel] [PATCH V7 0/5] Send the gratuitous by guest

2013-03-07 Thread Jason Wang
On 03/07/2013 06:04 PM, Michael S. Tsirkin wrote: > On Thu, Mar 07, 2013 at 04:23:46PM +0800, Jason Wang wrote: >> This series tries to let guest instead of qemu to send the gratuitous packets >> after migration when guest is capable of doing this. This is needed since >> i

Re: [Qemu-devel] [PATCH V7 0/5] Send the gratuitous by guest

2013-03-07 Thread Jason Wang
On 03/07/2013 06:25 PM, Michael S. Tsirkin wrote: > On Thu, Mar 07, 2013 at 06:13:41PM +0800, Jason Wang wrote: >> On 03/07/2013 06:04 PM, Michael S. Tsirkin wrote: >>> On Thu, Mar 07, 2013 at 04:23:46PM +0800, Jason Wang wrote: >>>> This series tries to let gue

Re: [Qemu-devel] [PATCH V7 0/5] Send the gratuitous by guest

2013-03-07 Thread Jason Wang
On 03/07/2013 06:52 PM, Michael S. Tsirkin wrote: > On Thu, Mar 07, 2013 at 06:33:30PM +0800, Jason Wang wrote: >> On 03/07/2013 06:25 PM, Michael S. Tsirkin wrote: >>> On Thu, Mar 07, 2013 at 06:13:41PM +0800, Jason Wang wrote: >>>> On 03/07/2013 06:04 PM, Michael

Re: [Qemu-devel] [PATCH V7 0/5] Send the gratuitous by guest

2013-03-11 Thread Jason Wang
On 03/08/2013 07:03 PM, Stefan Hajnoczi wrote: > On Thu, Mar 07, 2013 at 12:52:42PM +0200, Michael S. Tsirkin wrote: >> On Thu, Mar 07, 2013 at 06:33:30PM +0800, Jason Wang wrote: >>> On 03/07/2013 06:25 PM, Michael S. Tsirkin wrote: >>>> On Thu, Mar 07, 2013 at 06:1

Re: [Qemu-devel] [PATCH V7 1/5] runstate: introduce prelaunch-migrate state

2013-03-11 Thread Jason Wang
On 03/11/2013 10:31 PM, Jiri Denemark wrote: > On Thu, Mar 07, 2013 at 08:37:17 -0700, Eric Blake wrote: >> On 03/07/2013 01:23 AM, Jason Wang wrote: >>> Sometimes, we need track the state when guest is just about to start after >>> migration. There's not a accura

Re: [Qemu-devel] [PATCH V2 18/20] virtio-net: multiqueue support

2013-04-14 Thread Jason Wang
On 04/13/2013 09:17 PM, Aurelien Jarno wrote: > On Fri, Jan 25, 2013 at 06:35:41PM +0800, Jason Wang wrote: >> This patch implements both userspace and vhost support for multiple queue >> virtio-net (VIRTIO_NET_F_MQ). This is done by introducing an array of >> VirtIO

Re: [Qemu-devel] [PATCH V2 18/20] virtio-net: multiqueue support

2013-04-15 Thread Jason Wang
On 04/15/2013 04:28 PM, Aurelien Jarno wrote: > On Mon, Apr 15, 2013 at 01:29:01PM +0800, Jason Wang wrote: >> On 04/13/2013 09:17 PM, Aurelien Jarno wrote: >>> On Fri, Jan 25, 2013 at 06:35:41PM +0800, Jason Wang wrote: >>>> This patch implements both userspace

Re: [Qemu-devel] [PATCH V2 18/20] virtio-net: multiqueue support

2013-04-17 Thread Jason Wang
On 04/17/2013 03:20 PM, Aurelien Jarno wrote: > On Tue, Apr 16, 2013 at 11:08:59AM +0800, Jason Wang wrote: >> On 04/15/2013 04:28 PM, Aurelien Jarno wrote: >>> On Mon, Apr 15, 2013 at 01:29:01PM +0800, Jason Wang wrote: >>>> On 04/13/2013 09:17 PM, Aurelien Jarno wro

[Qemu-devel] [PATCH] tap: properly initialize vhostfds

2013-04-19 Thread Jason Wang
: qemu-sta...@nongnu.org Signed-off-by: Jason Wang --- net/tap.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/tap.c b/net/tap.c index 17bdf01..e0b7a2a 100644 --- a/net/tap.c +++ b/net/tap.c @@ -623,7 +623,7 @@ static int net_init_tap_one(const NetdevTapOption

Re: [Qemu-devel] [PATCH V2 18/20] virtio-net: multiqueue support

2013-04-24 Thread Jason Wang
On 04/17/2013 04:42 PM, Aurelien Jarno wrote: > On Wed, Apr 17, 2013 at 04:27:13PM +0800, Jason Wang wrote: >> On 04/17/2013 03:20 PM, Aurelien Jarno wrote: >>> On Tue, Apr 16, 2013 at 11:08:59AM +0800, Jason Wang wrote: >>>> On 04/15/2013 04:28 PM, Aurelien Jarno wro

[Qemu-devel] [PATCH] virtio-net: count VIRTIO_NET_F_MAC when calculating config_len

2013-04-24 Thread Jason Wang
VIRTIO_NET_F_MQ were disabled form command line. Then qemu will crash when user tries to read the config of virtio-net. Fix this by counting VIRTIO_NET_F_MAC and make sure the config at least contains the mac address. Cc: Jesse Larrew Signed-off-by: Jason Wang --- hw/net/virtio-net.c |3 ++- 1 files

[Qemu-devel] [PATCH] virtio-net: unbreak the minix guest

2013-04-24 Thread Jason Wang
f the VIRTIO_NET_F_CTRL_VQ feature bit is negotiated, identify the control virtqueue.", to keep the backward compatibility, always add the ctrl vq at end of the queues. Also remove the meaningless ctrl_vq initialization and vq deletion. Reported-by: Aurelien Jarno Cc: Aurelien Jarno Signed-off-by: Jason Wan

Re: [Qemu-devel] [PATCH] virtio-net: unbreak the minix guest

2013-04-25 Thread Jason Wang
On 04/25/2013 02:57 PM, Michael S. Tsirkin wrote: > On Thu, Apr 25, 2013 at 02:19:53PM +0800, Jason Wang wrote: >> Multiqueue patchset conditionally add control vq only when guest negotiate >> the >> feature. Though the spec is not clear on this but it breaks the minix g

Re: [Qemu-devel] [PATCH] virtio-net: count VIRTIO_NET_F_MAC when calculating config_len

2013-04-25 Thread Jason Wang
On 04/25/2013 02:59 PM, Michael S. Tsirkin wrote: > On Thu, Apr 25, 2013 at 02:21:29PM +0800, Jason Wang wrote: >> Commit 14f9b664 (hw/virtio-net.c: set config size using host features) tries >> to >> calculate config size based on the host features. But it forgets the >

[Qemu-devel] [PATCH v2] virtio-net: unbreak the minix guest

2013-04-25 Thread Jason Wang
f the VIRTIO_NET_F_CTRL_VQ feature bit is negotiated, identify the control virtqueue.", to keep the backward compatibility, always add the ctrl vq at end of the queues. Reported-by: Aurelien Jarno Cc: Aurelien Jarno Signed-off-by: Jason Wang --- Changes from V1: - Drop the unrelated cleanups - Drop the m

[Qemu-devel] [PATCH v2] virtio-net: count VIRTIO_NET_F_MAC when calculating config_len

2013-04-25 Thread Jason Wang
VIRTIO_NET_F_MQ were disabled form command line. Then qemu will crash when user tries to read the config of virtio-net. Fix this by counting VIRTIO_NET_F_MAC and make sure the config at least contains the mac address. Cc: Jesse Larrew Signed-off-by: Jason Wang --- Changes from V1: - Set VIRTIO_NET_F_MAC

Re: [Qemu-devel] [PATCH] virtio-net: count VIRTIO_NET_F_MAC when calculating config_len

2013-04-25 Thread Jason Wang
On 04/25/2013 03:06 PM, Michael S. Tsirkin wrote: > On Thu, Apr 25, 2013 at 03:02:44PM +0800, Jason Wang wrote: >> On 04/25/2013 02:59 PM, Michael S. Tsirkin wrote: >>> On Thu, Apr 25, 2013 at 02:21:29PM +0800, Jason Wang wrote: >>>> Commit 14f9b664 (hw/virtio-net

[Qemu-devel] [PATCH] virtio: abort on zero config length

2013-04-25 Thread Jason Wang
In fact we don't support zero length config length for virtio device. And it can lead outbound memory access. So abort on zero config length to catch the bug earlier. Signed-off-by: Jason Wang --- hw/virtio/virtio.c |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --

Re: [Qemu-devel] [PATCH] virtio: abort on zero config length

2013-04-25 Thread Jason Wang
On 04/26/2013 06:27 AM, Anthony Liguori wrote: > "Michael S. Tsirkin" writes: > >> On Thu, Apr 25, 2013 at 03:20:20PM -0500, Anthony Liguori wrote: >>> Jason Wang writes: >>> >>>> In fact we don't support zero length config length for virt

[Qemu-devel] [PATCH 1/3] virtio-pci: properly validate address before accessing config

2013-04-26 Thread Jason Wang
in virtio_pci_config_{read|write}() before .{set|get}_config - Use addition instead minus to do the validation Cc: Michael S. Tsirkin Cc: Petr Matousek Signed-off-by: Jason Wang --- hw/virtio/virtio-pci.c |9 + hw/virtio/virtio.c | 18 -- 2 files changed, 9 inserti

[Qemu-devel] [PATCH 2/3] virtio-ccw: check config length before accessing it

2013-04-26 Thread Jason Wang
virtio-rng-ccw has zero config length, so we need validate the config length before trying to access it. Otherwise we may crash since vdev->config is NULL. Cc: Cornelia Huck Cc: Richard Henderson Cc: Alexander Graf Signed-off-by: Jason Wang --- hw/s390x/virtio-ccw.c |4 ++-- 1 fi

[Qemu-devel] [PATCH 3/3] s390-virtio-bus: sync config only when config_len is not zero

2013-04-26 Thread Jason Wang
virtio-rng-s390 has zero config length, so no need to sync its config otherwise qemu will crash since vdev->config is NULL. Cc: Alexander Graf Cc: Richard Henderson Signed-off-by: Jason Wang --- hw/s390x/s390-virtio-bus.c |4 1 files changed, 4 insertions(+), 0 deletions(-) d

Re: [Qemu-devel] [PATCH] virtio: abort on zero config length

2013-04-26 Thread Jason Wang
On 04/26/2013 06:32 PM, Eric Blake wrote: > On 04/25/2013 11:06 PM, Jason Wang wrote: >>>> if (addr > (vdev->config_len - sizeof(val))) >>>> >>>> ^ quiz: spot a bug above if config_len is 0:) >>> Then we need to fix these bugs

[Qemu-devel] [PATCH] virtio-net: properly check the vhost status during status set

2013-04-26 Thread Jason Wang
dence than &&, place a brace to make sure both the conditions were met then does the check. This fixes the crash when doing a savem after set the link off which let qemu crash and complains: virtio_net_save: Assertion `!n->vhost_started' failed. Cc: Michael S. Tsirkin Signed-off-by: Jaso

Re: [Qemu-devel] [PATCH] virtio-net: properly check the vhost status during status set

2013-04-26 Thread Jason Wang
On 04/26/2013 08:26 PM, Michael S. Tsirkin wrote: > On Fri, Apr 26, 2013 at 06:27:40PM +0800, Jason Wang wrote: >> Commit 32993698 (vhost: disable on tap link down) tries to disable the vhost >> also when the peer's link is down. But the check was not done properly, the >&g

Re: [Qemu-devel] [PATCH 1/3] virtio-pci: properly validate address before accessing config

2013-04-26 Thread Jason Wang
On 04/26/2013 10:27 PM, Petr Matousek wrote: > On Fri, Apr 26, 2013 at 04:34:02PM +0800, Jason Wang wrote: >> There are several several issues in the current checking: >> >> - The check was based on the minus of unsigned values which can overflow >> - It was done afte

Re: [Qemu-devel] [PATCH 3/3] s390-virtio-bus: sync config only when config_len is not zero

2013-04-26 Thread Jason Wang
On 04/27/2013 01:07 AM, Alexander Graf wrote: > On 26.04.2013, at 10:34, Jason Wang wrote: > >> virtio-rng-s390 has zero config length, so no need to sync its config >> otherwise >> qemu will crash since vdev->config is NULL. > Why is it NULL? As far as I see, virti

Re: [Qemu-devel] [PATCH V2 3/3] virtio-net: announce self by guest

2014-06-10 Thread Jason Wang
On 06/10/2014 06:10 PM, Michael S. Tsirkin wrote: > On Tue, Jun 10, 2014 at 11:50:33AM +0530, Amit Shah wrote: >> On (Tue) 20 May 2014 [14:01:44], Jason Wang wrote: >>> It's hard to track all mac addresses and their configurations (e.g >>> vlan or ipv6) in qemu

Re: [Qemu-devel] [PATCH] net: Forbid dealing with packets when VM is not running

2014-08-18 Thread Jason Wang
On 08/18/2014 12:46 PM, zhanghailiang wrote: > For all NICs(except virtio-net) emulated by qemu, > Such as e1000, rtl8139, pcnet and ne2k_pci, > Qemu can still receive packets when VM is not running. > If this happened in *migration's* last PAUSE VM stage, > The new dirty RAM related to the packets

Re: [Qemu-devel] [PATCH] net: Forbid dealing with packets when VM is not running

2014-08-18 Thread Jason Wang
On 08/18/2014 04:32 PM, zhanghailiang wrote: > On 2014/8/18 14:55, Jason Wang wrote: >> On 08/18/2014 12:46 PM, zhanghailiang wrote: >>> For all NICs(except virtio-net) emulated by qemu, >>> Such as e1000, rtl8139, pcnet and ne2k_pci, >>> Qemu can still re

[Qemu-devel] [PATCH] vhost_net: start/stop guest notifiers properly

2014-08-18 Thread Jason Wang
quot; Signed-off-by: Michael S. Tsirkin Signed-off-by: Jason Wang -- Zhang Jie, please test this patch to see if it fixes the issue. --- hw/net/vhost_net.c | 20 ++-- hw/virtio/vhost.c | 2 -- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/hw/net/vhost_n

<    1   2   3   4   5   6   7   8   9   10   >