aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_u32.c
diff options
context:
space:
mode:
authorZhengchao Shao <shaozhengchao@huawei.com>2022-09-16 10:02:44 +0800
committerJakub Kicinski <kuba@kernel.org>2022-09-20 15:54:13 -0700
commit5508ff7cf3750f4a2ab1354754859bb949c0d692 (patch)
tree5edce42504ef9d82cf652e383447c4cba2d3abde /net/sched/cls_u32.c
parentnet/sched: cls_api: add helper for tc cls walker stats dump (diff)
downloadlinux-dev-5508ff7cf3750f4a2ab1354754859bb949c0d692.tar.xz
linux-dev-5508ff7cf3750f4a2ab1354754859bb949c0d692.zip
net/sched: use tc_cls_stats_dump() in filter
use tc_cls_stats_dump() in filter. Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com> Reviewed-by: Victor Nogueira <victor@mojatatu.com> Tested-by: Victor Nogueira <victor@mojatatu.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r--net/sched/cls_u32.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 4d27300c287c..58c7680faabd 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -1125,26 +1125,16 @@ static void u32_walk(struct tcf_proto *tp, struct tcf_walker *arg,
ht = rtnl_dereference(ht->next)) {
if (ht->prio != tp->prio)
continue;
- if (arg->count >= arg->skip) {
- if (arg->fn(tp, ht, arg) < 0) {
- arg->stop = 1;
- return;
- }
- }
- arg->count++;
+
+ if (!tc_cls_stats_dump(tp, arg, ht))
+ return;
+
for (h = 0; h <= ht->divisor; h++) {
for (n = rtnl_dereference(ht->ht[h]);
n;
n = rtnl_dereference(n->next)) {
- if (arg->count < arg->skip) {
- arg->count++;
- continue;
- }
- if (arg->fn(tp, n, arg) < 0) {
- arg->stop = 1;
+ if (!tc_cls_stats_dump(tp, arg, n))
return;
- }
- arg->count++;
}
}
}