Commit 5508ff7c authored by Zhengchao Shao's avatar Zhengchao Shao Committed by Jakub Kicinski
Browse files

net/sched: use tc_cls_stats_dump() in filter



use tc_cls_stats_dump() in filter.

Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
Reviewed-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: default avatarVictor Nogueira <victor@mojatatu.com>
Tested-by: default avatarVictor Nogueira <victor@mojatatu.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent fe0df81d
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -251,16 +251,9 @@ static void basic_walk(struct tcf_proto *tp, struct tcf_walker *arg,
	struct basic_filter *f;

	list_for_each_entry(f, &head->flist, link) {
		if (arg->count < arg->skip)
			goto skip;

		if (arg->fn(tp, f, arg) < 0) {
			arg->stop = 1;
		if (!tc_cls_stats_dump(tp, arg, f))
			break;
	}
skip:
		arg->count++;
	}
}

static void basic_bind_class(void *fh, u32 classid, unsigned long cl, void *q,
+1 −7
Original line number Diff line number Diff line
@@ -650,15 +650,9 @@ static void cls_bpf_walk(struct tcf_proto *tp, struct tcf_walker *arg,
	struct cls_bpf_prog *prog;

	list_for_each_entry(prog, &head->plist, link) {
		if (arg->count < arg->skip)
			goto skip;
		if (arg->fn(tp, prog, arg) < 0) {
			arg->stop = 1;
		if (!tc_cls_stats_dump(tp, arg, prog))
			break;
	}
skip:
		arg->count++;
	}
}

static int cls_bpf_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
+1 −7
Original line number Diff line number Diff line
@@ -683,15 +683,9 @@ static void flow_walk(struct tcf_proto *tp, struct tcf_walker *arg,
	struct flow_filter *f;

	list_for_each_entry(f, &head->filters, list) {
		if (arg->count < arg->skip)
			goto skip;
		if (arg->fn(tp, f, arg) < 0) {
			arg->stop = 1;
		if (!tc_cls_stats_dump(tp, arg, f))
			break;
	}
skip:
		arg->count++;
	}
}

static struct tcf_proto_ops cls_flow_ops __read_mostly = {
+1 −8
Original line number Diff line number Diff line
@@ -358,16 +358,9 @@ static void fw_walk(struct tcf_proto *tp, struct tcf_walker *arg,

		for (f = rtnl_dereference(head->ht[h]); f;
		     f = rtnl_dereference(f->next)) {
			if (arg->count < arg->skip) {
				arg->count++;
				continue;
			}
			if (arg->fn(tp, f, arg) < 0) {
				arg->stop = 1;
			if (!tc_cls_stats_dump(tp, arg, f))
				return;
		}
			arg->count++;
		}
	}
}

+1 −8
Original line number Diff line number Diff line
@@ -587,16 +587,9 @@ static void route4_walk(struct tcf_proto *tp, struct tcf_walker *arg,
				for (f = rtnl_dereference(b->ht[h1]);
				     f;
				     f = rtnl_dereference(f->next)) {
					if (arg->count < arg->skip) {
						arg->count++;
						continue;
					}
					if (arg->fn(tp, f, arg) < 0) {
						arg->stop = 1;
					if (!tc_cls_stats_dump(tp, arg, f))
						return;
				}
					arg->count++;
				}
			}
		}
	}
Loading