Skip to content

Commit

Permalink
net: linkwatch: allow vlans to get carrier changes faster
Browse files Browse the repository at this point in the history
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 <mitsuo.hayasaka.hu@hitachi.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Patrick McHardy <kaber@trash.net>
Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: Tom Herbert <therbert@google.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Jesse Gross <jesse@nicira.com>
Tested-by: Mitsuo Hayasaka <mitsuo.hayasaka.hu@hitachi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Sep 15, 2011
1 parent 3e829a7 commit c37e0c9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions net/core/link_watch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit c37e0c9

Please sign in to comment.