| 806 | }; |
| 807 | |
| 808 | static enum test_result func_test4(struct test_config *tcfg) |
| 809 | { |
| 810 | enum test_result result = PASS; |
| 811 | uint64_t time_diff = 0; |
| 812 | uint64_t start = 0; |
| 813 | double avg_before = 0.0; |
| 814 | double avg_after = 0.0; |
| 815 | double exp_avg = 0.0; |
| 816 | double diff = 0.0; |
| 817 | |
| 818 | printf("%s", tcfg->msg); |
| 819 | |
| 820 | if (test_rte_red_init(tcfg) != PASS) { |
| 821 | result = FAIL; |
| 822 | goto out; |
| 823 | } |
| 824 | |
| 825 | rte_red_rt_data_init(tcfg->tqueue->rdata); |
| 826 | |
| 827 | if (increase_actual_qsize(tcfg->tconfig->rconfig, |
| 828 | tcfg->tqueue->rdata, |
| 829 | tcfg->tqueue->q, |
| 830 | *tcfg->tlevel, |
| 831 | tcfg->tqueue->q_ramp_up) != 0) { |
| 832 | result = FAIL; |
| 833 | goto out; |
| 834 | } |
| 835 | |
| 836 | if (increase_average_qsize(tcfg->tconfig->rconfig, |
| 837 | tcfg->tqueue->rdata, |
| 838 | tcfg->tqueue->q, |
| 839 | *tcfg->tlevel, |
| 840 | tcfg->tqueue->avg_ramp_up) != 0) { |
| 841 | result = FAIL; |
| 842 | goto out; |
| 843 | } |
| 844 | |
| 845 | printf("%s", tcfg->htxt); |
| 846 | |
| 847 | avg_before = rte_red_get_avg_float(tcfg->tconfig->rconfig, tcfg->tqueue->rdata); |
| 848 | |
| 849 | /** |
| 850 | * empty the queue |
| 851 | */ |
| 852 | *tcfg->tqueue->q = 0; |
| 853 | rte_red_mark_queue_empty(tcfg->tqueue->rdata, get_port_ts()); |
| 854 | |
| 855 | /** |
| 856 | * record empty time locally |
| 857 | */ |
| 858 | start = rte_rdtsc(); |
| 859 | |
| 860 | sleep(tcfg->tvar->sleep_sec); |
| 861 | |
| 862 | /** |
| 863 | * enqueue one packet to recalculate average queue size |
| 864 | */ |
| 865 | if (rte_red_enqueue(tcfg->tconfig->rconfig, |
nothing calls this directly
no test coverage detected