* initialize the test rte_red config */
| 272 | * initialize the test rte_red config |
| 273 | */ |
| 274 | static enum test_result |
| 275 | test_rte_red_init(struct test_config *tcfg) |
| 276 | { |
| 277 | unsigned i = 0; |
| 278 | |
| 279 | tcfg->tvar->clk_freq = rte_get_timer_hz(); |
| 280 | init_port_ts( tcfg->tvar->clk_freq ); |
| 281 | |
| 282 | for (i = 0; i < tcfg->tconfig->num_cfg; i++) { |
| 283 | if (rte_red_config_init(&tcfg->tconfig->rconfig[i], |
| 284 | (uint16_t)tcfg->tconfig->wq_log2[i], |
| 285 | (uint16_t)tcfg->tconfig->min_th, |
| 286 | (uint16_t)tcfg->tconfig->max_th, |
| 287 | (uint16_t)tcfg->tconfig->maxp_inv[i]) != 0) { |
| 288 | return FAIL; |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | *tcfg->tqueue->q = 0; |
| 293 | *tcfg->tvar->dropped = 0; |
| 294 | *tcfg->tvar->enqueued = 0; |
| 295 | return PASS; |
| 296 | } |
| 297 | |
| 298 | /** |
| 299 | * enqueue until actual queue size reaches target level |
no test coverage detected