From: Eric Dumazet Date: Tue, 30 Aug 2011 23:31:58 +0000 (+0000) Subject: net: linkwatch: allow vlans to get carrier changes faster X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c37e0c993055d8c4fd82202331d06e6ef9bfec4b;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git net: linkwatch: allow vlans to get carrier changes faster There is a time-lag of IFF_RUNNING flag consistency between vlan and real devices when the real devices are in problem such as link or cable broken. This leads to a degradation of Availability such as a delay of failover in HA systems using vlan since the detection of the problem at real device is delayed. We can avoid the linkwatch delay (~1 sec) for devices linked to another ones, since delay is already done for the realdev. Based on a previous patch from Mitsuo Hayasaka Reported-by: Mitsuo Hayasaka Signed-off-by: Eric Dumazet Cc: Herbert Xu Cc: Patrick McHardy Cc: "Michał Mirosław" Cc: Tom Herbert Cc: Stephen Hemminger Cc: Jesse Gross Tested-by: Mitsuo Hayasaka Signed-off-by: David S. Miller --- diff --git a/net/core/link_watch.c b/net/core/link_watch.c index 357bd4ee4baa..c3519c6d1b16 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c @@ -78,8 +78,13 @@ static void rfc2863_policy(struct net_device *dev) static bool linkwatch_urgent_event(struct net_device *dev) { - return netif_running(dev) && netif_carrier_ok(dev) && - qdisc_tx_changing(dev); + if (!netif_running(dev)) + return false; + + if (dev->ifindex != dev->iflink) + return true; + + return netif_carrier_ok(dev) && qdisc_tx_changing(dev); }