🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23466

Re: [PATCH net v3 10/10] rxrpc: Fix RACK-TLP implementation

#23466
From: netdev-bot+sashiko
Date: Fri, 27 Nov 2026 10:13
258 lines
17083 bytes
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.

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

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] rxrpc_update_rack_rto_timer() (net/rxrpc/input_rack.c) never
  stops the RTO timer once every transmitted DATA packet has been ACK'd.
- [Low] In the new rxrpc_update_rack_rto_timer()
  (net/rxrpc/input_rack.c), `rto = ktime_add(earliest,…
- [Low] The new RTO rearm in rxrpc_input_call_event()
  (net/rxrpc/call_event.c:456-463) uses `rack_timer_mode == OFF &&…
- [Low] The new rxrpc_call::cong_in_recovery field is commented "If we're
  in Fast retransmit recovery", but it stays true after the call leaves…

--

rxrpc: Fix RACK-TLP implementation

This patch fixes several parts of the rxrpc RACK-TLP implementation. It
moves the recovery flag from rxrpc_ack_summary into rxrpc_call, rearms or
extends the RTO timer at the end of rxrpc_input_call_event(), and
initialises the TLP state only on entry to FAST_RETRANSMIT. It also moves
the segment_xmit_ts reset out of rxrpc_rack_mark_lost() and changes the
flight_size check in rxrpc_tlp_calc_pto().

> diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c
> index 62e15b03c9c2e..2b3bd5355a023 100644
> --- a/net/rxrpc/call_event.c
> +++ b/net/rxrpc/call_event.c

[ ... ]

> @@ -448,6 +450,24 @@ bool rxrpc_input_call_event(struct rxrpc_call *call)
>  				       rxrpc_propose_ack_input_data);
>  	}
>  
> +	/* Need to rearm the RTO timer if we don't start the TLP-PTO
> +	 * timer [RFC8985 7.3].
> +	 */
> +	if (call->rack_timer_mode == RXRPC_CALL_RACKTIMER_OFF &&
> +	    call->tx_in_flight > 0) {
> +		ktime_t rto = rxrpc_get_rto_backoff(call, false);
> +
> +		call->rack_timer_mode = RXRPC_CALL_RACKTIMER_RTO;
> +		call->rack_timo_at = ktime_add(ktime_get_real(), rto);
> +		trace_rxrpc_rack_timer(call, rto, false);
> +		trace_rxrpc_timer_set(call, rto, rxrpc_timer_trace_rack_rto);

[Severity: Low]
Can tx_in_flight be non-zero here only because of a TLP probe, after the
Tx phase has already ended?

The commit message says the RTO is rearmed "if DATA packets have been sent
but not yet ACK'd". However, tx_in_flight also counts a TLP retransmission
of a segment that has already been soft-ACK'd:

net/rxrpc/output.c:rxrpc_send_data_packet() {
    ...
		if (req->tlp_probe && test_bit(ix, &tq->segment_acked)) {
			...
			if (!call->tlp_in_flight) {
				call->tlp_in_flight = true;
				call->tx_in_flight++;
			}
    ...
}

Suppose the final ACK then hard-ACKs the whole window. tlp_seq goes
through the soft ACK to hard ACK branch of rxrpc_rotate_tx_window(), and
that branch doesn't call rxrpc_tlp_end_probe():

		} else if (test_bit(ix, &tq->segment_acked)) {
			/* Soft ACK -> hard ACK. */
			call->acks_nr_sacks--;
			trace_rxrpc_rotate(call, tq, summary, seq, rxrpc_rotate_trace_sack);
		}

rxrpc_input_ack() then calls rxrpc_end_tx_phase(), which sets
rack_timer_mode to RXRPC_CALL_RACKTIMER_OFF. It then jumps to send_response
and skips check_for_tlp_probe, so the probe isn't ended there either.

Back in rxrpc_input_call_event(), the mode is OFF and tx_in_flight is 1.
An RTO therefore gets armed on a call in CLIENT_AWAIT_REPLY or
CLIENT_RECV_REPLY. When it fires, rxrpc_rack_timer_expired() calls
rxrpc_congestion_timeout() even though nothing is outstanding.

rxrpc_tlp_probe_loss() may not clear the probe if rto_us has grown since
the probe was sent. In that case the mode goes back to OFF with
tx_in_flight still 1, and this block arms the RTO again.

Could this keep rearming the RTO on a call that has finished transmitting?

[ ... ]

> diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
> index 66be37f214105..aa3af5a10c015 100644
> --- a/net/rxrpc/input.c
> +++ b/net/rxrpc/input.c

[ ... ]

> @@ -97,12 +98,12 @@ static void rxrpc_congestion_management(struct rxrpc_call *call,
>  		call->cong_extra = 0;
>  		call->cong_dup_acks = 0;
>  		summary->need_retransmit = true;
> -		summary->in_fast_or_rto_recovery = true;
> +		call->cong_in_recovery = true;
> +		rxrpc_tlp_init(call);
>  		goto out;
>  
>  	case RXRPC_CA_FAST_RETRANSMIT:
> -		rxrpc_tlp_init(call);
> -		summary->in_fast_or_rto_recovery = true;
> +		call->cong_in_recovery = true;
>  		if (!summary->new_low_snack) {
>  			if (summary->nr_new_sacks == 0)
>  				call->cong_cwnd += 1;

[Severity: Low]
Does cong_in_recovery stay true after the call has left recovery?

The new field is commented "If we're in Fast retransmit recovery". On the
exit ACK, though, this case sets it to true and then leaves recovery:

		} else {
			summary->change = rxrpc_cong_progress;
			call->cong_cwnd = call->cong_ssthresh;
			if (call->acks_nr_snacks == 0) {
				summary->exiting_fast_or_rto_recovery = true;
				goto resume_normality;
			}
		}

resume_normality moves cong_ca_state to SLOW_START or CONGEST_AVOIDANCE
but doesn't clear cong_in_recovery.

The flag now outlives the ACK, so a reorder timer that fires before the
next ACK can still see it:

rxrpc_rack_timer_expired()
  rxrpc_rack_detect_loss_and_arm_timer()
    rxrpc_rack_update_reo_wnd()

Here cong_in_recovery is true while cong_ca_state says recovery is over.
With !rack_reordering_seen, rack_reo_wnd is set to 0, and a later RTO
uses that value in rxrpc_rack_mark_losses_on_rto().

The reorder path itself can't declare new losses, because acks_nr_snacks
is 0 at exit.

Would clearing cong_in_recovery in resume_normality keep the field
consistent with cong_ca_state and with its comment?

[ ... ]

> diff --git a/net/rxrpc/input_rack.c b/net/rxrpc/input_rack.c
> index 240362109a3b3..473046562b0bd 100644
> --- a/net/rxrpc/input_rack.c
> +++ b/net/rxrpc/input_rack.c

[ ... ]

> @@ -446,3 +447,50 @@ void rxrpc_rack_timer_expired(struct rxrpc_call *call, ktime_t overran_by)
>  		pr_warn("Unexpected rack timer %u", mode);
>  	}
>  }
> +
> +/*
> + * Update the RACK RTO timer after new data is ACK'd.
> + */
> +void rxrpc_update_rack_rto_timer(struct rxrpc_call *call)
> +{
> +	struct rxrpc_txqueue *tq;
> +	ktime_t earliest = KTIME_MAX, rto;
> +
> +	if (!call->tx_in_flight)
> +		return;

[Severity: Medium]
Should the RTO be stopped here when nothing is in flight, instead of
returning with the old deadline still set?

After this early return, rack_timer_mode is still
RXRPC_CALL_RACKTIMER_RTO and rack_timo_at keeps its old value. The new
block in rxrpc_input_call_event() can only arm the RTO or move it later,
so nothing cancels it.

Here is one way to reach this:

1. The RTO is armed when rxrpc_input_call_event() starts, so in_rto is
   true.

2. An ACK hard-ACKs everything that has been transmitted. The last packet
   hasn't been sent yet, so rxrpc_end_tx_phase() isn't called.

3. rxrpc_rotate_tx_window() drops tx_in_flight to 0, and
   RXRPC_CALL_NEW_DATA_ACKED gets set.

4. Nothing new is queued, so no TLP-PTO replaces the RTO, and this
   function returns early.

The timer is still rearmed through set(call->rack_timo_at). When it
fires, rxrpc_rack_timer_expired() calls rxrpc_congestion_timeout():

	set_bit(RXRPC_CALL_RETRANS_TIMEOUT, &call->flags);
	call->cong_ssthresh = umax(call->tx_in_flight / 2, 2);
	call->cong_cwnd = 1;

This sets cwnd to 1 and ssthresh to 2 even though nothing was lost.

RFC 6298 section 5.2, which RFC 8985 uses for the RTO, says to turn off
the retransmission timer once all outstanding data has been acknowledged.

The new arm-on-OFF code also makes this more likely. It now arms an RTO
after RTO-driven resends and after the reorder timer fires, where
previously no timer was set.

[ ... ]

> +	if (earliest != KTIME_MAX) {
> +		rto = ktime_add(earliest, rxrpc_get_rto_backoff(call, false));
> +		if (ktime_after(rto, call->rack_timo_at)) {
> +			call->rack_timer_mode = RXRPC_CALL_RACKTIMER_RTO;
> +			call->rack_timo_at = rto;
> +			trace_rxrpc_rack_timer(call, rto, false);
> +			trace_rxrpc_timer_set(call, rto, rxrpc_timer_trace_rack_rto);

[Severity: Low]
Is rto the right value to pass to these tracepoints?

Here rto is an absolute CLOCK_REALTIME deadline, because earliest comes
from rxrpc_get_xmit_ts(). Storing it in rack_timo_at is correct. However,
trace_rxrpc_rack_timer() and trace_rxrpc_timer_set() take a ktime_t delay
and print it as to=%lld via ktime_to_us().

The other rack_rto trace site added by this patch, in
rxrpc_input_call_event(), passes a relative rto:

		call->rack_timo_at = ktime_add(ktime_get_real(), rto);
		trace_rxrpc_rack_timer(call, rto, false);
		trace_rxrpc_timer_set(call, rto, rxrpc_timer_trace_rack_rto);

Traces from this path will therefore show the wall-clock time since the
epoch in microseconds, not the time left until the RTO fires.

Should a relative delay be passed here, as the other callers do?

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124161302.4044422-1-dhowells%40redhat.com
Technical Details
Message-ID: <179577442266.3135.14941327848364859850@kernel.org>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372643-linux-kernel-netdev=dewy.ru
References: <20261124161302.4044422-11-dhowells@redhat.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372643-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v3 10/10] rxrpc: Fix RACK-TLP implementation
Date: Fri, 27 Nov 2026 10:13:42 +0000
Organization: Usenet Network
Message-ID: <179577442266.3135.14941327848364859850@kernel.org>
References: <20261124161302.4044422-11-dhowells@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="704392"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:W1Hvu3XzIIPnzzxuKbgIEAyccHs= sha256:gT13euJMNqWzX1GvWWQCi4w10diVqoJLcalckkT3+/w=
	sha1:ZOjXWS8I18E2RngpdAgAVpr57f8= sha256:uYcK7q4o1smH65VyxqTIo/35LlfcAqOFAs4SZjYMJ1Q=
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 2550D125F51; Fri, 27 Nov 2026 13:14:54 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.501
X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31
	tests=[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]
	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 zpyvGIFLfkMw;
	Fri, 27 Nov 2026 13:14:50 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-372643-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 4AF20125F50; Fri, 27 Nov 2026 13:14:42 +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 C44803B6BB; Fri, 27 Nov 2026 10:13:58 +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=1795774424;
	b=BtqGuYEHhbG8KZhWRjbglfW6XiUyN7Nd0gcsO3+BBnjdZxn9xzHl6J08DVwGCuhFuytU
	 bqXBC/ZEln4CwtaZ0Ifr8mzZE1Df5Sekrfsdj00kNCaUEF2szR9RX9d6RZnYvjlmbSZdq
	 Mx8Szp5Cw6gaJjjICTIn4hVzlsvosoanGXS0syDRGPZ/sxrdCtaywUmOS5eVn426RFHAE
	 fiT+jfy3YdTaxmUGOsEgHGUpZedafd/iNnPE4WDp+Ggi+M6ie50s1TQrmMvBSZI9SnrIF
	 Hy1GyT0RT/ywSBPvgLdeqCirJekXsIICfFaK6ML2ULzaeq4Yf0zLmEyrQokqxAJ3dDg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795774424;
	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=3j5RK3itpNq34OmIOuVkOe088Cm5IuS4Nvic86ZYVGc=;
	b=vH559lyNQUlwnd5ALJWTVo9De/j72xIOMvcc4JVisBq+qz4XszwcsyWhl6biSsPIP1D9
	 CgHOvI6aIZ1D3c87d/ASOovgrkXAH2l6+YHyEdtmuKZGBFH1g/xC5e8RqpMVoegP9j6LL
	 UDFSYwBj5d+tdu76FpLyx0lmMvT3eN3DEkDbVbNbyYbvl0Uyse5HrZH0p38mgdGURCvmD
	 do0RvbbxZ5TysWe/sWyr3XrKgmlVGFb2J2PvXzpXqCa4VHXrHNVBDfESkUYvj3N27lid0
	 z7Y55IRqoSdM8ZvBpldBggHMjJloKoktWBAv/bnGJj65CpFmVxwO2i1KFBoItmvw4Cw==
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=fL2Knwde;
	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 DA19B606A6BE;
	Fri, 27 Nov 2026 10:13:44 +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=fL2Knwde
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=1795774424;
	b=3dBzxVWkMfr1BhyNTbsqS1aGfHFBUnKUXokgjkjq7GkVBV/8Z4pwdp+XtEb+ybNP5ElF
	 oT2IBfZC/7GQLxxYKiOLlfPdASRQifpIE4pEUcaIBugtPGO3tGUk0LlpNc8Gxfqte6nE9
	 z3lF779bi5eHKBEBKJVnGwA31p6sV6zAleUf0tLkwKIf5RDBk2Z+Ow3fdoPFz/cdNUknm
	 rLYyxooEtkFpXJ707r0N6XembvWL3y0Z372yQuNU8Jun2sWKCi8XN2ihVNfVPOwFu9jS7
	 DdjG/SKdCvpvfnHn3MLT8aUgC+HUv1LA3a4HXL4du72gEMxXt5hm0/by5D+9PVkyPHQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795774424;
	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=3j5RK3itpNq34OmIOuVkOe088Cm5IuS4Nvic86ZYVGc=;
	b=SnN2pNeuHkHAOX/gX46wsh9UOaktgjxl/z2JGnLpWo0YK8HFqoXKqpm6OM0p0VRHrpmE
	 Tx4yiQSnjtPFN91355c45r9Tnk5zfN9TeT5DHfgu8yy6MdBksmYisfDTNXzLpjyvvjCI0
	 14AL7W3TOCI7zskpTDrf7KjUvhafgf+VfhngY+1WocqvbudoUImhOtc/hje1V9+kZ+D9d
	 kpoOrBx9K+xo9PkHKvf0natj6zoTbpqzmOpogCaOsCGSMdDcMYjLVE/RA2YWQk+qiVR6I
	 /8E5JirdNGOjJdCdaPlLRGVuavtCMCu1zYQZK7bDx+5yu50BjnzDfoS6ZwGiCRtTpMg==
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=fL2Knwde;
	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 0683C606A690;
	Fri, 27 Nov 2026 10:13:43 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18D651F0182B;
	Fri, 27 Nov 2026 10:13:43 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795774423;
	bh=3j5RK3itpNq34OmIOuVkOe088Cm5IuS4Nvic86ZYVGc=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=fL2KnwdeqDE7lI+V+1UkJQsGOw3SLbctxv8XK1RREyzRIy4ilv3wnwcFlBDtKgiSB
	 WCsDcrc1o5+r2a/YuBbtisIyW54kBOjHb0Jpwpyg+3cYHPdoDhIYdM+PC4EHhbtknu
	 V4Qbi4TNQ5N5dzzvriGKZ+lbz/D1DbcnPlMWBRxQ5IVhkPUBEm0tJSBnFkY/SvfmsV
	 KdQz4RkIlSKn2XjicMAtSdmD0dPOCWH6UMjVq05QgLrgtANaG4CEUOlBI8gQamWQXb
	 c6N/tcGUyt2WEjWCjF65+xwlM3ZLGQ1t+YWifLa1ijrtguvD27Cy3wprJlLr6ctTNf
	 PagWX2er7GIlw==
X-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
X-In-Reply-To: <20261124161302.4044422-11-dhowells@redhat.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