Hi, Comments inline.
Best Regards, Xiao > -----Original Message----- > From: dev <dev-boun...@dpdk.org> On Behalf Of jer...@marvell.com > Sent: Wednesday, April 1, 2020 3:29 AM > To: Jerin Jacob <jer...@marvell.com>; Kiran Kumar K > <kirankum...@marvell.com> > Cc: dev@dpdk.org; tho...@monjalon.net; david.march...@redhat.com; > m...@ashroe.eu; mattias.ronnb...@ericsson.com; > pbhagavat...@marvell.com; ndabilpu...@marvell.com > Subject: [dpdk-dev] [PATCH v3 02/29] graph: implement node registration > > From: Jerin Jacob <jer...@marvell.com> > > Adding rte_node_register() API implementation includes allocating > memory for node object, check for duplicate node name and > add the allocated node to STAILQ node_list for future use. > > Signed-off-by: Jerin Jacob <jer...@marvell.com> > Signed-off-by: Kiran Kumar K <kirankum...@marvell.com> > Signed-off-by: Pavan Nikhilesh <pbhagavat...@marvell.com> > Signed-off-by: Nithin Dabilpuram <ndabilpu...@marvell.com> > --- > lib/librte_graph/Makefile | 1 + > lib/librte_graph/graph.c | 18 +++- > lib/librte_graph/graph_private.h | 75 ++++++++++++++++ > lib/librte_graph/meson.build | 2 +- > lib/librte_graph/node.c | 115 +++++++++++++++++++++++++ > lib/librte_graph/rte_graph_version.map | 4 + > 6 files changed, 213 insertions(+), 2 deletions(-) > create mode 100644 lib/librte_graph/graph_private.h > create mode 100644 lib/librte_graph/node.c > > diff --git a/lib/librte_graph/Makefile b/lib/librte_graph/Makefile > index 26fe514f3..933d0ee49 100644 > --- a/lib/librte_graph/Makefile > +++ b/lib/librte_graph/Makefile > @@ -14,6 +14,7 @@ LDLIBS += -lrte_eal > EXPORT_MAP := rte_graph_version.map > [...] > index 000000000..7999ca6ed > --- /dev/null > +++ b/lib/librte_graph/node.c > @@ -0,0 +1,115 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2020 Marvell International Ltd. > + */ > + > +#include <stdbool.h> > +#include <stdio.h> > +#include <string.h> > + > +#include <rte_common.h> > +#include <rte_debug.h> > +#include <rte_eal.h> > +#include <rte_errno.h> > +#include <rte_string_fns.h> > + > +#include "graph_private.h" > + > +static struct node_head node_list = STAILQ_HEAD_INITIALIZER(node_list); > +static rte_node_t node_id; > + > +#define NODE_ID_CHECK(id) ID_CHECK(id, node_id) It's better to move this MACRO into the next patch since it's first used there, and ID_CHECK is defined there. > + > +/* Private functions */