net: zperf: Fix wrong throughput in long-duration traffic test
The zperf received or sent bytes length and duration are in 32bits, if running long-duration zperf test more than 20min, the value will overflow, and the test result is wrong. Change it to 64bits can fix this issue. Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
This commit is contained in:
parent
e7444dcf42
commit
eda7dd1460
7 changed files with 55 additions and 26 deletions
|
@ -145,9 +145,9 @@ static void udp_received(int sock, const struct sockaddr *addr, uint8_t *data,
|
|||
case STATE_ONGOING:
|
||||
if (id < 0) { /* Negative id means session end. */
|
||||
struct zperf_results results = { 0 };
|
||||
uint32_t duration;
|
||||
uint64_t duration;
|
||||
|
||||
duration = k_ticks_to_us_ceil32(time -
|
||||
duration = k_ticks_to_us_ceil64(time -
|
||||
session->start_time);
|
||||
|
||||
/* Update state machine */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue