[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aIpvuNyyvud0sJOl@pop-os.localdomain>
Date: Wed, 30 Jul 2025 12:17:12 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Jamal Hadi Salim <jhs@...atatu.com>
Cc: netdev@...r.kernel.org, will@...lsroot.io, stephen@...workplumber.org
Subject: Re: [Patch v4 net 0/6] netem: Fix skb duplication logic and prevent
infinite loops
On Mon, Jul 21, 2025 at 10:00:30AM -0400, Jamal Hadi Salim wrote:
> On Sat, Jul 19, 2025 at 6:04 PM Cong Wang <xiyou.wangcong@...il.com> wrote:
> >
> > This patchset fixes the infinite loops due to duplication in netem, the
> > real root cause of this problem is enqueuing to the root qdisc, which is
> > now changed to enqueuing to the same qdisc. This is more reasonable,
> > more predictable from users' perspective, less error-proone and more elegant.
> >
> > Please see more details in patch 1/6 which contains two pages of detailed
> > explanation including why it is safe and better.
> >
> > This replaces the patches from William, with much less code and without
> > any workaround. More importantly, this does not break any use case.
> >
>
> Cong, you are changing user expected behavior.
> So instead of sending to the root qdisc, you are looping on the same
> qdisc. I dont recall what the history is for the decision to go back
> to the root qdisc - but one reason that sounds sensible is we want to
> iterate through the tree hierarchy again. Stephen may remember.
> The fact that the qfq issue is hit indicates the change has
> consequences - and given the check a few lines above, more than likely
> you are affecting the qlen by what you did.
Please refer the changelog of patch 1/6, let me quote it here for you:
The new netem duplication behavior does not break the documented
semantics of "creates a copy of the packet before queuing." The man page
description remains true since duplication occurs before the queuing
process, creating both original and duplicate packets that are then
enqueued. The documentation does not specify which qdisc should receive
the duplicates, only that copying happens before queuing. The implementation
choice to enqueue duplicates to the same qdisc (rather than root) is an
internal detail that maintains the documented behavior while preventing
infinite loops in hierarchical configurations.
I think it is reasonable to use man page as our agreement with users. I
am open to other alternative agreements, if you have one. I hope using
man page is not of my own preference here.
Thanks.
Powered by blists - more mailing lists