提交 fc943f67 编写于 作者: D David Howells

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: NDavid Howells <dhowells@redhat.com>
上级 0d4b103c
...@@ -44,7 +44,10 @@ static void rxrpc_send_ping(struct rxrpc_call *call, struct sk_buff *skb, ...@@ -44,7 +44,10 @@ 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;
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, rxrpc_propose_ACK(call, RXRPC_ACK_PING, skew, sp->hdr.serial,
true, true); true, true);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册