[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130803201238.GD12638@redhat.com>
Date: Sat, 3 Aug 2013 22:12:38 +0200
From: Veaceslav Falico <vfalico@...hat.com>
To: Nikolay Aleksandrov <nikolay@...hat.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, fubar@...ibm.com,
jhs@...atatu.com
Subject: Re: [PATCH net v2 2/2] net_sched: make dev_trans_start return vlan's
real dev trans_start
On Sat, Aug 03, 2013 at 10:07:47PM +0200, Nikolay Aleksandrov wrote:
>From: Nikolay Aleksandrov <Nikolay Aleksandrov nikolay@...hat.com>
>
>Vlan devices are LLTX and don't update their own trans_start, so if
>dev_trans_start has to be called with a vlan device then 0 or a stale
>value will be returned. Currently the bonding is the only such user, and
>it's needed for proper arp monitoring when the slaves are vlans.
>Fix this by extracting the vlan's real device trans_start.
>
>Suggested-by: David Miller <davem@...emloft.net>
>Signed-off-by: Nikolay Aleksandrov <nikolay@...hat.com>
Acked-by: Veaceslav Falico <vfalico@...hat.com>
>---
>v2: drop the while, since vlan_dev_real_dev now does it for us
>
> net/sched/sch_generic.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
>diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
>index 4626cef..eeb8276 100644
>--- a/net/sched/sch_generic.c
>+++ b/net/sched/sch_generic.c
>@@ -25,6 +25,7 @@
> #include <linux/rcupdate.h>
> #include <linux/list.h>
> #include <linux/slab.h>
>+#include <linux/if_vlan.h>
> #include <net/sch_generic.h>
> #include <net/pkt_sched.h>
> #include <net/dst.h>
>@@ -207,15 +208,19 @@ void __qdisc_run(struct Qdisc *q)
>
> unsigned long dev_trans_start(struct net_device *dev)
> {
>- unsigned long val, res = dev->trans_start;
>+ unsigned long val, res;
> unsigned int i;
>
>+ if (is_vlan_dev(dev))
>+ dev = vlan_dev_real_dev(dev);
>+ res = dev->trans_start;
> for (i = 0; i < dev->num_tx_queues; i++) {
> val = netdev_get_tx_queue(dev, i)->trans_start;
> if (val && time_after(val, res))
> res = val;
> }
> dev->trans_start = res;
>+
> return res;
> }
> EXPORT_SYMBOL(dev_trans_start);
>--
>1.8.1.4
>
--
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