master/device.c
changeset 1863 8ea4a79dfe84
parent 1857 ed8b490b5bc3
child 1907 dd276ae226b4
equal deleted inserted replaced
1862:05d224a66270 1863:8ea4a79dfe84
   308     struct sk_buff *skb = device->tx_skb[device->tx_ring_index];
   308     struct sk_buff *skb = device->tx_skb[device->tx_ring_index];
   309 
   309 
   310     // frame statistics
   310     // frame statistics
   311     if (unlikely(jiffies - device->stats_jiffies >= HZ)) {
   311     if (unlikely(jiffies - device->stats_jiffies >= HZ)) {
   312         unsigned int i;
   312         unsigned int i;
   313         unsigned int tx_frame_rate =
   313         u32 tx_frame_rate =
   314             (device->tx_count - device->last_tx_count) * 1000;
   314             (u32) (device->tx_count - device->last_tx_count) * 1000;
   315         unsigned int tx_byte_rate =
   315         u32 tx_byte_rate =
   316             (device->tx_bytes - device->last_tx_bytes) * 1000;
   316             (device->tx_bytes - device->last_tx_bytes) * 1000;
   317         int loss = device->tx_count - device->rx_count;
   317         u64 loss = device->tx_count - device->rx_count;
   318         int loss_rate = (loss - device->last_loss) * 1000;
   318         s32 loss_rate = (s32) (loss - device->last_loss) * 1000;
   319         for (i = 0; i < EC_RATE_COUNT; i++) {
   319         for (i = 0; i < EC_RATE_COUNT; i++) {
   320             unsigned int n = rate_intervals[i];
   320             unsigned int n = rate_intervals[i];
   321             device->tx_frame_rates[i] =
   321             device->tx_frame_rates[i] =
   322                 (device->tx_frame_rates[i] * (n - 1) + tx_frame_rate) / n;
   322                 (device->tx_frame_rates[i] * (n - 1) + tx_frame_rate) / n;
   323             device->tx_byte_rates[i] =
   323             device->tx_byte_rates[i] =