| 211 | } |
| 212 | |
| 213 | uint16_t |
| 214 | test_node0_worker(struct rte_graph *graph, struct rte_node *node, void **objs, |
| 215 | uint16_t nb_objs) |
| 216 | { |
| 217 | test_main_t *tm = &test_main; |
| 218 | |
| 219 | if (*(uint32_t *)node->ctx == test_node0.id) { |
| 220 | uint32_t obj_node0 = rte_rand() % 100, obj_node1; |
| 221 | struct rte_mbuf *data; |
| 222 | uint8_t second_pass = 0; |
| 223 | uint32_t count = 0; |
| 224 | uint32_t i; |
| 225 | |
| 226 | obj_stats[1] += nb_objs; |
| 227 | fn_calls[1] += 1; |
| 228 | |
| 229 | for (i = 0; i < nb_objs; i++) { |
| 230 | data = (struct rte_mbuf *)objs[i]; |
| 231 | if ((*graph_field(data) >> 32) != tm->test_node[0].idx) { |
| 232 | printf("Data idx miss match at node 0, expected" |
| 233 | " = %u got = %u\n", |
| 234 | tm->test_node[0].idx, |
| 235 | (uint32_t)(*graph_field(data) >> 32)); |
| 236 | goto end; |
| 237 | } |
| 238 | |
| 239 | if ((*graph_field(data) & 0xffff) != (i - count)) { |
| 240 | printf("Expected buff count miss match at " |
| 241 | "node 0\n"); |
| 242 | goto end; |
| 243 | } |
| 244 | |
| 245 | if (*graph_field(data) & (0x1 << 16)) |
| 246 | count = i + 1; |
| 247 | if (*graph_field(data) & (0x1 << 17)) |
| 248 | second_pass = 1; |
| 249 | } |
| 250 | |
| 251 | if (count != i) { |
| 252 | printf("Count mismatch at node 0\n"); |
| 253 | goto end; |
| 254 | } |
| 255 | |
| 256 | obj_node0 = nb_objs * obj_node0 * 0.01; |
| 257 | for (i = 0; i < obj_node0; i++) { |
| 258 | data = &mbuf[1][i]; |
| 259 | *graph_field(data) = |
| 260 | ((uint64_t)tm->test_node[1].idx << 32) | i; |
| 261 | if ((i + 1) == obj_node0) |
| 262 | *graph_field(data) |= (1 << 16); |
| 263 | if (second_pass) |
| 264 | *graph_field(data) |= (1 << 17); |
| 265 | } |
| 266 | rte_node_enqueue(graph, node, 0, (void **)&mbuf_p[1][0], |
| 267 | obj_node0); |
| 268 | |
| 269 | obj_node1 = nb_objs - obj_node0; |
| 270 | for (i = 0; i < obj_node1; i++) { |
nothing calls this directly
no test coverage detected