Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc943f67 authored by David Howells's avatar David Howells
Browse files

rxrpc: Reduce the number of PING ACKs sent



We don't want to send a PING ACK for every new incoming call as that just
adds to the network traffic.  Instead, we send a PING ACK to the first
three that we receive and then once per second thereafter.

This could probably be made adjustable in future.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 0d4b103c
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -44,7 +44,10 @@ static void rxrpc_send_ping(struct rxrpc_call *call, struct sk_buff *skb,
			    int skew)
{
	struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
	ktime_t now = skb->tstamp;

	if (call->peer->rtt_usage < 3 ||
	    ktime_before(ktime_add_ms(call->peer->rtt_last_req, 1000), now))
		rxrpc_propose_ACK(call, RXRPC_ACK_PING, skew, sp->hdr.serial,
				  true, true);
}
+1 −1

File changed.

Contains only whitespace changes.