For now, cycle_netdev() will be called to flush the neighbor cache when add slave by downing and upping the slave netdev. When the slave has vlan devices, the data transmission can interrupted. Optimize it by notifying the NETDEV_CHANGEADDR instead, which will also flush the neighbor cache. It's a little ugly, and maybe we can introduce a new event to do such flush :/ Signed-off-by: Menglong Dong --- drivers/net/vrf.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index 3ccd649913b5..d90bdf1fe747 100644 --- a/drivers/net/vrf.c +++ b/drivers/net/vrf.c @@ -1042,17 +1042,15 @@ static int vrf_rtable_create(struct net_device *dev) static void cycle_netdev(struct net_device *dev, struct netlink_ext_ack *extack) { - unsigned int flags = dev->flags; int ret; if (!netif_running(dev)) return; - ret = dev_change_flags(dev, flags & ~IFF_UP, extack); - if (ret >= 0) - ret = dev_change_flags(dev, flags, extack); + ret = call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); + ret = notifier_to_errno(ret); - if (ret < 0) { + if (ret) { netdev_err(dev, "Failed to cycle device %s; route tables might be wrong!\n", dev->name); -- 2.50.1