From: Cong Wang <xiyou.wangcong@gmail.com>
To: Xiang Mei <xmei5@asu.edu>
Cc: security@kernel.org, netdev@vger.kernel.org, toke@toke.dk,
cake@lists.bufferbloat.net, bestswngs@gmail.com
Subject: [Cake] Re: [PATCH net v6 1/2] net/sched: sch_cake: Fix incorrect qlen reduction in cake_drop
Date: Tue, 25 Nov 2025 20:31:04 -0800 [thread overview]
Message-ID: <aSaCiO/+zrzk9eF1@pop-os.localdomain> (raw)
In-Reply-To: <20251125220213.3155360-1-xmei5@asu.edu>
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
prev parent reply other threads:[~2025-11-26 4:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-25 22:02 [Cake] " Xiang Mei
2025-11-25 22:02 ` [Cake] [PATCH net v6 2/2] selftests/tc-testing: Check Cake Scheduler when enqueue drops packets Xiang Mei
2025-11-26 4:08 ` [Cake] " Cong Wang
2025-11-26 19:48 ` Xiang Mei
2025-11-26 4:31 ` Cong Wang [this message]
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
List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aSaCiO/+zrzk9eF1@pop-os.localdomain \
--to=xiyou.wangcong@gmail.com \
--cc=bestswngs@gmail.com \
--cc=cake@lists.bufferbloat.net \
--cc=netdev@vger.kernel.org \
--cc=security@kernel.org \
--cc=toke@toke.dk \
--cc=xmei5@asu.edu \
/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