From 5508ff7cf3750f4a2ab1354754859bb949c0d692 Mon Sep 17 00:00:00 2001 From: Zhengchao Shao Date: Fri, 16 Sep 2022 10:02:44 +0800 Subject: net/sched: use tc_cls_stats_dump() in filter use tc_cls_stats_dump() in filter. Signed-off-by: Zhengchao Shao Reviewed-by: Jamal Hadi Salim Reviewed-by: Victor Nogueira Tested-by: Victor Nogueira Signed-off-by: Jakub Kicinski --- net/sched/cls_tcindex.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'net/sched/cls_tcindex.c') diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c index 742c7d49a958..a33076033462 100644 --- a/net/sched/cls_tcindex.c +++ b/net/sched/cls_tcindex.c @@ -566,13 +566,8 @@ static void tcindex_walk(struct tcf_proto *tp, struct tcf_walker *walker, for (i = 0; i < p->hash; i++) { if (!p->perfect[i].res.class) continue; - if (walker->count >= walker->skip) { - if (walker->fn(tp, p->perfect + i, walker) < 0) { - walker->stop = 1; - return; - } - } - walker->count++; + if (!tc_cls_stats_dump(tp, walker, p->perfect + i)) + return; } } if (!p->h) @@ -580,13 +575,8 @@ static void tcindex_walk(struct tcf_proto *tp, struct tcf_walker *walker, for (i = 0; i < p->hash; i++) { for (f = rtnl_dereference(p->h[i]); f; f = next) { next = rtnl_dereference(f->next); - if (walker->count >= walker->skip) { - if (walker->fn(tp, &f->result, walker) < 0) { - walker->stop = 1; - return; - } - } - walker->count++; + if (!tc_cls_stats_dump(tp, walker, &f->result)) + return; } } } -- cgit