| 455 | }; |
| 456 | |
| 457 | static enum test_result func_test1(struct test_config *tcfg) |
| 458 | { |
| 459 | enum test_result result = PASS; |
| 460 | uint32_t i = 0; |
| 461 | |
| 462 | printf("%s", tcfg->msg); |
| 463 | |
| 464 | if (test_rte_red_init(tcfg) != PASS) { |
| 465 | result = FAIL; |
| 466 | goto out; |
| 467 | } |
| 468 | |
| 469 | printf("%s", tcfg->htxt); |
| 470 | |
| 471 | for (i = 0; i < RTE_DIM(ft1_tlevels); i++) { |
| 472 | const char *label = NULL; |
| 473 | uint32_t avg = 0; |
| 474 | double drop_rate = 0.0; |
| 475 | double drop_prob = 0.0; |
| 476 | double diff = 0.0; |
| 477 | |
| 478 | /** |
| 479 | * reset rte_red run-time data |
| 480 | */ |
| 481 | rte_red_rt_data_init(tcfg->tqueue->rdata); |
| 482 | *tcfg->tvar->enqueued = 0; |
| 483 | *tcfg->tvar->dropped = 0; |
| 484 | |
| 485 | if (increase_actual_qsize(tcfg->tconfig->rconfig, |
| 486 | tcfg->tqueue->rdata, |
| 487 | tcfg->tqueue->q, |
| 488 | tcfg->tlevel[i], |
| 489 | tcfg->tqueue->q_ramp_up) != 0) { |
| 490 | result = FAIL; |
| 491 | goto out; |
| 492 | } |
| 493 | |
| 494 | if (increase_average_qsize(tcfg->tconfig->rconfig, |
| 495 | tcfg->tqueue->rdata, |
| 496 | tcfg->tqueue->q, |
| 497 | tcfg->tlevel[i], |
| 498 | tcfg->tqueue->avg_ramp_up) != 0) { |
| 499 | result = FAIL; |
| 500 | goto out; |
| 501 | } |
| 502 | |
| 503 | enqueue_dequeue_func(tcfg->tconfig->rconfig, |
| 504 | tcfg->tqueue->rdata, |
| 505 | tcfg->tqueue->q, |
| 506 | tcfg->tvar->num_ops, |
| 507 | tcfg->tvar->enqueued, |
| 508 | tcfg->tvar->dropped); |
| 509 | |
| 510 | avg = rte_red_get_avg_int(tcfg->tconfig->rconfig, tcfg->tqueue->rdata); |
| 511 | if (avg != tcfg->tlevel[i]) { |
| 512 | fprintf(stderr, "Fail: avg != level\n"); |
| 513 | result = FAIL; |
| 514 | } |
nothing calls this directly
no test coverage detected