Check whether a node has next_node to itself */
| 12 | |
| 13 | /* Check whether a node has next_node to itself */ |
| 14 | static inline int |
| 15 | node_has_loop_edge(struct node *node) |
| 16 | { |
| 17 | rte_edge_t i; |
| 18 | char *name; |
| 19 | int rc = 0; |
| 20 | |
| 21 | for (i = 0; i < node->nb_edges; i++) { |
| 22 | if (strncmp(node->name, node->next_nodes[i], |
| 23 | RTE_NODE_NAMESIZE) == 0) { |
| 24 | name = node->name; |
| 25 | rc = 1; |
| 26 | SET_ERR_JMP(EINVAL, fail, "Node %s has loop to self", |
| 27 | name); |
| 28 | } |
| 29 | } |
| 30 | fail: |
| 31 | return rc; |
| 32 | } |
| 33 | |
| 34 | int |
| 35 | graph_node_has_loop_edge(struct graph *graph) |
no test coverage detected