Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1488629

[PATCH net-next 9/9] rxrpc: Reduce the number of PING ACKs sent [ver #2]

From David Howells <dhowells@redhat.com>
Newsgroups linux.kernel
Subject [PATCH net-next 9/9] rxrpc: Reduce the number of PING ACKs sent [ver #2]
Date 2016-09-22 10:30 +0200
Message-ID <sk7yi-3Vo-23@gated-at.bofh.it> (permalink)
References <sk7yh-3Vo-3@gated-at.bofh.it>
Organization Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903

Show all headers | View raw


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>
---

 net/rxrpc/call_event.c |    2 +-
 net/rxrpc/input.c      |    7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c
index adb2ec61e21f..6e2ea8f4ae75 100644
--- a/net/rxrpc/call_event.c
+++ b/net/rxrpc/call_event.c
@@ -142,7 +142,7 @@ static void rxrpc_resend(struct rxrpc_call *call)
 	struct rxrpc_skb_priv *sp;
 	struct sk_buff *skb;
 	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;
 	u8 annotation, anno_type;
 
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
index c121949de3c8..cbb5d53f09d7 100644
--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -44,9 +44,12 @@ 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;
 
-	rxrpc_propose_ACK(call, RXRPC_ACK_PING, skew, sp->hdr.serial,
-			  true, true);
+	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);
 }
 
 /*

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 0/9] rxrpc: Preparation for slow-start algorithm  [ver #2] David Howells <dhowells@redhat.com> - 2016-09-22 10:30 +0200
  [PATCH net-next 3/9] rxrpc: Add per-peer RTT tracker [ver #2] David Howells <dhowells@redhat.com> - 2016-09-22 10:30 +0200
  [PATCH net-next 8/9] rxrpc: Reduce the number of ACK-Requests sent  [ver #2] David Howells <dhowells@redhat.com> - 2016-09-22 10:30 +0200
  [PATCH net-next 9/9] rxrpc: Reduce the number of PING ACKs sent  [ver #2] David Howells <dhowells@redhat.com> - 2016-09-22 10:30 +0200
  Re: [PATCH net-next 0/9] rxrpc: Preparation for slow-start  algorithm [ver #2] David Miller <davem@davemloft.net> - 2016-09-22 14:20 +0200

csiph-web