MCPcopy Create free account
hub / github.com/F-Stack/f-stack / func_test1

Function func_test1

dpdk/app/test/test_pie.c:372–442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370};
371
372static enum test_result func_test1(struct test_config *tcfg)
373{
374 enum test_result result = PASS;
375 uint32_t i = 0;
376
377 printf("%s", tcfg->msg);
378
379 if (test_rte_pie_init(tcfg) != PASS) {
380 result = FAIL;
381 goto out;
382 }
383
384 printf("%s", tcfg->htxt);
385
386 /**
387 * reset rte_pie run-time data
388 */
389 rte_pie_rt_data_init(tcfg->tqueue->pdata_in);
390 rte_pie_set_active(NULL, tcfg->tqueue->pdata_in, 1);
391 *tcfg->tvar->enqueued = 0;
392 *tcfg->tvar->dropped = 0;
393
394 if (increase_qsize(&tcfg->tconfig->pconfig[i],
395 tcfg->tqueue->pdata_in,
396 tcfg->tqueue->qlen,
397 tcfg->tlevel[i],
398 tcfg->tqueue->q_ramp_up) != 0) {
399 fprintf(stderr, "Fail: increase qsize\n");
400 result = FAIL;
401 goto out;
402 }
403
404 for (i = 0; i < RTE_DIM(ft_tlevels); i++) {
405 const char *label = NULL;
406 uint16_t prob = 0;
407 uint16_t active = 0;
408 double drop_rate = 1.0;
409 double drop_prob = 0.0;
410 double diff = 0.0;
411
412 enqueue_dequeue_func(&tcfg->tconfig->pconfig[i],
413 tcfg->tqueue->pdata_in,
414 tcfg->tqueue->qlen,
415 tcfg->tvar->num_ops,
416 tcfg->tvar->enqueued,
417 tcfg->tvar->dropped);
418
419 drop_rate = calc_drop_rate(*tcfg->tvar->enqueued,
420 *tcfg->tvar->dropped);
421 drop_prob = rte_pie_get_drop_prob(NULL, tcfg->tqueue->pdata_in);
422
423 if (drop_prob != 0) {
424 fprintf(stderr, "Fail: check drop prob\n");
425 result = FAIL;
426 }
427
428 if (drop_rate != 0) {
429 fprintf(stderr, "Fail: check drop rate\n");

Callers

nothing calls this directly

Calls 9

test_rte_pie_initFunction · 0.85
rte_pie_rt_data_initFunction · 0.85
rte_pie_set_activeFunction · 0.85
increase_qsizeFunction · 0.85
rte_pie_get_drop_probFunction · 0.85
rte_pie_get_activeFunction · 0.85
enqueue_dequeue_funcFunction · 0.70
calc_drop_rateFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected