netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [08/38] arp_notify: allow drivers to explicitly request a notification event.
       [not found] <20100806183250.GA23019@kroah.com>
@ 2010-08-06 18:30 ` Greg KH
  2010-08-06 18:30 ` [09/38] xen: netfront: explicitly generate arp_notify event after migration Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2010-08-06 18:30 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Ian Campbell,
	Stephen Hemminger, Jeremy Fitzhardinge, David S. Miller, netdev

2.6.35-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Ian Campbell <Ian.Campbell@citrix.com>

commit 06c4648d46d1b757d6b9591a86810be79818b60c upstream.

Currently such notifications are only generated when the device comes up or the
address changes. However one use case for these notifications is to enable
faster network recovery after a virtual machine migration (by causing switches
to relearn their MAC tables). A migration appears to the network stack as a
temporary loss of carrier and therefore does not trigger either of the current
conditions. Rather than adding carrier up as a trigger (which can cause issues
when interfaces a flapping) simply add an interface which the driver can use
to explicitly trigger the notification.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 include/linux/netdevice.h |    2 ++
 include/linux/notifier.h  |    1 +
 net/ipv4/devinet.c        |    1 +
 net/sched/sch_generic.c   |   18 ++++++++++++++++++
 4 files changed, 22 insertions(+)

--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1775,6 +1775,8 @@ extern void netif_carrier_on(struct net_
 
 extern void netif_carrier_off(struct net_device *dev);
 
+extern void netif_notify_peers(struct net_device *dev);
+
 /**
  *	netif_dormant_on - mark device as dormant.
  *	@dev: network device
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -210,6 +210,7 @@ static inline int notifier_to_errno(int
 #define NETDEV_POST_INIT	0x0010
 #define NETDEV_UNREGISTER_BATCH 0x0011
 #define NETDEV_BONDING_DESLAVE  0x0012
+#define NETDEV_NOTIFY_PEERS	0x0012
 
 #define SYS_DOWN	0x0001	/* Notify of system down */
 #define SYS_RESTART	SYS_DOWN
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1081,6 +1081,7 @@ static int inetdev_event(struct notifier
 		}
 		ip_mc_up(in_dev);
 		/* fall through */
+	case NETDEV_NOTIFY_PEERS:
 	case NETDEV_CHANGEADDR:
 		/* Send gratuitous ARP to notify of link change */
 		if (IN_DEV_ARP_NOTIFY(in_dev)) {
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -327,6 +327,24 @@ void netif_carrier_off(struct net_device
 }
 EXPORT_SYMBOL(netif_carrier_off);
 
+/**
+ * 	netif_notify_peers - notify network peers about existence of @dev
+ * 	@dev: network device
+ *
+ * Generate traffic such that interested network peers are aware of
+ * @dev, such as by generating a gratuitous ARP. This may be used when
+ * a device wants to inform the rest of the network about some sort of
+ * reconfiguration such as a failover event or virtual machine
+ * migration.
+ */
+void netif_notify_peers(struct net_device *dev)
+{
+	rtnl_lock();
+	call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, dev);
+	rtnl_unlock();
+}
+EXPORT_SYMBOL(netif_notify_peers);
+
 /* "NOOP" scheduler: the best scheduler, recommended for all interfaces
    under all circumstances. It is difficult to invent anything faster or
    cheaper.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [09/38] xen: netfront: explicitly generate arp_notify event after migration.
       [not found] <20100806183250.GA23019@kroah.com>
  2010-08-06 18:30 ` [08/38] arp_notify: allow drivers to explicitly request a notification event Greg KH
@ 2010-08-06 18:30 ` Greg KH
  2010-08-10 13:07   ` Ian Campbell
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2010-08-06 18:30 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jeremy Fitzhardinge, xen-devel, Ian Campbell, torvalds,
	David S. Miller, netdev, akpm, Stephen Hemminger, stable-review,
	alan

2.6.35-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Ian Campbell <Ian.Campbell@citrix.com>

commit 592970675c9522bde588b945388c7995c8b51328 upstream.

Use newly introduced netif_notify_peers() method to ensure a gratuitous ARP is
generated after a migration.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Cc: xen-devel@lists.xensource.com
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/xen-netfront.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1621,6 +1621,7 @@ static void backend_changed(struct xenbu
 		if (xennet_connect(netdev) != 0)
 			break;
 		xenbus_switch_state(dev, XenbusStateConnected);
+		netif_notify_peers(netdev);
 		break;
 
 	case XenbusStateClosing:

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [09/38] xen: netfront: explicitly generate arp_notify event after migration.
  2010-08-06 18:30 ` [09/38] xen: netfront: explicitly generate arp_notify event after migration Greg KH
@ 2010-08-10 13:07   ` Ian Campbell
  2010-08-11 19:43     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2010-08-10 13:07 UTC (permalink / raw)
  To: Greg KH
  Cc: Jeremy Fitzhardinge, xen-devel@lists.xensource.com,
	David S. Miller, Stephen Hemminger, linux-kernel@vger.kernel.org,
	stable@kernel.org, netdev@vger.kernel.org,
	akpm@linux-foundation.org, torvalds@linux-foundation.org,
	stable-review@kernel.org, alan@lxorguk.ukuu.org.uk

Hi Greg,

Looks like I forgot to request this for 2.6.32 too, could you queue it
up there as well?

It depends on the previous patch in this series (arp_notify: allow
drivers to explicitly request a notification event.).

Thanks,
Ian.

On Fri, 2010-08-06 at 19:30 +0100, Greg KH wrote:
> 2.6.35-stable review patch.  If anyone has any objections, please let us know.
> 
> ------------------
> 
> From: Ian Campbell <Ian.Campbell@citrix.com>
> 
> commit 592970675c9522bde588b945388c7995c8b51328 upstream.
> 
> Use newly introduced netif_notify_peers() method to ensure a gratuitous ARP is
> generated after a migration.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Stephen Hemminger <shemminger@linux-foundation.org>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: netdev@vger.kernel.org
> Cc: xen-devel@lists.xensource.com
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> 
> ---
>  drivers/net/xen-netfront.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -1621,6 +1621,7 @@ static void backend_changed(struct xenbu
>  		if (xennet_connect(netdev) != 0)
>  			break;
>  		xenbus_switch_state(dev, XenbusStateConnected);
> +		netif_notify_peers(netdev);
>  		break;
>  
>  	case XenbusStateClosing:
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [09/38] xen: netfront: explicitly generate arp_notify event after migration.
  2010-08-10 13:07   ` Ian Campbell
@ 2010-08-11 19:43     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2010-08-11 19:43 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Greg KH, linux-kernel@vger.kernel.org, stable@kernel.org,
	stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Stephen Hemminger, Jeremy Fitzhardinge, David S. Miller,
	netdev@vger.kernel.org, xen-devel@lists.xensource.com

On Tue, Aug 10, 2010 at 02:07:27PM +0100, Ian Campbell wrote:
> Hi Greg,
> 
> Looks like I forgot to request this for 2.6.32 too, could you queue it
> up there as well?
> 
> It depends on the previous patch in this series (arp_notify: allow
> drivers to explicitly request a notification event.).

Now queued up for .32 and .34-stable kernels.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-11 19:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20100806183250.GA23019@kroah.com>
2010-08-06 18:30 ` [08/38] arp_notify: allow drivers to explicitly request a notification event Greg KH
2010-08-06 18:30 ` [09/38] xen: netfront: explicitly generate arp_notify event after migration Greg KH
2010-08-10 13:07   ` Ian Campbell
2010-08-11 19:43     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).