]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
virtio-net: send gratuitous packets when needed
authorJason Wang <jasowang@redhat.com>
Wed, 11 Apr 2012 20:43:52 +0000 (20:43 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 15 Apr 2012 07:23:31 +0000 (03:23 -0400)
commit586d17c5a01bf1ae4e215adc6c48457eee5482bc
tree20738485061d7965712bc711035883501d02bcc5
parent8831a3f2c9ee7d952e6d7a018d11c0c9c5b56749
virtio-net: send gratuitous packets when needed

As hypervior does not have the knowledge of guest network configuration, it's
better to ask guest to send gratuitous packets when needed.

This patch implements VIRTIO_NET_F_GUEST_ANNOUNCE feature: hypervisor would
notice the guest when it thinks it's time for guest to announce the link
presnece. Guest tests VIRTIO_NET_S_ANNOUNCE bit during config change interrupt
and woule send gratuitous packets through netif_notify_peers() and ack the
notification through ctrl vq.

We need to make sure the atomicy of read and ack in guest otherwise we may ack
more times than being notified. This is done through handling the whole config
change interrupt in an non-reentrant workqueue.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c
include/linux/virtio_net.h