From 8549ebe0a81ac9a526d13f96ba63e048d8b77aa7 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sun, 19 Sep 2010 09:03:39 -0700 Subject: [PATCH] Rx: properly compute dataPacketsReSent statistic The global dataPacketsReSent statistic should be the sum of all peer->reSends and dataPacketsSent should not include the count of resent packets. Prior to this patchset, dataPacketsSent included the resent packets and dataPacketsReSent was computed as the number of requests for Ack instead of the number of packets resent. Change-Id: I969003f7ec1805d09c14ac342453f86fdb5df99a Reviewed-on: http://gerrit.openafs.org/2776 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/rx/rx.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/rx/rx.c b/src/rx/rx.c index 62f20b525..f54d5106d 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -5279,10 +5279,15 @@ rxi_SendList(struct rx_call *call, struct rx_packet **list, int len, peer->nSent += len; if (resending) peer->reSends += len; - if (rx_stats_active) - rx_MutexAdd(rx_stats.dataPacketsSent, len, rx_stats_mutex); MUTEX_EXIT(&peer->peer_lock); + if (rx_stats_active) { + if (resending) + rx_MutexAdd(rx_stats.dataPacketsReSent, len, rx_stats_mutex); + else + rx_MutexAdd(rx_stats.dataPacketsSent, len, rx_stats_mutex); + } + if (list[len - 1]->header.flags & RX_LAST_PACKET) { lastPacket = 1; } @@ -5315,8 +5320,6 @@ rxi_SendList(struct rx_call *call, struct rx_packet **list, int len, * packet until the congestion window reaches the ack rate. */ if (list[i]->header.serial) { requestAck = 1; - if (rx_stats_active) - rx_MutexIncrement(rx_stats.dataPacketsReSent, rx_stats_mutex); } else { /* improved RTO calculation- not Karn */ list[i]->firstSent = *now; -- 2.39.5