Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-09 Thread Stefan Hajnoczi
On Mon, Jun 08, 2015 at 05:32:38PM +0200, Thibaut Collet wrote: 3. The easiest solution - nop .receive() The solution 3 is similar of my implementation and does not solve issue pointed by Jason: legacy guest do not send a gratuitous ARP. 2. Fail negotiation when

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-09 Thread Stefan Hajnoczi
On Mon, Jun 08, 2015 at 05:32:38PM +0200, Thibaut Collet wrote: 3. The easiest solution - nop .receive() The solution 3 is similar of my implementation and does not solve issue pointed by Jason: legacy guest do not send a gratuitous ARP. Yes, but it prints a warning so the user is aware

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Jason Wang
On 06/09/2015 12:13 AM, Michael S. Tsirkin wrote: On Mon, Jun 08, 2015 at 04:13:59PM +0100, Stefan Hajnoczi wrote: On Mon, Jun 8, 2015 at 3:05 PM, Thibaut Collet thibaut.col...@6wind.com wrote: I think Jason is pointing out that your patch lacks support for guests that do not negotiate

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Thibaut Collet
Hi, My understanding of gratuitous packet with virtio for any backend (vhost user or other): - When the VM is loaded (first start or migration) the virtio net interfaces are loaded ( virtio_net_load_device function in hw/net/virtio-net.c) - If the guest has the VIRTIO_NET_F_GUEST_ANNOUNCE

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Jason Wang
On 06/08/2015 04:21 PM, Thibaut Collet wrote: Hi, My understanding of gratuitous packet with virtio for any backend (vhost user or other): - When the VM is loaded (first start or migration) the virtio net interfaces are loaded ( virtio_net_load_device function in hw/net/virtio-net.c) -

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Michael S. Tsirkin
On Mon, Jun 08, 2015 at 12:01:38PM +0200, Thibaut Collet wrote: Hi, I agree that my patch is OK only for recent drivers. To have a simple patch with only few modifications I do not implement a solution for old driver but I can be done later. For legacy guest without 

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Michael S. Tsirkin
On Fri, Jun 05, 2015 at 03:24:12PM +0200, Thibaut Collet wrote: Add VIRTIO_NET_F_GUEST_ANNOUNCE capability to vhost-net when netdev backend is vhost-user. For netdev backend using virtio-net NIC the self announce is managed directly by the virtio-net NIC and not by the netdev backend itself.

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Thibaut Collet
Hi, I agree that my patch is OK only for recent drivers. To have a simple patch with only few modifications I do not implement a solution for old driver but I can be done later. For legacy guest without VIRTIO_NET_F_GUEST_ANNOUNCE the problem is more complex. The RARP must be sent by the vhost

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Jason Wang
On 06/08/2015 06:01 PM, Thibaut Collet wrote: Hi, I agree that my patch is OK only for recent drivers. To have a simple patch with only few modifications I do not implement a solution for old driver but I can be done later. This makes sense. For legacy guest without

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Stefan Hajnoczi
On Fri, Jun 05, 2015 at 03:24:12PM +0200, Thibaut Collet wrote: Add VIRTIO_NET_F_GUEST_ANNOUNCE capability to vhost-net when netdev backend is vhost-user. For netdev backend using virtio-net NIC the self announce is managed directly by the virtio-net NIC and not by the netdev backend itself.

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Thibaut Collet
I've asked several times whether vhost-user support live migration? vhost-user can support live migration but it needs such fixes of Qemu. I have found the issue and develop my patch by trying live migration with vhost user. I think Jason is pointing out that your patch lacks support for

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Thibaut Collet
Hi, I don't think qemu_send_packet_raw can ever work for vhost user. What happens if you merely add VIRTIO_NET_F_GUEST_ANNOUNCE to the feature list, and drop the rest of the patch? If you merely add VIRTIO_NET_F_GUEST_ANNOUNCE you have the GARP with recent guest after a live migration. The

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Michael S. Tsirkin
On Mon, Jun 08, 2015 at 01:29:39PM +0200, Thibaut Collet wrote: Hi, I don't think qemu_send_packet_raw can ever work for vhost user. What happens if you merely add VIRTIO_NET_F_GUEST_ANNOUNCE to the feature list, and drop the rest of the patch? If you merely add

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Stefan Hajnoczi
On Mon, Jun 08, 2015 at 10:21:38AM +0200, Thibaut Collet wrote: Hi, My understanding of gratuitous packet with virtio for any backend (vhost user or other): - When the VM is loaded (first start or migration) the virtio net interfaces are loaded ( virtio_net_load_device function in

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Thibaut Collet
How about implementing a receive function that discards all packets then? Implementing a receive function that discards all packets is an other solution. I have not chosen this one to avoid to mask other potential issues: Normally vhost-user never receives packets. By keeping a NULL function as

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Stefan Hajnoczi
On Mon, Jun 8, 2015 at 3:05 PM, Thibaut Collet thibaut.col...@6wind.com wrote: I think Jason is pointing out that your patch lacks support for guests that do not negotiate VIRTIO_NET_F_GUEST_ANNOUNCE. I have understood the issue with old guest pointed by Jason. I have thinking about the best

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Thibaut Collet
3. The easiest solution - nop .receive() The solution 3 is similar of my implementation and does not solve issue pointed by Jason: legacy guest do not send a gratuitous ARP. 2. Fail negotiation when VIRTIO_NET_F_GUEST_ANNOUNCE is not accepted

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Michael S. Tsirkin
On Mon, Jun 08, 2015 at 03:20:23PM +0200, Thibaut Collet wrote: How about implementing a receive function that discards all packets then? Implementing a receive function that discards all packets is an other solution. I have not chosen this one to avoid to mask other potential issues: 

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-08 Thread Michael S. Tsirkin
On Mon, Jun 08, 2015 at 04:13:59PM +0100, Stefan Hajnoczi wrote: On Mon, Jun 8, 2015 at 3:05 PM, Thibaut Collet thibaut.col...@6wind.com wrote: I think Jason is pointing out that your patch lacks support for guests that do not negotiate VIRTIO_NET_F_GUEST_ANNOUNCE. I have understood the

Re: [Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-07 Thread Jason Wang
On 06/05/2015 09:24 PM, Thibaut Collet wrote: Add VIRTIO_NET_F_GUEST_ANNOUNCE capability to vhost-net when netdev backend is vhost-user. For netdev backend using virtio-net NIC the self announce is managed directly by the virtio-net NIC and not by the netdev backend itself. To avoid

[Qemu-devel] [PATCH v2] net: Add support of VIRTIO_NET_F_GUEST_ANNOUNCE for vhost-net/vhost-user

2015-06-05 Thread Thibaut Collet
Add VIRTIO_NET_F_GUEST_ANNOUNCE capability to vhost-net when netdev backend is vhost-user. For netdev backend using virtio-net NIC the self announce is managed directly by the virtio-net NIC and not by the netdev backend itself. To avoid duplication of announces (once from the guest and once from