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

Function func_test5

dpdk/app/test/test_red.c:968–1041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

966};
967
968static enum test_result func_test5(struct test_config *tcfg)
969{
970 enum test_result result = PASS;
971 uint32_t j = 0;
972
973 printf("%s", tcfg->msg);
974
975 if (test_rte_red_init(tcfg) != PASS) {
976 result = FAIL;
977 goto out;
978 }
979
980 printf("%s", tcfg->htxt);
981
982 for (j = 0; j < tcfg->tqueue->num_queues; j++) {
983 rte_red_rt_data_init(&tcfg->tqueue->rdata[j]);
984 tcfg->tqueue->q[j] = 0;
985
986 if (increase_actual_qsize(&tcfg->tconfig->rconfig[tcfg->tqueue->qconfig[j]],
987 &tcfg->tqueue->rdata[j],
988 &tcfg->tqueue->q[j],
989 *tcfg->tlevel,
990 tcfg->tqueue->q_ramp_up) != 0) {
991 result = FAIL;
992 goto out;
993 }
994
995 if (increase_average_qsize(&tcfg->tconfig->rconfig[tcfg->tqueue->qconfig[j]],
996 &tcfg->tqueue->rdata[j],
997 &tcfg->tqueue->q[j],
998 *tcfg->tlevel,
999 tcfg->tqueue->avg_ramp_up) != 0) {
1000 result = FAIL;
1001 goto out;
1002 }
1003 }
1004
1005 for (j = 0; j < tcfg->tqueue->num_queues; j++) {
1006 uint32_t avg = 0;
1007 double drop_rate = 0.0;
1008 double drop_prob = 0.0;
1009 double diff = 0.0;
1010
1011 tcfg->tvar->dropped[j] = 0;
1012 tcfg->tvar->enqueued[j] = 0;
1013
1014 enqueue_dequeue_func(&tcfg->tconfig->rconfig[tcfg->tqueue->qconfig[j]],
1015 &tcfg->tqueue->rdata[j],
1016 &tcfg->tqueue->q[j],
1017 tcfg->tvar->num_ops,
1018 &tcfg->tvar->enqueued[j],
1019 &tcfg->tvar->dropped[j]);
1020
1021 avg = rte_red_get_avg_int(&tcfg->tconfig->rconfig[tcfg->tqueue->qconfig[j]],
1022 &tcfg->tqueue->rdata[j]);
1023 if (avg != *tcfg->tlevel)
1024 result = FAIL;
1025

Callers

nothing calls this directly

Calls 10

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_intFunction · 0.85
calc_drop_probFunction · 0.85
enqueue_dequeue_funcFunction · 0.70
calc_drop_rateFunction · 0.70
check_drop_rateFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected