Netdev List
 help / color / mirror / Atom feed
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, kuniyu@google.com
Subject: Re: [PATCH net-next v17 09/15] quic: add congestion control
Date: Mon, 19 Oct 2026 21:30:01 +0000	[thread overview]
Message-ID: <179244540161.3135.791644548439735124@kernel.org> (raw)
In-Reply-To: <9e1c586f76943aa9fcd96cecedec805c66fc6e07.1792164438.git.lucien.xin@gmail.com>

Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 2

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] When quic_cong_on_packet_lost() (net/quic/cong.c:94-99)
  declares persistent congestion, it sets cong->window =…
- [Low] The commit message says the implementation "adjusts the
  congestion window accordingly during packet transmission and…
- [Low] quic_cong_rtt_update() (net/quic/cong.c:207-209) throws away the
  whole RTT sample when the raw send-to-ACK interval (cong->time - time)…

--

quic: add congestion control

This patch adds struct quic_cong and struct quic_cong_ops to the QUIC
stack. They cover RTT measurement, loss and ECN handling, and pacing.
New Reno is the only algorithm so far, and quic_init_sock() sets it up
through quic_cong_init().

> 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]
Is this accurate for the transmit path? quic_cong_on_packet_sent() never
touches cong->window:

    if (cong->ops->on_packet_sent)
        cong->ops->on_packet_sent(cong, time, bytes, number);
    quic_cong_update_pacing_time(cong, bytes);

The New Reno entry in quic_congs[] has no .on_packet_sent, so on transmit
only cong->pacing_time changes.

The commit message body also doesn't mention pacing. That covers the
pacing_rate and pacing_time fields, the 2 * window / smoothed_rtt rate in
quic_cong_pace_update(), and quic_cong_update_pacing_time(). Pacing only
shows up in the version changelog notes.

Could the commit message describe pacing, and drop the part about
adjusting the window during transmission?

> diff --git a/net/quic/cong.c b/net/quic/cong.c
> new file mode 100644
> index 0000000000000..765f50660f0e4
> --- /dev/null
> +++ b/net/quic/cong.c
> @@ -0,0 +1,287 @@

[ ... ]

> +/* NEW RENO APIs */
> +static void reno_recovery(struct quic_cong *cong)
> +{
> +	cong->recovery_time = cong->time;
> +	cong->ssthresh = max(cong->window >> 1U, cong->min_window);
> +	cong->window = cong->ssthresh;
> +}

[ ... ]

> +/* COMMON APIs */
> +void quic_cong_on_packet_lost(struct quic_cong *cong, u64 time, u32 bytes,
> +			      s64 number)
> +{
> +	if (cong->pc_detected)
> +		return;
> +
> +	if (cong->pc_start_time && time > cong->pc_start_time &&
> +	    quic_cong_check_persistent_congestion(cong, time)) {
> +		cong->pc_detected = 1;
> +		cong->min_rtt_valid = 0;
> +		cong->window = cong->min_window;
> +		return;
> +	}

[Severity: Medium]
Should this branch also reset cong->recovery_time?

The recovery state comes only from quic_cong_in_recovery():

    return time <= cong->recovery_time;

The only place that writes recovery_time is reno_recovery(), which sets
it to cong->time (now).

Take a single loss-detection pass after a link outage:

  P1 lost (pc_start_time is 0, first_rtt_time is set, not in recovery)
    quic_cong_on_packet_lost()
      cong->pc_start_time = time of P1
      quic_reno_on_packet_lost()
        reno_recovery()
          cong->recovery_time = cong->time;    /* now */

  P2 lost, sent more than the persistent congestion duration after P1
    quic_cong_on_packet_lost()
      quic_cong_check_persistent_congestion() returns true
      cong->window = cong->min_window;

Every packet still in flight was sent before now, so the ACK for each of
them returns early here:

    quic_cong_on_packet_acked()
        if (quic_cong_in_recovery(cong, time))
            return;

In that case ops->on_packet_acked() is never called. Would the window
then stay at min_window for at least one more RTT, until a packet sent
after recovery_time is acked?

RFC 9002 Appendix B.8 sets congestion_recovery_start_time to 0 on
persistent congestion, so these ACKs grow the window in slow start. The
state diagram in cong.h shows the same transition:

 *             persistent congestion |   Slow     |
 *         (O)---------------------->|   Start    |

Here, though, the derived state ends up as Recovery Period, not Slow
Start.

Nothing in this patch calls the quic_cong_on_packet_* hooks yet. This
would show up once the outqueue changes start calling them.

[ ... ]

> +/* 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;
> +
> +	/* Ignore RTT sample if ACK delay is suspiciously large. */
> +	if (ack_delay > cong->max_ack_delay * 2 ||
> +	    cong->time - time > QUIC_RTT_MAX)
> +		return;

[Severity: Low]
Is the 6 second QUIC_RTT_MAX cutoff too tight here?

cong->time - time is the raw interval from send to ACK, so it includes
the peer's ACK delay. RFC 9000 allows max_ack_delay up to 2^14 ms, which
matches common.h:

    #define QUIC_MAX_ACK_DELAY	(16384 * 1000)

For example, take a peer max_ack_delay of 8s, an ack_delay of 7s and a
measured interval of 7.1s. The sample passes the ack_delay check but is
still thrown away. The same happens on any path whose RTT stays above
6s.

The early return comes before anything is updated. smoothed_rtt and
rttvar stay at their initial 333ms and 166ms, and those feed into pto,
loss_delay and the pacing rate.

first_rtt_time also stays 0, so this condition in
quic_cong_on_packet_lost() is never true:

    if (!cong->pc_start_time && cong->first_rtt_time &&
        time > cong->first_rtt_time)
        cong->pc_start_time = time;

As a result, persistent congestion tracking never starts.

The v14 changelog says the cap prevents latest_rtt overflow. latest_rtt
is a u32 in microseconds, though, so it doesn't overflow until about
4295 seconds.

Could the limit be raised, or could ack_delay be subtracted before the
check? Nothing in this patch calls quic_cong_rtt_update() yet, so this
only matters once later patches call it.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1792164438.git.lucien.xin%40gmail.com

             reply	other threads:[~2026-10-19 21:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 21:30 netdev-bot+sashiko [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-10-16 15:27 [PATCH net-next v17 00/15] net: introduce QUIC infrastructure and core subcomponents Xin Long
2026-10-16 15:27 ` [PATCH net-next v17 09/15] quic: add congestion control 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=179244540161.3135.791644548439735124@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=kuniyu@google.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox