Re: [Qemu-devel] updated: kvm networking todo wiki

2013-05-24 Thread Jason Wang
On 05/23/2013 04:50 PM, Michael S. Tsirkin wrote: Hey guys, I've updated the kvm networking todo wiki with current projects. Will try to keep it up to date more often. Original announcement below. Thanks a lot. I've added the tasks I'm currently working on to the wiki. btw. I notice the

Re: [Qemu-devel] [PATCH v2 2/2] net: introduce command to query mac-table information

2013-05-28 Thread Jason Wang
On 05/16/2013 07:07 PM, Amos Kong wrote: We want to implement mac programming over macvtap through Libvirt. The previous patch adds QMP event to notify management of mac-table change. This patch adds a monitor command to query rx mode information of mac-tables. (qemu) info mac-table vnet0

[Qemu-devel] [PATCH] net: tap: fix NULL dereference when passing both fd and vhostfds to tap

2013-06-03 Thread Jason Wang
...@redhat.com Cc: qemu-sta...@nongnu.org Signed-off-by: Jason Wang jasow...@redhat.com --- net/tap.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/net/tap.c b/net/tap.c index e0b7a2a..477505f 100644 --- a/net/tap.c +++ b/net/tap.c @@ -698,9 +698,10 @@ int net_init_tap

Re: [Qemu-devel] [PATCH] net: tap: fix NULL dereference when passing both fd and vhostfds to tap

2013-06-03 Thread Jason Wang
On 06/03/2013 06:48 PM, Laszlo Ersek wrote: comments below On 06/03/13 11:04, Jason Wang wrote: This is because vhostfdname were passed as NULL to net_init_tap_one() when vhostfd were not specified, but net_init_tap_one() will still pass it to monitor_handle_fd_param() when tap-has_vhostfds

[Qemu-devel] [PATCH V2] net: tap: fix NULL dereference when passing invalid parameters to tap

2013-06-03 Thread Jason Wang
to monitor_handle_fd_param(), which may crash the qemu. Also remove the unnecessary has_fd check. Cc: Paolo Bonzini pbonz...@redhat.com Cc: Stefan Hajnoczi shajn...@redhat.com Cc: Laszlo Ersek ler...@redhat.com Cc: qemu-sta...@nongnu.org Signed-off-by: Jason Wang jasow...@redhat.com --- Changes from v1: - check

Re: [Qemu-devel] [PATCH v5] net: add support of mac-programming over macvtap in QEMU side

2013-06-06 Thread Jason Wang
On 06/05/2013 06:42 PM, Amos Kong wrote: Currently macvtap based macvlan device is working in promiscuous mode, we want to implement mac-programming over macvtap through Libvirt for better performance. Design: QEMU notifies Libvirt when rx-filter config is changed in guest, then Libvirt

Re: [Qemu-devel] [PATCH] virtio-net: put virtio net header inline with data

2013-06-06 Thread Jason Wang
On 06/06/2013 05:55 PM, Michael S. Tsirkin wrote: For small packets we can simplify xmit processing by linearizing buffers with the header: most packets seem to have enough head room we can use for this purpose. Since some older hypervisors (e.g. qemu before version 1.5) required that header

Re: [Qemu-devel] [RFC] sync NIC's MAC maintained in NICConf as soon as emualted NIC's MAC changed in guest

2013-09-25 Thread Jason Wang
On 09/22/2013 04:35 PM, Zhanghaoyu (A) wrote: Hi, all Do live migration if emulated NIC's MAC has been changed, RARP with wrong MAC address will broadcast via qemu_announce_self in destination, so, long time network disconnection probably happen. I want to do below works to resolve this

Re: [Qemu-devel] [RFC] sync NIC's MAC maintained in NICConf as soon as emualted NIC's MAC changed in guest

2013-09-25 Thread Jason Wang
On 09/26/2013 11:42 AM, Zhanghaoyu (A) wrote: Hi, all Do live migration if emulated NIC's MAC has been changed, RARP with wrong MAC address will broadcast via qemu_announce_self in destination, so, long time network disconnection probably happen. I want to do below works to resolve this

Re: [Qemu-devel] Virtio Polling Mode

2013-09-29 Thread Jason Wang
On 09/28/2013 02:56 AM, Hu Yaohui wrote: Hi All, I am wondering whether virtio has provided polling mode already. Instead of sending a event from guest to host through eventfd on guest side and inject an interrupt into guest on host side to notify each other? Could both sides keep polling the

[Qemu-devel] [PATCH] virtio-net: only delete bh that existed

2013-11-06 Thread Jason Wang
We delete without check whether it existed during exit. This will lead NULL pointer deference since it was created conditionally depends on guest driver status and features. So add a check of existence before trying to delete it. Cc: qemu-sta...@nongnu.org Signed-off-by: Jason Wang jasow

Re: [Qemu-devel] [PATCH] virtio-net: only delete bh that existed

2013-11-06 Thread Jason Wang
On 11/06/2013 07:17 PM, Michael S. Tsirkin wrote: On Wed, Nov 06, 2013 at 04:58:08PM +0800, Jason Wang wrote: We delete without check whether it existed during exit. This will lead NULL pointer deference since it was created conditionally depends on guest driver status and features. So add

Re: [Qemu-devel] [PATCH] qdev-properties-system.c: Allow vlan or netdev for -device, not both

2013-11-10 Thread Jason Wang
*v, void *opaque, *ptr = NULL; return; } +if (*ptr) { +error_set_from_qdev_prop_error(errp, -EINVAL, dev, prop, name); +return; +} hubport = net_hub_port_find(id); if (!hubport) { Acked-by: Jason Wang jasow...@redhat.com

Re: [Qemu-devel] [PATCH] virtio-net: don't update mac_table in error state

2013-11-12 Thread Jason Wang
-off-by: Amos Kong ak...@redhat.com Acked-by: Jason Wang jasow...@redhat.com In the future, maybe we can allocate the mac_table dynamically instead of embed it in VirtIONet. Then we can just does a pointer swap and gfree() and can save a memcpy() here. --- hw/net/virtio-net.c | 34

Re: [Qemu-devel] [RFC PATCH 1/2] e1000: Use Address_Available bit as HW latch

2013-11-22 Thread Jason Wang
On 11/22/2013 04:04 AM, Vlad Yasevich wrote: e1000 provides a E1000_RAH_AV bit on every complete write to the Receive Address Register. We can use this bit 2 ways: 1) To trigger HMP notifications. When the bit is set the mac address is fully set and we can update the HMP. 2) We can

Re: [Qemu-devel] [RFC PATCH 1/2] e1000: Use Address_Available bit as HW latch

2013-11-25 Thread Jason Wang
On 11/22/2013 10:37 PM, Vlad Yasevich wrote: On 11/22/2013 04:47 AM, Jason Wang wrote: On 11/22/2013 04:04 AM, Vlad Yasevich wrote: e1000 provides a E1000_RAH_AV bit on every complete write to the Receive Address Register. We can use this bit 2 ways: 1) To trigger HMP notifications

Re: [Qemu-devel] [PATCH] monitor: properly handle invalid fd/vhostfd from command line

2010-10-12 Thread jason wang
On 10/09/2010 01:40 AM, Luiz Capitulino wrote: On Tue, 28 Sep 2010 16:57:44 +0200 Michael S. Tsirkinm...@redhat.com wrote: On Tue, Sep 28, 2010 at 11:53:43AM -0300, Luiz Capitulino wrote: On Mon, 27 Sep 2010 15:52:44 +0800 Jason Wangjasow...@redhat.com wrote:

Re: [Qemu-devel] [PATCH] net: provide a friendly message when a user passes a bad -net tap, fd=X (v2)

2010-10-12 Thread Jason Wang
- Anthony Liguori aligu...@us.ibm.com wrote: A lot of people copy libvirt's command line from ps -ef and then wonder why the VM isn't working correctly. Let's be kind and tell them what they should do instead. Without this patch, if you run with an invalid -net tap,fd=X, the guest

Re: [Qemu-devel] [PATCH] monitor: properly handle invalid fd/vhostfd from command line

2010-10-13 Thread Jason Wang
- Luiz Capitulino lcapitul...@redhat.com wrote: On Tue, 12 Oct 2010 14:32:25 +0800 jason wang jasow...@redhat.com wrote: On 10/09/2010 01:40 AM, Luiz Capitulino wrote: On Tue, 28 Sep 2010 16:57:44 +0200 Michael S. Tsirkinm...@redhat.com wrote: On Tue, Sep 28, 2010

[Qemu-devel] [RESEND PATCH] monitor: properly handle illegal fd/vhostfd from command line

2010-10-21 Thread Jason Wang
...@redhat.com. Signed-off-by: Jason Wang jasow...@redhat.com --- net.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/net.c b/net.c index ed74c7f..ab9c3bb 100644 --- a/net.c +++ b/net.c @@ -774,8 +774,8 @@ int qemu_find_nic_model(NICInfo *nd, const char * const *models

[Qemu-devel] [V3 PATCH] net: properly handle illegal fd/vhostfd from command line

2010-10-24 Thread Jason Wang
...@redhat.com. Signed-off-by: Jason Wang jasow...@redhat.com --- net.c | 16 +++- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/net.c b/net.c index ed74c7f..c5e6063 100644 --- a/net.c +++ b/net.c @@ -774,19 +774,25 @@ int qemu_find_nic_model(NICInfo *nd, const char * const

[Qemu-devel] [PATCH] vhost-net: Do not set features for backend when peer was deleted

2010-10-26 Thread Jason Wang
(). And setting offload features for a deleted backend is also meaningless in this situation Signed-off-by: Jason Wang jasow...@redhat.com --- hw/virtio-net.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 7e1688c..68c8e48 100644 --- a/hw

[Qemu-devel] Re: [PATCH] vhost-net: Do not set features for backend when peer was deleted

2010-10-27 Thread Jason Wang
Michael S. Tsirkin writes: On Wed, Oct 27, 2010 at 12:43:51AM +0800, Jason Wang wrote: When hot-unplug a virtio nic with vhost-net backend, guest may continue to program the nic even if its peer have been deleted. We can not set features at this time as vhost_net_ack_features() may

[Qemu-devel] [PATCH] tap: clear vhost_net backend on cleanup

2010-10-28 Thread Jason Wang
Michael S. Tsirkin writes: Frontends calling tap_get_vhost_net get an invalid pointer after the peer backend has been deleted. Jason Wang jasow...@redhat.com reports this leading to a crash in ack_features when we remove the vhost-net bakend of a virtio nic. The fix is simply to clear

[Qemu-devel] [PATCH] vhost: Fix address calculation in vhost_dev_sync_region()

2010-11-27 Thread Jason Wang
We still need advance address even we find there's no dirty pages in current chunk. Signed-off-by: Jason Wang jasow...@redhat.com --- hw/vhost.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/vhost.c b/hw/vhost.c index 8586f66..6082da2 100644 --- a/hw/vhost.c +++ b

[Qemu-devel] [PATCHv3 4/6] virtio-net: stop/start bh when appropriate

2010-12-01 Thread Jason Wang
Michael S. Tsirkin writes: Avoid sending out packets, and modifying device state, when VM is stopped. Add assert statements to verify this does not happen. Avoid scheduling bh when vhost-net is started. Stop bh when driver disabled bus mastering (we must not access memory after

Re: [Qemu-devel] [PATCHv3 4/6] virtio-net: stop/start bh when appropriate

2010-12-01 Thread Jason Wang
Michael S. Tsirkin writes: On Wed, Dec 01, 2010 at 01:45:09PM +0800, Jason Wang wrote: Michael S. Tsirkin writes: Avoid sending out packets, and modifying device state, when VM is stopped. Add assert statements to verify this does not happen. Avoid scheduling bh when

Re: [Qemu-devel] [PATCHv3 4/6] virtio-net: stop/start bh when appropriate

2010-12-02 Thread Jason Wang
Michael S. Tsirkin writes: On Wed, Dec 01, 2010 at 01:45:09PM +0800, Jason Wang wrote: Michael S. Tsirkin writes: Avoid sending out packets, and modifying device state, when VM is stopped. Add assert statements to verify this does not happen. Avoid scheduling bh when

Re: [Qemu-devel] [PATCHv3 4/6] virtio-net: stop/start bh when appropriate

2010-12-02 Thread Jason Wang
Michael S. Tsirkin writes: On Thu, Dec 02, 2010 at 08:56:30PM +0800, Jason Wang wrote: Michael S. Tsirkin writes: On Wed, Dec 01, 2010 at 01:45:09PM +0800, Jason Wang wrote: Michael S. Tsirkin writes: Avoid sending out packets, and modifying device state, when VM

Re: [Qemu-devel] [PATCHv3 4/6] virtio-net: stop/start bh when appropriate

2010-12-03 Thread Jason Wang
Michael S. Tsirkin writes: On Thu, Dec 02, 2010 at 10:19:55PM +0800, Jason Wang wrote: Michael S. Tsirkin writes: On Thu, Dec 02, 2010 at 08:56:30PM +0800, Jason Wang wrote: Michael S. Tsirkin writes: On Wed, Dec 01, 2010 at 01:45:09PM +0800, Jason Wang wrote

[Qemu-devel] [PATCH] kvm: x86: Save/restore error_code

2010-12-09 Thread Jason Wang
The saving and restoring of error_code seems lost and convert the error_code to uint32_t. Signed-off-by: Jason Wang jasow...@redhat.com --- target-i386/cpu.h |4 ++-- target-i386/machine.c |2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target-i386/cpu.h b

[Qemu-devel] [PATCH] migration: ide: drop ide_pci_post_load()

2010-12-09 Thread Jason Wang
the ide_pci_post_load() and it would also make possible to debugging of migration through comparing the exec files. Signed-off-by: Jason Wang jasow...@redhat.com I'm not sure whether this is the best way to handle this issue. Should we still care about the migration from old guest? --- hw/ide/pci.c

[Qemu-devel] Re: [PATCH] kvm: x86: Save/restore error_code

2010-12-09 Thread Jason Wang
Juan Quintela writes: Jason Wang jasow...@redhat.com wrote: The saving and restoring of error_code seems lost and convert the error_code to uint32_t. Signed-off-by: Jason Wang jasow...@redhat.com --- target-i386/cpu.h |4 ++-- target-i386/machine.c |2 ++ 2

[Qemu-devel] Re: [PATCH] kvm: x86: Save/restore error_code

2010-12-10 Thread Jason Wang
Juan Quintela writes: Jason Wang jasow...@redhat.com wrote: Juan Quintela writes: Jason Wang jasow...@redhat.com wrote: The saving and restoring of error_code seems lost and convert the error_code to uint32_t. Signed-off-by: Jason Wang jasow...@redhat.com

[Qemu-devel] [PATCHv3 0/2] vhost: fix tap link down

2011-02-09 Thread Jason Wang
change vhost: disable on tap link down hw/virtio-net.c |3 ++- net.c | 11 +++ 2 files changed, 13 insertions(+), 1 deletions(-) Acked-by: Jason Wang jasow...@redhat.com -- 1.7.3.2.91.g446ac

[Qemu-devel] [PATCH] monitor: properly handle invalid fd/vhostfd from command line

2010-09-27 Thread Jason Wang
monitor_get_fd() may also be used to parse fd or vhostfd from command line, so we need to check whether the pointer of mon is NULL to avoid segmentation fault when user pass invalid name of fd or vhostfd. Signed-off-by: Jason Wang jasow...@redhat.com --- monitor.c |4 1 files changed, 4

[Qemu-devel] [RFC PATCH 0/4] Model specific function for nic announcement

2010-09-27 Thread Jason Wang
in guest which means the vlan after migration is still broken. This patchset is just an RFC and need your suggestions and comments. Thanks. --- Jason Wang (4): net: move announce_self_create to net.c net: Introduce model specific nic announce function virtio-net: Limit the num

[Qemu-devel] [RFC PATCH 1/4] net: move announce_self_create to net.c

2010-09-27 Thread Jason Wang
Export and move announce_self_create to net.c in order to be used by model specific announcing function. Signed-off-by: Jason Wang jasow...@redhat.com --- net.c| 31 +++ net.h|1 + savevm.c | 32 3 files changed, 32

[Qemu-devel] [RFC PATCH 2/4] net: Introduce model specific nic announce function

2010-09-27 Thread Jason Wang
This patch introduce a function pointer in NetClientInfo which is called during self announcement to do the model specific mac address announcement. Previous method were kept for the model without its own implementation. Signed-off-by: Jason Wang jasow...@redhat.com --- net.h|2

[Qemu-devel] [RFC PATCH 3/4] virtio-net: Limit the num of uni/multicast mac addresses

2010-09-27 Thread Jason Wang
of uni/multicast mac addresses in qemu. Signed-off-by: Jason Wang jasow...@redhat.com --- hw/virtio-net.c | 17 - 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 0a9cae2..79afb65 100644 --- a/hw/virtio-net.c +++ b/hw/virtio

[Qemu-devel] [PATCH] net: Use iov helper functions

2011-02-24 Thread Jason Wang
Benjamin Poirier writes: Signed-off-by: Benjamin Poirier benjamin.poir...@gmail.com --- net.c | 28 ++-- 1 files changed, 6 insertions(+), 22 deletions(-) Looks good. Acked-by: Jason Wang jasow...@redhat.com diff --git a/net.c b/net.c index ec4745d

[Qemu-devel] [PATCH] net: Add the missing option declaration of vhostforce

2011-02-25 Thread Jason Wang
Signed-off-by: Jason Wang jasow...@redhat.com --- net.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/net.c b/net.c index 9ba5be2..21d4443 100644 --- a/net.c +++ b/net.c @@ -1025,7 +1025,11 @@ static const struct { .name = vhostfd

Re: [Qemu-devel] [PATCH v3] rtl8139: add vlan support

2011-02-28 Thread Jason Wang
On 02/26/2011 08:39 AM, Benjamin Poirier wrote: I've posted v2 of these patches back in november http://article.gmane.org/gmane.comp.emulators.qemu/84252 Changes since v2: insertion: * moved insertion later in the process, to handle tso * use qemu_sendv_packet() to insert the

Re: [Qemu-devel] [PATCH v3 2/2] rtl8139: add vlan tag extraction

2011-02-28 Thread Jason Wang
On 02/26/2011 08:40 AM, Benjamin Poirier wrote: Add support to the emulated hardware to extract vlan tags in packets going from the network to the guest. Signed-off-by: Benjamin Poirierbenjamin.poir...@gmail.com Cc: Igor V. Kovalenkoigor.v.kovale...@gmail.com Cc: Jason Wangjasow...@redhat.com

Re: [Qemu-devel] [PATCH v6] rtl8139: add vlan support

2011-03-17 Thread Jason Wang
On 03/11/2011 08:35 AM, Benjamin Poirier wrote: Here is version 6 of my patchset to add vlan support to the emulated rtl8139 nic. Changes since v5: * moved all receive changes to add vlan tag extraction * fixed checkpatch.pl style issues * fixed bugs in receive case

[Qemu-devel] [PATCH v6 2/3] rtl8139: add vlan tag extraction

2011-03-18 Thread Jason Wang
Benjamin Poirier writes: Add support to the emulated hardware to extract vlan tags in packets going from the network to the guest. Signed-off-by: Benjamin Poirier benjamin.poir...@gmail.com Cc: Igor V. Kovalenko igor.v.kovale...@gmail.com Cc: Jason Wang jasow...@redhat.com Cc

[Qemu-devel] [PATCH v6 3/3] rtl8139: add vlan tag insertion

2011-03-18 Thread Jason Wang
Benjamin Poirier writes: Add support to the emulated hardware to insert vlan tags in packets going from the guest to the network. Signed-off-by: Benjamin Poirier benjamin.poir...@gmail.com Cc: Igor V. Kovalenko igor.v.kovale...@gmail.com Cc: Jason Wang jasow...@redhat.com Cc

Re: [Qemu-devel] [PATCH v7] rtl8139: add vlan support

2011-03-24 Thread Jason Wang
aback: https://bugzilla.redhat.com/show_bug.cgi?id=516587 http://article.gmane.org/gmane.linux.network.general/14266 Thanks, -Ben Looks good to me. Acked-by: Jason Wang jasow...@redhat.com

[Qemu-devel] [PATCH] floppy: save and restore DIR register

2011-03-25 Thread Jason Wang
was introduced in order to save and restore the it from block layer through pre_save/post_load callbacks. Signed-off-by: Jason Wang jasow...@redhat.com --- hw/fdc.c | 46 ++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/hw/fdc.c b/hw

[Qemu-devel] Re: [PATCH] floppy: save and restore DIR register

2011-03-27 Thread Jason Wang
Paolo Bonzini writes: On 03/25/2011 07:27 AM, Jason Wang wrote: We need to keep DIR register unchanged across migration, but currently it depends on the media_changed flags from block layer and we do not save/restore it which could let the guest driver think the floppy have changed

[Qemu-devel] [V2 PATCH] floppy: save and restore DIR register

2011-03-27 Thread Jason Wang
have changed after migration. To fix this, a new filed media_changed in FDrive strcutre was introduced in order to save and restore the it from block layer through pre_save/post_load callbacks. Signed-off-by: Jason Wang jasow...@redhat.com --- hw/fdc.c | 52

[Qemu-devel] [PATCH V3] floppy: save and restore DIR register

2011-04-01 Thread Jason Wang
have changed after migration. To fix this, a new filed media_changed in FDrive strcutre was introduced in order to save and restore the it from block layer through pre_save/post_load callbacks. Signed-off-by: Jason Wang jasow...@redhat.com --- Changed from V2: According to Paolo's suggestions

[Qemu-devel] Re: [PATCH V3] floppy: save and restore DIR register

2011-04-01 Thread Jason Wang
Paolo Bonzini writes: On 04/01/2011 08:22 AM, Jason Wang wrote: + +if (drive-bs == NULL) { +return 1; Is it okay to return 1 here? Have you tested the case when both the source and the target drives have no floppy? Thanks for the reminding, and it could be fixed

[Qemu-devel] [PATCH] virtio: correctly initialize vm_running

2011-05-17 Thread Jason Wang
(). Signed-off-by: Jason Wang jasow...@redhat.com --- 0 files changed, 0 insertions(+), 0 deletions(-) diff --git a/hw/virtio.c b/hw/virtio.c index 6e8814c..27d7e50 100644 --- a/hw/virtio.c +++ b/hw/virtio.c @@ -789,6 +789,7 @@ VirtIODevice *virtio_common_init(const char *name, uint16_t device_id

Re: [Qemu-devel] [PATCH] virtio: correctly initialize vm_running

2011-05-22 Thread Jason Wang
On 05/18/2011 04:54 PM, Michael S. Tsirkin wrote: On Wed, May 18, 2011 at 01:57:37PM +0800, Jason Wang wrote: Current vm_running was not explicitly initialized and its value was changed by vm state notifier, this may confuse the virtio device being hotplugged such as virtio-net with vhost

[Qemu-devel] [V2 PATCH] rtl8139: check the buffer availiability

2011-10-16 Thread Jason Wang
Reduce spurious packet drops on RX ring empty when in c+ mode by verifying that we have at least 1 buffer ahead of the time. Change from v1: Fix style comments from Stefan. Signed-off-by: Jason Wang jasow...@redhat.com --- hw/rtl8139.c | 44 ++-- 1

Re: [Qemu-devel] [V2 PATCH] rtl8139: check the buffer availiability

2011-10-21 Thread Jason Wang
introduce some latency when qemu is doning a block select() in main_loop_wait(). Thanks. On 10/17/2011 10:55 AM, Jason Wang wrote: Reduce spurious packet drops on RX ring empty when in c+ mode by verifying that we have at least 1 buffer ahead of the time. Change from v1: Fix style comments

Re: [Qemu-devel] [V2 PATCH] rtl8139: check the buffer availiability

2011-10-21 Thread Jason Wang
On 10/19/2011 09:28 AM, Michael S. Tsirkin wrote: On Mon, Oct 17, 2011 at 10:55:57AM +0800, Jason Wang wrote: Reduce spurious packet drops on RX ring empty when in c+ mode by verifying that we have at least 1 buffer ahead of the time. Change from v1: Fix style comments from Stefan

[Qemu-devel] [RFC v2 PATCH 0/4] Support sending gratuitous by guest

2011-10-21 Thread Jason Wang
add a model specific fucntion which can let nic model to implement its own announce function and then implement a virtio-net specific function to let guest send the gratitous packet. Only basic test were done. Comments are welcomed. Thanks --- Jason Wang (4): announce self after vm start

[Qemu-devel] [RFC v2 PATCH 1/4] announce self after vm start

2011-10-21 Thread Jason Wang
entry may not existed because of aging. This patch solve this by call qemu_announce_self() in vm_start() instead of in process_incoming_migration(). Through this, gratituous packets were sent each time when vm starts. Signed-off-by: Jason Wang jasow...@redhat.com --- migration.c |1 - vl.c

[Qemu-devel] [RFC v2 PATCH 2/4] net: export announce_self_create()

2011-10-21 Thread Jason Wang
Export and move announce_self_create() to net.c in order to be used by model specific announcing function. Signed-off-by: Jason Wang jasow...@redhat.com --- net.c| 31 +++ net.h|1 + savevm.c | 32 3 files changed, 32

[Qemu-devel] [RFC v2 PATCH 3/4] net: model specific announcing support

2011-10-21 Thread Jason Wang
-by: Jason Wang jasow...@redhat.com --- net.h|2 ++ savevm.c |8 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/net.h b/net.h index 4943d4b..1845f01 100644 --- a/net.h +++ b/net.h @@ -46,6 +46,7 @@ typedef ssize_t (NetReceive)(VLANClientState *, const uint8_t

[Qemu-devel] [RFC v2 PATCH 5/4 PATCH] virtio-net: send gratuitous packet when needed

2011-10-21 Thread Jason Wang
bit VIRTIO_NET_F_GUEST_ANNOUNCE. Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/net/virtio_net.c | 31 ++- include/linux/virtio_net.h |2 ++ 2 files changed, 32 insertions(+), 1 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net

Re: [Qemu-devel] [RFC v2 PATCH 5/4 PATCH] virtio-net: send gratuitous packet when needed

2011-10-24 Thread Jason Wang
On 10/24/2011 01:25 PM, Michael S. Tsirkin wrote: On Mon, Oct 24, 2011 at 02:54:59PM +1030, Rusty Russell wrote: On Sat, 22 Oct 2011 13:43:11 +0800, Jason Wang jasow...@redhat.com wrote: This make let virtio-net driver can send gratituous packet by a new config bit - VIRTIO_NET_S_ANNOUNCE

Re: [Qemu-devel] [RFC v2 PATCH 5/4 PATCH] virtio-net: send gratuitous packet when needed

2011-10-25 Thread Jason Wang
On 10/25/2011 11:41 PM, Michael S. Tsirkin wrote: On Tue, Oct 25, 2011 at 10:50:41AM +0800, Jason Wang wrote: On 10/24/2011 01:25 PM, Michael S. Tsirkin wrote: On Mon, Oct 24, 2011 at 02:54:59PM +1030, Rusty Russell wrote: On Sat, 22 Oct 2011 13:43:11 +0800, Jason Wang jasow...@redhat.com

[Qemu-devel] [virtio-spec: RFC PATCH] virtio-spec: introduce VIRTIO_NET_F_GUEST_ANNOUNCE

2011-10-26 Thread Jason Wang
. When guest notice this, it should clear it and send the gratuitous packet. Signed-off-by: Jason Wang jasow...@redhat.com --- virtio-spec.lyx | 45 - 1 files changed, 44 insertions(+), 1 deletions(-) diff --git a/virtio-spec.lyx b/virtio-spec.lyx index

Re: [Qemu-devel] [virtio-spec: RFC PATCH] virtio-spec: introduce VIRTIO_NET_F_GUEST_ANNOUNCE

2011-10-26 Thread Jason Wang
On 10/27/2011 09:32 AM, Rusty Russell wrote: On Wed, 26 Oct 2011 16:49:12 +0800, Jason Wang jasow...@redhat.com wrote: Network connections in guest need to be kept after migration. This is done by sending gratuitous packet and let switch learn new port of the mac address. As hypervisor does

[Qemu-devel] [RFC v3 PATCH 0/4] Send gratuitous packets by guest

2011-10-27 Thread Jason Wang
the unused patch of function export. - Typos and other comments from Stefan Hajnoczi. - Disable guest announce for compat machine types. --- Jason Wang (4): announce self after vm start net: model specific announcing support virtio-net: notify guest to annouce itself virtio-net

[Qemu-devel] [RFC v3 PATCH 1/4] announce self after vm start

2011-10-27 Thread Jason Wang
gratuitous packet by guest may change the state of device, so we need to do it after vm is started. Signed-off-by: Jason Wang jasow...@redhat.com --- gdbstub.c |2 +- migration.c |4 ++-- monitor.c |4 ++-- savevm.c|2 +- sysemu.h|2 +- vl.c|7 +-- 6

[Qemu-devel] [RFC v3 PATCH 2/4] net: model specific announcing support

2011-10-27 Thread Jason Wang
This patch introduces a function pointer in NetClientInfo which is called during self announcement to do the model specific announcing. The first user would be virtio-net. Signed-off-by: Jason Wang jasow...@redhat.com --- net.h|2 ++ savevm.c |8 +--- 2 files changed, 7

[Qemu-devel] [RFC v3 PATCH 3/4] virtio-net: notify guest to annouce itself

2011-10-27 Thread Jason Wang
link through config update interrupt. When gust have done the annoucement, it should clear that bit. The feature is negotiated by bit VIRTIO_NET_F_ANNOUNCE. Signed-off-by: Jason Wang jasow...@redhat.com --- hw/virtio-net.c | 18 +- hw/virtio-net.h |3 +++ 2 files changed

[Qemu-devel] [RFC v3 PATCH 4/4] virtio-net: compat guest announce support.

2011-10-27 Thread Jason Wang
Disable guest announce for compat machine types. Signed-off-by: Jason Wang jasow...@redhat.com --- hw/pc_piix.c | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/hw/pc_piix.c b/hw/pc_piix.c index 8c7f2b7..6ca50a6 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c

[Qemu-devel] [RFC v3 PATCH 5/4 PATCH] virtio-net: send gratuitous packet when needed

2011-10-27 Thread Jason Wang
would be scheduled to send gratuitous packet through NETDEV_NOTIFY_PEERS. This feature is negotiated through bit VIRTIO_NET_F_GUEST_ANNOUNCE. Changes from v2: - Fix the race between unregister_dev() and workqueue Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/net/virtio_net.c

Re: [Qemu-devel] [PATCHv2] vhost: fix double free on device stop

2011-06-21 Thread Jason Wang
...@redhat.com --- Acked-by: Jason Wang jasow...@redhat.com hw/vhost.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/vhost.c b/hw/vhost.c index 80f771e..c3d8821 100644 --- a/hw/vhost.c +++ b/hw/vhost.c @@ -784,5 +784,6 @@ void vhost_dev_stop(struct vhost_dev *hdev

[Qemu-devel] [net-next RFC PATCH 0/7] multiqueue support for tun/tap

2011-08-11 Thread Jason Wang
packets. - addressing the comments of virtio-net driver - performance tunning Please review and comment it, Thanks. --- Jason Wang (5): tuntap: move socket/sock related structures to tun_file tuntap: categorize ioctl tuntap: introduce multiqueue related flags tuntap

[Qemu-devel] [net-next RFC PATCH 1/7] tuntap: move socket/sock related structures to tun_file

2011-08-11 Thread Jason Wang
to be attached to a single tap device. Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/net/tun.c | 349 +++-- 1 files changed, 180 insertions(+), 169 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 71f3d1a..2739887

[Qemu-devel] [net-next RFC PATCH 2/7] tuntap: categorize ioctl

2011-08-11 Thread Jason Wang
As we've moved socket related structure to file-private_data, we can separate system calls that only touch tfile from others as they don't need hold rtnl lock. Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/net/tun.c | 52 ++-- 1 files

[Qemu-devel] [net-next RFC PATCH 3/7] tuntap: introduce multiqueue related flags

2011-08-11 Thread Jason Wang
Signed-off-by: Jason Wang jasow...@redhat.com --- include/linux/if_tun.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 06b1829..c92a291 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h @@ -34,6 +34,7

[Qemu-devel] [net-next RFC PATCH 4/7] tuntap: multiqueue support

2011-08-11 Thread Jason Wang
for multiqueue tap device. And RCU is used for doing synchronization between packet handling and system calls such as removing queues. Currently, multiqueue support is limited for tap , but it's easy also enable it for tun if we find it was also helpful. Signed-off-by: Jason Wang jasow

[Qemu-devel] [net-next RFC PATCH 6/7] Change virtqueue structure

2011-08-11 Thread Jason Wang
From: Krishna Kumar krkum...@in.ibm.com Move queue_index from virtio_pci_vq_info to virtqueue. This allows callback handlers to figure out the queue number for the vq that needs attention. Signed-off-by: Krishna Kumar krkum...@in.ibm.com --- drivers/virtio/virtio_pci.c | 10 +++---

[Qemu-devel] [net-next RFC PATCH 7/7] virtio-net changes

2011-08-11 Thread Jason Wang
From: Krishna Kumar krkum...@in.ibm.com Implement mq virtio-net driver. Though struct virtio_net_config changes, it works with the old qemu since the last element is not accessed unless qemu sets VIRTIO_NET_F_MULTIQUEUE. Signed-off-by: Krishna Kumar krkum...@in.ibm.com Signed-off-by: Jason Wang

[Qemu-devel] [net-next RFC PATCH 5/7] tuntap: add ioctls to attach or detach a file form tap device

2011-08-11 Thread Jason Wang
, and this file could be re-attach to the tap device as a queue again. After those ioctls were added, userspace can create a multiqueue tap device by open /dev/net/tap and call TUNSETIFF, then it could easily control the number of queues through TUNATTACHQUEUE and TUNDETACHQUEUE. Signed-off-by: Jason Wang

[Qemu-devel] [net-next RFC PATCH 0/7] multiqueue support for tun/tap

2011-08-11 Thread Jason Wang
Jason Wang writes: As multi-queue nics were commonly used for high-end servers, current single queue based tap can not satisfy the requirement of scaling guest network performance as the numbers of vcpus increase. So the following series implements multiple queue support in tun/tap

Re: [Qemu-devel] [net-next RFC PATCH 7/7] virtio-net changes

2011-08-14 Thread Jason Wang
- Original Message - On Fri, 2011-08-12 at 09:55 +0800, Jason Wang wrote: From: Krishna Kumar krkum...@in.ibm.com Implement mq virtio-net driver. Though struct virtio_net_config changes, it works with the old qemu since the last element is not accessed unless qemu sets

Re: [Qemu-devel] [net-next RFC PATCH 4/7] tuntap: multiqueue support

2011-08-14 Thread Jason Wang
- Original Message - Le vendredi 12 août 2011 à 09:55 +0800, Jason Wang a écrit : + rxq = skb_get_rxhash(skb); + if (rxq) { + tfile = rcu_dereference(tun-tfiles[rxq % numqueues]); + if (tfile) + goto out; + } You can avoid an expensive divide with following trick : u32 idx

Re: [Qemu-devel] [net-next RFC PATCH 4/7] tuntap: multiqueue support

2011-08-14 Thread Jason Wang
- Original Message - On Fri, Aug 12, 2011 at 09:55:20AM +0800, Jason Wang wrote: With the abstraction that each socket were a backend of a queue for userspace, this patch adds multiqueue support for tap device by allowing multiple sockets to be attached to a tap device. Then we

[Qemu-devel] [net-next RFC V2 PATCH 0/5] Multiqueue support in tun/tap

2011-09-16 Thread Jason Wang
for multiple sessions. More reasonable method is needed. Please comment, thanks. Any suggestions are welcomed. --- Jason Wang (5): tuntap: move socket to tun_file tuntap: categorize ioctl tuntap: introduce multiqueue flags tuntap: multiqueue support tuntap: add ioctls

[Qemu-devel] [net-next RFC V2 PATCH 1/5] tuntap: move socket to tun_file

2011-09-16 Thread Jason Wang
-by: Jason Wang jasow...@redhat.com --- drivers/net/tun.c | 347 +++-- 1 files changed, 178 insertions(+), 169 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 7bea9c6..b64ad05 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c

[Qemu-devel] [net-next RFC V2 PATCH 3/5] tuntap: introduce multiqueue flags

2011-09-16 Thread Jason Wang
Add flags to be used by creating multiqueue tuntap device. Signed-off-by: Jason Wang jasow...@redhat.com --- include/linux/if_tun.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 06b1829..c92a291 100644

[Qemu-devel] [net-next RFC V2 PATCH 2/5] tuntap: categorize ioctl

2011-09-16 Thread Jason Wang
As we've moved socket related structure to file-private_data, we move the ioctls that only touch socket out of tun_chr_ioctl() as it don't need hold rtnl lock. Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/net/tun.c | 52 ++-- 1 files

[Qemu-devel] [net-next RFC V2 PATCH 4/5] tuntap: multiqueue support

2011-09-17 Thread Jason Wang
and NETIF_F_LLTX to synchronize between hot path and systemcall. Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/net/tun.c | 358 + 1 files changed, 223 insertions(+), 135 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index

[Qemu-devel] [net-next RFC V2 PATCH 5/5] tuntap: add ioctls to attach or detach a file form tap device

2011-09-17 Thread Jason Wang
New ioctls were added to let multiple files/sockets to be attached to a tap device. Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/net/tun.c | 25 ++--- include/linux/if_tun.h |3 +++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git

Re: [Qemu-devel] [net-next RFC V2 PATCH 0/5] Multiqueue support in tun/tap

2011-09-19 Thread Jason Wang
On 09/18/2011 03:17 AM, Michael S. Tsirkin wrote: On Sat, Sep 17, 2011 at 02:02:04PM +0800, Jason Wang wrote: A wiki-page was created to narrate the detail design of all parts involved in the multi queue implementation: http://www.linux-kvm.org/page/Multiqueue and some basic tests result could

[Qemu-devel] [PATCH] rtl8139: check the buffer availiability

2011-10-14 Thread Jason Wang
Reduce spurious packet drops on RX ring empty when in c+ mode by verifying that we have at least 1 buffer ahead of the time. Signed-off-by: Jason Wang jasow...@redhat.com --- hw/rtl8139.c | 43 +-- 1 files changed, 29 insertions(+), 14 deletions(-) diff

[Qemu-devel] [PATCH v4] floppy: save and restore DIR register

2011-04-06 Thread Jason Wang
have changed after migration. To fix this, a new filed media_changed in FDrive strcutre was introduced in order to save and restore the it from block layer through pre_save/post_load callbacks. Signed-off-by: Jason Wang jasow...@redhat.com --- Changed from V3: According to Juan's suggestions, back

[Qemu-devel] [RFC PATCH 0/2] Multiqueue support for qemu(virtio-net)

2011-04-20 Thread Jason Wang
a multiqueue virtio-net device through: ./qemu-system-x86_64 -netdev tap,id=hn0,vhost=on,fd=X -netdev tap,id=hn0,vhost=on,fd=Y -device virtio-net-pci,netdev=hn0#hn1,queues=2 ... The series is very primitive and still need polished. Suggestions are welcomed. --- Jason Wang (2): net: Add

[Qemu-devel] [RFC PATCH 1/2] net: Add multiqueue support

2011-04-20 Thread Jason Wang
. Signed-off-by: Jason Wang jasow...@redhat.com --- hw/qdev-properties.c | 37 ++--- hw/qdev.h|3 ++- net.c| 34 ++ net.h| 15 +++ 4 files changed, 69 insertions(+), 20

[Qemu-devel] [RFC PATCH 2/2] virtio-net: add multiqueue support

2011-04-20 Thread Jason Wang
This patch add the multiqueue ability to virtio-net for both userapce and vhost. With this patch the kernel side vhost could be reused without modification to support multiqueue virtio-net nics. Signed-off-by: Jason Wang jasow...@redhat.com --- hw/vhost.c | 26 ++- hw/vhost.h |1

Re: [Qemu-devel] [RFC PATCH 0/2] Multiqueue support for qemu(virtio-net)

2011-04-20 Thread Jason Wang
=32 -enable-kvm -smp $smp Regards, - KK Jason Wang jasow...@redhat.com wrote on 04/20/2011 02:03:07 PM: Jason Wang jasow...@redhat.com 04/20/2011 02:03 PM To Krishna Kumar2/India/IBM@IBMIN, k...@vger.kernel.org, m...@redhat.com, net...@vger.kernel.org, ru

[Qemu-devel] [RFC PATCH 0/2] Multiqueue support for qemu(virtio-net)

2011-04-27 Thread Jason Wang
Jason Wang writes: Inspired by Krishna's patch (http://www.spinics.net/lists/kvm/msg52098.html) and Michael's suggestions. The following series adds the multiqueue support for qemu and enable it for virtio-net (both userspace and vhost). The aim for this series is to simplified

  1   2   3   4   5   6   7   8   9   10   >