summaryrefslogtreecommitdiff
path: root/include/net/act_api.h
diff options
context:
space:
mode:
authorVlad Buslov <vladbu@mellanox.com>2019-10-30 16:09:01 +0200
committerDavid S. Miller <davem@davemloft.net>2019-10-30 18:07:50 -0700
commit5e1ad95b630e652d3467d1fd1f0b5e5ea2c441e2 (patch)
treed58db786d3cf69472784345310715ff49b9f23c8 /include/net/act_api.h
parentc8ecebd04cbb6badb46d42fe54282e7883ed63cc (diff)
net: sched: extract bstats update code into function
Extract common code that increments cpu_bstats counter into standalone act API function. Change hardware offloaded actions that use percpu counter allocation to use the new function instead of incrementing cpu_bstats directly. 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 'include/net/act_api.h')
-rw-r--r--include/net/act_api.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/act_api.h b/include/net/act_api.h
index f6f66c692385..9a32853f77f9 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -186,6 +186,13 @@ int tcf_action_dump(struct sk_buff *skb, struct tc_action *actions[], int bind,
int ref);
int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
+
+static inline void tcf_action_update_bstats(struct tc_action *a,
+ struct sk_buff *skb)
+{
+ bstats_cpu_update(this_cpu_ptr(a->cpu_bstats), skb);
+}
+
void tcf_action_update_stats(struct tc_action *a, u64 bytes, u32 packets,
bool drop, bool hw);
int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int);