rxrpc: Keep the call timeouts as ktimes rather than jiffies

Keep that call timeouts as ktimes rather than jiffies so that they can be
expressed as functions of RTT.

Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
David Howells
2016-09-26 22:12:49 +01:00
parent c31410ea00
commit df0adc788a
8 changed files with 82 additions and 74 deletions

View File

@@ -149,13 +149,13 @@ static void rxrpc_queue_packet(struct rxrpc_call *call, struct sk_buff *skb,
_debug("need instant resend %d", ret);
rxrpc_instant_resend(call, ix);
} else {
unsigned long resend_at;
ktime_t now = ktime_get_real(), resend_at;
resend_at = jiffies + msecs_to_jiffies(rxrpc_resend_timeout);
resend_at = ktime_add_ms(now, rxrpc_resend_timeout);
if (time_before(resend_at, call->resend_at)) {
if (ktime_before(resend_at, call->resend_at)) {
call->resend_at = resend_at;
rxrpc_set_timer(call, rxrpc_timer_set_for_send);
rxrpc_set_timer(call, rxrpc_timer_set_for_send, now);
}
}