[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110826060257.5304.62723.stgit@ltc219.sdl.hitachi.co.jp>
Date: Fri, 26 Aug 2011 15:02:57 +0900
From: Mitsuo Hayasaka <mitsuo.hayasaka.hu@...achi.com>
To: Patrick McHardy <kaber@...sh.net>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <eric.dumazet@...il.com>,
MichałMirosław
<mirq-linux@...e.qmqm.pl>, Tom Herbert <therbert@...gle.com>,
Jesse Gross <jesse@...ira.com>, herbert@...dor.apana.org.au
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
yrl.pp-manager.tt@...achi.com,
Mitsuo Hayasaka <mitsuo.hayasaka.hu@...achi.com>,
Patrick McHardy <kaber@...sh.net>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <eric.dumazet@...il.com>,
"MichałMirosław"
<mirq-linux@...e.qmqm.pl>, Tom Herbert <therbert@...gle.com>,
Jesse Gross <jesse@...ira.com>
Subject: [PATCH net-next ] Fix time-lag of IFF_RUNNING flag consistency
between vlan and real devices
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.
Why this happens:
Network devices' flags can be checked using ioctl with SIOCGIFFLAGS. When
vlan technique is used, it checks the flags of vlan device, not real
device.
Patch:
This patch adds vlan-device check into dev_get_flags(). So, it can check
flags of the real device even if the vlan is used.
Signed-off-by: Mitsuo Hayasaka <mitsuo.hayasaka.hu@...achi.com>
Cc: Patrick McHardy <kaber@...sh.net>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Eric Dumazet <eric.dumazet@...il.com>
Cc: "Michał Mirosław" <mirq-linux@...e.qmqm.pl>
Cc: Tom Herbert <therbert@...gle.com>
Cc: Jesse Gross <jesse@...ira.com>
---
include/linux/if_vlan.h | 2 +-
net/core/dev.c | 7 +++++++
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 44da482..4df4e6f 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -91,7 +91,7 @@ struct vlan_group {
struct rcu_head rcu;
};
-static inline int is_vlan_dev(struct net_device *dev)
+static inline int is_vlan_dev(const struct net_device *dev)
{
return dev->priv_flags & IFF_802_1Q_VLAN;
}
diff --git a/net/core/dev.c b/net/core/dev.c
index a4306f7..527e21b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4603,6 +4603,13 @@ unsigned dev_get_flags(const struct net_device *dev)
(dev->gflags & (IFF_PROMISC |
IFF_ALLMULTI));
+ /*
+ * If we're trying to get flags on a vlan device
+ * use the underlying physical device instead.
+ */
+ if (is_vlan_dev(dev))
+ dev = vlan_dev_real_dev(dev);
+
if (netif_running(dev)) {
if (netif_oper_up(dev))
flags |= IFF_RUNNING;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists