From 7ca2bb09472302c90be1d686e0f2e90c433d0924 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 30 Sep 2010 10:48:58 -0400 Subject: [PATCH] Rx: When call receive is done, send ack all packet When all of the packets for a call have been received, immediately send an ack all packet to the peer. This permits the peer to free the contents of the transmit queue and cancel all pending resend events. Reviewed-on: http://gerrit.openafs.org/2871 Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit 3cd3715e608b801b4848399e42cb47464e6e3cc3) Change-Id: I782e92935a04ce10b410b67043ea41fee262c1d5 Reviewed-on: http://gerrit.openafs.org/3041 --- src/rx/rx.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/rx/rx.c b/src/rx/rx.c index 68bbb284b..bacea6b88 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -3689,8 +3689,17 @@ rxi_ReceiveDataPacket(struct rx_call *call, * Send an ack when requested by the peer, or once every * rxi_SoftAckRate packets until the last packet has been * received. Always send a soft ack for the last packet in - * the server's reply. */ - if (ackNeeded) { + * the server's reply. + * + * If we have received all of the packets for the call + * immediately send an RX_PACKET_TYPE_ACKALL packet so that + * the peer can empty its packet queue and cancel all resend + * events. + */ + if (call->flags & RX_CALL_RECEIVE_DONE) { + rxevent_Cancel(call->delayedAckEvent, call, RX_CALL_REFCOUNT_DELAY); + rxi_AckAll(NULL, call, 0); + } else if (ackNeeded) { rxevent_Cancel(call->delayedAckEvent, call, RX_CALL_REFCOUNT_DELAY); np = rxi_SendAck(call, np, serial, ackNeeded, istack); } else if (call->nSoftAcks > (u_short) rxi_SoftAckRate) { @@ -3712,8 +3721,6 @@ rxi_ReceiveDataPacket(struct rx_call *call, call->delayedAckEvent = rxevent_PostNow(&when, &now, rxi_SendDelayedAck, call, 0); } - } else if (call->flags & RX_CALL_RECEIVE_DONE) { - rxevent_Cancel(call->delayedAckEvent, call, RX_CALL_REFCOUNT_DELAY); } return np; -- 2.39.5