jwbensley/Etherate

Longer tests overflow end stats

jwbensley opened this issue · 1 comments

ISSUE TYPE
  • Bug Report
  • Enhancement/Feature Request
  • Question
VERSION DETAILS
Etherate version 1.17 2018-04
SUMMARY

When running a longer test, e.g.5 minutes, the average bps/fps counters are overflowing:
Average speed during test: 352123.25Mbps, 709925909Fps

STEPS TO REPRODUCE
sudo taskset -c 2 ./etherate -i ens2f0 -t 3600 -f 48
...
900		392.23		41929		790782		709133369
901		393.10		41976		792540		709925909
^CQuitting...
Test frames transmitted: 710465807
Test frames received: 0
Non test frames received: 16
In order ACK frames received: 0
Out of order ACK frames received early: 0
Out of order ACK frames received late: 0
Maximum speed during test: 393.10Mbps, 792540Fps
Average speed during test: 352123.25Mbps, 709925909Fps
Data transmitted during test: 42008MBs
Leaving promiscuous mode

https://github.com/jwbensley/Etherate/blob/master/speed_tests.c#L435

b_speed_avg is a long doube, change to uint64_t (N.B. b_speed and b_speed_max as double):

Then replace:
eth->speed_test.b_speed_avg += eth->speed_test.b_speed;
with:
eth->speed_test.b_speed_avg += (eth->speed_test.b_tx - eth->speed_test.b_tx_prev)

This needs to have for both Tx and Rx and for all speed test functions.