#pragma warning(disable:181) /* Arg incompatible with format string */
#endif
-#define DIM(x) (sizeof(x)/sizeof(x[0]))
#define TEST_HZ_PER_KHZ 1000
#define TEST_NSEC_MARGIN 500 /**< nanosecond margin when calculating clk freq */
static struct test_rte_red_config ft_tconfig = {
.rconfig = ft_wrconfig,
- .num_cfg = DIM(ft_wrconfig),
+ .num_cfg = RTE_DIM(ft_wrconfig),
.wq_log2 = ft_wq_log2,
.min_th = 32,
.max_th = 128,
static struct test_queue ft_tqueue = {
.rdata = ft_rtdata,
- .num_queues = DIM(ft_rtdata),
+ .num_queues = RTE_DIM(ft_rtdata),
.qconfig = ft_qconfig,
.q = ft_q,
.q_ramp_up = 1000000,
printf("%s", tcfg->htxt);
- for (i = 0; i < DIM(ft1_tlevels); i++) {
+ for (i = 0; i < RTE_DIM(ft1_tlevels); i++) {
const char *label = NULL;
uint32_t avg = 0;
double drop_rate = 0.0;
static struct test_rte_red_config ft2_tconfig = {
.rconfig = ft2_rconfig,
- .num_cfg = DIM(ft2_rconfig),
+ .num_cfg = RTE_DIM(ft2_rconfig),
.wq_log2 = ft2_wq_log2,
.min_th = 32,
.max_th = 128,
static struct test_rte_red_config ft3_tconfig = {
.rconfig = ft_wrconfig,
- .num_cfg = DIM(ft_wrconfig),
+ .num_cfg = RTE_DIM(ft_wrconfig),
.wq_log2 = ft_wq_log2,
.min_th = 32,
.max_th = 1023,
static struct test_rte_red_config ft4_tconfig = {
.rconfig = ft_wrconfig,
- .num_cfg = DIM(ft_wrconfig),
+ .num_cfg = RTE_DIM(ft_wrconfig),
.min_th = 32,
.max_th = 1023,
.wq_log2 = ft4_wq_log2,
static struct test_queue ft4_tqueue = {
.rdata = ft_rtdata,
- .num_queues = DIM(ft_rtdata),
+ .num_queues = RTE_DIM(ft_rtdata),
.qconfig = ft_qconfig,
.q = ft_q,
.q_ramp_up = 1000000,
static struct test_rte_red_config ft5_tconfig = {
.rconfig = ft5_config,
- .num_cfg = DIM(ft5_config),
+ .num_cfg = RTE_DIM(ft5_config),
.min_th = 32,
.max_th = 128,
.wq_log2 = ft5_wq_log2,
static struct test_queue ft5_tqueue = {
.rdata = ft5_data,
- .num_queues = DIM(ft5_data),
+ .num_queues = RTE_DIM(ft5_data),
.qconfig = ft_qconfig,
.q = ft5_q,
.q_ramp_up = 1000000,
static struct test_rte_red_config ft6_tconfig = {
.rconfig = ft6_config,
- .num_cfg = DIM(ft6_config),
+ .num_cfg = RTE_DIM(ft6_config),
.min_th = 32,
.max_th = 1023,
.wq_log2 = ft6_wq_log2,
static struct test_queue ft6_tqueue = {
.rdata = ft6_data,
- .num_queues = DIM(ft6_data),
+ .num_queues = RTE_DIM(ft6_data),
.qconfig = ft_qconfig,
.q = ft6_q,
.q_ramp_up = 1000000,
static struct test_rte_red_config pt_tconfig = {
.rconfig = pt_wrconfig,
- .num_cfg = DIM(pt_wrconfig),
+ .num_cfg = RTE_DIM(pt_wrconfig),
.wq_log2 = pt_wq_log2,
.min_th = 32,
.max_th = 128,
static struct test_queue pt_tqueue = {
.rdata = pt_rtdata,
- .num_queues = DIM(pt_rtdata),
+ .num_queues = RTE_DIM(pt_rtdata),
.qconfig = pt_qconfig,
.q = pt_q,
.q_ramp_up = 1000000,
static struct test_rte_red_config ovfl_tconfig = {
.rconfig = ovfl_wrconfig,
- .num_cfg = DIM(ovfl_wrconfig),
+ .num_cfg = RTE_DIM(ovfl_wrconfig),
.wq_log2 = ovfl_wq_log2,
.min_th = 32,
.max_th = 1023,
static struct test_queue ovfl_tqueue = {
.rdata = ovfl_rtdata,
- .num_queues = DIM(ovfl_rtdata),
+ .num_queues = RTE_DIM(ovfl_rtdata),
.qconfig = ovfl_qconfig,
.q = ovfl_q,
.q_ramp_up = 1000000,
if (test_invalid_parameters() < 0)
return -1;
- run_tests(func_tests, DIM(func_tests), &num_tests, &num_pass);
- run_tests(perf_tests, DIM(perf_tests), &num_tests, &num_pass);
+ run_tests(func_tests, RTE_DIM(func_tests), &num_tests, &num_pass);
+ run_tests(perf_tests, RTE_DIM(perf_tests), &num_tests, &num_pass);
if (num_pass == num_tests) {
printf("[total: %u, pass: %u]\n", num_tests, num_pass);