All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net/sched: act_mirred: Use passed lastuse argument
@ 2016-10-19 14:42 Or Gerlitz
  2016-10-20 15:15 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Or Gerlitz @ 2016-10-19 14:42 UTC (permalink / raw)
  To: David S. Miller
  Cc: Amir Vadai, jakub.kicinski, netdev, Paul Blakey, Or Gerlitz

From: Paul Blakey <paulb@mellanox.com>

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>
---
 net/sched/act_mirred.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 667dc38..6b07fba 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -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,
-- 
2.3.7

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net/sched: act_mirred: Use passed lastuse argument
  2016-10-19 14:42 [PATCH net] net/sched: act_mirred: Use passed lastuse argument Or Gerlitz
@ 2016-10-20 15:15 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-10-20 15:15 UTC (permalink / raw)
  To: ogerlitz; +Cc: amirva, jakub.kicinski, netdev, paulb

From: Or Gerlitz <ogerlitz@mellanox.com>
Date: Wed, 19 Oct 2016 17:42:39 +0300

> From: Paul Blakey <paulb@mellanox.com>
> 
> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-20 15:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-19 14:42 [PATCH net] net/sched: act_mirred: Use passed lastuse argument Or Gerlitz
2016-10-20 15:15 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.