提交 3bfa215f 编写于 作者: M Maximilian Heyne 提交者: Zheng Zengkai

net: sched: avoid duplicates in classes dump

stable inclusion
from stable-5.10.24
commit 2809a5ca962e96397d9504414a1140a69fe5e138
bugzilla: 51348

--------------------------------

commit bfc25605 upstream.

This is a follow up of commit ea327469 ("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: 59cc1f61 ("net: sched: convert qdisc linked list to hashtable")
Signed-off-by: NMaximilian Heyne <mheyne@amazon.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: N  Weilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 9edc9d71
...@@ -2167,7 +2167,7 @@ static int tc_dump_tclass_qdisc(struct Qdisc *q, struct sk_buff *skb, ...@@ -2167,7 +2167,7 @@ static int tc_dump_tclass_qdisc(struct Qdisc *q, struct sk_buff *skb,
static int tc_dump_tclass_root(struct Qdisc *root, struct sk_buff *skb, static int tc_dump_tclass_root(struct Qdisc *root, struct sk_buff *skb,
struct tcmsg *tcm, struct netlink_callback *cb, struct tcmsg *tcm, struct netlink_callback *cb,
int *t_p, int s_t) int *t_p, int s_t, bool recur)
{ {
struct Qdisc *q; struct Qdisc *q;
int b; int b;
...@@ -2178,7 +2178,7 @@ static int tc_dump_tclass_root(struct Qdisc *root, struct sk_buff *skb, ...@@ -2178,7 +2178,7 @@ static int tc_dump_tclass_root(struct Qdisc *root, struct sk_buff *skb,
if (tc_dump_tclass_qdisc(root, skb, tcm, cb, t_p, s_t) < 0) if (tc_dump_tclass_qdisc(root, skb, tcm, cb, t_p, s_t) < 0)
return -1; return -1;
if (!qdisc_dev(root)) if (!qdisc_dev(root) || !recur)
return 0; return 0;
if (tcm->tcm_parent) { if (tcm->tcm_parent) {
...@@ -2213,13 +2213,13 @@ static int tc_dump_tclass(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -2213,13 +2213,13 @@ static int tc_dump_tclass(struct sk_buff *skb, struct netlink_callback *cb)
s_t = cb->args[0]; s_t = cb->args[0];
t = 0; t = 0;
if (tc_dump_tclass_root(dev->qdisc, skb, tcm, cb, &t, s_t) < 0) if (tc_dump_tclass_root(dev->qdisc, skb, tcm, cb, &t, s_t, true) < 0)
goto done; goto done;
dev_queue = dev_ingress_queue(dev); dev_queue = dev_ingress_queue(dev);
if (dev_queue && if (dev_queue &&
tc_dump_tclass_root(dev_queue->qdisc_sleeping, skb, tcm, cb, tc_dump_tclass_root(dev_queue->qdisc_sleeping, skb, tcm, cb,
&t, s_t) < 0) &t, s_t, false) < 0)
goto done; goto done;
done: done:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册