| 166 | RTE_NODE_REGISTER(test_node0); |
| 167 | |
| 168 | uint16_t |
| 169 | test_node_worker_source(struct rte_graph *graph, struct rte_node *node, |
| 170 | void **objs, uint16_t nb_objs) |
| 171 | { |
| 172 | uint32_t obj_node0 = rte_rand() % 100, obj_node1; |
| 173 | test_main_t *tm = &test_main; |
| 174 | struct rte_mbuf *data; |
| 175 | void **next_stream; |
| 176 | rte_node_t next; |
| 177 | uint32_t i; |
| 178 | |
| 179 | RTE_SET_USED(objs); |
| 180 | nb_objs = RTE_GRAPH_BURST_SIZE; |
| 181 | |
| 182 | /* Prepare stream for next node 0 */ |
| 183 | obj_node0 = nb_objs * obj_node0 * 0.01; |
| 184 | next = 0; |
| 185 | next_stream = rte_node_next_stream_get(graph, node, next, obj_node0); |
| 186 | for (i = 0; i < obj_node0; i++) { |
| 187 | data = &mbuf[0][i]; |
| 188 | *graph_field(data) = ((uint64_t)tm->test_node[0].idx << 32) | i; |
| 189 | if ((i + 1) == obj_node0) |
| 190 | *graph_field(data) |= (1 << 16); |
| 191 | next_stream[i] = &mbuf[0][i]; |
| 192 | } |
| 193 | rte_node_next_stream_put(graph, node, next, obj_node0); |
| 194 | |
| 195 | /* Prepare stream for next node 1 */ |
| 196 | obj_node1 = nb_objs - obj_node0; |
| 197 | next = 1; |
| 198 | next_stream = rte_node_next_stream_get(graph, node, next, obj_node1); |
| 199 | for (i = 0; i < obj_node1; i++) { |
| 200 | data = &mbuf[0][obj_node0 + i]; |
| 201 | *graph_field(data) = ((uint64_t)tm->test_node[1].idx << 32) | i; |
| 202 | if ((i + 1) == obj_node1) |
| 203 | *graph_field(data) |= (1 << 16); |
| 204 | next_stream[i] = &mbuf[0][obj_node0 + i]; |
| 205 | } |
| 206 | |
| 207 | rte_node_next_stream_put(graph, node, next, obj_node1); |
| 208 | obj_stats[0] += nb_objs; |
| 209 | fn_calls[0] += 1; |
| 210 | return nb_objs; |
| 211 | } |
| 212 | |
| 213 | uint16_t |
| 214 | test_node0_worker(struct rte_graph *graph, struct rte_node *node, void **objs, |
nothing calls this directly
no test coverage detected