summaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2016-09-21 11:44:05 +0100
committerDavid S. Miller <davem@davemloft.net>2016-09-21 19:50:03 -0400
commit9798e6fe4f9b6a2847a40e24b75e68afdc7a01b3 (patch)
treea0ef332d5f33ef8f6d5dad9aa78cc05cc5134872 /net/sched
parent19d0f54edab6e77b6b73277ac33717be1f858fa8 (diff)
downloadlinux-9798e6fe4f9b6a2847a40e24b75e68afdc7a01b3.tar.bz2
net: act_mirred: allow statistic updates from offloaded actions
Implement .stats_update() callback. The implementation is generic and can be reused by other simple actions if needed. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/act_mirred.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 1c76387c5d9c..667dc382df82 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -204,6 +204,13 @@ out:
return retval;
}
+static void tcf_stats_update(struct tc_action *a, u64 bytes, u32 packets,
+ u64 lastuse)
+{
+ tcf_lastuse_update(&a->tcfa_tm);
+ _bstats_cpu_update(this_cpu_ptr(a->cpu_bstats), bytes, packets);
+}
+
static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind,
int ref)
{
@@ -281,6 +288,7 @@ static struct tc_action_ops act_mirred_ops = {
.type = TCA_ACT_MIRRED,
.owner = THIS_MODULE,
.act = tcf_mirred,
+ .stats_update = tcf_stats_update,
.dump = tcf_mirred_dump,
.cleanup = tcf_mirred_release,
.init = tcf_mirred_init,