mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
rxrpc: Express protocol timeouts in terms of RTT
Express protocol timeouts for data retransmission and deferred ack generation in terms on RTT rather than specified timeouts once we have sufficient RTT samples. For the moment, this requires just one RTT sample to be able to use this for ack deferral and two for data retransmission. The data retransmission timeout is set at RTT*1.5 and the ACK deferral timeout is set at RTT. Note that the calculated timeout is limited to a minimum of 4ns to make sure it doesn't happen too quickly. Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
parent
8637abaa72
commit
beb8e5e4f3
2 changed files with 25 additions and 4 deletions
|
@ -226,6 +226,13 @@ static void rxrpc_queue_packet(struct rxrpc_sock *rx, struct rxrpc_call *call,
|
|||
} else {
|
||||
unsigned long now = jiffies, resend_at;
|
||||
|
||||
if (call->peer->rtt_usage > 1)
|
||||
resend_at = nsecs_to_jiffies(call->peer->rtt * 3 / 2);
|
||||
else
|
||||
resend_at = rxrpc_resend_timeout;
|
||||
if (resend_at < 1)
|
||||
resend_at = 1;
|
||||
|
||||
resend_at = now + rxrpc_resend_timeout;
|
||||
WRITE_ONCE(call->resend_at, resend_at);
|
||||
rxrpc_reduce_call_timer(call, resend_at, now,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue