| 679 | }; |
| 680 | |
| 681 | static enum test_result func_test3(struct test_config *tcfg) |
| 682 | { |
| 683 | enum test_result result = PASS; |
| 684 | uint32_t i = 0; |
| 685 | |
| 686 | printf("%s", tcfg->msg); |
| 687 | |
| 688 | if (test_rte_red_init(tcfg) != PASS) { |
| 689 | result = FAIL; |
| 690 | goto out; |
| 691 | } |
| 692 | |
| 693 | rte_red_rt_data_init(tcfg->tqueue->rdata); |
| 694 | |
| 695 | if (increase_actual_qsize(tcfg->tconfig->rconfig, |
| 696 | tcfg->tqueue->rdata, |
| 697 | tcfg->tqueue->q, |
| 698 | *tcfg->tlevel, |
| 699 | tcfg->tqueue->q_ramp_up) != 0) { |
| 700 | result = FAIL; |
| 701 | goto out; |
| 702 | } |
| 703 | |
| 704 | if (increase_average_qsize(tcfg->tconfig->rconfig, |
| 705 | tcfg->tqueue->rdata, |
| 706 | tcfg->tqueue->q, |
| 707 | *tcfg->tlevel, |
| 708 | tcfg->tqueue->avg_ramp_up) != 0) { |
| 709 | result = FAIL; |
| 710 | goto out; |
| 711 | } |
| 712 | |
| 713 | printf("%s", tcfg->htxt); |
| 714 | |
| 715 | for (i = 0; i < tcfg->tvar->num_iterations; i++) { |
| 716 | double avg_before = 0; |
| 717 | double avg_after = 0; |
| 718 | double exp_avg = 0; |
| 719 | double diff = 0.0; |
| 720 | |
| 721 | avg_before = rte_red_get_avg_float(tcfg->tconfig->rconfig, tcfg->tqueue->rdata); |
| 722 | |
| 723 | /** |
| 724 | * empty the queue |
| 725 | */ |
| 726 | *tcfg->tqueue->q = 0; |
| 727 | rte_red_mark_queue_empty(tcfg->tqueue->rdata, get_port_ts()); |
| 728 | |
| 729 | rte_delay_us(tcfg->tvar->wait_usec); |
| 730 | |
| 731 | /** |
| 732 | * enqueue one packet to recalculate average queue size |
| 733 | */ |
| 734 | if (rte_red_enqueue(tcfg->tconfig->rconfig, |
| 735 | tcfg->tqueue->rdata, |
| 736 | *tcfg->tqueue->q, |
| 737 | get_port_ts()) == 0) { |
| 738 | (*tcfg->tqueue->q)++; |
nothing calls this directly
no test coverage detected