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

Function func_test3

dpdk/app/test/test_pie.c:595–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

593};
594
595static enum test_result func_test3(struct test_config *tcfg)
596{
597 enum test_result result = PASS;
598 uint32_t i = 0;
599
600 printf("%s", tcfg->msg);
601
602 if (test_rte_pie_init(tcfg) != PASS) {
603 result = FAIL;
604 goto out;
605 }
606
607 printf("%s", tcfg->htxt);
608
609 /**
610 * reset rte_pie run-time data
611 */
612 rte_pie_rt_data_init(tcfg->tqueue->pdata_in);
613 rte_pie_set_active(NULL, tcfg->tqueue->pdata_in, 1);
614 *tcfg->tvar->enqueued = 0;
615 *tcfg->tvar->dropped = 0;
616
617 if (increase_qsize(&tcfg->tconfig->pconfig[i],
618 tcfg->tqueue->pdata_in,
619 tcfg->tqueue->qlen,
620 tcfg->tlevel[i],
621 tcfg->tqueue->q_ramp_up) != 0) {
622 fprintf(stderr, "Fail: increase qsize\n");
623 result = FAIL;
624 goto out;
625 }
626
627 for (i = 0; i < RTE_DIM(ft_tlevels); i++) {
628 const char *label = NULL;
629 uint16_t prob = 0;
630 uint16_t active = 0;
631 double drop_rate = 1.0;
632 double drop_prob = 0.0;
633 double diff = 0.0;
634
635 enqueue_dequeue_func(&tcfg->tconfig->pconfig[i],
636 tcfg->tqueue->pdata_in,
637 tcfg->tqueue->qlen,
638 tcfg->tvar->num_ops,
639 tcfg->tvar->enqueued,
640 tcfg->tvar->dropped);
641
642 drop_rate = calc_drop_rate(*tcfg->tvar->enqueued,
643 *tcfg->tvar->dropped);
644 drop_prob = rte_pie_get_drop_prob(NULL, tcfg->tqueue->pdata_in);
645
646 if (drop_prob != 0) {
647 fprintf(stderr, "Fail: check drop prob\n");
648 result = FAIL;
649 }
650
651 if (drop_rate != 0) {
652 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