64 bit frame statistics.
This commit is contained in:
parent
d5c2b6f0b2
commit
430b47d574
|
|
@ -310,12 +310,12 @@ void ec_device_send(
|
|||
// 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] =
|
||||
|
|
|
|||
|
|
@ -98,21 +98,19 @@ struct ec_device
|
|||
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. */
|
||||
|
|
|
|||
|
|
@ -162,10 +162,10 @@ typedef struct {
|
|||
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];
|
||||
|
|
|
|||
Loading…
Reference in New Issue