[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250713151220.772882ab@hermes.local>
Date: Sun, 13 Jul 2025 15:12:20 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: netdev@...r.kernel.org, jhs@...atatu.com, will@...lsroot.io, Savino
Dicanosa <savy@...t3mfailure.io>
Subject: Re: [Patch v3 net 1/4] net_sched: Implement the right netem
duplication behavior
On Sun, 13 Jul 2025 14:47:45 -0700
Cong Wang <xiyou.wangcong@...il.com> wrote:
> + if (q->duplicate) {
> + bool dup = true;
> +
> + if (netem_skb_cb(skb)->duplicate) {
> + netem_skb_cb(skb)->duplicate = 0;
> + dup = false;
> + }
> + if (dup && q->duplicate >= get_crandom(&q->dup_cor, &q->prng))
> + ++count;
> + }
Doesn't look ideal.
Why do yo need the temporary variable here?
And you risk having bug where first duplicate sets the flag then second clears it
and a third layer would do duplicate and reset it.
Powered by blists - more mailing lists