Skip to content

Commit 2029335

Browse files
committed
rxrpc: Adjust retransmission backoff
jira LE-1907 Rebuild_History Non-Buildable kernel-rt-5.14.0-284.30.1.rt14.315.el9_2 commit-author David Howells <[email protected]> commit 2c13c05 Improve retransmission backoff by only backing off when we retransmit data packets rather than when we set the lost ack timer. To this end: (1) In rxrpc_resend(), use rxrpc_get_rto_backoff() when setting the retransmission timer and only tell it that we are retransmitting if we actually have things to retransmit. Note that it's possible for the retransmission algorithm to race with the processing of a received ACK, so we may see no packets needing retransmission. (2) In rxrpc_send_data_packet(), don't bump the backoff when setting the ack_lost_at timer, as it may then get bumped twice. With this, when looking at one particular packet, the retransmission intervals were seen to be 1.5ms, 2ms, 3ms, 5ms, 9ms, 17ms, 33ms, 71ms, 136ms, 264ms, 544ms, 1.088s, 2.1s, 4.2s and 8.3s. Fixes: c410bf0 ("rxrpc: Fix the excessive initial retransmission timeout") Suggested-by: Marc Dionne <[email protected]> Signed-off-by: David Howells <[email protected]> Reviewed-by: Marc Dionne <[email protected]> Tested-by: Marc Dionne <[email protected]> cc: [email protected] Link: https://lore.kernel.org/r/164138117069.2023386.17446904856843997127.stgit@warthog.procyon.org.uk/ Signed-off-by: David S. Miller <[email protected]> (cherry picked from commit 2c13c05) Signed-off-by: Jonathan Maple <[email protected]>
1 parent d514fd9 commit 2029335

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

net/rxrpc/call_event.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -157,18 +157,16 @@ static void rxrpc_congestion_timeout(struct rxrpc_call *call)
157157
static void rxrpc_resend(struct rxrpc_call *call, unsigned long now_j)
158158
{
159159
struct sk_buff *skb;
160-
unsigned long resend_at, rto_j;
160+
unsigned long resend_at;
161161
rxrpc_seq_t cursor, seq, top;
162162
ktime_t now, max_age, oldest, ack_ts;
163163
int ix;
164164
u8 annotation, anno_type, retrans = 0, unacked = 0;
165165

166166
_enter("{%d,%d}", call->tx_hard_ack, call->tx_top);
167167

168-
rto_j = call->peer->rto_j;
169-
170168
now = ktime_get_real();
171-
max_age = ktime_sub(now, jiffies_to_usecs(rto_j));
169+
max_age = ktime_sub(now, jiffies_to_usecs(call->peer->rto_j));
172170

173171
spin_lock_bh(&call->lock);
174172

@@ -213,7 +211,7 @@ static void rxrpc_resend(struct rxrpc_call *call, unsigned long now_j)
213211
}
214212

215213
resend_at = nsecs_to_jiffies(ktime_to_ns(ktime_sub(now, oldest)));
216-
resend_at += jiffies + rto_j;
214+
resend_at += jiffies + rxrpc_get_rto_backoff(call->peer, retrans);
217215
WRITE_ONCE(call->resend_at, resend_at);
218216

219217
if (unacked)

net/rxrpc/output.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ int rxrpc_send_data_packet(struct rxrpc_call *call, struct sk_buff *skb,
468468
if (call->peer->rtt_count > 1) {
469469
unsigned long nowj = jiffies, ack_lost_at;
470470

471-
ack_lost_at = rxrpc_get_rto_backoff(call->peer, retrans);
471+
ack_lost_at = rxrpc_get_rto_backoff(call->peer, false);
472472
ack_lost_at += nowj;
473473
WRITE_ONCE(call->ack_lost_at, ack_lost_at);
474474
rxrpc_reduce_call_timer(call, ack_lost_at, nowj,

0 commit comments

Comments
 (0)