summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVlad Buslov <vladbu@mellanox.com>2025-07-25 00:56:14 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-08-28 16:21:36 +0200
commitb7b56a5f5c6045504e3c74169950abb4c7a65889 (patch)
tree687a173497fe39ad8f23cc0d7d26741146035d1c /include
parentdc15bd56343cd1c7c106265757d0be619ec34bf8 (diff)
downloadlinux-b7b56a5f5c6045504e3c74169950abb4c7a65889.tar.gz
linux-b7b56a5f5c6045504e3c74169950abb4c7a65889.tar.bz2
linux-b7b56a5f5c6045504e3c74169950abb4c7a65889.zip
net: sched: extract qstats update code into functions
[ Upstream commit 26b537a88ca5b7399c7ab0656e06dbd9da9513c1 ] Extract common code that increments cpu_qstats counters into standalone act API functions. Change hardware offloaded actions that use percpu counter allocation to use the new functions instead of accessing cpu_qstats 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> Stable-dep-of: ca22da2fbd69 ("act_mirred: use the backlog for nested calls to mirred ingress") Signed-off-by: Shubham Kulkarni <skulkarni@mvista.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/act_api.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 46009acb198b..25d9a12118ba 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -193,6 +193,22 @@ static inline void tcf_action_update_bstats(struct tc_action *a,
bstats_cpu_update(this_cpu_ptr(a->cpu_bstats), skb);
}
+static inline struct gnet_stats_queue *
+tcf_action_get_qstats(struct tc_action *a)
+{
+ return this_cpu_ptr(a->cpu_qstats);
+}
+
+static inline void tcf_action_inc_drop_qstats(struct tc_action *a)
+{
+ qstats_drop_inc(this_cpu_ptr(a->cpu_qstats));
+}
+
+static inline void tcf_action_inc_overlimit_qstats(struct tc_action *a)
+{
+ qstats_overlimit_inc(this_cpu_ptr(a->cpu_qstats));
+}
+
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);