๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21437

Re: [PATCH net-next v19 09/15] quic: add congestion control

#21437
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 01:21
97 lines
12102 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] quic_cong_rtt_update() in net/quic/cong.c begins with `if
  (ack_delay > cong->max_ack_delay * 2) return;`.

--

quic: add congestion control

This patch adds struct quic_cong for RTT measurement and congestion
control, along with struct quic_cong_ops for congestion control
algorithms. It implements a slow start, congestion avoidance and
recovery state machine, and currently provides New Reno only.

> diff --git a/net/quic/cong.c b/net/quic/cong.c
> new file mode 100644
> index 0000000000000..99fe8045d0170
> --- /dev/null
> +++ b/net/quic/cong.c

[ ... ]

> +/* rfc9002#section-5: Estimating the Round-Trip Time */
> +void quic_cong_rtt_update(struct quic_cong *cong, u64 time, u32 ack_delay)
> +{
> +	u32 adjusted_rtt, rttvar_sample;
> +	u64 raw_rtt;
> +
> +	/* Ignore RTT sample if ACK delay is suspiciously large. */
> +	if (ack_delay > cong->max_ack_delay * 2)
> +		return;

[Severity: Medium]
Should this early return be here? When it fires, quic_cong_rtt_update()
skips every update. latest_rtt, min_rtt/min_rtt_valid, smoothed_rtt,
rttvar and first_rtt_time stay as they are, and quic_cong_pto_update()
is never called.

RFC 9002 section 5.1 generates an RTT sample whenever the largest
acknowledged packet is newly acked and at least one newly acked packet
was ack-eliciting. It has no rule for rejecting a sample because of its
ack_delay.

RFC 9002 section 5.3 also says the endpoint SHOULD ignore the peer's
max_ack_delay until the handshake is confirmed. During the handshake,
peers can legitimately report delays larger than max_ack_delay (RFC 9000
sections 13.2.1 and 13.2.5). One example is a peer that buffers
undecryptable packets until keys arrive.

The changelog says callers will cap ack_delay to max_ack_delay after
handshake confirmation. If so, this check can only fire before
confirmation, which is the phase where the RFC says to ignore
max_ack_delay.

With the default from quic_cong_init():

	cong->max_ack_delay = QUIC_DEF_ACK_DELAY;

any handshake-phase sample with ack_delay above 50ms would be dropped. A
peer that advertises max_ack_delay of 0, which is a legal value, would
cause every pre-confirmation sample with a non-zero ack_delay to be
dropped.

In that case smoothed_rtt and rttvar would stay at the QUIC_RTT_INIT
values set by quic_cong_set_srtt(), so pto and loss_delay would not match
the real path. first_rtt_time would also stay 0. That keeps
quic_cong_on_packet_lost() from ever setting pc_start_time.

The RFC already handles a large ack_delay safely further down in this
function:

> +	adjusted_rtt = cong->latest_rtt;
> +	if (cong->latest_rtt >= cong->min_rtt + ack_delay)
> +		adjusted_rtt = cong->latest_rtt - ack_delay;

Is the drop-the-sample heuristic needed on top of this?

The commit message describes quic_cong_rtt_update() as "Performs RTT
measurement" and does not mention this deviation from RFC 9002.

This patch has no caller of quic_cong_rtt_update(), so whether this
triggers depends on the ACK processing code in the later patchset.

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1795393690.git.lucien.xin%40gmail.com
Technical Details
Message-ID: <179548327865.3135.16261562840994895440@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369920-linux-kernel-netdev=dewy.ru
References: <b69a2cad6c2faeab9ee1e90ad11c4b64168c8235.1795393691.git.lucien.xin@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369920-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v19 09/15] quic: add congestion control
Date: Tue, 24 Nov 2026 01:21:18 +0000
Organization: Usenet Network
Message-ID: <179548327865.3135.16261562840994895440@kernel.org>
References: <b69a2cad6c2faeab9ee1e90ad11c4b64168c8235.1795393691.git.lucien.xin@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="4025087"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:sYqnSaEH0e0S6gkgHqk2mrNgE+E= sha256:BE7AX6Vo+4aiWQUcW9Pa+omBVBlHIkJIbifuc2BDEL4= sha1:qIqh8JcnAXOUviLMaQffR1KOevw= sha256:WQI2s5JSdihhXmVcnvWQcA7XPpyKjuY00Jb1h4CbgeA=
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 2C3A6125DCC; Tue, 24 Nov 2026 04:21:41 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.3
X-Spam-Status: No, score=-2.3 tagged_above=-9999 required=6.31 tests=[DCC_CHECK=1.1, 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 ASKS0n9yKyss; Tue, 24 Nov 2026 04:21:37 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-369920-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 68813125DCA; Tue, 24 Nov 2026 04:21:29 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 4CB342CF15; Tue, 24 Nov 2026 01:21:25 +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=1795483282; b=lAx+145ReucyqIwUDinNMavgp9TO0Lgo9hzixj2AEgZifWyGejpzbSRqDFCw7OtVsZwo VwlO9PNKXmAdehVqSH4i9OjcvhKMtO1MZzWSvi6OjKXRgJb07p8HqkvpSrW8Emomf0gM0 PPgP3FT6JrOUml8HN9Erfw878Vgvjv8Oz5sLs2J2rsEa3HgMB36pnWvm2+L2c+/lodbgW Bw7R/+k4WKZUS+TpcQn6y4mISvEmVAyMq1o3rthmHL32C88WgZw4lWvnY8vgw0Iqm0gMm KkOQf9U0mMgW5/usFPXjTbuVIm4+MxNzPsKh9as2Ol0zXiLI071P7zdMGa8Myf+zcJA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795483282; 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=WZwDpOMAGe1JJovwAreJRvj62LQnJZ5Y3eTHJLCsFx8=; b=2ZMea6ZTaICl7ksB1gLgjg3YZJlrjponqPNw7jXo8t9vhm9glKeGqRzXUrsFzDBGdaEH JOx5AQzKDbIzEe5ANUqUvnxYj2lV2dQUh/i4Gexl5s9orre4Qk6qCg40kiIPHcvAk3yRr 0DukxGKXia6ftczczhiHhjFCgemR06YrS6dwRynHTp7gUsVh/wIFjd/EgA32dQxmlSWQ6 Jel+wKOL4QckmhxkHd4vZUJxdBwFPMig3OGBr+tvwFz8WcsaaMuJ8HX7KgIzs30Ga2nlk aofYWtcLWVRqL/X9CW2gBxZx+U51n4lPpXHu7owNRRYWDoXf5z2JnN6a8uiZnh9MYSg==
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=d9dJh3gZ; 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 5138E606A32A; Tue, 24 Nov 2026 01:21: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=d9dJh3gZ
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=1795483281; b=svjrlYz85EK8L7hq0SIsVZq/PgV5lEBQJEc5wX4JGOFL1ETtjRFFB31nCUEgKoGl2PtO BXrVRL3cq3OloAygZmdV5jj1ImtesG2cPV21wZAHf4GAQ4FmaUEGySIX/4zqfQDAcUIq1 MFPJPSSILvo3qMWDcwaU+OhIqY2RAyZJIPxFDJWGjzYpjoiP+W5dGwKuGm7hRkQnVVImc F5r1lKXej4H0MNDY0LdMT1+sy6OlY+kYRFaTQgz+FIa3x1P4xA3iq2zY5AKKfFz8G6Twm 2tKRC4L9sH2Vb8LxU0aP63V69XTFK/BqU1Nwh6vHrNEbBlE792TEXUrTmBi+OfD2tWA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795483281; 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=WZwDpOMAGe1JJovwAreJRvj62LQnJZ5Y3eTHJLCsFx8=; b=4Dg0OcOUuVHfJABObR3BpmzIkfgKDYLZUM2FpDbSFiN8jT24S8y22fEJ9aNos95/T1V1 QeHAmFmgzUkdsRgjisAxRroY+Y5wEWy7TZg+1uGZZKynA4E9SzVhHeYOQzA/nF5yzWdxA jq47HUZi45lRrAWJYDNQU9mZldedhgWFC10wIF5siToli6SrJjiNdzp7igY92rHTtlmiG XFOa5UqM1uEvggkQGuQSyfGz/LnaLJ8US6PR4zOsdyjbaMfRuOBOpD7fhW6aGXLJ+ti4X 1GdbBgYGScEQ1aWYviz4GwujQDbrfPsZ5tQe4ZNi9zXbo4LcUxQU5764OJMN8TVWwrw==
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=d9dJh3gZ; 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 6F4E4606A322; Tue, 24 Nov 2026 01:21:21 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 104B41F000CA; Tue, 24 Nov 2026 01:21:19 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795483280; bh=WZwDpOMAGe1JJovwAreJRvj62LQnJZ5Y3eTHJLCsFx8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=d9dJh3gZDukMh5XSYkHjAKzOSiyV5ppoKkMZY+GrYXbta0eGmKnrEk5ozrr9b2d0K IUXyjjdOh+dZ+G7KCnMIng6gi/DaX71ZaE+H+vzirTZH+6KQQs+p0nK3Buk51CCmjk 8/5DAEZZmx9SgWoBf0wGvBz7wHzM0MuCWmiiDknmyoKuBKf3d3IpLweUgTYGFmH1ad LSe2Khg6v2/of15H+gLuVIwX824f5b0Dk2KVq0bezcUx50mob4KtuZ5gWgr8u6oTbn UMzT8LRYiVyRTxKERODJ/1pCnyzMid/ISdUVki0qFwZYrZ2PGRrtIhsPv0qvk5M7pC s6naJ54Fo7kMw==
X-Cc: netdev@vger.kernel.org, quic@lists.linux.dev, davem@davemloft.net, kuba@kernel.org, edumazet@kernel.org, pabeni@redhat.com, horms@kernel.org, metze@samba.org, mbuhl@openbsd.org, tfanelli@redhat.com, hepengtao@xiaomi.com, dreibh@simula.no, jamie.bainbridge@gmail.com, linux-cifs@vger.kernel.org, pc@manguebit.org, linkinjeon@kernel.org, tom@talpey.com, kernel-tls-handshake@lists.linux.dev, cel@kernel.org, jlayton@kernel.org, steved@redhat.com, hare@suse.de, aahringo@redhat.com, dhowells@redhat.com, matttbe@kernel.org, mail@johnericson.me, xiyou.wangcong@gmail.com, alibuda@linux.alibaba.com, jbaron@akamai.com, illiliti@protonmail.com, sd@queasysnail.net, marcelo.leitner@gmail.com, daniel@haxx.se, andrew.gospodarek@broadcom.com, mef@scarletmail.rutgers.edu, paul@jakma.org, kuniyu@google.com
X-In-Reply-To: <b69a2cad6c2faeab9ee1e90ad11c4b64168c8235.1795393691.git.lucien.xin@gmail.com>
X-sashiko-severity: Medium
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
X-Received-Bytes: 11843