From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E2358A0093; Mon, 7 Mar 2022 13:48:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E644640688; Mon, 7 Mar 2022 13:48:15 +0100 (CET) Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) by mails.dpdk.org (Postfix) with ESMTP id 8BCBF4014E for ; Mon, 7 Mar 2022 13:48:14 +0100 (CET) Received: by mail-il1-f178.google.com with SMTP id b5so8761386ilj.9 for ; Mon, 07 Mar 2022 04:48:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KJP75CvxJoh38epz4yt85OktGVVv9zTawOJTKuEm9f0=; b=hLbI1h3LB9VZL4leLzbzdXsSjB4JjT079VivjS/8CBIBUx5bqWT025fmby3NthOh6P CtU9VSGfDfY8GuGZiwYazEXSG5hGHUvztQCTcaqsRKw4owtTLFzs9kcoOsk9N9dig8aS 8tIigBxGvYrdOMM2BRgJ1sSSxbMv+yNf8SuYZn1kZ67ymYY2kg5YrS18AFaUik53BWKE KtM+S19KU/D0m9MNptgvHs7tszG9jAZXeLcVzy8STX/Fwdonsa9RQW6dNfg5mmAQyZRl /SVjgCciQpBx+8XntX5NMVj/FRrOwlPQm5r1lQbiUnbggZLueeaG0CdQwnBo+orTFRz0 nklA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KJP75CvxJoh38epz4yt85OktGVVv9zTawOJTKuEm9f0=; b=I/UdL7t9lhXywxMLFcanOcRMdgb7LsD9YDpmAJE2T1iXTj4hW+ptQLNFk+t+GHhwxa 9jiIr6c5XAGhPZiP/pZWqSst9ZuHlGDyDAXLlgSliYIWT0pum/iikTaLkkXaQ2xIdHtf b3KAUpgYQee8Wy/iyX5hbpXfwDz48kJrCeZ7m/at+/1v4H+BU3OEwUMSnt4cpq7akEGM ufANZ1W9YqDCvlD7LMX+oujCkhin6j8adJIUGZbfbH+iGSyKKPBwLnkqQip2uQBy8saS crB4A4dfgfnlEhmJ6zmiAvXsbbKYF4Nfr7e+yVRCZkIPiDEIU8yLijOwybxo85OBKF9A sxYQ== X-Gm-Message-State: AOAM530BxybkS7GE7EEHqp0VB41eIv5eUJ/YREhNKWtI3kpM6wXUBYyw YxH4ljGDK/AaZGslYwJai/VaBjrjvq0f98Ps1Hw= X-Google-Smtp-Source: ABdhPJwXWmeVWSCN4spt65UhHh2m9bLk5SqD9mDuOCL5bcdgRhE2+UQsJJ0mxw5nJSA0p11AjeVjSURVc1PO7AQzFGA= X-Received: by 2002:a05:6e02:1c22:b0:2b9:dcbb:e810 with SMTP id m2-20020a056e021c2200b002b9dcbbe810mr10680973ilh.262.1646657293828; Mon, 07 Mar 2022 04:48:13 -0800 (PST) MIME-Version: 1.0 References: <0220307064318.1002855-1-haiyue.wang@intel.com> <20220307102556.1011130-1-haiyue.wang@intel.com> In-Reply-To: <20220307102556.1011130-1-haiyue.wang@intel.com> From: Jerin Jacob Date: Mon, 7 Mar 2022 18:17:47 +0530 Message-ID: Subject: Re: [PATCH v3] graph: remove the useless duplicate name check To: Haiyue Wang Cc: dpdk-dev , Jerin Jacob , Kiran Kumar K , Nithin Dabilpuram Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, Mar 7, 2022 at 4:30 PM Haiyue Wang wrote: > > 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 Acked-by: Jerin Jacob > --- > v3: No need to define another node id var. > v2: update the test case. > --- > app/test/test_graph.c | 6 ++++++ > lib/graph/node.c | 4 ---- > 2 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/app/test/test_graph.c b/app/test/test_graph.c > index 35e1a95b89..1a2d1e6fab 100644 > --- a/app/test/test_graph.c > +++ b/app/test/test_graph.c > @@ -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)) { > diff --git a/lib/graph/node.c b/lib/graph/node.c > index 79230035a2..ae6eadb260 100644 > --- a/lib/graph/node.c > +++ b/lib/graph/node.c > @@ -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; > -- > 2.35.1 >