netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: netdev@vger.kernel.org, jhs@mojatatu.com, will@willsroot.io,
	stephen@networkplumber.org,
	Savino Dicanosa <savy@syst3mfailure.io>
Subject: Re: [Patch v2 net 1/2] netem: Fix skb duplication logic to prevent infinite loops
Date: Tue, 8 Jul 2025 14:18:22 +0100	[thread overview]
Message-ID: <20250708131822.GJ452973@horms.kernel.org> (raw)
In-Reply-To: <20250707195015.823492-2-xiyou.wangcong@gmail.com>

On Mon, Jul 07, 2025 at 12:50:14PM -0700, Cong Wang wrote:
> This patch refines the packet duplication handling in netem_enqueue() to ensure
> that only newly cloned skbs are marked as duplicates. This prevents scenarios
> where nested netem qdiscs with 100% duplication could cause infinite loops of
> skb duplication.
> 
> By ensuring the duplicate flag is properly managed, this patch maintains skb
> integrity and avoids excessive packet duplication in complex qdisc setups.
> 
> Now we could also get rid of the ugly temporary overwrite of
> q->duplicate.
> 
> Fixes: 0afb51e72855 ("[PKT_SCHED]: netem: reinsert for duplication")
> Reported-by: William Liu <will@willsroot.io>
> Reported-by: Savino Dicanosa <savy@syst3mfailure.io>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>


  reply	other threads:[~2025-07-08 13:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-07 19:50 [Patch v2 net 0/2] netem: Fix skb duplication logic to prevent infinite loops Cong Wang
2025-07-07 19:50 ` [Patch v2 net 1/2] " Cong Wang
2025-07-08 13:18   ` Simon Horman [this message]
2025-07-08 13:19     ` Jamal Hadi Salim
2025-07-08 19:11       ` Simon Horman
2025-07-08 15:56     ` William Liu
2025-07-08 16:06       ` Jakub Kicinski
2025-07-07 19:50 ` [Patch v2 net 2/2] selftests/tc-testing: Add a nested netem duplicate test Cong Wang
2025-07-08 13:19   ` Simon Horman

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=20250708131822.GJ452973@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=savy@syst3mfailure.io \
    --cc=stephen@networkplumber.org \
    --cc=will@willsroot.io \
    --cc=xiyou.wangcong@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).