| 479 | }; |
| 480 | |
| 481 | static enum test_result func_test2(struct test_config *tcfg) |
| 482 | { |
| 483 | enum test_result result = PASS; |
| 484 | uint32_t i = 0; |
| 485 | |
| 486 | printf("%s", tcfg->msg); |
| 487 | |
| 488 | printf("%s", tcfg->htxt); |
| 489 | |
| 490 | for (i = 0; i < tcfg->tconfig->num_cfg; i++) { |
| 491 | uint32_t avg = 0; |
| 492 | double drop_rate = 0.0; |
| 493 | double drop_prob = 0.0; |
| 494 | double diff = 0.0; |
| 495 | |
| 496 | if (test_rte_pie_init(tcfg) != PASS) { |
| 497 | result = FAIL; |
| 498 | goto out; |
| 499 | } |
| 500 | |
| 501 | rte_pie_rt_data_init(tcfg->tqueue->pdata_in); |
| 502 | rte_pie_set_active(NULL, tcfg->tqueue->pdata_in, 1); |
| 503 | *tcfg->tvar->enqueued = 0; |
| 504 | *tcfg->tvar->dropped = 0; |
| 505 | |
| 506 | if (increase_qsize(&tcfg->tconfig->pconfig[i], |
| 507 | tcfg->tqueue->pdata_in, |
| 508 | tcfg->tqueue->qlen, |
| 509 | *tcfg->tlevel, |
| 510 | tcfg->tqueue->q_ramp_up) != 0) { |
| 511 | result = FAIL; |
| 512 | goto out; |
| 513 | } |
| 514 | |
| 515 | enqueue_dequeue_func(&tcfg->tconfig->pconfig[i], |
| 516 | tcfg->tqueue->pdata_in, |
| 517 | tcfg->tqueue->qlen, |
| 518 | tcfg->tvar->num_ops, |
| 519 | tcfg->tvar->enqueued, |
| 520 | tcfg->tvar->dropped); |
| 521 | |
| 522 | avg = rte_pie_get_avg_dq_time(NULL, tcfg->tqueue->pdata_in); |
| 523 | |
| 524 | drop_rate = calc_drop_rate(*tcfg->tvar->enqueued, |
| 525 | *tcfg->tvar->dropped); |
| 526 | drop_prob = rte_pie_get_drop_prob(NULL, tcfg->tqueue->pdata_in); |
| 527 | |
| 528 | if (!check_drop_rate(&diff, drop_rate, drop_prob, |
| 529 | (double)tcfg->tqueue->drop_tolerance)) { |
| 530 | fprintf(stderr, "Fail: drop rate outside tolerance\n"); |
| 531 | result = FAIL; |
| 532 | } |
| 533 | |
| 534 | printf("%-15u%-15u%-15u%-15u%-15.4lf%-15.4lf%-15.4lf%-15.4lf\n", |
| 535 | i, avg, *tcfg->tvar->enqueued, *tcfg->tvar->dropped, |
| 536 | drop_prob * 100.0, drop_rate * 100.0, diff, |
| 537 | (double)tcfg->tqueue->drop_tolerance); |
| 538 | } |
nothing calls this directly
no test coverage detected