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

Function test_perf_node_worker

dpdk/app/test/test_graph_perf.c:164–218  ·  view source on GitHub ↗

Worker node function */

Source from the content-addressed store, hash-verified

162
163/* Worker node function */
164static uint16_t
165test_perf_node_worker(struct rte_graph *graph, struct rte_node *node,
166 void **objs, uint16_t nb_objs)
167{
168 uint16_t next = 0;
169 uint16_t enq = 0;
170 uint16_t count;
171 int i;
172
173 /* Move stream for single next node */
174 if (node->ctx[0] == 1) {
175 rte_node_next_stream_move(graph, node, node->ctx[1]);
176 return nb_objs;
177 }
178
179 /* Enqueue objects to next nodes proportionally */
180 for (i = 0; i < node->ctx[0]; i++) {
181 next = node->ctx[i + 1];
182 count = (node->ctx[i + 9] * nb_objs) / 100;
183 enq += count;
184 while (count) {
185 switch (count & (4 - 1)) {
186 case 0:
187 rte_node_enqueue_x4(graph, node, next, objs[0],
188 objs[1], objs[2], objs[3]);
189 objs += 4;
190 count -= 4;
191 break;
192 case 1:
193 rte_node_enqueue_x1(graph, node, next, objs[0]);
194 objs += 1;
195 count -= 1;
196 break;
197 case 2:
198 rte_node_enqueue_x2(graph, node, next, objs[0],
199 objs[1]);
200 objs += 2;
201 count -= 2;
202 break;
203 case 3:
204 rte_node_enqueue_x2(graph, node, next, objs[0],
205 objs[1]);
206 rte_node_enqueue_x1(graph, node, next, objs[0]);
207 objs += 3;
208 count -= 3;
209 break;
210 }
211 }
212 }
213
214 if (enq != nb_objs)
215 rte_node_enqueue(graph, node, next, objs, nb_objs - enq);
216
217 return nb_objs;
218}
219
220static struct rte_node_register test_graph_perf_worker = {
221 .name = TEST_GRAPH_WRK_NAME,

Callers

nothing calls this directly

Calls 5

rte_node_enqueue_x4Function · 0.85
rte_node_enqueue_x1Function · 0.85
rte_node_enqueue_x2Function · 0.85
rte_node_enqueueFunction · 0.85

Tested by

no test coverage detected