summaryrefslogtreecommitdiffstats
path: root/net/sched/act_mirred.c
diff options
context:
space:
mode:
authorRoi Dayan <roid@mellanox.com>2017-12-26 07:48:51 +0200
committerDavid S. Miller <davem@davemloft.net>2018-01-02 13:27:52 -0500
commit3bb23421a504f01551b7cb9dff0e41dbf16656b0 (patch)
treebbc7599fe5e42c5f0717e752a024259c7bd464f6 /net/sched/act_mirred.c
parent90045fc9c78855bdc625a0ab185d97b72a937613 (diff)
downloadop-kernel-dev-3bb23421a504f01551b7cb9dff0e41dbf16656b0.zip
op-kernel-dev-3bb23421a504f01551b7cb9dff0e41dbf16656b0.tar.gz
net/sched: Fix update of lastuse in act modules implementing stats_update
We need to update lastuse to to the most updated value between what is already set and the new value. If HW matching fails, i.e. because of an issue, the stats are not updated but it could be that software did match and updated lastuse. Fixes: 5712bf9c5c30 ("net/sched: act_mirred: Use passed lastuse argument") Fixes: 9fea47d93bcc ("net/sched: act_gact: Update statistics when offloaded to hardware") Signed-off-by: Roi Dayan <roid@mellanox.com> Reviewed-by: Paul Blakey <paulb@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_mirred.c')
-rw-r--r--net/sched/act_mirred.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 8b3e5938..08b6184 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -239,7 +239,7 @@ static void tcf_stats_update(struct tc_action *a, u64 bytes, u32 packets,
struct tcf_t *tm = &m->tcf_tm;
_bstats_cpu_update(this_cpu_ptr(a->cpu_bstats), bytes, packets);
- tm->lastuse = lastuse;
+ tm->lastuse = max_t(u64, tm->lastuse, lastuse);
}
static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind,
OpenPOWER on IntegriCloud