From 36ce1b03e4d9a01f7a128b2deabf03b4ace4ecf0 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 (cherry picked from commit 8549ebe0a81ac9a526d13f96ba63e048d8b77aa7) Reviewed-on: http://gerrit.openafs.org/2811 --- 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 b25f19d04..ca436ff4e 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -5281,10 +5281,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; } @@ -5317,8 +5322,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