Skip to content

Commit 4d00b7a

Browse files
author
Dmitry Akhmedzhanov
committed
Made iteration counter uint64 to prevent overflow
Signed-off-by: Dmitry Akhmedzhanov <[email protected]>
1 parent e83e621 commit 4d00b7a

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/perftest_parameters.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555

5656
#include <infiniband/verbs.h>
5757
#include <unistd.h>
58+
#include <inttypes.h>
5859
#if !defined(__FreeBSD__)
5960
#include <malloc.h>
6061
#endif
@@ -206,11 +207,11 @@
206207
#define RESULT_FMT_FS_RATE_DUR " #flows fs_avg_time[usec] fps[flow per sec]"
207208

208209
/* Result print format */
209-
#define REPORT_FMT " %-7lu %-10lu %-7.2lf %-7.2lf %-7.6lf"
210+
#define REPORT_FMT " %-7lu %-10" PRIu64 " %-7.2lf %-7.2lf %-7.6lf"
210211

211-
#define REPORT_FMT_EXT " %-7lu %lu %-7.6lf %-7.6lf %-7.6lf"
212+
#define REPORT_FMT_EXT " %-7lu %" PRIu64 " %-7.6lf %-7.6lf %-7.6lf"
212213

213-
#define REPORT_FMT_PER_PORT " %-7lu %-10lu %-7.2lf %-7.2lf %-7.6lf %-7.2lf %-7.6lf %-7.2lf %-7.6lf"
214+
#define REPORT_FMT_PER_PORT " %-7lu %-10" PRIu64 " %-7.2lf %-7.2lf %-7.6lf %-7.2lf %-7.6lf %-7.2lf %-7.6lf"
214215

215216
#define REPORT_EXT "\n"
216217

@@ -219,12 +220,12 @@
219220
#define REPORT_FMT_QOS " %-7lu %d %lu %-7.2lf %-7.2lf %-7.6lf\n"
220221

221222
/* Result print format for latency tests. */
222-
#define REPORT_FMT_LAT " %-7lu %d %-7.2f %-7.2f %-7.2f %-7.2f %-7.2f %-7.2f %-7.2f"
223-
#define REPORT_FMT_LAT_DUR " %-7lu %d %-7.2f %-7.2f"
223+
#define REPORT_FMT_LAT " %-7lu %" PRIu64 " %-7.2f %-7.2f %-7.2f %-7.2f %-7.2f %-7.2f %-7.2f"
224+
#define REPORT_FMT_LAT_DUR " %-7lu %" PRIu64 " %-7.2f %-7.2f"
224225

225-
#define REPORT_FMT_FS_RATE " %d %-7.2f %-7.2f %-7.2f %-7.2f %-7.2f"
226+
#define REPORT_FMT_FS_RATE "%" PRIu64 " %-7.2f %-7.2f %-7.2f %-7.2f %-7.2f"
226227

227-
#define REPORT_FMT_FS_RATE_DUR " %d %-7.2f %-7.2f"
228+
#define REPORT_FMT_FS_RATE_DUR "%" PRIu64 " %-7.2f %-7.2f"
228229

229230
#define CHECK_VALUE(arg,type,minv,maxv,name) \
230231
{ arg = (type)strtol(optarg, NULL, 0); if ((arg < minv) || (arg > maxv)) \
@@ -366,7 +367,7 @@ struct perftest_parameters {
366367
uint64_t size;
367368
int req_size;
368369
uint64_t dct_key;
369-
int iters;
370+
uint64_t iters;
370371
uint64_t iters_per_port[2];
371372
uint64_t *port_by_qp;
372373
int tx_depth;

0 commit comments

Comments
 (0)