get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/67828/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 67828,
    "url": "http://patches.dpdk.org/api/patches/67828/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200405085613.1336841-7-jerinj@marvell.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20200405085613.1336841-7-jerinj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200405085613.1336841-7-jerinj@marvell.com",
    "date": "2020-04-05T08:55:50",
    "name": "[v4,06/29] graph: populate fastpath memory for graph reel",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "71d96883b0d7279038f67bfe1f7bea810601a759",
    "submitter": {
        "id": 1188,
        "url": "http://patches.dpdk.org/api/people/1188/?format=api",
        "name": "Jerin Jacob Kollanukkaran",
        "email": "jerinj@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200405085613.1336841-7-jerinj@marvell.com/mbox/",
    "series": [
        {
            "id": 9203,
            "url": "http://patches.dpdk.org/api/series/9203/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=9203",
            "date": "2020-04-05T08:55:44",
            "name": "graph: introduce graph subsystem",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/9203/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/67828/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/67828/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 696E2A0577;\n\tSun,  5 Apr 2020 10:57:28 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0B0FC1BFA3;\n\tSun,  5 Apr 2020 10:56:34 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 754C91BF60\n for <dev@dpdk.org>; Sun,  5 Apr 2020 10:56:31 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n 0358uSde029753; Sun, 5 Apr 2020 01:56:29 -0700",
            "from sc-exch03.marvell.com ([199.233.58.183])\n by mx0a-0016f401.pphosted.com with ESMTP id 306qkqtmq0-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Sun, 05 Apr 2020 01:56:29 -0700",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH03.marvell.com\n (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Sun, 5 Apr 2020 01:56:27 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Sun, 5 Apr 2020 01:56:28 -0700",
            "from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14])\n by maili.marvell.com (Postfix) with ESMTP id CC6F73F703F;\n Sun,  5 Apr 2020 01:56:24 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0818;\n bh=if4RxXXHrWer/6wRUkixjhNV08/WZIloUoKIl0PXAvo=;\n b=iZkmyEZJ2ft2Olz7BTRQuzx9XJNYrqD5JzZZfVjC0c7QbbHImiNkSCP3sDntxemk+CJk\n 0f1enQZ3vs0Cm0u1xK7+QI8JO0ZoDtXJ74riXV4rBpx+ME6wfHOA2ukgbSe8lgB5WPGg\n BRJkUHj4cfA8J/JkljQ8pWyl5/P7a9OA0p/GksJ8uSQVa6kjwnA1S5e1FPkLoXjHg5Ox\n qfpSYz5UVqXBsIcPJVlk7RZcAmIjobJY9Qspt20CpbdDY3JUSDXNJ/yUwozgsvsuFc6g\n B63G9puQ3WQhGkhosUN7JqGQnmQvCCnageeedeP1dUe2L0mKQRDEnoeLcAjfGgxVvYbg kw==",
        "From": "<jerinj@marvell.com>",
        "To": "Jerin Jacob <jerinj@marvell.com>, Kiran Kumar K <kirankumark@marvell.com>",
        "CC": "<dev@dpdk.org>, <thomas@monjalon.net>, <david.marchand@redhat.com>,\n <mdr@ashroe.eu>, <mattias.ronnblom@ericsson.com>,\n <pbhagavatula@marvell.com>, <ndabilpuram@marvell.com>,\n <xiao.w.wang@intel.com>",
        "Date": "Sun, 5 Apr 2020 14:25:50 +0530",
        "Message-ID": "<20200405085613.1336841-7-jerinj@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20200405085613.1336841-1-jerinj@marvell.com>",
        "References": "<20200331192945.2466880-1-jerinj@marvell.com>\n <20200405085613.1336841-1-jerinj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676\n definitions=2020-04-05_01:2020-04-03,\n 2020-04-05 signatures=0",
        "Subject": "[dpdk-dev] [PATCH v4 06/29] graph: populate fastpath memory for\n\tgraph reel",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Jerin Jacob <jerinj@marvell.com>\n\nAdding support to create and populate the memory for graph reel.\nThis includes reserving the memory in the memzone, populating the nodes,\nAllocating memory for node-specific streams to hold objects.\n\nOnce it is populated the reel memory contains the following sections.\n\n+---------------------+\n|   Graph Header      |\n+---------------------+\n|   Fence             |\n+---------------------+\n|   Circular buffer   |\n+---------------------+\n|   Fence             |\n+---------------------+\n|   Node Object 0     |\n+------------------- -+\n|   Node Object 1     |\n+------------------- -+\n|   Node Object 2     |\n+------------------- -+\n|   Node Object n     |\n+------------------- -+\n\nSigned-off-by: Jerin Jacob <jerinj@marvell.com>\nSigned-off-by: Kiran Kumar K <kirankumark@marvell.com>\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\nSigned-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>\n---\n lib/librte_graph/Makefile              |   2 +\n lib/librte_graph/graph.c               |  16 ++\n lib/librte_graph/graph_populate.c      | 234 +++++++++++++++++++++++++\n lib/librte_graph/graph_private.h       |  64 +++++++\n lib/librte_graph/meson.build           |   4 +-\n lib/librte_graph/node.c                |   5 +\n lib/librte_graph/rte_graph_version.map |   1 +\n lib/librte_graph/rte_graph_worker.h    | 108 ++++++++++++\n 8 files changed, 432 insertions(+), 2 deletions(-)\n create mode 100644 lib/librte_graph/graph_populate.c\n create mode 100644 lib/librte_graph/rte_graph_worker.h",
    "diff": "diff --git a/lib/librte_graph/Makefile b/lib/librte_graph/Makefile\nindex 39ecb2652..7bfd7d51f 100644\n--- a/lib/librte_graph/Makefile\n+++ b/lib/librte_graph/Makefile\n@@ -18,8 +18,10 @@ SRCS-$(CONFIG_RTE_LIBRTE_GRAPH) += node.c\n SRCS-$(CONFIG_RTE_LIBRTE_GRAPH) += graph.c\n SRCS-$(CONFIG_RTE_LIBRTE_GRAPH) += graph_ops.c\n SRCS-$(CONFIG_RTE_LIBRTE_GRAPH) += graph_debug.c\n+SRCS-$(CONFIG_RTE_LIBRTE_GRAPH) += graph_populate.c\n \n # install header files\n SYMLINK-$(CONFIG_RTE_LIBRTE_GRAPH)-include += rte_graph.h\n+SYMLINK-$(CONFIG_RTE_LIBRTE_GRAPH)-include += rte_graph_worker.h\n \n include $(RTE_SDK)/mk/rte.lib.mk\ndiff --git a/lib/librte_graph/graph.c b/lib/librte_graph/graph.c\nindex 4c3f2fe7b..e1930b7d2 100644\n--- a/lib/librte_graph/graph.c\n+++ b/lib/librte_graph/graph.c\n@@ -2,6 +2,7 @@\n  * Copyright(C) 2020 Marvell International Ltd.\n  */\n \n+#include <rte_malloc.h>\n #include <rte_spinlock.h>\n \n #include \"graph_private.h\"\n@@ -19,3 +20,18 @@ graph_spinlock_unlock(void)\n {\n \trte_spinlock_unlock(&graph_lock);\n }\n+\n+void __rte_noinline\n+__rte_node_stream_alloc(struct rte_graph *graph, struct rte_node *node)\n+{\n+\tuint16_t size = node->size;\n+\n+\tRTE_VERIFY(size != UINT16_MAX);\n+\t/* Allocate double amount of size to avoid immediate realloc */\n+\tsize = RTE_MIN(UINT16_MAX, RTE_MAX(RTE_GRAPH_BURST_SIZE, size * 2));\n+\tnode->objs = rte_realloc_socket(node->objs, size * sizeof(void *),\n+\t\t\t\t\tRTE_CACHE_LINE_SIZE, graph->socket);\n+\tRTE_VERIFY(node->objs);\n+\tnode->size = size;\n+\tnode->realloc_count++;\n+}\ndiff --git a/lib/librte_graph/graph_populate.c b/lib/librte_graph/graph_populate.c\nnew file mode 100644\nindex 000000000..093512efa\n--- /dev/null\n+++ b/lib/librte_graph/graph_populate.c\n@@ -0,0 +1,234 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#include <fnmatch.h>\n+#include <stdbool.h>\n+\n+#include <rte_common.h>\n+#include <rte_errno.h>\n+#include <rte_malloc.h>\n+#include <rte_memzone.h>\n+\n+#include \"graph_private.h\"\n+\n+static size_t\n+graph_fp_mem_calc_size(struct graph *graph)\n+{\n+\tstruct graph_node *graph_node;\n+\trte_node_t val;\n+\tsize_t sz;\n+\n+\t/* Graph header */\n+\tsz = sizeof(struct rte_graph);\n+\t/* Source nodes list */\n+\tsz += sizeof(rte_graph_off_t) * graph->src_node_count;\n+\t/* Circular buffer for pending streams of size number of nodes */\n+\tval = rte_align32pow2(graph->node_count * sizeof(rte_graph_off_t));\n+\tsz = RTE_ALIGN(sz, val);\n+\tgraph->cir_start = sz;\n+\tgraph->cir_mask = rte_align32pow2(graph->node_count) - 1;\n+\tsz += val;\n+\t/* Fence */\n+\tsz += sizeof(RTE_GRAPH_FENCE);\n+\tsz = RTE_ALIGN(sz, RTE_CACHE_LINE_SIZE);\n+\tgraph->nodes_start = sz;\n+\t/* For 0..N node objects with fence */\n+\tSTAILQ_FOREACH(graph_node, &graph->node_list, next) {\n+\t\tsz = RTE_ALIGN(sz, RTE_CACHE_LINE_SIZE);\n+\t\tsz += sizeof(struct rte_node);\n+\t\t/* Pointer to next nodes(edges) */\n+\t\tsz += sizeof(struct rte_node *) * graph_node->node->nb_edges;\n+\t}\n+\n+\tgraph->mem_sz = sz;\n+\treturn sz;\n+}\n+\n+static void\n+graph_header_popluate(struct graph *_graph)\n+{\n+\tstruct rte_graph *graph = _graph->graph;\n+\n+\tgraph->tail = 0;\n+\tgraph->head = (int32_t)-_graph->src_node_count;\n+\tgraph->cir_mask = _graph->cir_mask;\n+\tgraph->nb_nodes = _graph->node_count;\n+\tgraph->cir_start = RTE_PTR_ADD(graph, _graph->cir_start);\n+\tgraph->nodes_start = _graph->nodes_start;\n+\tgraph->socket = _graph->socket;\n+\tgraph->id = _graph->id;\n+\tmemcpy(graph->name, _graph->name, RTE_GRAPH_NAMESIZE);\n+\tgraph->fence = RTE_GRAPH_FENCE;\n+}\n+\n+static void\n+graph_nodes_populate(struct graph *_graph)\n+{\n+\trte_graph_off_t off = _graph->nodes_start;\n+\tstruct rte_graph *graph = _graph->graph;\n+\tstruct graph_node *graph_node;\n+\trte_edge_t count, nb_edges;\n+\tconst char *parent;\n+\trte_node_t pid;\n+\n+\tSTAILQ_FOREACH(graph_node, &_graph->node_list, next) {\n+\t\tstruct rte_node *node = RTE_PTR_ADD(graph, off);\n+\t\tmemset(node, 0, sizeof(*node));\n+\t\tnode->fence = RTE_GRAPH_FENCE;\n+\t\tnode->off = off;\n+\t\tnode->process = graph_node->node->process;\n+\t\tmemcpy(node->name, graph_node->node->name, RTE_GRAPH_NAMESIZE);\n+\t\tpid = graph_node->node->parent_id;\n+\t\tif (pid != RTE_NODE_ID_INVALID) { /* Cloned node */\n+\t\t\tparent = rte_node_id_to_name(pid);\n+\t\t\tmemcpy(node->parent, parent, RTE_GRAPH_NAMESIZE);\n+\t\t}\n+\t\tnode->id = graph_node->node->id;\n+\t\tnode->parent_id = pid;\n+\t\tnb_edges = graph_node->node->nb_edges;\n+\t\tnode->nb_edges = nb_edges;\n+\t\toff += sizeof(struct rte_node);\n+\t\t/* Copy the name in first pass to replace with rte_node* later*/\n+\t\tfor (count = 0; count < nb_edges; count++)\n+\t\t\tnode->nodes[count] = (struct rte_node *)&graph_node\n+\t\t\t\t\t\t     ->adjacency_list[count]\n+\t\t\t\t\t\t     ->node->name[0];\n+\n+\t\toff += sizeof(struct rte_node *) * nb_edges;\n+\t\toff = RTE_ALIGN(off, RTE_CACHE_LINE_SIZE);\n+\t\tnode->next = off;\n+\t\t__rte_node_stream_alloc(graph, node);\n+\t}\n+}\n+\n+struct rte_node *\n+graph_node_id_to_ptr(const struct rte_graph *graph, rte_node_t id)\n+{\n+\trte_node_t count;\n+\trte_graph_off_t off;\n+\tstruct rte_node *node;\n+\n+\trte_graph_foreach_node(count, off, graph, node)\n+\t\tif (unlikely(node->id == id))\n+\t\t\treturn node;\n+\n+\treturn NULL;\n+}\n+\n+struct rte_node *\n+graph_node_name_to_ptr(const struct rte_graph *graph, const char *name)\n+{\n+\trte_node_t count;\n+\trte_graph_off_t off;\n+\tstruct rte_node *node;\n+\n+\trte_graph_foreach_node(count, off, graph, node)\n+\t\tif (strncmp(name, node->name, RTE_NODE_NAMESIZE) == 0)\n+\t\t\treturn node;\n+\n+\treturn NULL;\n+}\n+\n+static int\n+graph_node_nexts_populate(struct graph *_graph)\n+{\n+\trte_node_t count, val;\n+\trte_graph_off_t off;\n+\tstruct rte_node *node;\n+\tconst struct rte_graph *graph = _graph->graph;\n+\tconst char *name;\n+\n+\trte_graph_foreach_node(count, off, graph, node) {\n+\t\tfor (val = 0; val < node->nb_edges; val++) {\n+\t\t\tname = (const char *)node->nodes[val];\n+\t\t\tnode->nodes[val] = graph_node_name_to_ptr(graph, name);\n+\t\t\tif (node->nodes[val] == NULL)\n+\t\t\t\tSET_ERR_JMP(EINVAL, fail, \"%s not found\", name);\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+static int\n+graph_src_nodes_populate(struct graph *_graph)\n+{\n+\tstruct rte_graph *graph = _graph->graph;\n+\tstruct graph_node *graph_node;\n+\tstruct rte_node *node;\n+\tint32_t head = -1;\n+\tconst char *name;\n+\n+\tSTAILQ_FOREACH(graph_node, &_graph->node_list, next) {\n+\t\tif (graph_node->node->flags & RTE_NODE_SOURCE_F) {\n+\t\t\tname = graph_node->node->name;\n+\t\t\tnode = graph_node_name_to_ptr(graph, name);\n+\t\t\tif (node == NULL)\n+\t\t\t\tSET_ERR_JMP(EINVAL, fail, \"%s not found\", name);\n+\n+\t\t\t__rte_node_stream_alloc(graph, node);\n+\t\t\tgraph->cir_start[head--] = node->off;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+static int\n+graph_fp_mem_populate(struct graph *graph)\n+{\n+\tint rc;\n+\n+\tgraph_header_popluate(graph);\n+\tgraph_nodes_populate(graph);\n+\trc = graph_node_nexts_populate(graph);\n+\trc |= graph_src_nodes_populate(graph);\n+\n+\treturn rc;\n+}\n+\n+int\n+graph_fp_mem_create(struct graph *graph)\n+{\n+\tconst struct rte_memzone *mz;\n+\tsize_t sz;\n+\n+\tsz = graph_fp_mem_calc_size(graph);\n+\tmz = rte_memzone_reserve(graph->name, sz, graph->socket, 0);\n+\tif (mz == NULL)\n+\t\tSET_ERR_JMP(ENOMEM, fail, \"Memzone %s reserve failed\",\n+\t\t\t    graph->name);\n+\n+\tgraph->graph = mz->addr;\n+\tgraph->mz = mz;\n+\n+\treturn graph_fp_mem_populate(graph);\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+static void\n+graph_nodes_mem_destroy(struct rte_graph *graph)\n+{\n+\trte_node_t count;\n+\trte_graph_off_t off;\n+\tstruct rte_node *node;\n+\n+\tif (graph == NULL)\n+\t\treturn;\n+\n+\trte_graph_foreach_node(count, off, graph, node)\n+\t\trte_free(node->objs);\n+}\n+\n+int\n+graph_fp_mem_destroy(struct graph *graph)\n+{\n+\tgraph_nodes_mem_destroy(graph->graph);\n+\treturn rte_memzone_free(graph->mz);\n+}\ndiff --git a/lib/librte_graph/graph_private.h b/lib/librte_graph/graph_private.h\nindex 220a35e2a..7fce52e00 100644\n--- a/lib/librte_graph/graph_private.h\n+++ b/lib/librte_graph/graph_private.h\n@@ -12,6 +12,7 @@\n #include <rte_eal.h>\n \n #include \"rte_graph.h\"\n+#include \"rte_graph_worker.h\"\n \n extern int rte_graph_logtype;\n \n@@ -254,6 +255,69 @@ rte_node_t graph_nodes_count(struct graph *graph);\n  */\n void graph_mark_nodes_as_not_visited(struct graph *graph);\n \n+/* Fast path graph memory populate unctions */\n+\n+/**\n+ * @internal\n+ *\n+ * Create fast-path memory for the graph and nodes.\n+ *\n+ * @param graph\n+ *   Pointer to the internal graph object.\n+ *\n+ * @return\n+ *   - 0: Success.\n+ *   - -ENOMEM: Not enough for graph and nodes.\n+ *   - -EINVAL: Graph nodes not found.\n+ */\n+int graph_fp_mem_create(struct graph *graph);\n+\n+/**\n+ * @internal\n+ *\n+ * Free fast-path memory used by graph and nodes.\n+ *\n+ * @param graph\n+ *   Pointer to the internal graph object.\n+ *\n+ * @return\n+ *   - 0: Success.\n+ *   - <0: Graph memzone related error.\n+ */\n+int graph_fp_mem_destroy(struct graph *graph);\n+\n+/* Lookup functions */\n+/**\n+ * @internal\n+ *\n+ * Get graph node object from node id.\n+ *\n+ * @param graph\n+ *   Pointer to rte_graph object.\n+ * @param id\n+ *   Node Identifier.\n+ *\n+ * @return\n+ *   Pointer to rte_node if identifier is valid else NULL.\n+ */\n+struct rte_node *graph_node_id_to_ptr(const struct rte_graph *graph,\n+\t\t\t\t      rte_node_t id);\n+\n+/**\n+ * @internal\n+ *\n+ * Get graph node object from node name.\n+ *\n+ * @param graph\n+ *   Pointer to rte_graph object.\n+ * @param node_name\n+ *   Pointer to character string holding the node name.\n+ *\n+ * @return\n+ *   Pointer to rte_node if identifier is valid else NULL.\n+ */\n+struct rte_node *graph_node_name_to_ptr(const struct rte_graph *graph,\n+\t\t\t\t\tconst char *node_name);\n \n /**\n  * @internal\ndiff --git a/lib/librte_graph/meson.build b/lib/librte_graph/meson.build\nindex 16e0625c1..fb203a5e2 100644\n--- a/lib/librte_graph/meson.build\n+++ b/lib/librte_graph/meson.build\n@@ -4,8 +4,8 @@\n \n name = 'graph'\n \n-sources = files('node.c', 'graph.c', 'graph_ops.c', 'graph_debug.c')\n-headers = files('rte_graph.h')\n+sources = files('node.c', 'graph.c', 'graph_ops.c', 'graph_debug.c', 'graph_populate.c')\n+headers = files('rte_graph.h', 'rte_graph_worker.h')\n allow_experimental_apis = true\n \n deps += ['eal']\ndiff --git a/lib/librte_graph/node.c b/lib/librte_graph/node.c\nindex 8592c1221..e05c4d5ed 100644\n--- a/lib/librte_graph/node.c\n+++ b/lib/librte_graph/node.c\n@@ -61,6 +61,11 @@ __rte_node_register(const struct rte_node_register *reg)\n \trte_edge_t i;\n \tsize_t sz;\n \n+\t/* Limit Node specific metadata to one cacheline on 64B CL machine */\n+\tRTE_BUILD_BUG_ON((offsetof(struct rte_node, nodes) -\n+\t\t\t  offsetof(struct rte_node, ctx)) !=\n+\t\t\t RTE_CACHE_LINE_MIN_SIZE);\n+\n \tgraph_spinlock_lock();\n \n \t/* Check sanity */\ndiff --git a/lib/librte_graph/rte_graph_version.map b/lib/librte_graph/rte_graph_version.map\nindex f2c2139c5..a9fe1b610 100644\n--- a/lib/librte_graph/rte_graph_version.map\n+++ b/lib/librte_graph/rte_graph_version.map\n@@ -2,6 +2,7 @@ EXPERIMENTAL {\n \tglobal:\n \n \t__rte_node_register;\n+\t__rte_node_stream_alloc;\n \n \trte_node_clone;\n \trte_node_dump;\ndiff --git a/lib/librte_graph/rte_graph_worker.h b/lib/librte_graph/rte_graph_worker.h\nnew file mode 100644\nindex 000000000..a8133739d\n--- /dev/null\n+++ b/lib/librte_graph/rte_graph_worker.h\n@@ -0,0 +1,108 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#ifndef _RTE_GRAPH_WORKER_H_\n+#define _RTE_GRAPH_WORKER_H_\n+\n+/**\n+ * @file rte_graph_worker.h\n+ *\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * This API allows a worker thread to walk over a graph and nodes to create,\n+ * process, enqueue and move streams of objects to the next nodes.\n+ */\n+\n+#include <rte_common.h>\n+#include <rte_cycles.h>\n+#include <rte_prefetch.h>\n+#include <rte_memcpy.h>\n+#include <rte_memory.h>\n+\n+#include \"rte_graph.h\"\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+/**\n+ * @internal\n+ *\n+ * Data structure to hold graph data.\n+ */\n+struct rte_graph {\n+\tuint32_t tail;\t\t     /**< Tail of circular buffer. */\n+\tuint32_t head;\t\t     /**< Head of circular buffer. */\n+\tuint32_t cir_mask;\t     /**< Circular buffer wrap around mask. */\n+\trte_node_t nb_nodes;\t     /**< Number of nodes in the graph. */\n+\trte_graph_off_t *cir_start;  /**< Pointer to circular buffer. */\n+\trte_graph_off_t nodes_start; /**< Offset at which node memory starts. */\n+\trte_graph_t id;\t/**< Graph identifier. */\n+\tint socket;\t/**< Socket ID where memory is allocated. */\n+\tchar name[RTE_GRAPH_NAMESIZE];\t/**< Name of the graph. */\n+\tuint64_t fence;\t\t\t/**< Fence. */\n+} __rte_cache_aligned;\n+\n+/**\n+ * @internal\n+ *\n+ * Data structure to hold node data.\n+ */\n+struct rte_node {\n+\t/* Slow path area  */\n+\tuint64_t fence;\t\t/**< Fence. */\n+\trte_graph_off_t next;\t/**< Index to next node. */\n+\trte_node_t id;\t\t/**< Node identifier. */\n+\trte_node_t parent_id;\t/**< Parent Node identifier. */\n+\trte_edge_t nb_edges;\t/**< Number of edges from this node. */\n+\tuint32_t realloc_count;\t/**< Number of times realloced. */\n+\n+\tchar parent[RTE_NODE_NAMESIZE];\t/**< Parent node name. */\n+\tchar name[RTE_NODE_NAMESIZE];\t/**< Name of the node. */\n+\n+\t/* Fast path area  */\n+#define RTE_NODE_CTX_SZ 16\n+\tuint8_t ctx[RTE_NODE_CTX_SZ] __rte_cache_aligned; /**< Node Context. */\n+\tuint16_t size;\t\t/**< Total number of objects available. */\n+\tuint16_t idx;\t\t/**< Number of objects used. */\n+\trte_graph_off_t off;\t/**< Offset of node in the graph reel. */\n+\tuint64_t total_cycles;\t/**< Cycles spent in this node. */\n+\tuint64_t total_calls;\t/**< Calls done to this node. */\n+\tuint64_t total_objs;\t/**< Objects processed by this node. */\n+\tRTE_STD_C11\n+\t\tunion {\n+\t\t\tvoid **objs;\t   /**< Array of object pointers. */\n+\t\t\tuint64_t objs_u64;\n+\t\t};\n+\tRTE_STD_C11\n+\t\tunion {\n+\t\t\trte_node_process_t process; /**< Process function. */\n+\t\t\tuint64_t process_u64;\n+\t\t};\n+\tstruct rte_node *nodes[] __rte_cache_min_aligned; /**< Next nodes. */\n+} __rte_cache_aligned;\n+\n+/**\n+ * @internal\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * Allocate a stream of objects.\n+ *\n+ * If stream already exists then re-allocate it to a larger size.\n+ *\n+ * @param graph\n+ *   Pointer to the graph object.\n+ * @param node\n+ *   Pointer to the node object.\n+ */\n+__rte_experimental\n+void __rte_node_stream_alloc(struct rte_graph *graph, struct rte_node *node);\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* _RTE_GRAPH_WORKER_H_ */\n",
    "prefixes": [
        "v4",
        "06/29"
    ]
}