From: netdev-bot+sashiko@kernel.org
To: lucien.xin@gmail.com
Cc: netdev@vger.kernel.org, quic@lists.linux.dev,
davem@davemloft.net, kuba@kernel.org, edumazet@google.com,
pabeni@redhat.com, horms@kernel.org, metze@samba.org,
mbuhl@openbsd.org, tfanelli@redhat.com, hepengtao@xiaomi.com,
dreibh@simula.no, linux-cifs@vger.kernel.org, pc@manguebit.org,
linkinjeon@kernel.org, tom@talpey.com,
kernel-tls-handshake@lists.linux.dev, chuck.lever@oracle.com,
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
Subject: Re: [PATCH net-next v15 09/15] quic: add congestion control
Date: Tue, 15 Sep 2026 19:50:46 +0000 [thread overview]
Message-ID: <178950184662.22033.5889968066649167674@kernel.org> (raw)
In-Reply-To: <ede5ba63212b87ddfa14acf70426b81d87501e44.1789393775.git.lucien.xin@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider:
Critical: 0 · High: 0 · Medium: 1 · Low: 1
- [Medium] Spurious persistent-congestion detection:
quic_cong_on_packet_lost() (net/quic/cong.c:125-140) is the ONLY place…
- [Low] Commit message vs. what the patch actually enables: the message
says the implementation 'adjusts the congestion window accordingly…
--
quic: add congestion control
This adds net/quic/cong.c and net/quic/cong.h with RTT estimation, a
congestion control state machine (slow start, recovery, congestion
avoidance), pacing helpers and the New Reno algorithm behind a
quic_cong_ops indirection. quic_init_sock() now calls quic_cong_init().
A couple of questions below.
> This patch introduces 'quic_cong' for RTT measurement and congestion
> control. The 'quic_cong_ops' is added to define the congestion
> control algorithm.
[ ... ]
> The implementation updates RTT estimates when packets are acknowledged,
> reacts to loss and ECN signals, and adjusts the congestion window
> accordingly during packet transmission and acknowledgment processing.
[Severity: Low]
This isn't a bug, but does the description match what this patch alone
does?
None of the six documented entry points has a caller at this commit, and
quic_cong_on_packet_sent() only advances cong->pacing_time because New
Reno registers no on_packet_sent hook:
if (cong->ops->on_packet_sent)
cong->ops->on_packet_sent(cong, time, bytes, number);
quic_cong_update_pacing_time(cong, bytes);
Similarly quic_cong_set_mss() in net/quic/cong.h, the only initializer of
cong->mss, cong->min_window and cong->window, has no caller yet, and
cong->time is never assigned here. The comment in
quic_reno_on_packet_acked() also refers to quic_packet_route(), which is
only introduced by the later "quic: add packet builder base" patch:
/* cong->window is never zero; it is initialized by
* quic_packet_route() during connect/accept.
*/
Would something like "the congestion control infrastructure is added here
and wired up in <later patch>" describe this patch more accurately?
> diff --git a/net/quic/cong.c b/net/quic/cong.c
> new file mode 100644
> index 0000000000000..78f28bbdfb374
> --- /dev/null
> +++ b/net/quic/cong.c
> @@ -0,0 +1,340 @@
[ ... ]
> +static bool quic_cong_check_persistent_congestion(struct quic_cong *cong,
> + u64 time)
> +{
> + u32 ssthresh;
> +
> + time -= cong->pc_start_time;
> +
> + /* rfc9002#section-7.6.1:
> + * (smoothed_rtt + max(4*rttvar, kGranularity) + max_ack_delay) *
> + * kPersistentCongestionThreshold
> + */
> + ssthresh = cong->smoothed_rtt +
> + max(4 * cong->rttvar, QUIC_KGRANULARITY);
> + ssthresh = (ssthresh + cong->max_ack_delay) *
> + QUIC_KPERSISTENT_CONGESTION_THRESHOLD;
> +
> + return time > ssthresh;
> +}
> +
> +/* COMMON APIs */
> +void quic_cong_on_packet_lost(struct quic_cong *cong, u64 time, u32 bytes,
> + s64 number)
> +{
> + if (cong->pc_start_time && time > cong->pc_start_time &&
> + quic_cong_check_persistent_congestion(cong, time)) {
> + cong->pc_start_time = 0;
> + cong->min_rtt_valid = 0;
> + cong->window = cong->min_window;
> + cong->state = QUIC_CONG_SLOW_START;
> + return;
> + }
> +
> + if (!cong->pc_start_time && cong->is_rtt_set)
> + cong->pc_start_time = time;
^^^^
[Severity: Medium]
Can persistent congestion be declared here even though a packet sent
inside the interval was acknowledged?
quic_cong_on_packet_lost() is the only place that establishes
cong->pc_start_time, and quic_cong_on_packet_acked() can only clear an
interval that already exists, so an acknowledgment processed before the
first loss callback leaves no state behind.
With srtt = 100ms the duration threshold is roughly 400ms. Consider
packet A sent at t=0, B sent at t=100ms, C sent at t=500ms, and B
acknowledged first (ACK processing precedes loss detection):
quic_cong_on_packet_acked(time=100ms)
/* pc_start_time == 0, so this guard is false */
if (cong->pc_start_time && time > cong->pc_start_time &&
!quic_cong_check_persistent_congestion(cong, time))
cong->pc_start_time = 0;
quic_cong_on_packet_lost(time=0ms) /* A declared lost */
if (!cong->pc_start_time && cong->is_rtt_set)
cong->pc_start_time = time; /* pc_start_time = 0ms */
quic_cong_on_packet_lost(time=500ms) /* C declared lost */
/* 500ms - 0ms > 400ms */
quic_cong_check_persistent_congestion() == true
cong->window = cong->min_window;
cong->state = QUIC_CONG_SLOW_START;
cong->min_rtt_valid = 0;
B was sent at 100ms, i.e. between the send times of A and C, and it was
acknowledged, which rfc9002#section-7.6.2 says should disqualify the
interval. Since neither the acknowledgment timestamp nor the packet
number is retained (the number argument is unused in both callbacks), is
there a way to reject this interval, for example by recording the send
time or packet number of the most recently acknowledged packet?
> +
> + cong->ops->on_packet_lost(cong, time, bytes, number);
> +}
> +
> +void quic_cong_on_packet_acked(struct quic_cong *cong, u64 time, u32 bytes,
> + s64 number)
> +{
[ ... ]
> + if (cong->pc_start_time && time > cong->pc_start_time &&
> + !quic_cong_check_persistent_congestion(cong, time))
> + cong->pc_start_time = 0;
> +
> + cong->ops->on_packet_acked(cong, time, bytes, number);
> +}
[ ... ]
> +void quic_cong_on_packet_sent(struct quic_cong *cong, u64 time, u32 bytes,
> + s64 number)
> +{
> + if (!bytes)
> + return;
> + if (cong->ops->on_packet_sent)
> + cong->ops->on_packet_sent(cong, time, bytes, number);
> + quic_cong_update_pacing_time(cong, bytes);
> +}
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1789393775.git.lucien.xin%40gmail.com
next prev reply other threads:[~2026-09-15 19:50 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 13:49 [PATCH net-next v15 00/15] net: introduce QUIC infrastructure and core subcomponents Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 01/15] net: define IPPROTO_QUIC and SOL_QUIC constants Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 02/15] net: build socket infrastructure for QUIC protocol Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 03/15] quic: provide common utilities and data structures Xin Long
2026-09-15 19:50 ` netdev-bot+sashiko
2026-09-16 15:18 ` Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 04/15] quic: provide family ops for address and protocol Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 05/15] quic: provide quic.h header files for kernel and userspace Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 06/15] quic: add stream management Xin Long
2026-09-15 19:50 ` netdev-bot+sashiko
2026-09-16 15:21 ` Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 07/15] quic: add connection id management Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 08/15] quic: add path management Xin Long
2026-09-15 19:50 ` netdev-bot+sashiko
2026-09-16 15:43 ` Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 09/15] quic: add congestion control Xin Long
2026-09-15 19:50 ` netdev-bot+sashiko [this message]
2026-09-16 15:48 ` Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 10/15] quic: add packet number space Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 11/15] quic: add crypto key derivation and installation Xin Long
2026-09-15 19:50 ` netdev-bot+sashiko
2026-09-16 15:51 ` Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 12/15] quic: add crypto packet encryption and decryption Xin Long
2026-09-15 19:50 ` netdev-bot+sashiko
2026-09-16 16:01 ` Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 13/15] quic: add timer management Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 14/15] quic: add packet builder base Xin Long
2026-09-15 19:50 ` netdev-bot+sashiko
2026-09-16 16:20 ` Xin Long
2026-09-14 13:49 ` [PATCH net-next v15 15/15] quic: add packet parser base Xin Long
2026-09-15 19:51 ` netdev-bot+sashiko
2026-09-15 21:34 ` Xin Long
2026-09-16 18:08 ` Xin Long
2026-09-16 23:46 ` Kuniyuki Iwashima
2026-09-17 13:38 ` Xin Long
2026-09-17 19:06 ` Kuniyuki Iwashima
2026-09-18 19:51 ` Xin Long
2026-09-16 18:33 ` [PATCH net-next v15 00/15] net: introduce QUIC infrastructure and core subcomponents Xin Long
2026-09-17 8:35 ` Paolo Abeni
2026-09-18 19:59 ` Xin Long
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178950184662.22033.5889968066649167674@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=aahringo@redhat.com \
--cc=alibuda@linux.alibaba.com \
--cc=andrew.gospodarek@broadcom.com \
--cc=chuck.lever@oracle.com \
--cc=daniel@haxx.se \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=dreibh@simula.no \
--cc=edumazet@google.com \
--cc=hare@suse.de \
--cc=hepengtao@xiaomi.com \
--cc=horms@kernel.org \
--cc=illiliti@protonmail.com \
--cc=jbaron@akamai.com \
--cc=jlayton@kernel.org \
--cc=kernel-tls-handshake@lists.linux.dev \
--cc=kuba@kernel.org \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=lucien.xin@gmail.com \
--cc=mail@johnericson.me \
--cc=marcelo.leitner@gmail.com \
--cc=matttbe@kernel.org \
--cc=mbuhl@openbsd.org \
--cc=mef@scarletmail.rutgers.edu \
--cc=metze@samba.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=paul@jakma.org \
--cc=pc@manguebit.org \
--cc=quic@lists.linux.dev \
--cc=sd@queasysnail.net \
--cc=steved@redhat.com \
--cc=tfanelli@redhat.com \
--cc=tom@talpey.com \
--cc=xiyou.wangcong@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.