From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 114EEA0577; Mon, 6 Apr 2020 16:09:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 429942B96; Mon, 6 Apr 2020 16:09:19 +0200 (CEST) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by dpdk.org (Postfix) with ESMTP id 7CC96F12 for ; Mon, 6 Apr 2020 16:09:17 +0200 (CEST) Received: by mail-io1-f67.google.com with SMTP id m4so31121ioq.6 for ; Mon, 06 Apr 2020 07:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iBGT64NXA4C0lzugbksMeEFRjGlpEOzbZzq1rUZeCZI=; b=thtrYrjjVei3dzwGu7S98pt7bvUxGDRS+azUbqFWC/TTLXX2Or7UcDVVDVFqwYhmFb gxMxgqgPluPYPyR1Xm0dasyTA25RpMh/PaUBGy2z++BTMCRtHI6bgkJqc29kDLzEAt2H F87DPrHOPpMHZY5C0Jq6m4jLPYWpKRmiJ7+JBFwBRI1XZzT/YYrKrkuytKVXVqg1kL46 nd44KKCqZAL8gZOB0y5QbdJjNgjLgxLaTKDOgsiy5DsaeqjG9/gs7vo5BzkPyLww6e3n tsQkodmMBGlcscSgBosDd2OpY+nzCS7eVQqLulfZZgmxEM6tiwQJ4Wjtf9jYItkXAVGD e2lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iBGT64NXA4C0lzugbksMeEFRjGlpEOzbZzq1rUZeCZI=; b=VhrhODbA5Osw0xAJSLwH1LSQrKtbGAh3qjP6lgE1a4bmc45ieT+QnG1Nqu3lg70eWh 1pSczdYQayPzEPWn3f06O98cGWyxVvU8N41ExtJ8+bGnLn/4eqh1qBN3ZB5yR22a6mId t2W2O7TzzZayQOyKzApruFmsVyH7zM192KMOXw4F8EmwIJ3CP8duB37wlKe1F29cpOvG CN5kieLq0Ye2FpgYVbjv+Od/85nhMMXMNbiWcjdd75NdwjgSf1HhDPaOxS21QdjNE7/3 5Ss6RoNBTIAa0Ue1vShQfwnHq7HpjflM6nYcJxY0IJQY8KHe3b8SNoyBZtOJigiudZ0o KvUA== X-Gm-Message-State: AGi0PubQB+t0wkUmb8917eeK36lS3UKFABwVHAJtbtGIYpHWFXZjVitr Do+u9kAVfpqMrRtTDoki2j4Va3cyB6fQ8ReA4hY= X-Google-Smtp-Source: APiQypKQnn8IP681PYnMlUl4IuNKYfJwGx+quI1d+wXOOWIx8qWbuZeRyegAjuvJOb3IAS3zTymTQ7BOMHox+pa8CnM= X-Received: by 2002:a6b:14d4:: with SMTP id 203mr5030362iou.123.1586182156608; Mon, 06 Apr 2020 07:09:16 -0700 (PDT) MIME-Version: 1.0 References: <20200326165644.866053-1-jerinj@marvell.com> <20200331192945.2466880-1-jerinj@marvell.com> <20200331192945.2466880-6-jerinj@marvell.com> In-Reply-To: From: Jerin Jacob Date: Mon, 6 Apr 2020 19:38:57 +0530 Message-ID: To: "Wang, Xiao W" Cc: "jerinj@marvell.com" , Kiran Kumar K , "dev@dpdk.org" , "thomas@monjalon.net" , "david.marchand@redhat.com" , "mdr@ashroe.eu" , "mattias.ronnblom@ericsson.com" , "pbhagavatula@marvell.com" , "ndabilpuram@marvell.com" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v3 05/29] graph: implement internal graph operation helpers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > > +/* 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.