Эх сурвалжийг харах

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>
Amerigo Wang 13 жил өмнө
parent
commit
ee89bab14e

+ 1 - 1
drivers/net/hyperv/netvsc_drv.c

@@ -400,7 +400,7 @@ static void netvsc_send_garp(struct work_struct *w)
 	ndev_ctx = container_of(w, struct net_device_context, dwork.work);
 	ndev_ctx = container_of(w, struct net_device_context, dwork.work);
 	net_device = hv_get_drvdata(ndev_ctx->device_ctx);
 	net_device = hv_get_drvdata(ndev_ctx->device_ctx);
 	net = net_device->ndev;
 	net = net_device->ndev;
-	netif_notify_peers(net);
+	netdev_notify_peers(net);
 }
 }
 
 
 
 

+ 1 - 1
drivers/net/virtio_net.c

@@ -993,7 +993,7 @@ static void virtnet_config_changed_work(struct work_struct *work)
 		goto done;
 		goto done;
 
 
 	if (v & VIRTIO_NET_S_ANNOUNCE) {
 	if (v & VIRTIO_NET_S_ANNOUNCE) {
-		netif_notify_peers(vi->dev);
+		netdev_notify_peers(vi->dev);
 		virtnet_ack_link_announce(vi);
 		virtnet_ack_link_announce(vi);
 	}
 	}
 
 

+ 1 - 1
drivers/net/xen-netfront.c

@@ -1731,7 +1731,7 @@ static void netback_changed(struct xenbus_device *dev,
 		break;
 		break;
 
 
 	case XenbusStateConnected:
 	case XenbusStateConnected:
-		netif_notify_peers(netdev);
+		netdev_notify_peers(netdev);
 		break;
 		break;
 
 
 	case XenbusStateClosing:
 	case XenbusStateClosing:

+ 1 - 2
include/linux/netdevice.h

@@ -2246,8 +2246,6 @@ extern void netif_carrier_on(struct net_device *dev);
 
 
 extern void netif_carrier_off(struct net_device *dev);
 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.
  *	netif_dormant_on - mark device as dormant.
  *	@dev: network device
  *	@dev: network device
@@ -2596,6 +2594,7 @@ extern void		__dev_set_rx_mode(struct net_device *dev);
 extern int		dev_set_promiscuity(struct net_device *dev, int inc);
 extern int		dev_set_promiscuity(struct net_device *dev, int inc);
 extern int		dev_set_allmulti(struct net_device *dev, int inc);
 extern int		dev_set_allmulti(struct net_device *dev, int inc);
 extern void		netdev_state_change(struct net_device *dev);
 extern void		netdev_state_change(struct net_device *dev);
+extern void		netdev_notify_peers(struct net_device *dev);
 extern int		netdev_bonding_change(struct net_device *dev,
 extern int		netdev_bonding_change(struct net_device *dev,
 					      unsigned long event);
 					      unsigned long event);
 extern void		netdev_features_change(struct net_device *dev);
 extern void		netdev_features_change(struct net_device *dev);

+ 18 - 0
net/core/dev.c

@@ -1106,6 +1106,24 @@ void netdev_state_change(struct net_device *dev)
 }
 }
 EXPORT_SYMBOL(netdev_state_change);
 EXPORT_SYMBOL(netdev_state_change);
 
 
+/**
+ * 	netdev_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 netdev_notify_peers(struct net_device *dev)
+{
+	rtnl_lock();
+	call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, dev);
+	rtnl_unlock();
+}
+EXPORT_SYMBOL(netdev_notify_peers);
+
 int netdev_bonding_change(struct net_device *dev, unsigned long event)
 int netdev_bonding_change(struct net_device *dev, unsigned long event)
 {
 {
 	return call_netdevice_notifiers(event, dev);
 	return call_netdevice_notifiers(event, dev);

+ 0 - 18
net/sched/sch_generic.c

@@ -324,24 +324,6 @@ void netif_carrier_off(struct net_device *dev)
 }
 }
 EXPORT_SYMBOL(netif_carrier_off);
 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
 /* "NOOP" scheduler: the best scheduler, recommended for all interfaces
    under all circumstances. It is difficult to invent anything faster or
    under all circumstances. It is difficult to invent anything faster or
    cheaper.
    cheaper.