]> git.droids-corp.org - dpdk.git/commitdiff
graph: remove useless duplicate name check
authorHaiyue Wang <haiyue.wang@intel.com>
Mon, 7 Mar 2022 10:25:56 +0000 (18:25 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 7 Mar 2022 19:31:14 +0000 (20:31 +0100)
The node clone API parameter 'name' is the new node's postfix name, not
the final node name, so it makes no sense to check it. And the new name
will be checked duplicate when calling API '__rte_node_register'.

And update the test case to call clone API twice to check the real name
duplicate.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
app/test/test_graph.c
lib/graph/node.c

index 35e1a95b894820791467f73d129529d96ec01f77..1a2d1e6fabc7e8ad4c1a32dd22b16516bb2b4175 100644 (file)
@@ -550,6 +550,12 @@ test_node_clone(void)
        node_id = rte_node_from_name("test_node00");
        tm->test_node[0].idx = node_id;
 
+       dummy_id = rte_node_clone(node_id, "test_node00");
+       if (rte_node_is_invalid(dummy_id)) {
+               printf("Got invalid id when clone, Expecting fail\n");
+               return -1;
+       }
+
        /* Clone with same name, should fail */
        dummy_id = rte_node_clone(node_id, "test_node00");
        if (!rte_node_is_invalid(dummy_id)) {
index 79230035a2ea49fa614b0d2515c40d3df5baacea..ae6eadb260fa506bb7e80f07ef75e9726622d5f1 100644 (file)
@@ -150,10 +150,6 @@ node_clone(struct node *node, const char *name)
                goto fail;
        }
 
-       /* Check for duplicate name */
-       if (node_has_duplicate_entry(name))
-               goto fail;
-
        reg = calloc(1, sizeof(*reg) + (sizeof(char *) * node->nb_edges));
        if (reg == NULL) {
                rte_errno = ENOMEM;