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

Function func_test4

dpdk/app/test/test_red.c:808–901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

806};
807
808static enum test_result func_test4(struct test_config *tcfg)
809{
810 enum test_result result = PASS;
811 uint64_t time_diff = 0;
812 uint64_t start = 0;
813 double avg_before = 0.0;
814 double avg_after = 0.0;
815 double exp_avg = 0.0;
816 double diff = 0.0;
817
818 printf("%s", tcfg->msg);
819
820 if (test_rte_red_init(tcfg) != PASS) {
821 result = FAIL;
822 goto out;
823 }
824
825 rte_red_rt_data_init(tcfg->tqueue->rdata);
826
827 if (increase_actual_qsize(tcfg->tconfig->rconfig,
828 tcfg->tqueue->rdata,
829 tcfg->tqueue->q,
830 *tcfg->tlevel,
831 tcfg->tqueue->q_ramp_up) != 0) {
832 result = FAIL;
833 goto out;
834 }
835
836 if (increase_average_qsize(tcfg->tconfig->rconfig,
837 tcfg->tqueue->rdata,
838 tcfg->tqueue->q,
839 *tcfg->tlevel,
840 tcfg->tqueue->avg_ramp_up) != 0) {
841 result = FAIL;
842 goto out;
843 }
844
845 printf("%s", tcfg->htxt);
846
847 avg_before = rte_red_get_avg_float(tcfg->tconfig->rconfig, tcfg->tqueue->rdata);
848
849 /**
850 * empty the queue
851 */
852 *tcfg->tqueue->q = 0;
853 rte_red_mark_queue_empty(tcfg->tqueue->rdata, get_port_ts());
854
855 /**
856 * record empty time locally
857 */
858 start = rte_rdtsc();
859
860 sleep(tcfg->tvar->sleep_sec);
861
862 /**
863 * enqueue one packet to recalculate average queue size
864 */
865 if (rte_red_enqueue(tcfg->tconfig->rconfig,

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
check_avgFunction · 0.85
get_port_tsFunction · 0.70
printfFunction · 0.50
rte_rdtscFunction · 0.50

Tested by

no test coverage detected