From: Nikolay Aleksandrov <nikolay@redhat.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, fubar@us.ibm.com, jhs@mojatatu.com
Subject: [PATCH net] net_sched: make dev_trans_start return vlan's real dev trans_start
Date: Sat, 3 Aug 2013 17:07:51 +0200 [thread overview]
Message-ID: <1375542471-22739-1-git-send-email-nikolay@redhat.com> (raw)
From: Nikolay Aleksandrov <Nikolay Aleksandrov nikolay@redhat.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@davemloft.net>
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
---
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..da936f6 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;
+ while (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
next reply other threads:[~2013-08-03 15:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-03 15:07 Nikolay Aleksandrov [this message]
2013-08-03 17:07 ` [net] net_sched: make dev_trans_start return vlan's real dev trans_start Veaceslav Falico
2013-08-03 18:13 ` Nikolay Aleksandrov
2013-08-03 18:19 ` Nikolay Aleksandrov
2013-08-03 18:25 ` Veaceslav Falico
2013-08-03 18:52 ` David Miller
2013-08-03 19:09 ` Veaceslav Falico
2013-08-03 19:35 ` Nikolay Aleksandrov
2013-08-03 19:37 ` David Miller
2013-08-03 19:37 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1375542471-22739-1-git-send-email-nikolay@redhat.com \
--to=nikolay@redhat.com \
--cc=davem@davemloft.net \
--cc=fubar@us.ibm.com \
--cc=jhs@mojatatu.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).