[PATCH net v3 06/10] rxrpc: Fix lost driving of congestion management retransmission timeout
From: David Howells
Date: Tue Nov 24 2026 - 11:13:55 EST
The implementation of RACK-TLP in AF_RXRPC lost the part that sets
RXRPC_CALL_RETRANS_TIMEOUT when the retransmission timeout expired (and if
there were unacked packets).
Fix this by moving the currently-unused congestion timeout code to its own
function and then calling it from the RTO handling function.
RXRPC_CALL_RETRANS_TIMEOUT is then repurposed to convey that this happened
in the rxrpc_congest tracepoint.
Fixes: 7c482665931b ("rxrpc: Implement RACK/TLP to deal with transmission stalls [RFC8985]")
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261020201258.290827-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
cc: Marc Dionne <marc.dionne@xxxxxxxxxxxx>
cc: Jeffrey Altman <jaltman@xxxxxxxxxxxx>
cc: Eric Dumazet <edumazet@xxxxxxxxxx>
cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
cc: Jakub Kicinski <kuba@xxxxxxxxxx>
cc: Paolo Abeni <pabeni@xxxxxxxxxx>
cc: Simon Horman <horms@xxxxxxxxxx>
cc: linux-afs@xxxxxxxxxxxxxxxxxxx
cc: stable@xxxxxxxxxxxxxxx
---
net/rxrpc/ar-internal.h | 1 +
net/rxrpc/input.c | 27 +++++++++++++++++----------
net/rxrpc/input_rack.c | 2 +-
3 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index d88dd02b6ab5..6e9fc996cd92 100644
--- a/net/rxrpc/ar-internal.h
+++ b/net/rxrpc/ar-internal.h
@@ -1243,6 +1243,7 @@ void rxrpc_unpublish_service_conn(struct rxrpc_connection *);
* input.c
*/
void rxrpc_congestion_degrade(struct rxrpc_call *);
+void rxrpc_congestion_timeout(struct rxrpc_call *call);
void rxrpc_input_call_packet(struct rxrpc_call *, struct sk_buff *);
void rxrpc_implicit_end_call(struct rxrpc_call *, struct sk_buff *);
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
index 9b02e36264aa..63a0feae2081 100644
--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -35,17 +35,8 @@ static void rxrpc_congestion_management(struct rxrpc_call *call,
summary->change = rxrpc_cong_no_change;
summary->in_flight = rxrpc_tx_in_flight(call);
- if (test_and_clear_bit(RXRPC_CALL_RETRANS_TIMEOUT, &call->flags)) {
+ if (test_and_clear_bit(RXRPC_CALL_RETRANS_TIMEOUT, &call->flags))
summary->retrans_timeo = true;
- call->cong_ssthresh = umax(summary->in_flight / 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;
- }
- }
call->cong_cumul_acks += summary->nr_new_sacks;
call->cong_cumul_acks += summary->nr_new_hacks;
@@ -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;
+ }
+}
+
/*
* 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 e5288e5beb59..c652451cc9b5 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;
//case RXRPC_CALL_RACKTIMER_ZEROWIN: