Skip to content

Commit 07ce76a

Browse files
nikolay@redhat.comdavem330
authored andcommitted
net_sched: make dev_trans_start return vlan's real dev trans_start
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> Acked-by: Veaceslav Falico <vfalico@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0369722 commit 07ce76a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

net/sched/sch_generic.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/rcupdate.h>
2626
#include <linux/list.h>
2727
#include <linux/slab.h>
28+
#include <linux/if_vlan.h>
2829
#include <net/sch_generic.h>
2930
#include <net/pkt_sched.h>
3031
#include <net/dst.h>
@@ -207,15 +208,19 @@ void __qdisc_run(struct Qdisc *q)
207208

208209
unsigned long dev_trans_start(struct net_device *dev)
209210
{
210-
unsigned long val, res = dev->trans_start;
211+
unsigned long val, res;
211212
unsigned int i;
212213

214+
if (is_vlan_dev(dev))
215+
dev = vlan_dev_real_dev(dev);
216+
res = dev->trans_start;
213217
for (i = 0; i < dev->num_tx_queues; i++) {
214218
val = netdev_get_tx_queue(dev, i)->trans_start;
215219
if (val && time_after(val, res))
216220
res = val;
217221
}
218222
dev->trans_start = res;
223+
219224
return res;
220225
}
221226
EXPORT_SYMBOL(dev_trans_start);

0 commit comments

Comments
 (0)