🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25281

Re: [PATCH net-next v5 1/4] tcp: export CE count in rate_sample

#25281
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 13:10
87 lines
11658 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The new comment on struct rate_sample::acked_sacked_ce
  (include/net/tcp.h:1372-1378) calls the field the "Number of packets…

--

tcp: export CE count in rate_sample

This commit adds an acked_sacked_ce field to struct rate_sample. The field
holds the number of newly ACKed/SACKed CE-marked packets, for use by
upcoming congestion control modules such as TCP Prague. In RFC3168 mode it
is set to the delivered count when FLAG_ECE is present. In AccECN mode it
holds the delta derived from the ACE field or the AccECN options.

> diff --git a/include/net/tcp.h b/include/net/tcp.h
> index 68a60268d19da..12129ae8b06b5 100644
> --- a/include/net/tcp.h
> +++ b/include/net/tcp.h
> @@ -1369,6 +1369,13 @@ struct rate_sample {
>  	long rtt_us;		/* RTT of last (S)ACKed packet (or -1) */
>  	int  losses;		/* number of packets marked lost upon ACK */
>  	u32  acked_sacked;	/* number of packets newly (S)ACKed upon ACK */
> +	/*
> +	 * Number of packets newly (S)ACked associated with congestion
> +	 * signalling upon ACK.
> +	 * For AccECN, this is the number of newly CE-marked packets.
> +	 * For RFC3168, this equals acked_sacked when the ECE flag is present.
> +	 */
> +	u32  acked_sacked_ce;

[Severity: Low]
Does this comment hold for the AccECN case? It describes the field as a
subset of the newly (S)ACKed packets, which implies acked_sacked_ce never
exceeds acked_sacked. The AccECN path doesn't seem to guarantee that.

__tcp_accecn_process() keeps going on timestamp progress alone, so
delivered_pkts can be 0:

net/ipv4/tcp_input.c:__tcp_accecn_process() {
    ...
	if (!(flag & (FLAG_FORWARD_PROGRESS | FLAG_TS_PROGRESS)))
		return 0;
    ...
	corrected_ace = tcp_accecn_ace(th) - TCP_ACCECN_CEP_INIT_OFFSET;
	delta = (corrected_ace - tp->delivered_ce) & TCP_ACCECN_CEP_ACE_MASK;
	if (delivered_pkts <= TCP_ACCECN_CEP_ACE_MASK)
		return delta;
    ...
}

Take an ACK on the slowpath that doesn't ack the SYN. Here delta can be
1..7, taken from the peer's ACE field, even when delivered_pkts is 0 or
smaller than delta. tcp_accecn_process() then stores it without any clamp:

	rs->acked_sacked_ce = delta;

Later, tcp_rate_gen() sets rs->acked_sacked = delivered without checking
it against acked_sacked_ce.

The ACE bits are set by the peer. A peer can therefore make
acked_sacked_ce larger than acked_sacked, including when acked_sacked is 0.
This can happen maliciously, or simply because the peer counts CE-marked
pure ACKs or retransmits, which RFC 9768 allows.

The value is also visible right away to BPF struct_ops cong_control
programs. A consumer that trusts this comment and computes acked_sacked_ce
/ acked_sacked could get a ratio above 1, or a non-zero numerator over a
zero denominator.

Nothing in the tree reads acked_sacked_ce yet, and the stored value has the
same meaning as the old ecn_count. So this is mostly a mismatch between the
comment and the code.

Could the comment say that under AccECN this is the ACE/option-derived CE
count, which is not bounded by acked_sacked? Or should the value be clamped
to the delivered count?

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130125658.20292-1-chia-yu.chang%40nokia-bell-labs.com
Technical Details
Message-ID: <179613061918.3146.18307347617095764135@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375086-linux-kernel-netdev=dewy.ru
References: <20261130125658.20292-2-chia-yu.chang@nokia-bell-labs.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375086-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v5 1/4] tcp: export CE count in rate_sample
Date: Tue, 01 Dec 2026 13:10:19 +0000
Organization: Usenet Network
Message-ID: <179613061918.3146.18307347617095764135@kernel.org>
References: <20261130125658.20292-2-chia-yu.chang@nokia-bell-labs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1718275"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:7hP2a4Uxph1FT86HFX65zLl6TjI= sha256:HxJxxENhoOvqwP7LTK/vPuBZtlUCyfYtHtf6ifrPh3A=
	sha1:CY7J0hYwiElxJFCzWBBPcKeLyiA= sha256:/YoWIgI+CVqwihA96BM6Kruk2qfVFOZdZMf9CNvOAoc=
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 C0F151173AD; Tue,  1 Dec 2026 16:10:41 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
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 QgvkDf-0rgPa;
	Tue,  1 Dec 2026 16:10:34 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375086-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id B2A26117370; Tue,  1 Dec 2026 16:10:25 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 088E72D894; Tue,  1 Dec 2026 13:10:23 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796130622;
	b=qMCX/As024rdv3ZFUU6QoSC/yB3AV2Pq5/URxQrfDS+T0aLqcrXDQNXXUITOuEQPVBKR
	 qoK5zYAqh9s5XOaqCE2YOuzJSLObOTyhd6bZ0g38hiV1TTN7yzCrW/APgGrRx9FiDonHm
	 uqUsHRj+zltE2MdPRjpCCWurbMIRjkVHKjcMmlf9xk56AuZC0Oz+mBQ1TpyNQcNY1AJ7N
	 XjJ05q7PYGtWlwiMDr20+ywB6xnHjKwneVRSv5Re06taM1SKBWD0ylzi6US1gYVf1gjwa
	 t2Q6SV0Dc3k5ifFryKuw7T7P4BOeTBArLbbQ50pkJ+EwqnSBNaxZldkdcwK37eoyDdg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796130622;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=1MQpttziBFjx69tmJnWlPIOtDGiPf5sCcsWEWN2nz4g=;
	b=bsZYtBn1eY8cBWxprrXTExx5HdRkgGsGVAkHyDCe7f1M1cURHVRb18p7PRCEub9ABdvT
	 87YPcT3+IS6O4cx7OWn+vLke1hObR8evRmrPnPCIPpdKA1KUN7ZorivuUnUjE/poxY05q
	 klTiObXy1H/oOw89V8z+i2+vFyALWHF7fEAaK3bxVI9kNNIc49Aphy/xTerkQGICjQeHT
	 ASq60uBveEmgUJHqlqIAZHvrY0w4kP4N1T2vWS/40R2goprJsCSmolWrg6gxiAT/hCutI
	 sV8cHxYcIgjuiMfiPrKGDxjzCEXxFjwjUimB9iEKH7pHxT5cpV1o1357zT69v8bh+fg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=e6+QRPJS;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id D52BF606A32E;
	Tue,  1 Dec 2026 13:10:22 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=e6+QRPJS
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796130622;
	b=d9oxSg/FQ2bpdDz/ZhJF9t2XWvjNigTZHTdRPwW2VIlAPc/HQK7pO/n1M/gX8kR7uv1C
	 lmyNjlr9z3+17e2hbCLPzRA+YBRjQWVRxb3aJlEaV7XNrT8bgH/snIjFSnMoDXv53q/Lm
	 XqtZeSbVrLInsVNKVxAEoS+yHWlVZqybgNehPwoYZQfKWLK+Y5bDi6XyoXug/seHkdsBV
	 9tkV2KlyNKduGo8RihHxopOntqATo4m4kCCQTMoawTSiSjNhvrV84hwtuhVfyCKIvi3OR
	 bDRE6badjpDYX/LGS6N26FukP2HkAIHjMlFH1fVI67mj2nNl8EjYGEjj8mUMOFlJCkw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796130622;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=1MQpttziBFjx69tmJnWlPIOtDGiPf5sCcsWEWN2nz4g=;
	b=FlV0v65fzpRzF8YRya5J/AKezKzAUuvgnlX26MLgFgQD4vF/teSZ4E7+nwL6u0iQoexK
	 FvgEHKMEGOapI4d8w6vr4mcRNA4lQCKEjsglui6vPAp9WKqfrYgh/1/q/euS7XGNIz9uC
	 UcIEWXkzxUlDZMwADT4PUDXgO3PK2tmgJS2I5cHMnEueggxt64ziX0+SQnZac1aIPAEUj
	 JDQAqak/2GR3oE6ft4xB6zr1TkbDJIQy6jcbm1E7ibrrAx+sBsW8Spd+kf0x5zGA/c3O5
	 hKi915GQykzk/3HL4il5SugJYMXi3TdgJEpr/dCMB9sn2lWnBLQ8NXac2aUm7uO47bQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=e6+QRPJS;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id F301F606A31A;
	Tue,  1 Dec 2026 13:10:21 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id A15011F00899;
	Tue,  1 Dec 2026 13:10:19 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796130621;
	bh=1MQpttziBFjx69tmJnWlPIOtDGiPf5sCcsWEWN2nz4g=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=e6+QRPJSg4Y721lCnRHwg6TeWd5yPQiaporzdXL2I4EZH8IcS0+fvTwy6sEl93z1I
	 z1T6UMNhLsBM4DQHZXxn16q3DDjglbxSR6xwUCC7/JixqFy1HWkMzy63cIkojw7nQJ
	 0GzMYz2nxRuuEUUFGvwS7Ru5pkf7EM6ORITFcvet8skKF30zk/gMqiiWHk4L7j1YpN
	 vBppc/3+otS9xegzt0BjZTVSolw1e70sQwfsXnJ8YVWqp4WUTjqEPMucY54X8rBNE8
	 yqE4hi4cPC0EXEoxWcjOJXjNGNduMYHyY0x8xnVvzPhOamJ/DgiNGs79muACNGg9kC
	 z7uWaC1Kmalbw==
X-Cc: emil@etsalapatis.com, martin.lau@kernel.org, ast@kernel.org,
 kafai.wan@linux.dev, bpf@vger.kernel.org, willemb@google.com,
 horms@kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org,
 netdev@vger.kernel.org, pabeni@redhat.com, davem@davemloft.net,
 edumazet@kernel.org, kuniyu@google.com, ij@kernel.org, ncardwell@google.com,
 koen0607@gmail.com, g.white@cablelabs.com, ingemar.s.johansson@ericsson.com,
 mirja.kuehlewind@ericsson.com, cheshire@apple.com, rs.ietf@gmx.at,
 Jason_Livingood@comcast.com, vidhi_goel@apple.com, Mike_Rudolph@comcast.com,
 Jeff_Howe@comcast.com, srichard@netapp.com
X-In-Reply-To: <20261130125658.20292-2-chia-yu.chang@nokia-bell-labs.com>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list