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

Function run_test

dpdk/app/test-dma-perf/main.c:105–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105static void
106run_test(uint32_t case_id, struct test_configure *case_cfg)
107{
108 uint32_t i;
109 uint32_t nb_lcores = rte_lcore_count();
110 struct test_configure_entry *mem_size = &case_cfg->mem_size;
111 struct test_configure_entry *buf_size = &case_cfg->buf_size;
112 struct test_configure_entry *ring_size = &case_cfg->ring_size;
113 struct test_configure_entry *kick_batch = &case_cfg->kick_batch;
114 struct test_configure_entry dummy = { 0 };
115 struct test_configure_entry *var_entry = &dummy;
116
117 for (i = 0; i < RTE_DIM(output_str); i++)
118 memset(output_str[i], 0, MAX_OUTPUT_STR_LEN);
119
120 if (nb_lcores <= case_cfg->lcore_dma_map.cnt) {
121 printf("Case %u: Not enough lcores.\n", case_id);
122 return;
123 }
124
125 printf("Number of used lcores: %u.\n", nb_lcores);
126
127 if (mem_size->incr != 0)
128 var_entry = mem_size;
129
130 if (buf_size->incr != 0)
131 var_entry = buf_size;
132
133 if (ring_size->incr != 0)
134 var_entry = ring_size;
135
136 if (kick_batch->incr != 0)
137 var_entry = kick_batch;
138
139 case_cfg->scenario_id = 0;
140
141 output_header(case_id, case_cfg);
142
143 for (var_entry->cur = var_entry->first; var_entry->cur <= var_entry->last;) {
144 case_cfg->scenario_id++;
145 printf("\nRunning scenario %d\n", case_cfg->scenario_id);
146
147 run_test_case(case_cfg);
148 output_csv(false);
149
150 if (var_entry->op == OP_ADD)
151 var_entry->cur += var_entry->incr;
152 else if (var_entry->op == OP_MUL)
153 var_entry->cur *= var_entry->incr;
154 else {
155 printf("No proper operation for variable entry.\n");
156 break;
157 }
158 }
159}
160
161static int
162parse_lcore(struct test_configure *test_case, const char *value)

Callers 1

mainFunction · 0.70

Calls 6

rte_lcore_countFunction · 0.85
memsetFunction · 0.85
output_headerFunction · 0.85
output_csvFunction · 0.85
run_test_caseFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected