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

net/sched: use tc_qdisc_stats_dump() in qdisc



use tc_qdisc_stats_dump() in qdisc.

Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
Reviewed-by: default avatarVictor Nogueira <victor@mojatatu.com>
Tested-by: default avatarVictor Nogueira <victor@mojatatu.com>
Acked-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent d7a68e56
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -354,13 +354,9 @@ static void atm_tc_walk(struct Qdisc *sch, struct qdisc_walker *walker)
	if (walker->stop)
		return;
	list_for_each_entry(flow, &p->flows, list) {
		if (walker->count >= walker->skip &&
		    walker->fn(sch, (unsigned long)flow, walker) < 0) {
			walker->stop = 1;
		if (!tc_qdisc_stats_dump(sch, (unsigned long)flow, walker))
			break;
	}
		walker->count++;
	}
}

static struct tcf_block *atm_tc_tcf_block(struct Qdisc *sch, unsigned long cl,
+3 −6
Original line number Diff line number Diff line
@@ -3061,17 +3061,14 @@ static void cake_walk(struct Qdisc *sch, struct qdisc_walker *arg)
		struct cake_tin_data *b = &q->tins[q->tin_order[i]];

		for (j = 0; j < CAKE_QUEUES; j++) {
			if (list_empty(&b->flows[j].flowchain) ||
			    arg->count < arg->skip) {
			if (list_empty(&b->flows[j].flowchain)) {
				arg->count++;
				continue;
			}
			if (arg->fn(sch, i * CAKE_QUEUES + j + 1, arg) < 0) {
				arg->stop = 1;
			if (!tc_qdisc_stats_dump(sch, i * CAKE_QUEUES + j + 1,
						 arg))
				break;
		}
			arg->count++;
		}
	}
}

+1 −8
Original line number Diff line number Diff line
@@ -1676,16 +1676,9 @@ static void cbq_walk(struct Qdisc *sch, struct qdisc_walker *arg)

	for (h = 0; h < q->clhash.hashsize; h++) {
		hlist_for_each_entry(cl, &q->clhash.hash[h], common.hnode) {
			if (arg->count < arg->skip) {
				arg->count++;
				continue;
			}
			if (arg->fn(sch, (unsigned long)cl, arg) < 0) {
				arg->stop = 1;
			if (!tc_qdisc_stats_dump(sch, (unsigned long)cl, arg))
				return;
		}
			arg->count++;
		}
	}
}

+1 −7
Original line number Diff line number Diff line
@@ -520,13 +520,7 @@ static unsigned long cbs_find(struct Qdisc *sch, u32 classid)
static void cbs_walk(struct Qdisc *sch, struct qdisc_walker *walker)
{
	if (!walker->stop) {
		if (walker->count >= walker->skip) {
			if (walker->fn(sch, 1, walker) < 0) {
				walker->stop = 1;
				return;
			}
		}
		walker->count++;
		tc_qdisc_stats_dump(sch, 1, walker);
	}
}

+1 −8
Original line number Diff line number Diff line
@@ -284,16 +284,9 @@ static void drr_walk(struct Qdisc *sch, struct qdisc_walker *arg)

	for (i = 0; i < q->clhash.hashsize; i++) {
		hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) {
			if (arg->count < arg->skip) {
				arg->count++;
				continue;
			}
			if (arg->fn(sch, (unsigned long)cl, arg) < 0) {
				arg->stop = 1;
			if (!tc_qdisc_stats_dump(sch, (unsigned long)cl, arg))
				return;
		}
			arg->count++;
		}
	}
}

Loading