aboutsummaryrefslogtreecommitdiffstats
path: root/net/rxrpc
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2014-02-14 15:05:32 -0500
committerDavid Howells <dhowells@redhat.com>2014-02-26 12:25:07 -0500
commite8388eb10371745627d1e538e018cb10ded86aa7 (patch)
tree4adf9238ecba8a33d74fdbaf5c1b212b5f5324ad /net/rxrpc
parent817913d8cd7627d9303bce97c3c339ceb0f8e199 (diff)
af_rxrpc: Request an ACK for every alternate DATA packet
Set the RxRPC header flag to request an ACK packet for every odd-numbered DATA packet unless it's the last one (which implicitly requests an ACK anyway). This is similar to how librx appears to work. If we don't do this, we'll send out a full window of packets and then just sit there until the other side gets bored and sends an ACK to indicate that it's been idle for a while and has received no new packets. Requesting a lot of ACKs shouldn't be a problem as ACKs should be merged when possible. As AF_RXRPC currently works, it will schedule an ACK to be generated upon receipt of a DATA packet with the ACK-request packet set - and in the time taken to schedule this in a work queue, several other packets are likely to arrive and then all get ACK'd together. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'net/rxrpc')
-rw-r--r--net/rxrpc/ar-output.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/rxrpc/ar-output.c b/net/rxrpc/ar-output.c
index 4814d882bcb4..0b4b9a79f5ab 100644
--- a/net/rxrpc/ar-output.c
+++ b/net/rxrpc/ar-output.c
@@ -669,6 +669,7 @@ static int rxrpc_send_data(struct kiocb *iocb,
669 /* add the packet to the send queue if it's now full */ 669 /* add the packet to the send queue if it's now full */
670 if (sp->remain <= 0 || (segment == 0 && !more)) { 670 if (sp->remain <= 0 || (segment == 0 && !more)) {
671 struct rxrpc_connection *conn = call->conn; 671 struct rxrpc_connection *conn = call->conn;
672 uint32_t seq;
672 size_t pad; 673 size_t pad;
673 674
674 /* pad out if we're using security */ 675 /* pad out if we're using security */
@@ -681,11 +682,12 @@ static int rxrpc_send_data(struct kiocb *iocb,
681 memset(skb_put(skb, pad), 0, pad); 682 memset(skb_put(skb, pad), 0, pad);
682 } 683 }
683 684
685 seq = atomic_inc_return(&call->sequence);
686
684 sp->hdr.epoch = conn->epoch; 687 sp->hdr.epoch = conn->epoch;
685 sp->hdr.cid = call->cid; 688 sp->hdr.cid = call->cid;
686 sp->hdr.callNumber = call->call_id; 689 sp->hdr.callNumber = call->call_id;
687 sp->hdr.seq = 690 sp->hdr.seq = htonl(seq);
688 htonl(atomic_inc_return(&call->sequence));
689 sp->hdr.serial = 691 sp->hdr.serial =
690 htonl(atomic_inc_return(&conn->serial)); 692 htonl(atomic_inc_return(&conn->serial));
691 sp->hdr.type = RXRPC_PACKET_TYPE_DATA; 693 sp->hdr.type = RXRPC_PACKET_TYPE_DATA;
@@ -700,6 +702,8 @@ static int rxrpc_send_data(struct kiocb *iocb,
700 else if (CIRC_SPACE(call->acks_head, call->acks_tail, 702 else if (CIRC_SPACE(call->acks_head, call->acks_tail,
701 call->acks_winsz) > 1) 703 call->acks_winsz) > 1)
702 sp->hdr.flags |= RXRPC_MORE_PACKETS; 704 sp->hdr.flags |= RXRPC_MORE_PACKETS;
705 if (more && seq & 1)
706 sp->hdr.flags |= RXRPC_REQUEST_ACK;
703 707
704 ret = rxrpc_secure_packet( 708 ret = rxrpc_secure_packet(
705 call, skb, skb->mark, 709 call, skb, skb->mark,