aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmerigo Wang <amwang@redhat.com>2012-08-09 18:14:56 -0400
committerDavid S. Miller <davem@davemloft.net>2012-08-14 17:28:23 -0400
commitee89bab14e857678f83a71ee99e575b0fdbb58d4 (patch)
tree7af6dd9ff8e565dd91fe6324861d432a0cef836d
parent0f48917b93414a9c306a834b1b93307383956f44 (diff)
net: move and rename netif_notify_peers()
I believe net/core/dev.c is a better place for netif_notify_peers(), because other net event notify functions also stay in this file. And rename it to netdev_notify_peers(). Cc: David S. Miller <davem@davemloft.net> Cc: Ian Campbell <Ian.Campbell@citrix.com> Signed-off-by: Cong Wang <amwang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/hyperv/netvsc_drv.c2
-rw-r--r--drivers/net/virtio_net.c2
-rw-r--r--drivers/net/xen-netfront.c2
-rw-r--r--include/linux/netdevice.h3
-rw-r--r--net/core/dev.c18
-rw-r--r--net/sched/sch_generic.c18
6 files changed, 22 insertions, 23 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 8c5a1c43c81d..e91111a656f7 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -400,7 +400,7 @@ static void netvsc_send_garp(struct work_struct *w)
400 ndev_ctx = container_of(w, struct net_device_context, dwork.work); 400 ndev_ctx = container_of(w, struct net_device_context, dwork.work);
401 net_device = hv_get_drvdata(ndev_ctx->device_ctx); 401 net_device = hv_get_drvdata(ndev_ctx->device_ctx);
402 net = net_device->ndev; 402 net = net_device->ndev;
403 netif_notify_peers(net); 403 netdev_notify_peers(net);
404} 404}
405 405
406 406
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 83d2b0c34c5e..81a64c58e8ad 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -993,7 +993,7 @@ static void virtnet_config_changed_work(struct work_struct *work)
993 goto done; 993 goto done;
994 994
995 if (v & VIRTIO_NET_S_ANNOUNCE) { 995 if (v & VIRTIO_NET_S_ANNOUNCE) {
996 netif_notify_peers(vi->dev); 996 netdev_notify_peers(vi->dev);
997 virtnet_ack_link_announce(vi); 997 virtnet_ack_link_announce(vi);
998 } 998 }
999 999
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 30899901aef5..39afd37e62b3 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1731,7 +1731,7 @@ static void netback_changed(struct xenbus_device *dev,
1731 break; 1731 break;
1732 1732
1733 case XenbusStateConnected: 1733 case XenbusStateConnected:
1734 netif_notify_peers(netdev); 1734 netdev_notify_peers(netdev);
1735 break; 1735 break;
1736 1736
1737 case XenbusStateClosing: 1737 case XenbusStateClosing:
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a9db4f33407f..8d4b7316c734 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2246,8 +2246,6 @@ extern void netif_carrier_on(struct net_device *dev);
2246 2246
2247extern void netif_carrier_off(struct net_device *dev); 2247extern void netif_carrier_off(struct net_device *dev);
2248 2248
2249extern void netif_notify_peers(struct net_device *dev);
2250
2251/** 2249/**
2252 * netif_dormant_on - mark device as dormant. 2250 * netif_dormant_on - mark device as dormant.
2253 * @dev: network device 2251 * @dev: network device
@@ -2596,6 +2594,7 @@ extern void __dev_set_rx_mode(struct net_device *dev);
2596extern int dev_set_promiscuity(struct net_device *dev, int inc); 2594extern int dev_set_promiscuity(struct net_device *dev, int inc);
2597extern int dev_set_allmulti(struct net_device *dev, int inc); 2595extern int dev_set_allmulti(struct net_device *dev, int inc);
2598extern void netdev_state_change(struct net_device *dev); 2596extern void netdev_state_change(struct net_device *dev);
2597extern void netdev_notify_peers(struct net_device *dev);
2599extern int netdev_bonding_change(struct net_device *dev, 2598extern int netdev_bonding_change(struct net_device *dev,
2600 unsigned long event); 2599 unsigned long event);
2601extern void netdev_features_change(struct net_device *dev); 2600extern void netdev_features_change(struct net_device *dev);
diff --git a/net/core/dev.c b/net/core/dev.c
index 1f06df8d10a3..5defcf940005 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1106,6 +1106,24 @@ void netdev_state_change(struct net_device *dev)
1106} 1106}
1107EXPORT_SYMBOL(netdev_state_change); 1107EXPORT_SYMBOL(netdev_state_change);
1108 1108
1109/**
1110 * netdev_notify_peers - notify network peers about existence of @dev
1111 * @dev: network device
1112 *
1113 * Generate traffic such that interested network peers are aware of
1114 * @dev, such as by generating a gratuitous ARP. This may be used when
1115 * a device wants to inform the rest of the network about some sort of
1116 * reconfiguration such as a failover event or virtual machine
1117 * migration.
1118 */
1119void netdev_notify_peers(struct net_device *dev)
1120{
1121 rtnl_lock();
1122 call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, dev);
1123 rtnl_unlock();
1124}
1125EXPORT_SYMBOL(netdev_notify_peers);
1126
1109int netdev_bonding_change(struct net_device *dev, unsigned long event) 1127int netdev_bonding_change(struct net_device *dev, unsigned long event)
1110{ 1128{
1111 return call_netdevice_notifiers(event, dev); 1129 return call_netdevice_notifiers(event, dev);
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 511323e89cec..6c4d5fe53ce8 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -324,24 +324,6 @@ void netif_carrier_off(struct net_device *dev)
324} 324}
325EXPORT_SYMBOL(netif_carrier_off); 325EXPORT_SYMBOL(netif_carrier_off);
326 326
327/**
328 * netif_notify_peers - notify network peers about existence of @dev
329 * @dev: network device
330 *
331 * Generate traffic such that interested network peers are aware of
332 * @dev, such as by generating a gratuitous ARP. This may be used when
333 * a device wants to inform the rest of the network about some sort of
334 * reconfiguration such as a failover event or virtual machine
335 * migration.
336 */
337void netif_notify_peers(struct net_device *dev)
338{
339 rtnl_lock();
340 call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, dev);
341 rtnl_unlock();
342}
343EXPORT_SYMBOL(netif_notify_peers);
344
345/* "NOOP" scheduler: the best scheduler, recommended for all interfaces 327/* "NOOP" scheduler: the best scheduler, recommended for all interfaces
346 under all circumstances. It is difficult to invent anything faster or 328 under all circumstances. It is difficult to invent anything faster or
347 cheaper. 329 cheaper.