public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: William Liu <will@willsroot.io>
Cc: netdev@vger.kernel.org, stephen@networkplumber.org,
	kuba@kernel.org, Savino Dicanosa <savy@syst3mfailure.io>,
	Jamal Hadi Salim <jhs@mojatatu.com>
Subject: Re: [Patch net v5 3/9] net_sched: Implement the right netem duplication behavior
Date: Wed, 26 Nov 2025 14:08:52 -0800	[thread overview]
Message-ID: <aSd6dM38CXchhmJd@pop-os.localdomain> (raw)
In-Reply-To: <dEmtK-Tj-bnNJVo0mNwP1vJ1cj9g0hqnoi-0HJdZeTittbRmmzE4wBRIjapBAFQNZDWgE4hcR27UrTSuiGj_-yRFntfX4Tuv4QP6asVecZQ=@willsroot.io>

Hi William,

On Wed, Nov 26, 2025 at 08:30:21PM +0000, William Liu wrote:
> On Wednesday, November 26th, 2025 at 7:53 PM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> 
> > 
> > 
> > In the old behavior, duplicated packets were sent back to the root qdisc,
> > which could create dangerous infinite loops in hierarchical setups -
> > imagine a scenario where each level of a multi-stage netem hierarchy kept
> > feeding duplicates back to the top, potentially causing system instability
> > or resource exhaustion.
> > 
> > The new behavior elegantly solves this by enqueueing duplicates to the same
> > qdisc that created them, ensuring that packet duplication occurs exactly
> > once per netem stage in a controlled, predictable manner. This change
> > enables users to safely construct complex network emulation scenarios using
> > netem hierarchies (like the 4x multiplication demonstrated in testing)
> > without worrying about runaway packet generation, while still preserving
> > the intended duplication effects.
> > 
> > Another advantage of this approach is that it eliminates the enqueue reentrant
> > behaviour which triggered many vulnerabilities. See the last patch in this
> > patchset which updates the test cases for such vulnerabilities.
> > 
> > Now users can confidently chain multiple netem qdiscs together to achieve
> > sophisticated network impairment combinations, knowing that each stage will
> > apply its effects exactly once to the packet flow, making network testing
> > scenarios more reliable and results more deterministic.
> > 


Thanks for your quick response.

> 
> Cong, this approach has an issue we previously raised - please refer to [2]. I re-posted the summary of the issues with the various other approaches in [3] just 2 days ago in a thread with you on it. As both Jamal and Stephen have pointed out, this breaks expected user behavior as well, and the enqueuing at root was done for the sake of proper accounting and rate limit semantics. You pointed out that this doesn't violate manpage semantics, but this is still changing long-term user behavior. It doesn't make sense imo to change one longtime user behavior for another.

If you have a better standard than man page, please kindly point it out.
I am happy to follow.

I think we both agree it should not be either my standard or anyone's
personal stardard, this is why I use man page as a neutral and reasonable
stardard.

If you disagree man page is reasonable, please offer a better one for me
to follow. I am very open, I just simply don't know anything better than
man page.

Sorry for my ignorance. Please help me out. :)


> 
> Jamal suggested a really reasonable fix with tc_skb_ext - can we please take a look at its soundness and attempt that approach? No user behavior would be affected in that case.

As I already explained, tc_skb_ext is for cross-layer, in this specific
case, we don't cross layers, the skb is immediately queued to the _same_
layer before others.

Could you please kindly explain why you still believe tc_skb_ext is
better? I am very open to your thoughts, please enlighten me here.

Thanks,
Cong

  reply	other threads:[~2025-11-26 22:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26 19:52 [Patch net v5 0/9] netem: Fix skb duplication logic and prevent infinite loops Cong Wang
2025-11-26 19:52 ` [Patch net v5 1/9] Revert "net/sched: Restrict conditions for adding duplicating netems to qdisc tree" Cong Wang
2025-11-26 19:52 ` [Patch net v5 2/9] Revert "selftests/tc-testing: Add tests for restrictions on netem duplication" Cong Wang
2025-11-26 19:52 ` [Patch net v5 3/9] net_sched: Implement the right netem duplication behavior Cong Wang
2025-11-26 20:30   ` William Liu
2025-11-26 22:08     ` Cong Wang [this message]
2025-11-26 22:43       ` William Liu
2025-11-26 23:13         ` Cong Wang
2025-11-27  2:09           ` William Liu
2025-11-27  3:01             ` Cong Wang
2025-12-03 15:05   ` Stephen Hemminger
2025-11-26 19:52 ` [Patch net v5 4/9] net_sched: Prevent using netem duplication in non-initial user namespace Cong Wang
2025-12-02  0:25   ` Jakub Kicinski
2025-12-03  5:41     ` Cong Wang
2025-12-02  0:40   ` Stephen Hemminger
2025-12-02  9:16   ` Paolo Abeni
2025-11-26 19:52 ` [Patch net v5 5/9] net_sched: Check the return value of qfq_choose_next_agg() Cong Wang
2025-12-02  9:20   ` Paolo Abeni
2025-12-03  5:42     ` Cong Wang
2025-12-02 21:18   ` Xiang Mei
2025-11-26 19:52 ` [Patch net v5 6/9] selftests/tc-testing: Add a nested netem duplicate test Cong Wang
2025-11-26 19:52 ` [Patch net v5 7/9] selftests/tc-testing: Add a test case for piro with netem duplicate Cong Wang
2025-11-26 19:52 ` [Patch net v5 8/9] selftests/tc-testing: Add a test case for mq " Cong Wang
2025-11-26 19:52 ` [Patch net v5 9/9] selftests/tc-testing: Update test cases " 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=aSd6dM38CXchhmJd@pop-os.localdomain \
    --to=xiyou.wangcong@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=savy@syst3mfailure.io \
    --cc=stephen@networkplumber.org \
    --cc=will@willsroot.io \
    /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