public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: netdev@vger.kernel.org
Cc: Cong Wang <cwang@multikernel.io>,
	Ji-Soo Chung <jschung2@proton.me>,
	Gerlinde <lrGerlinde@mailfence.com>
Subject: [Patch net v8 2/9] Revert "net/sched: Restrict conditions for adding duplicating netems to qdisc tree"
Date: Sat, 17 Jan 2026 22:15:08 -0800	[thread overview]
Message-ID: <20260118061515.930322-3-xiyou.wangcong@gmail.com> (raw)
In-Reply-To: <20260118061515.930322-1-xiyou.wangcong@gmail.com>

From: Cong Wang <cwang@multikernel.io>

This reverts commit ec8e0e3d7adef940cdf9475e2352c0680189d14e since it
breaks mq+netem.

Reported-by: Ji-Soo Chung <jschung2@proton.me>
Reported-by: Gerlinde <lrGerlinde@mailfence.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220774
Signed-off-by: Cong Wang <cwang@multikernel.io>
---
 net/sched/sch_netem.c | 40 ----------------------------------------
 1 file changed, 40 deletions(-)

diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 32a5f3304046..a9ea40c13527 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -974,41 +974,6 @@ static int parse_attr(struct nlattr *tb[], int maxtype, struct nlattr *nla,
 	return 0;
 }
 
-static const struct Qdisc_class_ops netem_class_ops;
-
-static int check_netem_in_tree(struct Qdisc *sch, bool duplicates,
-			       struct netlink_ext_ack *extack)
-{
-	struct Qdisc *root, *q;
-	unsigned int i;
-
-	root = qdisc_root_sleeping(sch);
-
-	if (sch != root && root->ops->cl_ops == &netem_class_ops) {
-		if (duplicates ||
-		    ((struct netem_sched_data *)qdisc_priv(root))->duplicate)
-			goto err;
-	}
-
-	if (!qdisc_dev(root))
-		return 0;
-
-	hash_for_each(qdisc_dev(root)->qdisc_hash, i, q, hash) {
-		if (sch != q && q->ops->cl_ops == &netem_class_ops) {
-			if (duplicates ||
-			    ((struct netem_sched_data *)qdisc_priv(q))->duplicate)
-				goto err;
-		}
-	}
-
-	return 0;
-
-err:
-	NL_SET_ERR_MSG(extack,
-		       "netem: cannot mix duplicating netems with other netems in tree");
-	return -EINVAL;
-}
-
 /* Parse netlink message to set options */
 static int netem_change(struct Qdisc *sch, struct nlattr *opt,
 			struct netlink_ext_ack *extack)
@@ -1067,11 +1032,6 @@ static int netem_change(struct Qdisc *sch, struct nlattr *opt,
 	q->gap = qopt->gap;
 	q->counter = 0;
 	q->loss = qopt->loss;
-
-	ret = check_netem_in_tree(sch, qopt->duplicate, extack);
-	if (ret)
-		goto unlock;
-
 	q->duplicate = qopt->duplicate;
 
 	/* for compatibility with earlier versions.
-- 
2.34.1


  parent reply	other threads:[~2026-01-18  6:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-18  6:15 [Patch net v8 0/9] netem: Fix skb duplication logic and prevent infinite loops Cong Wang
2026-01-18  6:15 ` [Patch net v8 1/9] net_sched: Check the return value of qfq_choose_next_agg() Cong Wang
2026-01-18  6:15 ` Cong Wang [this message]
2026-01-18  6:15 ` [Patch net v8 3/9] Revert "selftests/tc-testing: Add tests for restrictions on netem duplication" Cong Wang
2026-01-18  6:15 ` [Patch net v8 4/9] net_sched: Implement the right netem duplication behavior Cong Wang
2026-01-18  6:15 ` [Patch net v8 5/9] selftests/tc-testing: Add a nested netem duplicate test Cong Wang
2026-01-18  6:15 ` [Patch net v8 6/9] selftests/tc-testing: Add a test case for prio with netem duplicate Cong Wang
2026-01-18  6:15 ` [Patch net v8 7/9] selftests/tc-testing: Add a test case for mq " Cong Wang
2026-01-18  6:15 ` [Patch net v8 8/9] selftests/tc-testing: Update test cases " Cong Wang
2026-01-18  6:15 ` [Patch net v8 9/9] selftests/tc-testing: Add a test case for HTB with netem Cong Wang
2026-01-18 15:07 ` [Patch net v8 0/9] netem: Fix skb duplication logic and prevent infinite loops Jamal Hadi Salim
2026-01-21 17:08   ` Simon Horman
2026-01-21 18:50     ` Jamal Hadi Salim
2026-01-27 17:15   ` Jakub Kicinski
2026-01-30 20:53     ` Cong Wang
2026-01-30 21:18       ` Jakub Kicinski
2026-01-30 21:32         ` Cong Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260118061515.930322-3-xiyou.wangcong@gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=cwang@multikernel.io \
    --cc=jschung2@proton.me \
    --cc=lrGerlinde@mailfence.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox