| 1093 | }; |
| 1094 | |
| 1095 | static enum test_result func_test6(struct test_config *tcfg) |
| 1096 | { |
| 1097 | enum test_result result = PASS; |
| 1098 | uint32_t j = 0; |
| 1099 | |
| 1100 | printf("%s", tcfg->msg); |
| 1101 | if (test_rte_red_init(tcfg) != PASS) { |
| 1102 | result = FAIL; |
| 1103 | goto out; |
| 1104 | } |
| 1105 | printf("%s", tcfg->htxt); |
| 1106 | |
| 1107 | for (j = 0; j < tcfg->tqueue->num_queues; j++) { |
| 1108 | rte_red_rt_data_init(&tcfg->tqueue->rdata[j]); |
| 1109 | tcfg->tqueue->q[j] = 0; |
| 1110 | |
| 1111 | if (increase_actual_qsize(&tcfg->tconfig->rconfig[tcfg->tqueue->qconfig[j]], |
| 1112 | &tcfg->tqueue->rdata[j], |
| 1113 | &tcfg->tqueue->q[j], |
| 1114 | *tcfg->tlevel, |
| 1115 | tcfg->tqueue->q_ramp_up) != 0) { |
| 1116 | result = FAIL; |
| 1117 | goto out; |
| 1118 | } |
| 1119 | if (increase_average_qsize(&tcfg->tconfig->rconfig[tcfg->tqueue->qconfig[j]], |
| 1120 | &tcfg->tqueue->rdata[j], |
| 1121 | &tcfg->tqueue->q[j], |
| 1122 | *tcfg->tlevel, |
| 1123 | tcfg->tqueue->avg_ramp_up) != 0) { |
| 1124 | result = FAIL; |
| 1125 | goto out; |
| 1126 | } |
| 1127 | } |
| 1128 | for (j = 0; j < tcfg->tqueue->num_queues; j++) { |
| 1129 | double avg_before = 0; |
| 1130 | double avg_after = 0; |
| 1131 | double exp_avg = 0; |
| 1132 | double diff = 0.0; |
| 1133 | |
| 1134 | avg_before = rte_red_get_avg_float(&tcfg->tconfig->rconfig[tcfg->tqueue->qconfig[j]], |
| 1135 | &tcfg->tqueue->rdata[j]); |
| 1136 | |
| 1137 | /** |
| 1138 | * empty the queue |
| 1139 | */ |
| 1140 | tcfg->tqueue->q[j] = 0; |
| 1141 | rte_red_mark_queue_empty(&tcfg->tqueue->rdata[j], get_port_ts()); |
| 1142 | rte_delay_us(tcfg->tvar->wait_usec); |
| 1143 | |
| 1144 | /** |
| 1145 | * enqueue one packet to recalculate average queue size |
| 1146 | */ |
| 1147 | if (rte_red_enqueue(&tcfg->tconfig->rconfig[tcfg->tqueue->qconfig[j]], |
| 1148 | &tcfg->tqueue->rdata[j], |
| 1149 | tcfg->tqueue->q[j], |
| 1150 | get_port_ts()) == 0) { |
| 1151 | tcfg->tqueue->q[j]++; |
| 1152 | } else { |
nothing calls this directly
no test coverage detected