Skip to content

Commit

Permalink
sched: act_pedit: Implement stats_update callback
Browse files Browse the repository at this point in the history
Implement this callback in order to get the offloaded stats added to the
kernel stats.

Reported-by: Alexander Petrovskiy <[email protected]>
Signed-off-by: Petr Machata <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
pmachata authored and davem330 committed Mar 27, 2020
1 parent 837cb17 commit d4d9d9c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions net/sched/act_pedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,16 @@ static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a,
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)
{
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d4d9d9c

Please sign in to comment.