Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5712bf9c authored by Paul Blakey's avatar Paul Blakey Committed by David S. Miller
Browse files

net/sched: act_mirred: Use passed lastuse argument



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: 9798e6fe ('net: act_mirred: allow statistic updates from offloaded actions')
Signed-off-by: default avatarPaul Blakey <paulb@mellanox.com>
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 164c971d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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,