Correct computation of rx packet resends and data packets sent.
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 11 Jul 2009 00:43:13 +0000 (20:43 -0400)
committerRuss Allbery <rra@stanford.edu>
Sat, 11 Jul 2009 01:47:22 +0000 (19:47 -0600)
rx packet resends were being double counted.

rx data packets sent were one more per send list than it
should have been.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/54
Verified-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Russ Allbery <rra@stanford.edu>

src/rx/rx.c

index fdff269..63ed366 100644 (file)
@@ -5052,7 +5052,7 @@ rxi_SendList(struct rx_call *call, struct rx_packet **list, int len,
     if (resending)
        peer->reSends += len;
     if (rx_stats_active)
-        rx_MutexIncrement(rx_stats.dataPacketsSent, rx_stats_mutex);
+        rx_MutexAdd(rx_stats.dataPacketsSent, len, rx_stats_mutex);
     MUTEX_EXIT(&peer->peer_lock);
 
     if (list[len - 1]->header.flags & RX_LAST_PACKET) {
@@ -5099,14 +5099,6 @@ rxi_SendList(struct rx_call *call, struct rx_packet **list, int len,
            }
        }
 
-       MUTEX_ENTER(&peer->peer_lock);
-       peer->nSent++;
-       if (resending)
-           peer->reSends++;
-        if (rx_stats_active)
-            rx_MutexIncrement(rx_stats.dataPacketsSent, rx_stats_mutex);
-       MUTEX_EXIT(&peer->peer_lock);
-
        /* Tag this packet as not being the last in this group,
         * for the receiver's benefit */
        if (i < len - 1 || moreFlag) {