aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_gact.c
diff options
context:
space:
mode:
authorVlad Buslov <vladbu@mellanox.com>2019-10-30 16:09:00 +0200
committerDavid S. Miller <davem@davemloft.net>2019-10-30 18:07:50 -0700
commitc8ecebd04cbb6badb46d42fe54282e7883ed63cc (patch)
treed94e6aac16139ec99b7517777980175edead7cc4 /net/sched/act_gact.c
parentnet: qrtr: Simplify 'qrtr_tun_release()' (diff)
downloadlinux-dev-c8ecebd04cbb6badb46d42fe54282e7883ed63cc.tar.xz
linux-dev-c8ecebd04cbb6badb46d42fe54282e7883ed63cc.zip
net: sched: extract common action counters update code into function
Currently, all implementations of tc_action_ops->stats_update() callback have almost exactly the same implementation of counters update code (besides gact which also updates drop counter). In order to simplify support for using both percpu-allocated and regular action counters depending on run-time flag in following patches, extract action counters update code into standalone function in act API. This commit doesn't change functionality. Signed-off-by: Vlad Buslov <vladbu@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/sched/act_gact.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
index 324f1d1f6d47..569cec63d4c3 100644
--- a/net/sched/act_gact.c
+++ b/net/sched/act_gact.c
@@ -177,15 +177,7 @@ static void tcf_gact_stats_update(struct tc_action *a, u64 bytes, u32 packets,
int action = READ_ONCE(gact->tcf_action);
struct tcf_t *tm = &gact->tcf_tm;
- _bstats_cpu_update(this_cpu_ptr(gact->common.cpu_bstats), bytes,
- packets);
- if (action == TC_ACT_SHOT)
- this_cpu_ptr(gact->common.cpu_qstats)->drops += packets;
-
- if (hw)
- _bstats_cpu_update(this_cpu_ptr(gact->common.cpu_bstats_hw),
- bytes, packets);
-
+ tcf_action_update_stats(a, bytes, packets, action == TC_ACT_SHOT, hw);
tm->lastuse = max_t(u64, tm->lastuse, lastuse);
}