net/sched: act_mirred: Use passed lastuse argument
authorPaul Blakey <paulb@mellanox.com>
Wed, 19 Oct 2016 14:42:39 +0000 (17:42 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Oct 2016 15:14:24 +0000 (11:14 -0400)
stats_update callback is called by NIC drivers doing hardware
offloading of the mirred action. Lastuse is passed as argument
to specify when the stats was actually last updated and is not
always the current time.

Fixes: 9798e6fe4f9b ('net: act_mirred: allow statistic updates from offloaded actions')
Signed-off-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_mirred.c

index 667dc382df82bf1b7f884b7d60b0907826cc21a3..6b07fba5770b2fd0997eef25be5ea2e2803b54ca 100644 (file)
@@ -207,8 +207,11 @@ out:
 static void tcf_stats_update(struct tc_action *a, u64 bytes, u32 packets,
                             u64 lastuse)
 {
-       tcf_lastuse_update(&a->tcfa_tm);
+       struct tcf_mirred *m = to_mirred(a);
+       struct tcf_t *tm = &m->tcf_tm;
+
        _bstats_cpu_update(this_cpu_ptr(a->cpu_bstats), bytes, packets);
+       tm->lastuse = lastuse;
 }
 
 static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind,