diff options
author | Laszlo Ersek <lersek@redhat.com> | 2011-12-10 20:48:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-12 19:02:41 -0500 |
commit | 08e34eb14fe4cfd934b5c169a7682a969457c4ea (patch) | |
tree | 1f342a21766e4eee495d0fb74fd26970743d9c5b /drivers/net/xen-netfront.c | |
parent | f2abba4921b945a6f8aca36fcba634c22797ba78 (diff) |
xen-netfront: delay gARP until backend switches to Connected
After a guest is live migrated, the xen-netfront driver emits a gratuitous
ARP message, so that networking hardware on the target host's subnet can
take notice, and public routing to the guest is re-established. However,
if the packet appears on the backend interface before the backend is added
to the target host's bridge, the packet is lost, and the migrated guest's
peers become unable to talk to the guest.
A sufficient two-parts condition to prevent the above is:
(1) ensure that the backend only moves to Connected xenbus state after its
hotplug scripts completed, ie. the netback interface got added to the
bridge; and
(2) ensure the frontend only queues the gARP when it sees the backend move
to Connected.
These two together provide complete ordering. Sub-condition (1) is already
satisfied by commit f942dc2552b8 in Linus' tree, based on commit
6b0b80ca7165 from [1].
In general, the full condition is sufficient, not necessary, because,
according to [2], live migration has been working for a long time without
satisfying sub-condition (2). However, after 6b0b80ca7165 was backported
to the RHEL-5 host to ensure (1), (2) still proved necessary in the RHEL-6
guest. This patch intends to provide (2) for upstream.
The Reviewed-by line comes from [3].
[1] git://xenbits.xen.org/people/ianc/linux-2.6.git#upstream/dom0/backend/netback-history
[2] http://old-list-archives.xen.org/xen-devel/2011-06/msg01969.html
[3] http://old-list-archives.xen.org/xen-devel/2011-07/msg00484.html
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netfront.c')
-rw-r--r-- | drivers/net/xen-netfront.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 4312db8cdeab..0a59c57864f5 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -1709,7 +1709,6 @@ static void netback_changed(struct xenbus_device *dev, | |||
1709 | case XenbusStateInitialised: | 1709 | case XenbusStateInitialised: |
1710 | case XenbusStateReconfiguring: | 1710 | case XenbusStateReconfiguring: |
1711 | case XenbusStateReconfigured: | 1711 | case XenbusStateReconfigured: |
1712 | case XenbusStateConnected: | ||
1713 | case XenbusStateUnknown: | 1712 | case XenbusStateUnknown: |
1714 | case XenbusStateClosed: | 1713 | case XenbusStateClosed: |
1715 | break; | 1714 | break; |
@@ -1720,6 +1719,9 @@ static void netback_changed(struct xenbus_device *dev, | |||
1720 | if (xennet_connect(netdev) != 0) | 1719 | if (xennet_connect(netdev) != 0) |
1721 | break; | 1720 | break; |
1722 | xenbus_switch_state(dev, XenbusStateConnected); | 1721 | xenbus_switch_state(dev, XenbusStateConnected); |
1722 | break; | ||
1723 | |||
1724 | case XenbusStateConnected: | ||
1723 | netif_notify_peers(netdev); | 1725 | netif_notify_peers(netdev); |
1724 | break; | 1726 | break; |
1725 | 1727 | ||