Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: dhowells@redhat.com
Cc: netdev@vger.kernel.org, marc.dionne@auristor.com,
	kuba@kernel.org, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, horms@kernel.org,
	linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org,
	jaltman@auristor.com, stable@vger.kernel.org
Subject: Re: [PATCH net v3 06/10] rxrpc: Fix lost driving of congestion management retransmission timeout
Date: Fri, 27 Nov 2026 10:13:36 +0000	[thread overview]
Message-ID: <179577441601.3135.13037869649269792957@kernel.org> (raw)
In-Reply-To: <20261124161302.4044422-7-dhowells@redhat.com>

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

Critical: 0 · High: 0 · Medium: 2 · 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] In rxrpc_rack_timer_expired() (net/rxrpc/input_rack.c), the
  RXRPC_CALL_RACKTIMER_RTO case now calls rxrpc_congestion_timeout()…
- [Medium] The patch makes previously dead RTO congestion code live by
  moving it unchanged into rxrpc_congestion_timeout()…

--

rxrpc: Fix lost driving of congestion management retransmission timeout

This moves the unused RTO congestion code out of
rxrpc_congestion_management() into a new rxrpc_congestion_timeout()
helper. The helper is called from the RXRPC_CALL_RACKTIMER_RTO case of
rxrpc_rack_timer_expired(). RXRPC_CALL_RETRANS_TIMEOUT now only marks
that this happened, for the rxrpc_congest tracepoint.

Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261020201258.290827-1-dhowells%40redhat.com

> diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
> index 9b02e36264aa4..63a0feae2081d 100644
> --- a/net/rxrpc/input.c
> +++ b/net/rxrpc/input.c

[ ... ]

> @@ -199,6 +190,22 @@ void rxrpc_congestion_degrade(struct rxrpc_call *call)
>  	call->cong_cwnd = umax(call->cong_cwnd / 2, RXRPC_MIN_CWND);
>  }
>  
> +/*
> + * Handle congestion being detected by the retransmit timeout.
> + */
> +void rxrpc_congestion_timeout(struct rxrpc_call *call)
> +{
> +	set_bit(RXRPC_CALL_RETRANS_TIMEOUT, &call->flags);
> +	call->cong_ssthresh = umax(rxrpc_tx_in_flight(call) / 2, 2);
> +	call->cong_cwnd = 1;
> +	if (call->cong_cwnd >= call->cong_ssthresh &&
> +	    call->cong_ca_state == RXRPC_CA_SLOW_START) {
> +		call->cong_ca_state = RXRPC_CA_CONGEST_AVOIDANCE;
> +		call->cong_tstamp = call->acks_latest_ts;
> +		call->cong_cumul_acks = 0;
> +	}
> +}

[Severity: Medium]
Can this if block ever run? cong_cwnd has just been set to 1, and
cong_ssthresh is always at least 2, so the condition is always false.
cong_ca_state is left as it was.

At the baseline this code was dead, because RXRPC_CALL_RETRANS_TIMEOUT
was never set. This patch makes it live. After an RTO, though, the call
never moves into slow start, which RFC 5681 requires.

If the RTO fires in RXRPC_CA_CONGEST_AVOIDANCE, cwnd grows back from 1
by at most one packet per srtt:

rxrpc_congestion_management() {
    ...
	case RXRPC_CA_CONGEST_AVOIDANCE:
    ...
		if (call->cong_cumul_acks >= call->cong_cwnd)
			call->cong_cwnd++;
    ...
}

In the usual tail-loss RTO case, the ACKs after the retransmission carry
no soft-NACKs. So the resume_normality path, which would choose
RXRPC_CA_SLOW_START because cwnd < ssthresh, is never taken.

If the RTO fires in RXRPC_CA_FAST_RETRANSMIT, the call stays in
recovery. The next new_low_snack ACK does this, which mostly undoes the
loss window:

			call->cong_cwnd = call->cong_ssthresh;

By contrast, rxrpc_congestion_degrade() sets RXRPC_CA_SLOW_START
explicitly:

	call->cong_ca_state = RXRPC_CA_SLOW_START;

Should rxrpc_congestion_timeout() also set cong_ca_state to
RXRPC_CA_SLOW_START (and reset cong_dup_acks and cong_extra)? The
behaviour is unchanged at the end of the series.

>  /*
>   * Add an RTT sample derived from an ACK'd DATA packet.
>   */
> diff --git a/net/rxrpc/input_rack.c b/net/rxrpc/input_rack.c
> index e5288e5beb592..c652451cc9b55 100644
> --- a/net/rxrpc/input_rack.c
> +++ b/net/rxrpc/input_rack.c
> @@ -420,7 +420,7 @@ void rxrpc_rack_timer_expired(struct rxrpc_call *call, ktime_t overran_by)
>  		rxrpc_tlp_send_probe(call);
>  		break;
>  	case RXRPC_CALL_RACKTIMER_RTO:
> -		// Might need to poke the congestion algo in some way
> +		rxrpc_congestion_timeout(call);
>  		rxrpc_rack_mark_losses_on_rto(call);
>  		break;

[Severity: Medium]
Should this call be conditional on there being unacked packets? The
commit message describes the lost behaviour as setting the flag:

    when the retransmission timeout expired (and if
    there were unacked packets).

Before 7c482665931b, the call in net/rxrpc/call_event.c was guarded:

	if (unacked)
		rxrpc_congestion_timeout(call);

Here, rxrpc_congestion_timeout() runs on every RTO expiry.

The RTO is only armed in rxrpc_tlp_send_probe(), and only when
rxrpc_tx_in_flight(call) != 0. Could a stale RTO fire with nothing
outstanding, like this?

  1. rxrpc_tlp_send_probe() arms RXRPC_CALL_RACKTIMER_RTO.
  2. An ACK hard-ACKs everything transmitted, but RXRPC_CALL_TX_LAST is
     not set (for example, a MSG_MORE sender waiting on the
     application). rxrpc_end_tx_phase() therefore never cancels the
     timer.
  3. rxrpc_rack_detect_loss_and_arm_timer() only replaces the timer
     when the reorder timeout is non-zero.
  4. No new data is sent before the RTO elapses, and the timer fires.

rxrpc_congestion_timeout() would then set cong_cwnd to 1 and
cong_ssthresh to umax(0 / 2, 2) = 2, even though nothing was lost.

That low ssthresh also outlives the call. rxrpc_disconnect_call() copies
it to the peer:

	call->peer->cong_ssthresh = call->cong_ssthresh;

Later client calls (rxrpc_connect_call() path in conn_client.c) and
service calls (call_accept.c) to the same peer inherit it:

	call->cong_ssthresh = call->peer->cong_ssthresh;

This seems to still be present at the end of the series.
rxrpc_update_rack_rto_timer(), added by "rxrpc: Fix RACK-TLP
implementation", returns early when tx_in_flight == 0 without cancelling
the RTO, and rxrpc_congestion_timeout() still has no guard.

>  	//case RXRPC_CALL_RACKTIMER_ZEROWIN:

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124161302.4044422-1-dhowells%40redhat.com

  reply	other threads:[~2026-11-27 10:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 16:12 [PATCH net v3 00/10] rxrpc: RACK-TLP fixes David Howells
2026-11-24 16:12 ` [PATCH net v3 01/10] rxrpc: Fix incorrect unit conversion David Howells
2026-11-24 16:12 ` [PATCH net v3 02/10] rxrpc: Fix time unit conversion truncation David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:12 ` [PATCH net v3 03/10] rxrpc: Fix carrying of in-flight calc over retransmission David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:12 ` [PATCH net v3 04/10] rxrpc: Fix ack parsing to mark reneged ACKs as lost for RACK-TLP David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:12 ` [PATCH net v3 05/10] rxrpc: Fix RTT processing for a presumed lost packet getting ACK'd David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:12 ` [PATCH net v3 06/10] rxrpc: Fix lost driving of congestion management retransmission timeout David Howells
2026-11-27 10:13   ` netdev-bot+sashiko [this message]
2026-11-24 16:12 ` [PATCH net v3 07/10] rxrpc: Fix limit on packets to be transmitted in one go David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:12 ` [PATCH net v3 08/10] rxrpc: Fix detection of TLP probe response David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:12 ` [PATCH net v3 09/10] rxrpc: Fix counting of in-flight transmitted packets David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:12 ` [PATCH net v3 10/10] rxrpc: Fix RACK-TLP implementation David Howells
2026-11-27 10:13   ` netdev-bot+sashiko
2026-11-24 16:18 ` [PATCH net v3 00/10] rxrpc: RACK-TLP fixes netdev-bot+sinfo

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=179577441601.3135.13037869649269792957@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jaltman@auristor.com \
    --cc=kuba@kernel.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.dionne@auristor.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    /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