Skip to content

Commit

Permalink
net/sched: act_mirred: Use passed lastuse argument
Browse files Browse the repository at this point in the history
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: 9798e6f ('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>
  • Loading branch information
Paul Blakey authored and David S. Miller committed Oct 20, 2016
1 parent 164c971 commit 5712bf9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/sched/act_mirred.c
Original file line number Diff line number Diff line change
@@ -207,8 +207,11 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a,
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,

0 comments on commit 5712bf9

Please sign in to comment.