graph: remove useless duplicate name check

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>
This commit is contained in:
Haiyue Wang 2022-03-07 18:25:56 +08:00 committed by Thomas Monjalon
parent 79aab97c94
commit 6eccb0c9ee
2 changed files with 6 additions and 4 deletions

View 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)) {

View 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;