From owner-svn-src-user@FreeBSD.ORG Tue Sep 6 16:37:03 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B56E106564A; Tue, 6 Sep 2011 16:37:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00F9E8FC13; Tue, 6 Sep 2011 16:37:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p86Gb2cr092479; Tue, 6 Sep 2011 16:37:02 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p86Gb20j092476; Tue, 6 Sep 2011 16:37:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109061637.p86Gb20j092476@svn.freebsd.org> From: Adrian Chadd Date: Tue, 6 Sep 2011 16:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225424 - user/adrian/if_ath_tx/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2011 16:37:03 -0000 Author: adrian Date: Tue Sep 6 16:37:02 2011 New Revision: 225424 URL: http://svn.freebsd.org/changeset/base/225424 Log: Convert some packet fields to 64 bit values. Since I can now tx/rx ~ 18,000 pps, the 32 bit counters overflow the percentage calculations in a relatively easily obtained period of time (hours.) So given the likely uptime of some 802.11 links will be measured in days if not weeks, assume it'll overflow in the real world. Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_rate/sample/sample.c user/adrian/if_ath_tx/sys/dev/ath/ath_rate/sample/sample.h Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/ath_rate/sample/sample.c Tue Sep 6 15:12:51 2011 (r225423) +++ user/adrian/if_ath_tx/sys/dev/ath/ath_rate/sample/sample.c Tue Sep 6 16:37:02 2011 (r225424) @@ -1208,15 +1208,15 @@ sample_stats(void *arg, struct ieee80211 for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { if (sn->stats[y][rix].total_packets == 0) continue; - printf("[%2u %s:%4u] %8d:%-8d (%3d%%) (EWMA %3d.%1d%%) T %8d F %4d avg %5u last %u\n", + printf("[%2u %s:%4u] %8ju:%-8ju (%3d%%) (EWMA %3d.%1d%%) T %8ju F %4d avg %5u last %u\n", dot11rate(rt, rix), dot11rate_label(rt, rix), bin_to_size(y), - sn->stats[y][rix].total_packets, - sn->stats[y][rix].packets_acked, - (100*sn->stats[y][rix].packets_acked)/sn->stats[y][rix].total_packets, + (uintmax_t) sn->stats[y][rix].total_packets, + (uintmax_t) sn->stats[y][rix].packets_acked, + (int) ((100*sn->stats[y][rix].packets_acked)/sn->stats[y][rix].total_packets), sn->stats[y][rix].ewma_pct / 10, sn->stats[y][rix].ewma_pct % 10, - sn->stats[y][rix].tries, + (uintmax_t) sn->stats[y][rix].tries, sn->stats[y][rix].successive_failures, sn->stats[y][rix].average_tx_time, ticks - sn->stats[y][rix].last_tx); Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_rate/sample/sample.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/ath_rate/sample/sample.h Tue Sep 6 15:12:51 2011 (r225423) +++ user/adrian/if_ath_tx/sys/dev/ath/ath_rate/sample/sample.h Tue Sep 6 16:37:02 2011 (r225424) @@ -58,9 +58,9 @@ struct sample_softc { struct rate_stats { unsigned average_tx_time; int successive_failures; - int tries; - int total_packets; /* pkts total since assoc */ - int packets_acked; /* pkts acked since assoc */ + uint64_t tries; + uint64_t total_packets; /* pkts total since assoc */ + uint64_t packets_acked; /* pkts acked since assoc */ int ewma_pct; /* EWMA percentage */ unsigned perfect_tx_time; /* transmit time for 0 retries */ int last_tx;