[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aSaCiO/+zrzk9eF1@pop-os.localdomain>
Date: Tue, 25 Nov 2025 20:31:04 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: Xiang Mei <xmei5@....edu>
Cc: security@...nel.org, netdev@...r.kernel.org, toke@...e.dk,
cake@...ts.bufferbloat.net, bestswngs@...il.com
Subject: Re: [PATCH net v6 1/2] net/sched: sch_cake: Fix incorrect qlen
reduction in cake_drop
On Tue, Nov 25, 2025 at 03:02:12PM -0700, Xiang Mei wrote:
> @@ -1927,24 +1928,30 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch,
> if (q->buffer_used > q->buffer_max_used)
> q->buffer_max_used = q->buffer_used;
>
> - if (q->buffer_used > q->buffer_limit) {
> - bool same_flow = false;
> - u32 dropped = 0;
> - u32 drop_id;
> + if (q->buffer_used <= q->buffer_limit)
> + return NET_XMIT_SUCCESS;
>
> - while (q->buffer_used > q->buffer_limit) {
> - dropped++;
> - drop_id = cake_drop(sch, to_free);
> + prev_qlen = sch->q.qlen;
> + prev_backlog = sch->qstats.backlog;
>
> - if ((drop_id >> 16) == tin &&
> - (drop_id & 0xFFFF) == idx)
> - same_flow = true;
> - }
> - b->drop_overlimit += dropped;
> + while (q->buffer_used > q->buffer_limit) {
> + drop_id = cake_drop(sch, to_free);
> + if ((drop_id >> 16) == tin &&
> + (drop_id & 0xFFFF) == idx)
> + same_flow = true;
> + }
> +
> + /* Compute the droppped qlen and pkt length */
Just a nit: this comment is not needed, because the code below is
readable enough to explain itself. :)
Regards,
Cong Wang
Powered by blists - more mailing lists