summaryrefslogtreecommitdiff
path: root/net/sched/act_pedit.c
diff options
context:
space:
mode:
authorPetr Machata <petrm@mellanox.com>2020-03-26 22:45:56 +0200
committerDavid S. Miller <davem@davemloft.net>2020-03-26 19:20:37 -0700
commitd4d9d9c53bef8124e93cb232ed137d91daaf6965 (patch)
tree0f1d5c9f3c2768727d6f90f4e498659e22087fbf /net/sched/act_pedit.c
parent837cb17dd67f37a3b8f7d9b25306d2e0dba982e7 (diff)
sched: act_pedit: Implement stats_update callback
Implement this callback in order to get the offloaded stats added to the kernel stats. Reported-by: Alexander Petrovskiy <alexpe@mellanox.com> Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_pedit.c')
-rw-r--r--net/sched/act_pedit.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index 3ad718576304..d41d6200d9de 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -409,6 +409,16 @@ done:
return p->tcf_action;
}
+static void tcf_pedit_stats_update(struct tc_action *a, u64 bytes, u32 packets,
+ u64 lastuse, bool hw)
+{
+ struct tcf_pedit *d = to_pedit(a);
+ struct tcf_t *tm = &d->tcf_tm;
+
+ tcf_action_update_stats(a, bytes, packets, false, hw);
+ tm->lastuse = max_t(u64, tm->lastuse, lastuse);
+}
+
static int tcf_pedit_dump(struct sk_buff *skb, struct tc_action *a,
int bind, int ref)
{
@@ -485,6 +495,7 @@ static struct tc_action_ops act_pedit_ops = {
.id = TCA_ID_PEDIT,
.owner = THIS_MODULE,
.act = tcf_pedit_act,
+ .stats_update = tcf_pedit_stats_update,
.dump = tcf_pedit_dump,
.cleanup = tcf_pedit_cleanup,
.init = tcf_pedit_init,