🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #614

Re: [PATCH net-next v5] net/sched: cap the accounted backlog before it can wrap

#614
From: Toke Høiland-Jørgensen
Date: Thu, 08 Oct 2026 09:49
72 lines
7794 bytes
> This is a follow-up to an issue found by Sashiko (nipa) during review of
> commit d9ebd8f9aa8b ("net/sched: fq_codel: clamp default quantum and
> mtu"), part of the quantum/mtu overflow series merged as a687f2ae995f.
> Clamping the per-flow quantum and the CoDel mtu does not bound the
> accounted backlog, so the per-flow backlog wrap the review flagged
> remained.

This, and the rest of the commit message is obtuse LLM vomit, and close
to unreadable. Please rewrite the commit message without the verbosity,
so it's actually something a human reader can comprehend. For the cake
bits in particular:

[..]

> CAKE's SPLIT_GSO path accounts the sum of the segment lengths, which a
> stab recomputes from skb->len and can exceed the pre-split
> qdisc_pkt_len(). The list is summed before any segment is linked and
> rejected as a whole before any flow state is resolved: the flow/host keys
> are computed from the unsegmented packet, but the set-associative
> resolution that commits q->tags[], the flow host indices, the way
> counters and the host bulk-flow counts runs only after the whole
> segment-sum admission test passes. A packet rejected by that test
> therefore leaves no persistent state behind. The whole list is dropped
> via to_free so the tail segment's sock_wfree() never runs under the qdisc
> lock. A fraglist GSO is the exception: skb_segment_list() returns the
> original skb as the list head carrying an extra reference, so segs ==
> skb; dropping the caller's reference and queueing the list once avoids
> self-linking *to_free, which would otherwise free the same skb repeatedly
> in the deferred teardown.

I read this paragraph multiple times, and it's still not clear to me
what it's trying to say.

Also:

>  net/sched/sch_cake.c      | 198 ++++++++++++++++++++++++++++----------

You're changing hundreds of lines of code which is partly a refactor,
partly a fix for the actual overflow issue, and partly unrelated
changes. Please split them into separate patches.

[..]

> +/* Compute the flow/host hash keys from the packet as received. Must run
> + * before skb_gso_segment(), which rewrites an encapsulated GSO packet's
> + * headers to the inner ones and would change the keys. Reads only the skb
> + * and commits no qdisc state, so it may run before admission is known.
> + */

And drop the weird LLM comments, please. If you split the series
properly they are not needed.

[..]
> -		skb_list_walk_safe(segs, segs, nskb) {
> -			skb_mark_not_on_list(segs);
> -			qdisc_skb_cb(segs)->pkt_len = segs->len;
> -			qdisc_skb_cb(segs)->pkt_segs = 1;
> -			cobalt_set_enqueue_time(segs, now);
> -			get_cobalt_cb(segs)->adjusted_len = cake_overhead(q,
> -									  segs);
> -			flow_queue_add(flow, segs);
> +		skb_list_walk_safe(segs, seg, nskb) {

The skb_list_walk_safe(segs, segs) thing is admittedly a bit weird, and
fixing it is fine. But that's the "separate fix" I was referring to
above, so split it out; it's just making the actual fix harder to
comprehend here.

-Toke

pw-bot: cr
Technical Details
Message-ID: <87a4oottcj.fsf@toke.dk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342898-linux-kernel-netdev=dewy.ru
References: <QDISC-BA27.v5.20261007171509@mojatatu.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342898-linux-kernel-netdev=dewy.ru
From: toke@toke.dk (Toke Høiland-Jørgensen)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v5] net/sched: cap the accounted backlog before
 it can wrap
Date: Thu, 08 Oct 2026 11:49:32 +0200
Organization: Usenet Network
Message-ID: <87a4oottcj.fsf@toke.dk>
References: <QDISC-BA27.v5.20261007171509@mojatatu.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: usenet.network;
	logging-data="857742"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:rbUnvGXA+bgpwmuAfSTx0Ymq2I4= sha256:QRwuold6IcZT/OA4x2soDOd8r53e4rdxWyWnJGgGPL8=
	sha1:QtbKaRRynbzh4uYSOUmlyG1QzX0= sha256:BbzDAGqEqHD+XHm1IN4zVyARugwVENxFPPQLNBoAPPE=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 8C0E610F39B; Thu,  8 Oct 2026 13:35:56 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: 0.349
X-Spam-Status: No, score=0.349 tagged_above=-9999 required=6.31
	tests=[DKIM_ADSP_ALL=1.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=no autolearn_force=no
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id ciQmNrFVilOH;
	Thu,  8 Oct 2026 13:35:54 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-342898-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=toke.dk
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 2341010F39C; Thu,  8 Oct 2026 13:35:39 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sea.lore.kernel.org (Postfix) with ESMTP id 71F0F34FD8; Thu,  8 Oct 2026 10:35:36 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F61E49552C;
	Thu,  8 Oct 2026 10:35:36 +0000 (UTC)
X-Received: from mail.toke.dk (mail.toke.dk [45.145.95.4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E7A0495AF4
	for <netdev@vger.kernel.org>; Thu,  8 Oct 2026 10:35:33 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.145.95.4
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791455736; cv=none; b=HQv4JRFjzlb6xDs1mACNIAKcNTEsNaZ9R4e6WZW8Q0sr0Z87pDjruus3B5tyc1P4pU+qXEKkbb8yD8/l7jUWWNu6hNRrMK8Hdnw5kWJ/yUGoAQSI7huEV16EBjYkVDq8/1xkCEzMGguc4MLb93dm+mu7p9r186j7Jkz95LnA2hA=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791455736; c=relaxed/simple;
	bh=8Qt4h11lvIE2A7XUDXKgSrzsGycrgEBeGx3uKams5rM=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 MIME-Version:Content-Type; b=Br+BkjZ7sioA8NRlKDCwb0G9ecu7Nf3uHWjpF2j0wlkGz1tDDT4EUo2e6brSwsbPdOEx4TlG5J8OmkOUY8+xAOfFco0LLGLfWf6hzagHZ5O67Zyu+qJa0V+Xv1sRfOqR4v2Z5Cqy9gWzHqDiri8SPXD+8tYdomGBd6mo3mh7H7o=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=toke.dk; spf=pass smtp.mailfrom=toke.dk; arc=none smtp.client-ip=45.145.95.4
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=toke.dk
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=toke.dk
X-Authentication-Results: mail.toke.dk; dkim=none
X-Cc: Jamal Hadi Salim <jhs@mojatatu.com>, Jiri Pirko <jiri@resnulli.us>,
 "David S . Miller" <davem@davemloft.net>, Eric Dumazet
 <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni
 <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, Victor Nogueira
 <victor@mojatatu.com>, moeller0@gmx.de, cake@lists.bufferbloat.net,
 Sashiko <sashiko-bot@kernel.org>
X-In-Reply-To: <QDISC-BA27.v5.20261007171509@mojatatu.com>
X-Clacks-Overhead: GNU Terry Pratchett
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>