From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A15011F00899; Tue, 1 Dec 2026 13:10:19 +0000 (UTC) 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== Subject: Re: [PATCH net-next v5 1/4] tcp: export CE count in rate_sample From: netdev-bot+sashiko@kernel.org To: chia-yu.chang@nokia-bell-labs.com 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 Date: Tue, 01 Dec 2026 13:10:19 +0000 Message-ID: <179613061918.3146.18307347617095764135@kernel.org> In-Reply-To: <20261130125658.20292-2-chia-yu.chang@nokia-bell-labs.com> References: <20261130125658.20292-2-chia-yu.chang@nokia-bell-labs.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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