Skip to content

Commit bfc2560

Browse files
heynemaxdavem330
authored andcommitted
net: sched: avoid duplicates in classes dump
This is a follow up of commit ea32746 ("net: sched: avoid duplicates in qdisc dump") which has fixed the issue only for the qdisc dump. The duplicate printing also occurs when dumping the classes via tc class show dev eth0 Fixes: 59cc1f6 ("net: sched: convert qdisc linked list to hashtable") Signed-off-by: Maximilian Heyne <mheyne@amazon.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6c59cff commit bfc2560

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/sched/sch_api.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,7 +2168,7 @@ static int tc_dump_tclass_qdisc(struct Qdisc *q, struct sk_buff *skb,
21682168

21692169
static int tc_dump_tclass_root(struct Qdisc *root, struct sk_buff *skb,
21702170
struct tcmsg *tcm, struct netlink_callback *cb,
2171-
int *t_p, int s_t)
2171+
int *t_p, int s_t, bool recur)
21722172
{
21732173
struct Qdisc *q;
21742174
int b;
@@ -2179,7 +2179,7 @@ static int tc_dump_tclass_root(struct Qdisc *root, struct sk_buff *skb,
21792179
if (tc_dump_tclass_qdisc(root, skb, tcm, cb, t_p, s_t) < 0)
21802180
return -1;
21812181

2182-
if (!qdisc_dev(root))
2182+
if (!qdisc_dev(root) || !recur)
21832183
return 0;
21842184

21852185
if (tcm->tcm_parent) {
@@ -2214,13 +2214,13 @@ static int tc_dump_tclass(struct sk_buff *skb, struct netlink_callback *cb)
22142214
s_t = cb->args[0];
22152215
t = 0;
22162216

2217-
if (tc_dump_tclass_root(dev->qdisc, skb, tcm, cb, &t, s_t) < 0)
2217+
if (tc_dump_tclass_root(dev->qdisc, skb, tcm, cb, &t, s_t, true) < 0)
22182218
goto done;
22192219

22202220
dev_queue = dev_ingress_queue(dev);
22212221
if (dev_queue &&
22222222
tc_dump_tclass_root(dev_queue->qdisc_sleeping, skb, tcm, cb,
2223-
&t, s_t) < 0)
2223+
&t, s_t, false) < 0)
22242224
goto done;
22252225

22262226
done:

0 commit comments

Comments
 (0)