64 bit frame statistics.
authorFlorian Pose <fp@igh-essen.com>
Tue, 09 Mar 2010 12:18:43 +0100
changeset 1863 8ea4a79dfe84
parent 1862 05d224a66270
child 1864 0a6b3aacc847
64 bit frame statistics.
master/device.c
master/device.h
master/ioctl.h
--- a/master/device.c	Tue Mar 09 12:01:29 2010 +0100
+++ b/master/device.c	Tue Mar 09 12:18:43 2010 +0100
@@ -310,12 +310,12 @@
     // frame statistics
     if (unlikely(jiffies - device->stats_jiffies >= HZ)) {
         unsigned int i;
-        unsigned int tx_frame_rate =
-            (device->tx_count - device->last_tx_count) * 1000;
-        unsigned int tx_byte_rate =
+        u32 tx_frame_rate =
+            (u32) (device->tx_count - device->last_tx_count) * 1000;
+        u32 tx_byte_rate =
             (device->tx_bytes - device->last_tx_bytes) * 1000;
-        int loss = device->tx_count - device->rx_count;
-        int loss_rate = (loss - device->last_loss) * 1000;
+        u64 loss = device->tx_count - device->rx_count;
+        s32 loss_rate = (s32) (loss - device->last_loss) * 1000;
         for (i = 0; i < EC_RATE_COUNT; i++) {
             unsigned int n = rate_intervals[i];
             device->tx_frame_rates[i] =
--- a/master/device.h	Tue Mar 09 12:01:29 2010 +0100
+++ b/master/device.h	Tue Mar 09 12:18:43 2010 +0100
@@ -98,21 +98,19 @@
     unsigned long jiffies_poll; /**< jiffies of last poll */
 
     // Frame statistics
-    unsigned int tx_count; /**< Number of frames sent. */
-    unsigned int rx_count; /**< Number of frames received. */
-    unsigned int tx_bytes; /**< Number of frames sent. */
-    unsigned int tx_errors; /**< Number of transmit errors. */
+    u64 tx_count; /**< Number of frames sent. */
+    u64 last_tx_count; /**< Number of frames sent of last statistics cycle. */
+    u64 rx_count; /**< Number of frames received. */
+    u64 tx_bytes; /**< Number of frames sent. */
+    u64 last_tx_bytes; /**< Number of bytes sent of last statistics cycle. */
+    u64 tx_errors; /**< Number of transmit errors. */
+    u64 last_loss; /**< Tx/Rx difference of last statistics cycle. */
     unsigned int tx_frame_rates[EC_RATE_COUNT]; /**< Transmit rates in
                                                   frames/s for different
                                                   statistics cycle periods. */
     unsigned int tx_byte_rates[EC_RATE_COUNT]; /**< Transmit rates in byte/s
                                                  for different statistics
                                                  cycle periods. */
-    unsigned int last_tx_count; /**< Number of frames sent of last statistics
-                                  cycle. */
-    unsigned int last_tx_bytes; /**< Number of bytes sent of last statistics
-                                  cycle. */
-    int last_loss; /**< Tx/Rx difference of last statistics cycle. */
     int loss_rates[EC_RATE_COUNT]; /**< Frame loss rates for different
                                      statistics cycle periods. */
     unsigned long stats_jiffies; /**< Jiffies of last statistic cycle. */
--- a/master/ioctl.h	Tue Mar 09 12:01:29 2010 +0100
+++ b/master/ioctl.h	Tue Mar 09 12:18:43 2010 +0100
@@ -162,10 +162,10 @@
         uint8_t address[6];
         uint8_t attached;
         uint8_t link_state;
-        uint32_t tx_count;
-        uint32_t rx_count;
-        uint32_t tx_bytes;
-        uint32_t tx_errors;
+        uint64_t tx_count;
+        uint64_t rx_count;
+        uint64_t tx_bytes;
+        uint64_t tx_errors;
         uint32_t tx_frame_rates[EC_RATE_COUNT];
         uint32_t tx_byte_rates[EC_RATE_COUNT];
         int32_t loss_rates[EC_RATE_COUNT];