vhost: handle request to send RARP
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Fri, 29 Jan 2016 04:58:01 +0000 (12:58 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 19 Feb 2016 14:49:02 +0000 (15:49 +0100)
commit33226236a35ed6540c3cbfe1a54550726be37926
treec19c821c235ae2900a655af527e54ff5b3e1cfe5
parentd293dac8f30e46f0cb66fbcce2977d73d56fe103
vhost: handle request to send RARP

While in former patch we enabled GUEST_ANNOUNCE feature, so that the
guest OS will broadcast a GARP message after migration to notify the
switch about the new location of migrated VM, the thing is that
GUEST_ANNOUNCE is enabled since kernel v3.5 only. For older kernel,
VHOST_USER_SEND_RARP request comes to rescue.

The payload of this new request is the mac address of the migrated VM,
with that, we could construct a RARP message, and then broadcast it
to host interfaces.

That's how this patch works:

- list all interfaces, with the help of SIOCGIFCONF ioctl command

- construct an RARP message and broadcast it

Cc: Thibaut Collet <thibaut.collet@6wind.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/vhost_user/vhost-net-user.c
lib/librte_vhost/vhost_user/vhost-net-user.h
lib/librte_vhost/vhost_user/virtio-net-user.c
lib/librte_vhost/vhost_user/virtio-net-user.h