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: David Howells <dhowells@redhat.com>
This commit is contained in:
David Howells 2016-09-22 00:29:32 +01:00
parent 0d4b103c00
commit fc943f6777
2 changed files with 6 additions and 3 deletions

View File

@ -142,7 +142,7 @@ static void rxrpc_resend(struct rxrpc_call *call)
struct rxrpc_skb_priv *sp; struct rxrpc_skb_priv *sp;
struct sk_buff *skb; struct sk_buff *skb;
rxrpc_seq_t cursor, seq, top; rxrpc_seq_t cursor, seq, top;
ktime_t now = ktime_get_real(), max_age, oldest, resend_at; ktime_t now = ktime_get_real(), max_age, oldest, resend_at;
int ix; int ix;
u8 annotation, anno_type; u8 annotation, anno_type;

View File

@ -44,9 +44,12 @@ static void rxrpc_send_ping(struct rxrpc_call *call, struct sk_buff *skb,
int skew) int skew)
{ {
struct rxrpc_skb_priv *sp = rxrpc_skb(skb); struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
ktime_t now = skb->tstamp;
rxrpc_propose_ACK(call, RXRPC_ACK_PING, skew, sp->hdr.serial, if (call->peer->rtt_usage < 3 ||
true, true); 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);
} }
/* /*