summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2016-09-24 19:05:27 +0200
committerDavid Howells <dhowells@redhat.com>2016-09-25 00:49:46 +0200
commita7056c5ba67ee6a956b42cf9ff9ba3a6a0bd9794 (patch)
treee4d901ab6e5b3a9954ad55e59d13f3f98c69d1be /net
parentrxrpc: Send an ACK after every few DATA packets we receive (diff)
downloadlinux-a7056c5ba67ee6a956b42cf9ff9ba3a6a0bd9794.tar.xz
linux-a7056c5ba67ee6a956b42cf9ff9ba3a6a0bd9794.zip
rxrpc: Send an immediate ACK if we fill in a hole
Send an immediate ACK if we fill in a hole in the buffer left by an out-of-sequence packet. This may allow the congestion management in the peer to avoid a retransmission if packets got reordered on the wire. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/rxrpc/input.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
index 349698d87ad1..757c16f033a0 100644
--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -331,8 +331,16 @@ next_subpacket:
call->rxtx_annotations[ix] = annotation;
smp_wmb();
call->rxtx_buffer[ix] = skb;
- if (after(seq, call->rx_top))
+ if (after(seq, call->rx_top)) {
smp_store_release(&call->rx_top, seq);
+ } else if (before(seq, call->rx_top)) {
+ /* Send an immediate ACK if we fill in a hole */
+ if (!ack) {
+ ack = RXRPC_ACK_DELAY;
+ ack_serial = serial;
+ }
+ immediate_ack = true;
+ }
if (flags & RXRPC_LAST_PACKET) {
set_bit(RXRPC_CALL_RX_LAST, &call->flags);
trace_rxrpc_receive(call, rxrpc_receive_queue_last, serial, seq);