Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee89bab1 authored by Amerigo Wang's avatar Amerigo Wang Committed by David S. Miller
Browse files

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: default avatarCong Wang <amwang@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0f48917b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -400,7 +400,7 @@ static void netvsc_send_garp(struct work_struct *w)
	ndev_ctx = container_of(w, struct net_device_context, dwork.work);
	net_device = hv_get_drvdata(ndev_ctx->device_ctx);
	net = net_device->ndev;
	netif_notify_peers(net);
	netdev_notify_peers(net);
}


+1 −1
Original line number Diff line number Diff line
@@ -993,7 +993,7 @@ static void virtnet_config_changed_work(struct work_struct *work)
		goto done;

	if (v & VIRTIO_NET_S_ANNOUNCE) {
		netif_notify_peers(vi->dev);
		netdev_notify_peers(vi->dev);
		virtnet_ack_link_announce(vi);
	}

+1 −1
Original line number Diff line number Diff line
@@ -1731,7 +1731,7 @@ static void netback_changed(struct xenbus_device *dev,
		break;

	case XenbusStateConnected:
		netif_notify_peers(netdev);
		netdev_notify_peers(netdev);
		break;

	case XenbusStateClosing:
+1 −2
Original line number Diff line number Diff line
@@ -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_notify_peers(struct net_device *dev);

/**
 *	netif_dormant_on - mark device as dormant.
 *	@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_allmulti(struct net_device *dev, int inc);
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,
					      unsigned long event);
extern void		netdev_features_change(struct net_device *dev);
+18 −0
Original line number Diff line number Diff line
@@ -1106,6 +1106,24 @@ void netdev_state_change(struct net_device *dev)
}
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)
{
	return call_netdevice_notifiers(event, dev);
Loading