From 3cd3715e608b801b4848399e42cb47464e6e3cc3 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. Change-Id: Ic06ccaca6f0c5e2f770c5c45c84f7fc155207bcf Reviewed-on: http://gerrit.openafs.org/2871 Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- 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 a0363b0..aad1009 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -3737,8 +3737,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) { @@ -3762,8 +3771,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; -- 1.9.4