[dpdk-dev] [PATCH v3 02/29] graph: implement node registration

Wang, Xiao W xiao.w.wang at intel.com
Fri Apr 3 12:44:23 CEST 2020


Hi,

Comments inline.

Best Regards,
Xiao

> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of jerinj at marvell.com
> Sent: Wednesday, April 1, 2020 3:29 AM
> To: Jerin Jacob <jerinj at marvell.com>; Kiran Kumar K
> <kirankumark at marvell.com>
> Cc: dev at dpdk.org; thomas at monjalon.net; david.marchand at redhat.com;
> mdr at ashroe.eu; mattias.ronnblom at ericsson.com;
> pbhagavatula at marvell.com; ndabilpuram at marvell.com
> Subject: [dpdk-dev] [PATCH v3 02/29] graph: implement node registration
> 
> From: Jerin Jacob <jerinj at 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 <jerinj at marvell.com>
> Signed-off-by: Kiran Kumar K <kirankumark at marvell.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula at marvell.com>
> Signed-off-by: Nithin Dabilpuram <ndabilpuram at 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 */



More information about the dev mailing list