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

Function func_test3

dpdk/app/test/test_red.c:681–759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679};
680
681static enum test_result func_test3(struct test_config *tcfg)
682{
683 enum test_result result = PASS;
684 uint32_t i = 0;
685
686 printf("%s", tcfg->msg);
687
688 if (test_rte_red_init(tcfg) != PASS) {
689 result = FAIL;
690 goto out;
691 }
692
693 rte_red_rt_data_init(tcfg->tqueue->rdata);
694
695 if (increase_actual_qsize(tcfg->tconfig->rconfig,
696 tcfg->tqueue->rdata,
697 tcfg->tqueue->q,
698 *tcfg->tlevel,
699 tcfg->tqueue->q_ramp_up) != 0) {
700 result = FAIL;
701 goto out;
702 }
703
704 if (increase_average_qsize(tcfg->tconfig->rconfig,
705 tcfg->tqueue->rdata,
706 tcfg->tqueue->q,
707 *tcfg->tlevel,
708 tcfg->tqueue->avg_ramp_up) != 0) {
709 result = FAIL;
710 goto out;
711 }
712
713 printf("%s", tcfg->htxt);
714
715 for (i = 0; i < tcfg->tvar->num_iterations; i++) {
716 double avg_before = 0;
717 double avg_after = 0;
718 double exp_avg = 0;
719 double diff = 0.0;
720
721 avg_before = rte_red_get_avg_float(tcfg->tconfig->rconfig, tcfg->tqueue->rdata);
722
723 /**
724 * empty the queue
725 */
726 *tcfg->tqueue->q = 0;
727 rte_red_mark_queue_empty(tcfg->tqueue->rdata, get_port_ts());
728
729 rte_delay_us(tcfg->tvar->wait_usec);
730
731 /**
732 * enqueue one packet to recalculate average queue size
733 */
734 if (rte_red_enqueue(tcfg->tconfig->rconfig,
735 tcfg->tqueue->rdata,
736 *tcfg->tqueue->q,
737 get_port_ts()) == 0) {
738 (*tcfg->tqueue->q)++;

Callers

nothing calls this directly

Calls 11

test_rte_red_initFunction · 0.85
rte_red_rt_data_initFunction · 0.85
increase_actual_qsizeFunction · 0.85
increase_average_qsizeFunction · 0.85
rte_red_get_avg_floatFunction · 0.85
rte_red_mark_queue_emptyFunction · 0.85
rte_red_enqueueFunction · 0.85
calc_exp_avg_on_emptyFunction · 0.85
check_avgFunction · 0.85
get_port_tsFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected