[dpdk-dev] [PATCH v3 05/29] graph: implement internal graph operation helpers

Jerin Jacob jerinjacobk at gmail.com
Mon Apr 6 16:08:57 CEST 2020


> > +/* Check whether a node has connected path or parent node */
> > +int
> > +graph_has_isolated_node(struct graph *graph)
> > +{
> > +     struct graph_node *graph_node;
> > +
> > +     graph_mark_nodes_as_not_visited(graph);
> > +
> > +     STAILQ_FOREACH(graph_node, &graph->node_list, next) {
> > +             if (graph_node->node->flags & RTE_NODE_SOURCE_F) {
> > +                     if (graph_node->node->nb_edges == 0)
> > +                             SET_ERR_JMP(EINVAL, fail,
> > +                                         "%s node needs minimum one
> > edge",
> > +                                         graph_node->node->name);
> > +                     if (graph_bfs(graph, graph_node))
> > +                             goto fail;
> > +             }
> > +     }
> > +
> > +     STAILQ_FOREACH(graph_node, &graph->node_list, next)
> > +             if (graph_node->visited == false)
> > +                     SET_ERR_JMP(EINVAL, fail, "Found isolated node %s",
> > +                                 graph_node->node->name);
> > +
> > +     return 0;
> > +fail:
> > +     return 1;
> > +}
>  Do you think we even need to detect loop which is neither self-looping nor looping-to-src,
> or in another word, loop constructed by some intermediate nodes?

We support loop constructed by some intermediate nodes, example use
case would be in the IP in IP packet,
where process the tunnel and send the inner one the backward IP node.


More information about the dev mailing list