When live migration is finished, the backup VM needs to proactively announce its new location. DPDK vhost has implemented VHOST_USER_PROTOCOL_F_RARP to generate a RARP packet to switch in dequeue path. Another method is to let the guest proactively send out RARP packet using VIRTIO_NET_F_GUEST_ANNOUNCE feature.
This patch set enables this feature in virtio pmd, to support VM running virtio pmd be migrated without vhost supporting RARP generation. v10: - Add a bold doxygen comment for the experimental function. v9: - Introduce function with the experimental state. v8: - Add a helper in lib/librte_net to make rarp packet, it's used by both vhost and virtio. v7: - Improve comment for state_lock. - Rename spinlock variable 'sl' to 'lock'. v6: - Use rte_pktmbuf_alloc() instead of rte_mbuf_raw_alloc(). - Remove the 'len' parameter in calling virtio_send_command(). - Remove extra space between typo and var. - Improve comment and alignment. - Remove the unnecessary header file. - A better usage of 'unlikely' indication. v5: - Remove txvq parameter in virtio_inject_pkts. - Zero hw->special_buf after using it. - Return the retval of tx_pkt_burst(). - Allocate a mbuf pointer on stack directly. v4: - Move spinlock lock/unlock into dev_pause/resume. - Separate out a patch for packet injection. v3: - Remove Tx function code duplication, use a special pointer for rarp injection. - Rename function generate_rarp to virtio_notify_peers, replace 'virtnet_' with 'virtio_'. - Add comment for state_lock. - Typo fix and comment improvement. v2: - Use spaces instead of tabs between the code and comments. - Remove unnecessary parentheses. - Use rte_pktmbuf_mtod directly to get eth_hdr addr. - Fix virtio_dev_pause return value check. Xiao Wang (5): net/virtio: make control queue thread-safe net/virtio: add packet injection method net: add a helper for making RARP packet vhost: use lib API to make RARP packet net/virtio: support GUEST ANNOUNCE drivers/net/virtio/virtio_ethdev.c | 118 +++++++++++++++++++++++++++++++- drivers/net/virtio/virtio_ethdev.h | 6 ++ drivers/net/virtio/virtio_pci.h | 7 ++ drivers/net/virtio/virtio_rxtx.c | 3 +- drivers/net/virtio/virtio_rxtx.h | 1 + drivers/net/virtio/virtio_rxtx_simple.c | 2 +- drivers/net/virtio/virtqueue.h | 11 +++ lib/Makefile | 3 +- lib/librte_net/Makefile | 1 + lib/librte_net/rte_arp.c | 42 ++++++++++++ lib/librte_net/rte_arp.h | 17 +++++ lib/librte_net/rte_net_version.map | 6 ++ lib/librte_vhost/Makefile | 2 +- lib/librte_vhost/virtio_net.c | 41 +---------- 14 files changed, 213 insertions(+), 47 deletions(-) create mode 100644 lib/librte_net/rte_arp.c -- 2.15.1