get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 65434,
    "url": "http://patches.dpdk.org/api/patches/65434/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200131170201.3236153-3-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": "<20200131170201.3236153-3-jerinj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200131170201.3236153-3-jerinj@marvell.com",
    "date": "2020-01-31T17:01:58",
    "name": "[RFC,2/5] node: add packet processing nodes",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ea66ece002118a41d7f86a9e644f3b1a978971b5",
    "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/20200131170201.3236153-3-jerinj@marvell.com/mbox/",
    "series": [
        {
            "id": 8382,
            "url": "http://patches.dpdk.org/api/series/8382/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8382",
            "date": "2020-01-31T17:01:56",
            "name": "graph: introduce graph subsystem",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/8382/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/65434/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/65434/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 1756EA0524;\n\tFri, 31 Jan 2020 18:03:15 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 6FD811C123;\n\tFri, 31 Jan 2020 18:03:01 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 21D4E1C0DA;\n Fri, 31 Jan 2020 18:02:56 +0100 (CET)",
            "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 00VGuDtT032216; Fri, 31 Jan 2020 09:02:49 -0800",
            "from sc-exch04.marvell.com ([199.233.58.184])\n by mx0a-0016f401.pphosted.com with ESMTP id 2xvpas8fwf-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Fri, 31 Jan 2020 09:02:49 -0800",
            "from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com\n (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 31 Jan\n 2020 09:02:46 -0800",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com\n (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Fri, 31 Jan 2020 09:02:46 -0800",
            "from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14])\n by maili.marvell.com (Postfix) with ESMTP id E6BB93F7043;\n Fri, 31 Jan 2020 09:02:36 -0800 (PST)"
        ],
        "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=AbKR2vHpXSdQnO9dCn886m9ht8m+JmxvfF2GPuw0BrY=;\n b=sHbFJDkehhKkyH4+pBGeDy0TqiC6uC4eWkaCMYirGwXnJQmAYSrdSQadL+MpJchzzSxz\n 35NysCGaG8wAZcPvLYHB257DFgb8yXFGSzZM0j1mH18l1JgAg1silIdy1EDLuJkBr4X2\n 3lg19gmBjhM9Yxyx3jusjQwF5HfsvYRtoLi+rcByeJCXAmQ/YVawdnc/HELYq4KEBa8/\n vzNICY+SjS9SjQrfe2skcT9udz9b9lVGrsygCbzTdU4xOpv9UKNjHlPpdUs3o1dyeQr8\n uCUG28b3iCzteXT6V9omrfHPrMtRcGILZNVHsaQF3amtJZv8Z29OJgXCeu2JFj+uPqya fg==",
        "From": "<jerinj@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<pkapoor@marvell.com>, <ndabilpuram@marvell.com>,\n <kirankumark@marvell.com>, <pbhagavatula@marvell.com>,\n <pathreya@marvell.com>, <nsaxena@marvell.com>,\n <sshankarnara@marvell.com>, <honnappa.nagarahalli@arm.com>,\n <thomas@monjalon.net>, <david.marchand@redhat.com>,\n <ferruh.yigit@intel.com>, <arybchenko@solarflare.com>,\n <ajit.khaparde@broadcom.com>, <xiaolong.ye@intel.com>,\n <rasland@mellanox.com>, <maxime.coquelin@redhat.com>,\n <akhil.goyal@nxp.com>, <cristian.dumitrescu@intel.com>,\n <john.mcnamara@intel.com>, <bruce.richardson@intel.com>,\n <anatoly.burakov@intel.com>, <gavin.hu@arm.com>,\n <drc@linux.vnet.ibm.com>, <konstantin.ananyev@intel.com>,\n <pallavi.kadam@intel.com>, <olivier.matz@6wind.com>,\n <gage.eads@intel.com>, <nikhil.rao@intel.com>,\n <erik.g.carrillo@intel.com>, <hemant.agrawal@nxp.com>,\n <artem.andreev@oktetlabs.ru>, <sthemmin@microsoft.com>,\n <shahafs@mellanox.com>, <keith.wiles@intel.com>,\n <mattias.ronnblom@ericsson.com>, <jasvinder.singh@intel.com>,\n <vladimir.medvedkin@intel.com>, <mdr@ashroe.eu>, <techboard@dpdk.org>,\n \"Jerin Jacob\" <jerinj@marvell.com>",
        "Date": "Fri, 31 Jan 2020 22:31:58 +0530",
        "Message-ID": "<20200131170201.3236153-3-jerinj@marvell.com>",
        "X-Mailer": "git-send-email 2.24.1",
        "In-Reply-To": "<20200131170201.3236153-1-jerinj@marvell.com>",
        "References": "<20200131170201.3236153-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.572\n definitions=2020-01-31_04:2020-01-31,\n 2020-01-31 signatures=0",
        "Subject": "[dpdk-dev]  [RFC PATCH 2/5] node: add packet processing nodes",
        "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: Nithin Dabilpuram <ndabilpuram@marvell.com>\n\nSigned-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>\nSigned-off-by: Jerin Jacob <jerinj@marvell.com>\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\n---\n app/test/meson.build                 |   7 +-\n config/common_base                   |   6 +\n lib/Makefile                         |   4 +\n lib/librte_node/Makefile             |  30 ++\n lib/librte_node/ethdev_ctrl.c        | 106 +++++\n lib/librte_node/ethdev_rx.c          | 218 +++++++++\n lib/librte_node/ethdev_rx.h          |  17 +\n lib/librte_node/ethdev_rx_priv.h     |  45 ++\n lib/librte_node/ethdev_tx.c          |  74 +++\n lib/librte_node/ethdev_tx_priv.h     |  33 ++\n lib/librte_node/ip4_lookup.c         | 657 +++++++++++++++++++++++++++\n lib/librte_node/ip4_lookup_priv.h    |  17 +\n lib/librte_node/ip4_rewrite.c        | 340 ++++++++++++++\n lib/librte_node/ip4_rewrite_priv.h   |  44 ++\n lib/librte_node/log.c                |  14 +\n lib/librte_node/meson.build          |   8 +\n lib/librte_node/node_private.h       |  61 +++\n lib/librte_node/null.c               |  23 +\n lib/librte_node/pkt_drop.c           |  26 ++\n lib/librte_node/rte_node_eth_api.h   |  31 ++\n lib/librte_node/rte_node_ip4_api.h   |  33 ++\n lib/librte_node/rte_node_version.map |   9 +\n lib/meson.build                      |   5 +-\n meson.build                          |   1 +\n mk/rte.app.mk                        |   1 +\n 25 files changed, 1807 insertions(+), 3 deletions(-)\n create mode 100644 lib/librte_node/Makefile\n create mode 100644 lib/librte_node/ethdev_ctrl.c\n create mode 100644 lib/librte_node/ethdev_rx.c\n create mode 100644 lib/librte_node/ethdev_rx.h\n create mode 100644 lib/librte_node/ethdev_rx_priv.h\n create mode 100644 lib/librte_node/ethdev_tx.c\n create mode 100644 lib/librte_node/ethdev_tx_priv.h\n create mode 100644 lib/librte_node/ip4_lookup.c\n create mode 100644 lib/librte_node/ip4_lookup_priv.h\n create mode 100644 lib/librte_node/ip4_rewrite.c\n create mode 100644 lib/librte_node/ip4_rewrite_priv.h\n create mode 100644 lib/librte_node/log.c\n create mode 100644 lib/librte_node/meson.build\n create mode 100644 lib/librte_node/node_private.h\n create mode 100644 lib/librte_node/null.c\n create mode 100644 lib/librte_node/pkt_drop.c\n create mode 100644 lib/librte_node/rte_node_eth_api.h\n create mode 100644 lib/librte_node/rte_node_ip4_api.h\n create mode 100644 lib/librte_node/rte_node_version.map",
    "diff": "diff --git a/app/test/meson.build b/app/test/meson.build\nindex e1cdae3cb..7d761c8fa 100644\n--- a/app/test/meson.build\n+++ b/app/test/meson.build\n@@ -159,8 +159,9 @@ test_deps = ['acl',\n \t'rib',\n \t'ring',\n \t'stack',\n-\t'timer'\n+\t'timer',\n \t'graph',\n+\t'node'\n ]\n \n fast_test_names = [\n@@ -382,13 +383,15 @@ endforeach\n test_dep_objs += cc.find_library('execinfo', required: false)\n \n link_libs = []\n+link_nodes = []\n if get_option('default_library') == 'static'\n \tlink_libs = dpdk_drivers\n+\tlink_nodes = dpdk_graph_nodes\n endif\n \n dpdk_test = executable('dpdk-test',\n \ttest_sources,\n-\tlink_whole: link_libs,\n+\tlink_whole: link_libs + link_nodes,\n \tdependencies: test_dep_objs,\n \tc_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],\n \tinstall_rpath: driver_install_path,\ndiff --git a/config/common_base b/config/common_base\nindex badcc0be5..f7f3f2607 100644\n--- a/config/common_base\n+++ b/config/common_base\n@@ -1077,6 +1077,12 @@ CONFIG_RTE_LIBRTE_GRAPH=y\n CONFIG_RTE_GRAPH_BURST_SIZE=256\n CONFIG_RTE_LIBRTE_GRAPH_STATS=y\n CONFIG_RTE_LIBRTE_GRAPH_DEBUG=n\n+#\n+# Compile librte_node\n+#\n+CONFIG_RTE_LIBRTE_NODE=y\n+CONFIG_RTE_LIBRTE_NODE_DEBUG=n\n+\n #\n # Compile the test application\n #\ndiff --git a/lib/Makefile b/lib/Makefile\nindex 495f572bf..fe3fcc70f 100644\n--- a/lib/Makefile\n+++ b/lib/Makefile\n@@ -121,6 +121,10 @@ DEPDIRS-librte_rcu := librte_eal\n \n DIRS-$(CONFIG_RTE_LIBRTE_GRAPH) += librte_graph\n DEPDIRS-librte_graph := librte_eal librte_mbuf\n+\n+DIRS-$(CONFIG_RTE_LIBRTE_NODE) += librte_node\n+DEPDIRS-librte_node := librte_graph librte_lpm librte_ethdev librte_mbuf\n+\n ifeq ($(CONFIG_RTE_EXEC_ENV_LINUX),y)\n DIRS-$(CONFIG_RTE_LIBRTE_KNI) += librte_kni\n endif\ndiff --git a/lib/librte_node/Makefile b/lib/librte_node/Makefile\nnew file mode 100644\nindex 000000000..aaf041580\n--- /dev/null\n+++ b/lib/librte_node/Makefile\n@@ -0,0 +1,30 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(C) 2020 Marvell International Ltd.\n+#\n+\n+include $(RTE_SDK)/mk/rte.vars.mk\n+\n+# library name\n+LIB = librte_node.a\n+\n+CFLAGS += -O3 -DALLOW_EXPERIMENTAL_API\n+CFLAGS += $(WERROR_FLAGS)\n+LDLIBS += -lrte_eal -lrte_graph -lrte_mbuf -lrte_lpm -lrte_ethdev -lrte_mempool\n+\n+EXPORT_MAP := rte_node_version.map\n+\n+# all source are stored in SRCS-y\n+SRCS-$(CONFIG_RTE_LIBRTE_NODE) += null.c\n+SRCS-$(CONFIG_RTE_LIBRTE_NODE) += log.c\n+SRCS-$(CONFIG_RTE_LIBRTE_NODE) += ethdev_rx.c\n+SRCS-$(CONFIG_RTE_LIBRTE_NODE) += ethdev_tx.c\n+SRCS-$(CONFIG_RTE_LIBRTE_NODE) += ethdev_ctrl.c\n+SRCS-$(CONFIG_RTE_LIBRTE_NODE) += ip4_lookup.c\n+SRCS-$(CONFIG_RTE_LIBRTE_NODE) += ip4_rewrite.c\n+SRCS-$(CONFIG_RTE_LIBRTE_NODE) += pkt_drop.c\n+\n+# install header files\n+SYMLINK-$(CONFIG_RTE_LIBRTE_NODE)-include += rte_node_ip4_api.h\n+SYMLINK-$(CONFIG_RTE_LIBRTE_NODE)-include += rte_node_eth_api.h\n+\n+include $(RTE_SDK)/mk/rte.lib.mk\ndiff --git a/lib/librte_node/ethdev_ctrl.c b/lib/librte_node/ethdev_ctrl.c\nnew file mode 100644\nindex 000000000..7fc7af7f7\n--- /dev/null\n+++ b/lib/librte_node/ethdev_ctrl.c\n@@ -0,0 +1,106 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#include <rte_debug.h>\n+#include <rte_ether.h>\n+#include <rte_ethdev.h>\n+#include <rte_graph.h>\n+#include <rte_node_eth_api.h>\n+\n+#include \"ethdev_rx_priv.h\"\n+#include \"ethdev_tx_priv.h\"\n+#include \"ip4_rewrite_priv.h\"\n+#include \"node_private.h\"\n+\n+static struct ethdev_ctrl {\n+\tuint16_t nb_graphs;\n+} ctrl;\n+\n+int\n+rte_node_eth_config(struct rte_node_ethdev_config *conf,\n+\t\t    uint16_t nb_confs, uint16_t nb_graphs)\n+{\n+\tuint16_t tx_q_used, rx_q_used, port_id;\n+\tchar name[RTE_NODE_NAMESIZE];\n+\tconst char *next_nodes = name;\n+\tstruct rte_mempool *mp;\n+\tint i, j, rc;\n+\tuint32_t id;\n+\n+\tfor (i = 0; i < nb_confs; i++) {\n+\t\tport_id = conf[i].port_id;\n+\n+\t\tif (!rte_eth_dev_is_valid_port(port_id))\n+\t\t\treturn -EINVAL;\n+\n+\t\t/* Check for mbuf minimum private size requirement */\n+\t\tfor (j = 0; j < conf[i].mp_count; j++) {\n+\t\t\tmp = conf[i].mp[j];\n+\t\t\tif (!mp)\n+\t\t\t\tcontinue;\n+\t\t\t/* Check for minimum private space */\n+\t\t\tif (rte_pktmbuf_priv_size(mp) <\n+\t\t\t    RTE_NODE_MBUF_PRIV2_SIZE) {\n+\t\t\t\tnode_err(\"ethdev\",\n+\t\t\t\t\t \"Minimum mbuf priv size \"\n+\t\t\t\t\t \"requirement not met by mp %s\",\n+\t\t\t\t\t mp->name);\n+\t\t\t\treturn -EINVAL;\n+\t\t\t}\n+\t\t}\n+\n+\t\trx_q_used = conf[i].num_rx_queues;\n+\t\ttx_q_used = conf[i].num_tx_queues;\n+\t\t/* Check if we have a txq for each worker */\n+\t\tif (tx_q_used < nb_graphs)\n+\t\t\treturn -EINVAL;\n+\n+\t\t/* Create node for each rx port queue pair */\n+\t\tfor (j = 0; j < rx_q_used; j++) {\n+\t\t\tethdev_rx_node_elem_t *elem;\n+\n+\t\t\tsnprintf(name, sizeof(name), \"%u-%u\", port_id, j);\n+\t\t\t/* Clone a new rx node with same edges as parent */\n+\t\t\tid = rte_node_clone(ethdev_rx_node_base.id, name);\n+\t\t\tif (id == RTE_NODE_ID_INVALID)\n+\t\t\t\treturn -EIO;\n+\n+\t\t\t/* Add it to list of ethdev rx nodes for lookup */\n+\t\t\telem = malloc(sizeof(ethdev_rx_node_elem_t));\n+\t\t\tmemset(elem, 0, sizeof(ethdev_rx_node_elem_t));\n+\t\t\telem->ctx.port_id = port_id;\n+\t\t\telem->ctx.queue_id = j;\n+\t\t\telem->nid = id;\n+\t\t\telem->next = ethdev_rx_main.head;\n+\t\t\tethdev_rx_main.head = elem;\n+\n+\t\t\tnode_dbg(\"ethdev\", \"rx node %s-%s: is at %u\",\n+\t\t\t\t ethdev_rx_node_base.name, name, id);\n+\t\t}\n+\n+\t\t/* Create a per port tx node from base node */\n+\t\tsnprintf(name, sizeof(name), \"%u\", port_id);\n+\t\t/* Clone a new node with same edges as parent */\n+\t\tid = rte_node_clone(ethdev_tx_node_base.id, name);\n+\t\tethdev_tx_main.nodes[port_id] = id;\n+\n+\t\tnode_dbg(\"ethdev\", \"tx node %s-%s: is at %u\",\n+\t\t\t ethdev_tx_node_base.name, name, id);\n+\n+\t\t/* Prepare the actual name of the cloned node */\n+\t\tsnprintf(name, sizeof(name), \"ethdev_tx-%u\", port_id);\n+\n+\t\t/* Add this tx port node as next to ip4_rewrite_node */\n+\t\trte_node_edge_update(ip4_rewrite_node.id,\n+\t\t\t\t     RTE_EDGE_ID_INVALID, &next_nodes, 1);\n+\t\t/* Assuming edge id is the last one alloc'ed */\n+\t\trc = ip4_rewrite_set_next(port_id,\n+\t\t\t\trte_node_edge_count(ip4_rewrite_node.id) - 1);\n+\t\tif (rc < 0)\n+\t\t\treturn rc;\n+\t}\n+\n+\tctrl.nb_graphs = nb_graphs;\n+\treturn 0;\n+}\ndiff --git a/lib/librte_node/ethdev_rx.c b/lib/librte_node/ethdev_rx.c\nnew file mode 100644\nindex 000000000..48cbc5692\n--- /dev/null\n+++ b/lib/librte_node/ethdev_rx.c\n@@ -0,0 +1,218 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#include <rte_debug.h>\n+#include <rte_ether.h>\n+#include <rte_ethdev.h>\n+#include <rte_mbuf.h>\n+#include <rte_graph.h>\n+#include <rte_graph_worker.h>\n+\n+#include \"ethdev_rx.h\"\n+#include \"ethdev_rx_priv.h\"\n+#include \"node_private.h\"\n+\n+struct ethdev_rx_node_main ethdev_rx_main;\n+\n+static __rte_always_inline uint16_t\n+ethdev_rx_node_process_inline(struct rte_graph *graph, struct rte_node *node,\n+\t\t\t      uint16_t port, uint16_t queue)\n+{\n+\tuint16_t count, next_index = ETHDEV_RX_NEXT_IP4_LOOKUP;\n+\n+\t/* Get pkts from port */\n+\tcount = rte_eth_rx_burst(port, queue, (struct rte_mbuf **)node->objs,\n+\t\t\t\t RTE_GRAPH_BURST_SIZE);\n+\n+\tif (!count)\n+\t\treturn 0;\n+\tnode->idx = count;\n+\t/* Enqueue to next node */\n+\trte_node_next_stream_move(graph, node, next_index);\n+\n+\treturn count;\n+}\n+\n+static __rte_always_inline uint16_t\n+ethdev_rx_node_process(struct rte_graph *graph, struct rte_node *node,\n+\t\t       void **objs, uint16_t cnt)\n+{\n+\tethdev_rx_node_ctx_t *ctx = (ethdev_rx_node_ctx_t *)node->ctx;\n+\tuint16_t n_pkts = 0;\n+\n+\tRTE_SET_USED(objs);\n+\tRTE_SET_USED(cnt);\n+\n+\tn_pkts = ethdev_rx_node_process_inline(graph, node, ctx->port_id,\n+\t\t\t\t\t       ctx->queue_id);\n+\treturn n_pkts;\n+}\n+\n+static inline uint32_t\n+l3_ptype(uint16_t etype, uint32_t ptype)\n+{\n+\tptype = ptype & ~RTE_PTYPE_L3_MASK;\n+\tif (etype == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4))\n+\t\tptype |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;\n+\telse if (etype == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6))\n+\t\tptype |= RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;\n+\treturn ptype;\n+}\n+\n+/* Callback for soft ptype parsing */\n+static uint16_t\n+eth_pkt_parse_cb(uint16_t port, uint16_t queue,\n+\t\t struct rte_mbuf **mbufs, uint16_t nb_pkts,\n+\t\t uint16_t max_pkts, void *user_param)\n+{\n+\tstruct rte_mbuf *mbuf0, *mbuf1, *mbuf2, *mbuf3;\n+\tstruct rte_ether_hdr *eth_hdr;\n+\tuint16_t etype, n_left;\n+\tstruct rte_mbuf **pkts;\n+\n+\tRTE_SET_USED(port);\n+\tRTE_SET_USED(queue);\n+\tRTE_SET_USED(max_pkts);\n+\tRTE_SET_USED(user_param);\n+\n+\tpkts = mbufs;\n+\tn_left = nb_pkts;\n+\twhile (n_left >= 12) {\n+\n+\t\t/* Prefetch next-next mbufs */\n+\t\trte_prefetch0(pkts[8]);\n+\t\trte_prefetch0(pkts[9]);\n+\t\trte_prefetch0(pkts[10]);\n+\t\trte_prefetch0(pkts[11]);\n+\n+\t\t/* Prefetch next mbuf data */\n+\t\trte_prefetch0(rte_pktmbuf_mtod(pkts[4],\n+\t\t\t\t\t       struct rte_ether_hdr *));\n+\t\trte_prefetch0(rte_pktmbuf_mtod(pkts[5],\n+\t\t\t\t\t       struct rte_ether_hdr *));\n+\t\trte_prefetch0(rte_pktmbuf_mtod(pkts[6],\n+\t\t\t\t\t       struct rte_ether_hdr *));\n+\t\trte_prefetch0(rte_pktmbuf_mtod(pkts[7],\n+\t\t\t\t\t       struct rte_ether_hdr *));\n+\n+\t\tmbuf0 = pkts[0];\n+\t\tmbuf1 = pkts[1];\n+\t\tmbuf2 = pkts[2];\n+\t\tmbuf3 = pkts[3];\n+\t\tpkts += 4;\n+\t\tn_left -= 4;\n+\n+\t\t/* Extract ptype of mbuf0 */\n+\t\teth_hdr = rte_pktmbuf_mtod(mbuf0,\n+\t\t\t\t\t   struct rte_ether_hdr *);\n+\t\tetype = eth_hdr->ether_type;\n+\t\tmbuf0->packet_type = l3_ptype(etype, 0);\n+\n+\t\t/* Extract ptype of mbuf1 */\n+\t\teth_hdr = rte_pktmbuf_mtod(mbuf1,\n+\t\t\t\t\t   struct rte_ether_hdr *);\n+\t\tetype = eth_hdr->ether_type;\n+\t\tmbuf1->packet_type = l3_ptype(etype, 0);\n+\n+\t\t/* Extract ptype of mbuf2 */\n+\t\teth_hdr = rte_pktmbuf_mtod(mbuf2,\n+\t\t\t\t\t   struct rte_ether_hdr *);\n+\t\tetype = eth_hdr->ether_type;\n+\t\tmbuf2->packet_type = l3_ptype(etype, 0);\n+\n+\t\t/* Extract ptype of mbuf3 */\n+\t\teth_hdr = rte_pktmbuf_mtod(mbuf3,\n+\t\t\t\t\t   struct rte_ether_hdr *);\n+\t\tetype = eth_hdr->ether_type;\n+\t\tmbuf3->packet_type = l3_ptype(etype, 0);\n+\n+\t}\n+\n+\twhile (n_left > 0) {\n+\t\tmbuf0 = pkts[0];\n+\n+\t\tpkts += 1;\n+\t\tn_left -= 1;\n+\n+\t\t/* Extract ptype of mbuf0 */\n+\t\teth_hdr = rte_pktmbuf_mtod(mbuf0,\n+\t\t\t\t\t   struct rte_ether_hdr *);\n+\t\tetype = eth_hdr->ether_type;\n+\t\tmbuf0->packet_type = l3_ptype(etype, 0);\n+\t}\n+\n+\treturn nb_pkts;\n+}\n+\n+#define MAX_PTYPES  16\n+static int\n+ethdev_ptype_setup(uint16_t port, uint16_t queue)\n+{\n+\tuint8_t l3_ipv4 = 0, l3_ipv6 = 0;\n+\tuint32_t ptypes[MAX_PTYPES];\n+\tint i, rc;\n+\n+\t/* Check IPv4 & IPv6 ptype support */\n+\trc = rte_eth_dev_get_supported_ptypes(port, RTE_PTYPE_L3_MASK,\n+\t\t\t\t\t      ptypes, MAX_PTYPES);\n+\tfor (i = 0; i < rc; i++) {\n+\t\tif (ptypes[i] & RTE_PTYPE_L3_IPV4)\n+\t\t\tl3_ipv4 = 1;\n+\t\tif (ptypes[i] & RTE_PTYPE_L3_IPV6)\n+\t\t\tl3_ipv6 = 1;\n+\t}\n+\n+\tif (!l3_ipv4 || !l3_ipv6) {\n+\t\tnode_info(\"ethdev_rx\",\n+\t\t\t  \"Enabling ptype callback for required ptypes \"\n+\t\t\t  \"on port %u\\n\", port);\n+\n+\t\tif (!rte_eth_add_rx_callback(port, queue,\n+\t\t\t\t\t     eth_pkt_parse_cb, NULL)) {\n+\t\t\tnode_err(\"ethdev_rx\",\n+\t\t\t\t \"Failed to add rx ptype cb: port=%d, queue=%d\\n\",\n+\t\t\t\t port, queue);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n+static int\n+ethdev_rx_node_init(const struct rte_graph *graph, struct rte_node *node)\n+{\n+\tethdev_rx_node_ctx_t *ctx = (ethdev_rx_node_ctx_t *)node->ctx;\n+\tethdev_rx_node_elem_t *elem = ethdev_rx_main.head;\n+\n+\tRTE_SET_USED(graph);\n+\n+\twhile (elem) {\n+\t\tif (elem->nid == node->id) {\n+\t\t\t/* Update node specific context */\n+\t\t\tmemcpy(ctx, &elem->ctx, sizeof(ethdev_rx_node_ctx_t));\n+\t\t\tbreak;\n+\t\t}\n+\t\telem = elem->next;\n+\t}\n+\n+\tRTE_VERIFY(elem != NULL);\n+\n+\t/* Check and setup ptype */\n+\treturn ethdev_ptype_setup(ctx->port_id, ctx->queue_id);\n+}\n+\n+struct rte_node_register ethdev_rx_node_base = {\n+\t.process = ethdev_rx_node_process,\n+\t.flags = RTE_NODE_SOURCE_F,\n+\t.name = \"ethdev_rx\",\n+\n+\t.init = ethdev_rx_node_init,\n+\n+\t.nb_edges = ETHDEV_RX_NEXT_MAX,\n+\t.next_nodes = {\n+\t\t[ETHDEV_RX_NEXT_IP4_LOOKUP] = \"ip4_lookup\"\n+\t},\n+};\n+\n+RTE_NODE_REGISTER(ethdev_rx_node_base);\ndiff --git a/lib/librte_node/ethdev_rx.h b/lib/librte_node/ethdev_rx.h\nnew file mode 100644\nindex 000000000..7ae2923ea\n--- /dev/null\n+++ b/lib/librte_node/ethdev_rx.h\n@@ -0,0 +1,17 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+#ifndef __INCLUDE_ETHDEV_RX_H__\n+#define __INCLUDE_ETHDEV_RX_H__\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* __INCLUDE_ETHDEV_RX_H__ */\ndiff --git a/lib/librte_node/ethdev_rx_priv.h b/lib/librte_node/ethdev_rx_priv.h\nnew file mode 100644\nindex 000000000..beb54e739\n--- /dev/null\n+++ b/lib/librte_node/ethdev_rx_priv.h\n@@ -0,0 +1,45 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+#ifndef __INCLUDE_ETHDEV_RX_PRIV_H__\n+#define __INCLUDE_ETHDEV_RX_PRIV_H__\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#include <rte_common.h>\n+\n+struct ethdev_rx_node_elem;\n+struct ethdev_rx_node_ctx;\n+typedef struct ethdev_rx_node_elem ethdev_rx_node_elem_t;\n+typedef struct ethdev_rx_node_ctx ethdev_rx_node_ctx_t;\n+\n+struct ethdev_rx_node_ctx {\n+\tuint16_t port_id;\n+\tuint16_t queue_id;\n+};\n+\n+struct ethdev_rx_node_elem {\n+\tstruct ethdev_rx_node_elem *next;\n+\tstruct ethdev_rx_node_ctx ctx;\n+\trte_node_t nid;\n+};\n+\n+enum ethdev_rx_next_nodes {\n+    ETHDEV_RX_NEXT_IP4_LOOKUP,\n+    ETHDEV_RX_NEXT_MAX,\n+};\n+\n+struct ethdev_rx_node_main {\n+\tethdev_rx_node_elem_t *head;\n+};\n+\n+extern struct ethdev_rx_node_main ethdev_rx_main;\n+extern struct rte_node_register ethdev_rx_node_base;\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* __INCLUDE_ETHDEV_RX_PRIV_H__ */\ndiff --git a/lib/librte_node/ethdev_tx.c b/lib/librte_node/ethdev_tx.c\nnew file mode 100644\nindex 000000000..06f944d4c\n--- /dev/null\n+++ b/lib/librte_node/ethdev_tx.c\n@@ -0,0 +1,74 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#include <rte_debug.h>\n+#include <rte_ethdev.h>\n+#include <rte_mbuf.h>\n+#include <rte_graph.h>\n+#include <rte_graph_worker.h>\n+\n+#include \"ethdev_tx_priv.h\"\n+\n+struct ethdev_tx_node_main ethdev_tx_main;\n+\n+static uint16_t\n+ethdev_tx_node_process(struct rte_graph *graph, struct rte_node *node,\n+\t\t       void **objs, uint16_t nb_objs)\n+{\n+\tethdev_tx_node_ctx_t *ctx = (ethdev_tx_node_ctx_t *)node->ctx;\n+\tuint16_t port, queue;\n+\tuint16_t count;\n+\n+\t/* Get Tx port id */\n+\tport = ctx->port;\n+\tqueue = ctx->queue;\n+\n+\tcount = rte_eth_tx_burst(port, queue,\n+\t\t\t\t (struct rte_mbuf **)objs, nb_objs);\n+\n+\t/* Redirect unsent pkts to drop node */\n+\tif (count < nb_objs) {\n+\t\trte_node_enqueue(graph, node, ETHDEV_TX_NEXT_PKT_DROP,\n+\t\t\t\t &objs[count], nb_objs - count);\n+\t}\n+\n+\treturn count;\n+}\n+\n+static int\n+ethdev_tx_node_init(const struct rte_graph *graph, struct rte_node *node)\n+{\n+\tethdev_tx_node_ctx_t *ctx = (ethdev_tx_node_ctx_t *)node->ctx;\n+\tuint64_t port_id = RTE_MAX_ETHPORTS;\n+\tint i;\n+\n+\t/* Find our port id */\n+\tfor (i = 0; i < RTE_MAX_ETHPORTS; i++) {\n+\t\tif (ethdev_tx_main.nodes[i] == node->id) {\n+\t\t\tport_id = i;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\tRTE_VERIFY(port_id < RTE_MAX_ETHPORTS);\n+\n+\t/* Update port and queue */\n+\tctx->port = port_id;\n+\tctx->queue = graph->id;\n+\treturn 0;\n+}\n+\n+\n+struct rte_node_register ethdev_tx_node_base = {\n+\t.process = ethdev_tx_node_process,\n+\t.name = \"ethdev_tx\",\n+\n+\t.init = ethdev_tx_node_init,\n+\n+\t.nb_edges = ETHDEV_TX_NEXT_MAX,\n+\t.next_nodes = {\n+\t\t[ETHDEV_TX_NEXT_PKT_DROP] = \"pkt_drop\",\n+\t},\n+};\n+\n+RTE_NODE_REGISTER(ethdev_tx_node_base);\ndiff --git a/lib/librte_node/ethdev_tx_priv.h b/lib/librte_node/ethdev_tx_priv.h\nnew file mode 100644\nindex 000000000..394cccbb1\n--- /dev/null\n+++ b/lib/librte_node/ethdev_tx_priv.h\n@@ -0,0 +1,33 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+#ifndef __INCLUDE_ETHDEV_TX_PRIV_H__\n+#define __INCLUDE_ETHDEV_TX_PRIV_H__\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+enum ethdev_tx_next_nodes {\n+    ETHDEV_TX_NEXT_PKT_DROP,\n+    ETHDEV_TX_NEXT_MAX,\n+};\n+\n+typedef struct ethdev_tx_node_ctx {\n+\tuint16_t port;\n+\tuint16_t queue;\n+} ethdev_tx_node_ctx_t;\n+\n+struct ethdev_tx_node_main {\n+\t/* Tx nodes for each ethdev port */\n+\tuint32_t nodes[RTE_MAX_ETHPORTS];\n+};\n+\n+extern struct ethdev_tx_node_main ethdev_tx_main;\n+extern struct rte_node_register ethdev_tx_node_base;\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* __INCLUDE_ETHDEV_TX_PRIV_H__ */\ndiff --git a/lib/librte_node/ip4_lookup.c b/lib/librte_node/ip4_lookup.c\nnew file mode 100644\nindex 000000000..c7bccad93\n--- /dev/null\n+++ b/lib/librte_node/ip4_lookup.c\n@@ -0,0 +1,657 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#include <rte_debug.h>\n+#include <rte_ether.h>\n+#include <rte_ethdev.h>\n+#include <rte_ip.h>\n+#include <rte_lpm.h>\n+#include <rte_mbuf.h>\n+#include <rte_graph.h>\n+#include <rte_graph_worker.h>\n+#include <rte_tcp.h>\n+#include <rte_udp.h>\n+\n+#include <arpa/inet.h>\n+#include <rte_node_ip4_api.h>\n+#include \"ip4_lookup_priv.h\"\n+#include \"node_private.h\"\n+\n+#define IPV4_L3FWD_LPM_MAX_RULES\t1024\n+#define IPV4_L3FWD_LPM_NUMBER_TBL8S\t(1 << 8)\n+\n+/* IP4 Lookup global data struct */\n+struct ip4_lookup_node_main {\n+    struct rte_lpm *lpm_tbl[RTE_MAX_NUMA_NODES];\n+};\n+\n+static struct ip4_lookup_node_main ip4_lookup_nm;\n+\n+#if defined(RTE_MACHINE_CPUFLAG_NEON)\n+/* ARM64 NEON */\n+static uint16_t\n+ip4_lookup_node_process(struct rte_graph *graph,\n+                        struct rte_node *node,\n+\t\t\tvoid **objs, uint16_t nb_objs)\n+{\n+\tstruct rte_mbuf *mbuf0, *mbuf1, *mbuf2, *mbuf3, **pkts;\n+\tstruct rte_ipv4_hdr *ipv4_hdr;\n+\tstruct rte_ether_hdr *eth_hdr;\n+\tvoid **to_next, **from;\n+\tuint16_t last_spec = 0;\n+\trte_edge_t next_index;\n+\tuint16_t n_left_from;\n+\tstruct rte_lpm *lpm;\n+\tuint16_t held = 0;\n+\tuint32_t drop_nh;\n+\trte_xmm_t result;\n+\trte_xmm_t priv01;\n+\trte_xmm_t priv23;\n+\tint32x4_t dip;\n+\tint rc, i;\n+\n+\t/* Speculative next */\n+\tnext_index = IP4_LOOKUP_NEXT_REWRITE;\n+\tdrop_nh = ((uint32_t)IP4_LOOKUP_NEXT_PKT_DROP) << 16; /* Drop node */\n+\n+\t/* Get socket specific lpm from ctx */\n+\tlpm = *((struct rte_lpm **)node->ctx);\n+\n+\tpkts = (struct rte_mbuf **)objs;\n+\tfrom = objs;\n+\tn_left_from = nb_objs;\n+\n+#define OBJS_PER_CLINE\t(RTE_CACHE_LINE_SIZE / sizeof (void *))\n+\tfor (i = OBJS_PER_CLINE; i < RTE_GRAPH_BURST_SIZE; i += OBJS_PER_CLINE)\n+\t\trte_prefetch0(&objs[i]);\n+\n+\tfor (i = 0; i < 4 && i < n_left_from; i++) {\n+\t\trte_prefetch0(rte_pktmbuf_mtod(pkts[i],\n+\t\t\t\t\tstruct rte_ether_hdr *) + 1);\n+\t}\n+\n+\t/* Get stream for the speculated next node */\n+\tto_next = rte_node_next_stream_get(graph, node,\n+\t\t\tnext_index, nb_objs);\n+\twhile (n_left_from >= 4) {\n+\n+\t\t/* Prefetch next-next mbufs */\n+\t\tif (likely(n_left_from >= 11)) {\n+\t\t\trte_prefetch0(pkts[8]);\n+\t\t\trte_prefetch0(pkts[9]);\n+\t\t\trte_prefetch0(pkts[10]);\n+\t\t\trte_prefetch0(pkts[11]);\n+\t\t}\n+\n+\t\t/* Prefetch next mbuf data */\n+\t\tif (likely(n_left_from >= 7 )) {\n+\t\t\trte_prefetch0(rte_pktmbuf_mtod(pkts[4],\n+\t\t\t\t\t\tstruct rte_ether_hdr *) + 1);\n+\t\t\trte_prefetch0(rte_pktmbuf_mtod(pkts[5],\n+\t\t\t\t\t\tstruct rte_ether_hdr *) + 1);\n+\t\t\trte_prefetch0(rte_pktmbuf_mtod(pkts[6],\n+\t\t\t\t\t\tstruct rte_ether_hdr *) + 1);\n+\t\t\trte_prefetch0(rte_pktmbuf_mtod(pkts[7],\n+\t\t\t\t\t\tstruct rte_ether_hdr *) + 1);\n+\t\t}\n+\n+\t\tmbuf0 = pkts[0];\n+\t\tmbuf1 = pkts[1];\n+\t\tmbuf2 = pkts[2];\n+\t\tmbuf3 = pkts[3];\n+\n+\t\tpkts += 4;\n+\t\tn_left_from -= 4;\n+\n+\t\t/* Extract DIP of mbuf0 */\n+\t\teth_hdr = rte_pktmbuf_mtod(mbuf0,\n+\t\t\t\tstruct rte_ether_hdr *);\n+\t\tipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);\n+\t\tdip = vsetq_lane_s32(ipv4_hdr->dst_addr, dip, 0);\n+\t\t/* Extract cksum, ttl as ipv4 hdr is in cache */\n+\t\tpriv01.u16[1] = ipv4_hdr->time_to_live;\n+\t\tpriv01.u32[1] = ipv4_hdr->hdr_checksum;\n+\n+\t\t/* Extract DIP of mbuf1 */\n+\t\teth_hdr = rte_pktmbuf_mtod(mbuf1,\n+\t\t\t\tstruct rte_ether_hdr *);\n+\t\tipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);\n+\t\tdip = vsetq_lane_s32(ipv4_hdr->dst_addr, dip, 1);\n+\t\t/* Extract cksum, ttl as ipv4 hdr is in cache */\n+\t\tpriv01.u16[5] = ipv4_hdr->time_to_live;\n+\t\tpriv01.u32[3] = ipv4_hdr->hdr_checksum;\n+\n+\t\t/* Extract DIP of mbuf2 */\n+\t\teth_hdr = rte_pktmbuf_mtod(mbuf2,\n+\t\t\t\tstruct rte_ether_hdr *);\n+\t\tipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);\n+\t\tdip = vsetq_lane_s32(ipv4_hdr->dst_addr, dip, 2);\n+\t\t/* Extract cksum, ttl as ipv4 hdr is in cache */\n+\t\tpriv23.u16[1] = ipv4_hdr->time_to_live;\n+\t\tpriv23.u32[1] = ipv4_hdr->hdr_checksum;\n+\n+\t\t/* Extract DIP of mbuf3 */\n+\t\teth_hdr = rte_pktmbuf_mtod(mbuf3,\n+\t\t\t\tstruct rte_ether_hdr *);\n+\t\tipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);\n+\t\tdip = vsetq_lane_s32(ipv4_hdr->dst_addr, dip, 3);\n+\n+\t\tdip = vreinterpretq_s32_u8(vrev32q_u8(\n+\t\t\t\t\tvreinterpretq_u8_s32(dip)));\n+\t\t/* Extract cksum, ttl as ipv4 hdr is in cache */\n+\t\tpriv23.u16[5] = ipv4_hdr->time_to_live;\n+\t\tpriv23.u32[3] = ipv4_hdr->hdr_checksum;\n+\n+\t\t/* Perform LPM lookup to get NH and next node */\n+\t\trte_lpm_lookupx4(lpm, dip, result.u32, drop_nh);\n+\t\tpriv01.u16[0] = result.u16[0];\n+\t\tpriv01.u16[4] = result.u16[2];\n+\t\tpriv23.u16[0] = result.u16[4];\n+\t\tpriv23.u16[4] = result.u16[6];\n+\n+\t\trte_node_mbuf_priv1(mbuf0)->u = priv01.u64[0];\n+\t\trte_node_mbuf_priv1(mbuf1)->u = priv01.u64[1];\n+\t\trte_node_mbuf_priv1(mbuf2)->u = priv23.u64[0];\n+\t\trte_node_mbuf_priv1(mbuf3)->u = priv23.u64[1];\n+\n+\t\t/* Enqueue four to next node */\n+\t\t/* TODO: Do we need a macro for this ?*/\n+\t\trte_edge_t fix_spec = (next_index ^ result.u16[1]) |\n+\t\t\t(next_index ^ result.u16[3]) |\n+\t\t\t(next_index ^ result.u16[5]) |\n+\t\t\t(next_index ^ result.u16[7]);\n+\n+\t\tif (unlikely(fix_spec)) {\n+\n+\t\t\t/* Copy things succesfully speculated till now */\n+\t\t\trte_memcpy(to_next, from,\n+\t\t\t\t\tlast_spec * sizeof(from[0]));\n+\t\t\tfrom += last_spec;\n+\t\t\tto_next += last_spec;\n+\t\t\theld += last_spec;\n+\t\t\tlast_spec = 0;\n+\n+\t\t\t/* next0 */\n+\t\t\tif (next_index == result.u16[1]) {\n+\t\t\t\tto_next[0] = from[0];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node,\n+\t\t\t\t\t\tresult.u16[1],\n+\t\t\t\t\t\tfrom[0]);\n+\t\t\t}\n+\n+\t\t\t/* next1 */\n+\t\t\tif (next_index == result.u16[3]) {\n+\t\t\t\tto_next[0] = from[1];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node,\n+\t\t\t\t\t\tresult.u16[3],\n+\t\t\t\t\t\tfrom[1]);\n+\t\t\t}\n+\n+\t\t\t/* next2 */\n+\t\t\tif (next_index == result.u16[5]) {\n+\t\t\t\tto_next[0] = from[2];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node,\n+\t\t\t\t\t\tresult.u16[5],\n+\t\t\t\t\t\tfrom[2]);\n+\t\t\t}\n+\n+\t\t\t/* next3 */\n+\t\t\tif (next_index == result.u16[7]) {\n+\t\t\t\tto_next[0] = from[3];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node,\n+\t\t\t\t\t\tresult.u16[7],\n+\t\t\t\t\t\tfrom[3]);\n+\t\t\t}\n+\n+\t\t\tfrom += 4;\n+\t\t} else {\n+\t\t\tlast_spec += 4;\n+\t\t}\n+\t}\n+\n+\twhile (n_left_from > 0) {\n+\t\tuint32_t next_hop;\n+\t\tuint16_t next0;\n+\n+\t\tmbuf0 = pkts[0];\n+\n+\t\tpkts += 1;\n+\t\tn_left_from -= 1;\n+\n+\t\t/* Extract DIP of mbuf0 */\n+\t\teth_hdr = rte_pktmbuf_mtod(mbuf0,\n+\t\t\t\tstruct rte_ether_hdr *);\n+\t\tipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);\n+\t\t/* Extract cksum, ttl as ipv4 hdr is in cache */\n+\t\trte_node_mbuf_priv1(mbuf0)->cksum =\n+\t\t\tipv4_hdr->hdr_checksum;\n+\t\trte_node_mbuf_priv1(mbuf0)->ttl =\n+\t\t\tipv4_hdr->time_to_live;\n+\n+\t\trc = rte_lpm_lookup(lpm,\n+\t\t\t\trte_be_to_cpu_32(ipv4_hdr->dst_addr),\n+\t\t\t\t&next_hop);\n+\t\tnext_hop = (rc == 0) ? next_hop : drop_nh;\n+\n+\t\trte_node_mbuf_priv1(mbuf0)->nh = (uint16_t)next_hop;\n+\t\tnext_hop = next_hop >> 16;\n+\t\tnext0 = (uint16_t)next_hop;\n+\n+\t\tif (unlikely(next_index ^ next0)) {\n+\t\t\t/* Copy things succesfully speculated till now */\n+\t\t\trte_memcpy(to_next, from,\n+\t\t\t\t\tlast_spec * sizeof(from[0]));\n+\t\t\tfrom += last_spec;\n+\t\t\tto_next += last_spec;\n+\t\t\theld += last_spec;\n+\t\t\tlast_spec = 0;\n+\n+\t\t\trte_node_enqueue_x1(graph, node,\n+\t\t\t\t\tnext0, from[0]);\n+\t\t\tfrom += 1;\n+\t\t} else {\n+\t\t\tlast_spec += 1;\n+\t\t}\n+\t}\n+\n+\t/* !!! Home run !!! */\n+\tif (likely(last_spec == nb_objs)) {\n+\t\trte_node_next_stream_move(graph, node, next_index);\n+\t\treturn nb_objs;\n+\t}\n+\theld += last_spec;\n+\trte_memcpy(to_next, from,\n+\t\t\tlast_spec * sizeof(from[0]));\n+\trte_node_next_stream_put(graph, node, next_index, held);\n+\n+\treturn nb_objs;\n+}\n+\n+#elif defined(RTE_ARCH_X86)\n+/* X86 SSE */\n+static uint16_t\n+ip4_lookup_node_process(struct rte_graph *graph,\n+                        struct rte_node *node,\n+\t\t\tvoid **objs, uint16_t nb_objs)\n+{\n+\tstruct rte_mbuf *mbuf0, *mbuf1, *mbuf2, *mbuf3, **pkts;\n+\trte_edge_t next0, next1, next2, next3, next_index;\n+\tstruct rte_ipv4_hdr *ipv4_hdr;\n+\tstruct rte_ether_hdr *eth_hdr;\n+\tuint32_t ip0, ip1, ip2, ip3;\n+\tvoid **to_next, **from;\n+\tuint16_t last_spec = 0;\n+\tuint16_t n_left_from;\n+\tstruct rte_lpm *lpm;\n+\tuint16_t held = 0;\n+\tuint32_t drop_nh;\n+\trte_xmm_t dst;\n+\t__m128i dip; /* SSE register */\n+\tint rc, i;\n+\n+\t/* Speculative next */\n+\tnext_index = IP4_LOOKUP_NEXT_REWRITE;\n+\tdrop_nh = ((uint32_t)IP4_LOOKUP_NEXT_PKT_DROP) << 16; /* Drop node */\n+\n+\t/* Get socket specific lpm from ctx */\n+\tlpm = *((struct rte_lpm **)node->ctx);\n+\n+\tpkts = (struct rte_mbuf **)objs;\n+\tfrom = objs;\n+\tn_left_from = nb_objs;\n+\n+\tif (n_left_from >= 4) {\n+\t\tfor (i = 0; i < 4; i++) {\n+\t\t\trte_prefetch0(rte_pktmbuf_mtod(pkts[i],\n+\t\t\t\t\t       struct rte_ether_hdr *) + 1);\n+\t\t}\n+\t}\n+\n+\t/* Get stream for the speculated next node */\n+\tto_next = rte_node_next_stream_get(graph, node,\n+\t\t\tnext_index, nb_objs);\n+\twhile (n_left_from >= 4) {\n+\n+\t\t/* Prefetch next-next mbufs */\n+\t\tif (likely(n_left_from >= 11)) {\n+\t\t\trte_prefetch0(pkts[8]);\n+\t\t\trte_prefetch0(pkts[9]);\n+\t\t\trte_prefetch0(pkts[10]);\n+\t\t\trte_prefetch0(pkts[11]);\n+\t\t}\n+\n+\t\t/* Prefetch next mbuf data */\n+\t\tif (likely(n_left_from >= 7 )) {\n+\t\t\trte_prefetch0(rte_pktmbuf_mtod(pkts[4],\n+\t\t\t\t\t\tstruct rte_ether_hdr *) + 1);\n+\t\t\trte_prefetch0(rte_pktmbuf_mtod(pkts[5],\n+\t\t\t\t\t\tstruct rte_ether_hdr *) + 1);\n+\t\t\trte_prefetch0(rte_pktmbuf_mtod(pkts[6],\n+\t\t\t\t\t\tstruct rte_ether_hdr *) + 1);\n+\t\t\trte_prefetch0(rte_pktmbuf_mtod(pkts[7],\n+\t\t\t\t\t\tstruct rte_ether_hdr *) + 1);\n+\t\t}\n+\n+\t\tmbuf0 = pkts[0];\n+\t\tmbuf1 = pkts[1];\n+\t\tmbuf2 = pkts[2];\n+\t\tmbuf3 = pkts[3];\n+\n+\t\tpkts += 4;\n+\t\tn_left_from -= 4;\n+\n+\t\t/* Extract DIP of mbuf0 */\n+\t\teth_hdr = rte_pktmbuf_mtod(mbuf0,\n+\t\t\t\tstruct rte_ether_hdr *);\n+\t\tipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);\n+\t\tip0 = ipv4_hdr->dst_addr;\n+\t\t/* Extract cksum, ttl as ipv4 hdr is in cache */\n+\t\trte_node_mbuf_priv1(mbuf0)->cksum =\n+\t\t\tipv4_hdr->hdr_checksum;\n+\t\trte_node_mbuf_priv1(mbuf0)->ttl =\n+\t\t\tipv4_hdr->time_to_live;\n+\n+\t\t/* Extract DIP of mbuf1 */\n+\t\teth_hdr = rte_pktmbuf_mtod(mbuf1,\n+\t\t\t\tstruct rte_ether_hdr *);\n+\t\tipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);\n+\t\tip1 = ipv4_hdr->dst_addr;\n+\t\t/* Extract cksum, ttl as ipv4 hdr is in cache */\n+\t\trte_node_mbuf_priv1(mbuf1)->cksum =\n+\t\t\tipv4_hdr->hdr_checksum;\n+\t\trte_node_mbuf_priv1(mbuf1)->ttl =\n+\t\t\tipv4_hdr->time_to_live;\n+\n+\t\t/* Extract DIP of mbuf2 */\n+\t\teth_hdr = rte_pktmbuf_mtod(mbuf2,\n+\t\t\t\tstruct rte_ether_hdr *);\n+\t\tipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);\n+\t\tip2 = ipv4_hdr->dst_addr;\n+\t\t/* Extract cksum, ttl as ipv4 hdr is in cache */\n+\t\trte_node_mbuf_priv1(mbuf2)->cksum =\n+\t\t\tipv4_hdr->hdr_checksum;\n+\t\trte_node_mbuf_priv1(mbuf2)->ttl =\n+\t\t\tipv4_hdr->time_to_live;\n+\n+\t\t/* Extract DIP of mbuf3 */\n+\t\teth_hdr = rte_pktmbuf_mtod(mbuf3,\n+\t\t\t\tstruct rte_ether_hdr *);\n+\t\tipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);\n+\t\tip3 = ipv4_hdr->dst_addr;\n+\n+\t\t/* Prepare for lookup x4 */\n+\t\tdip = _mm_set_epi32(ip3, ip2, ip1, ip0);\n+\n+\t\t/* Byte swap 4 IPV4 addresses. */\n+\t\tconst  __m128i bswap_mask = _mm_set_epi8(12, 13, 14, 15,\n+\t\t\t\t8, 9, 10, 11, 4, 5, 6, 7,\n+\t\t\t\t0, 1, 2, 3);\n+\t\tdip = _mm_shuffle_epi8(dip, bswap_mask);\n+\n+\t\t/* Extract cksum, ttl as ipv4 hdr is in cache */\n+\t\trte_node_mbuf_priv1(mbuf3)->cksum =\n+\t\t\tipv4_hdr->hdr_checksum;\n+\t\trte_node_mbuf_priv1(mbuf3)->ttl =\n+\t\t\tipv4_hdr->time_to_live;\n+\n+\t\t/* Perform LPM lookup to get NH and next node */\n+\t\trte_lpm_lookupx4(lpm, dip, dst.u32, drop_nh);\n+\n+\t\t/* Extract next node id and NH */\n+\t\trte_node_mbuf_priv1(mbuf0)->nh = dst.u32[0] & 0xFFFF;\n+\t\tnext0 = (dst.u32[0] >> 16);\n+\n+\t\trte_node_mbuf_priv1(mbuf1)->nh = dst.u32[1] & 0xFFFF;\n+\t\tnext1 = (dst.u32[1] >> 16);\n+\n+\t\trte_node_mbuf_priv1(mbuf2)->nh = dst.u32[2] & 0xFFFF;\n+\t\tnext2 = (dst.u32[2] >> 16);\n+\n+\t\trte_node_mbuf_priv1(mbuf3)->nh = dst.u32[3] & 0xFFFF;\n+\t\tnext3 = (dst.u32[3] >> 16);\n+\n+\t\t/* Enqueue four to next node */\n+\t\t/* TODO: Do we need a macro for this ?*/\n+\t\trte_edge_t fix_spec = (next_index ^ next0) |\n+\t\t\t(next_index ^ next1) | (next_index ^ next2) |\n+\t\t\t(next_index ^ next3);\n+\n+\t\tif (unlikely(fix_spec)) {\n+\n+\t\t\t/* Copy things succesfully speculated till now */\n+\t\t\trte_memcpy(to_next, from,\n+\t\t\t\t\tlast_spec * sizeof(from[0]));\n+\t\t\tfrom += last_spec;\n+\t\t\tto_next += last_spec;\n+\t\t\theld += last_spec;\n+\t\t\tlast_spec = 0;\n+\n+\t\t\t/* next0 */\n+\t\t\tif (next_index == next0) {\n+\t\t\t\tto_next[0] = from[0];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node,\n+\t\t\t\t\t\tnext0, from[0]);\n+\t\t\t}\n+\n+\t\t\t/* next1 */\n+\t\t\tif (next_index == next1) {\n+\t\t\t\tto_next[0] = from[1];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node,\n+\t\t\t\t\t\tnext1, from[1]);\n+\t\t\t}\n+\n+\t\t\t/* next2 */\n+\t\t\tif (next_index == next2) {\n+\t\t\t\tto_next[0] = from[2];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node,\n+\t\t\t\t\t\tnext2, from[2]);\n+\t\t\t}\n+\n+\t\t\t/* next3 */\n+\t\t\tif (next_index == next3) {\n+\t\t\t\tto_next[0] = from[3];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node,\n+\t\t\t\t\t\tnext3, from[3]);\n+\t\t\t}\n+\n+\t\t\tfrom += 4;\n+\n+\t\t} else {\n+\t\t\tlast_spec += 4;\n+\t\t}\n+\t}\n+\n+\twhile (n_left_from > 0) {\n+\t\tuint32_t next_hop;\n+\n+\t\tmbuf0 = pkts[0];\n+\n+\t\tpkts += 1;\n+\t\tn_left_from -= 1;\n+\n+\t\t/* Extract DIP of mbuf0 */\n+\t\teth_hdr = rte_pktmbuf_mtod(mbuf0,\n+\t\t\t\tstruct rte_ether_hdr *);\n+\t\tipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);\n+\t\t/* Extract cksum, ttl as ipv4 hdr is in cache */\n+\t\trte_node_mbuf_priv1(mbuf0)->cksum =\n+\t\t\tipv4_hdr->hdr_checksum;\n+\t\trte_node_mbuf_priv1(mbuf0)->ttl =\n+\t\t\tipv4_hdr->time_to_live;\n+\n+\t\trc = rte_lpm_lookup(lpm,\n+\t\t\t\trte_be_to_cpu_32(ipv4_hdr->dst_addr),\n+\t\t\t\t&next_hop);\n+\t\tnext_hop = (rc == 0) ? next_hop : drop_nh;\n+\n+\t\trte_node_mbuf_priv1(mbuf0)->nh = next_hop & 0xFFFF;\n+\t\tnext0 = (next_hop >> 16);\n+\n+\t\tif (unlikely(next_index ^ next0)) {\n+\t\t\t/* Copy things succesfully speculated till now */\n+\t\t\trte_memcpy(to_next, from,\n+\t\t\t\t\tlast_spec * sizeof(from[0]));\n+\t\t\tfrom += last_spec;\n+\t\t\tto_next += last_spec;\n+\t\t\theld += last_spec;\n+\t\t\tlast_spec = 0;\n+\n+\t\t\trte_node_enqueue_x1(graph, node,\n+\t\t\t\t\tnext0, from[0]);\n+\t\t\tfrom += 1;\n+\t\t} else {\n+\t\t\tlast_spec += 1;\n+\t\t}\n+\t}\n+\n+\t/* !!! Home run !!! */\n+\tif (likely(last_spec == nb_objs)) {\n+\t\trte_node_next_stream_move(graph, node, next_index);\n+\t\treturn nb_objs;\n+\t}\n+\n+\theld += last_spec;\n+\t/* Copy things successfully speculated till now */\n+\trte_memcpy(to_next, from, last_spec * sizeof(from[0]));\n+\trte_node_next_stream_put(graph, node, next_index, held);\n+\n+\treturn nb_objs;\n+}\n+#else\n+static uint16_t\n+ip4_lookup_node_process(struct rte_graph *graph, struct rte_node *node,\n+\t\t\tvoid **objs, uint16_t nb_objs)\n+{\n+\tRTE_SET_USED(graph);\n+\tRTE_SET_USED(node);\n+\tRTE_SET_USED(objs);\n+\tRTE_SET_USED(nb_objs);\n+\treturn nb_objs;\n+}\n+#endif\n+\n+int rte_node_ip4_route_add(uint32_t ip, uint8_t depth, uint16_t next_hop,\n+\t\t\t   enum ip4_lookup_next_nodes next_node)\n+{\n+\tchar abuf[INET6_ADDRSTRLEN];\n+\tstruct in_addr in;\n+\tuint8_t socket;\n+\tuint32_t val;\n+\tint ret;\n+\n+\tin.s_addr = htonl(ip);\n+\tinet_ntop(AF_INET, &in, abuf, sizeof(abuf));\n+\t/* Embedded next node id in next hop */\n+\tval = (next_node << 16) | next_hop;\n+\tnode_dbg(\"ip4_lookup\", \"LPM: Adding route %s / %d nh (0x%x)\",\n+\t\t     abuf, depth, val);\n+\n+\tfor (socket = 0; socket < RTE_MAX_NUMA_NODES; socket++) {\n+\n+\t\tif (!ip4_lookup_nm.lpm_tbl[socket])\n+\t\t\tcontinue;\n+\n+\t\tret = rte_lpm_add(ip4_lookup_nm.lpm_tbl[socket], ip, depth, val);\n+\n+\t\tif (ret < 0)\n+\t\t\tnode_err(\"ip4_lookup\", \"Unable to add entry %s / %d nh (%x) \"\n+\t\t\t\t \"to LPM table on sock %d, rc=%d\\n\",\n+\t\t\t\t abuf, depth, val, socket, ret);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+setup_lpm(struct ip4_lookup_node_main *nm, int socket)\n+{\n+\tstruct rte_lpm_config config_ipv4;\n+\tchar s[64];\n+\n+\t/* One LPM table per socket */\n+\tif (nm->lpm_tbl[socket])\n+\t\treturn 0;\n+\n+\t/* create the LPM table */\n+\tconfig_ipv4.max_rules = IPV4_L3FWD_LPM_MAX_RULES;\n+\tconfig_ipv4.number_tbl8s = IPV4_L3FWD_LPM_NUMBER_TBL8S;\n+\tconfig_ipv4.flags = 0;\n+\tsnprintf(s, sizeof(s), \"IPV4_L3FWD_LPM_%d\", socket);\n+\tnm->lpm_tbl[socket] = rte_lpm_create(s, socket, &config_ipv4);\n+\tif (nm->lpm_tbl[socket] == NULL)\n+\t\trte_panic(\"ip4_lookup: Unable to create LPM table on socket %d\\n\",\n+\t\t\t   socket);\n+\n+\n+\treturn 0;\n+}\n+\n+static int\n+ip4_lookup_node_init(const struct rte_graph *graph, struct rte_node *node)\n+{\n+\tstatic uint8_t init_once;\n+\tuint16_t socket, lcore_id;\n+\tstruct rte_lpm **lpm_p = (struct rte_lpm **)&node->ctx;\n+\tint rc;\n+\n+\tRTE_SET_USED(graph);\n+\tRTE_SET_USED(node);\n+\n+\tif (!init_once) {\n+\t\t/* Setup LPM tables for all sockets */\n+\t\tRTE_LCORE_FOREACH(lcore_id) {\n+\t\t\tsocket = rte_lcore_to_socket_id(lcore_id);\n+\t\t\trc = setup_lpm(&ip4_lookup_nm, socket);\n+\t\t\tif (rc)\n+\t\t\t\tnode_err(\"ip4_lookup\",\n+\t\t\t\t\t \"Failed to setup lpm tbl for sock %u, rc=%d\",\n+\t\t\t\t\t socket, rc);\n+\t\t}\n+\t\tinit_once = 1;\n+\t}\n+\n+\t*lpm_p = ip4_lookup_nm.lpm_tbl[graph->socket];\n+\tnode_dbg(\"ip4_lookup\", \"Initialized ip4_lookup node\");\n+\treturn 0;\n+}\n+\n+\n+static struct rte_node_register ip4_lookup_node = {\n+    .process = ip4_lookup_node_process,\n+    .name = \"ip4_lookup\",\n+\n+    .init = ip4_lookup_node_init,\n+\n+    .nb_edges = IP4_LOOKUP_NEXT_MAX,\n+    .next_nodes = {\n+\t[IP4_LOOKUP_NEXT_REWRITE] = \"ip4_rewrite\",\n+\t[IP4_LOOKUP_NEXT_PKT_DROP] = \"pkt_drop\",\n+    },\n+};\n+\n+RTE_NODE_REGISTER(ip4_lookup_node);\ndiff --git a/lib/librte_node/ip4_lookup_priv.h b/lib/librte_node/ip4_lookup_priv.h\nnew file mode 100644\nindex 000000000..898eba301\n--- /dev/null\n+++ b/lib/librte_node/ip4_lookup_priv.h\n@@ -0,0 +1,17 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+#ifndef __INCLUDE_IP4_LOOKUP_PRIV_H__\n+#define __INCLUDE_IP4_LOOKUP_PRIV_H__\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#include <rte_common.h>\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* __INCLUDE_IP4_LOOKUP_PRIV_H__ */\ndiff --git a/lib/librte_node/ip4_rewrite.c b/lib/librte_node/ip4_rewrite.c\nnew file mode 100644\nindex 000000000..f0f1d599e\n--- /dev/null\n+++ b/lib/librte_node/ip4_rewrite.c\n@@ -0,0 +1,340 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#include <rte_debug.h>\n+#include <rte_ether.h>\n+#include <rte_ethdev.h>\n+#include <rte_ip.h>\n+#include <rte_mbuf.h>\n+#include <rte_malloc.h>\n+#include <rte_graph.h>\n+#include <rte_graph_worker.h>\n+#include <rte_tcp.h>\n+#include <rte_udp.h>\n+#include <rte_vect.h>\n+\n+#include <rte_node_ip4_api.h>\n+#include \"ip4_rewrite_priv.h\"\n+#include \"node_private.h\"\n+\n+static struct ip4_rewrite_node_main *ip4_rewrite_nm;\n+\n+static uint16_t\n+ip4_rewrite_node_process(struct rte_graph *graph, struct rte_node *node,\n+\t\t\tvoid **objs, uint16_t nb_objs)\n+{\n+\tstruct rte_mbuf *mbuf0, *mbuf1, *mbuf2, *mbuf3, **pkts;\n+\tstruct ip4_rewrite_nh_header *nh = ip4_rewrite_nm->nh;\n+\tuint16_t next0, next1, next2, next3, next_index;\n+\tstruct rte_ipv4_hdr *ip0, *ip1, *ip2, *ip3;\n+\tuint16_t n_left_from, held = 0, last_spec = 0;\n+\tvoid *d0, *d1, *d2, *d3;\n+\tvoid **to_next, **from;\n+\trte_xmm_t priv01;\n+\trte_xmm_t priv23;\n+\tint i;\n+\n+\t/* Speculative next as last next */\n+\tnext_index = *(uint16_t *)node->ctx;\n+\trte_prefetch0(nh);\n+\n+\tpkts = (struct rte_mbuf **)objs;\n+\tfrom = objs;\n+\tn_left_from = nb_objs;\n+\n+\tfor (i = 0; i < 4 && i < n_left_from; i++)\n+\t\trte_prefetch0(pkts[i]);\n+\n+\t/* Get stream for the speculated next node */\n+\tto_next = rte_node_next_stream_get(graph, node,\n+\t\t\tnext_index, nb_objs);\n+\t/* Update ethernet header of pkts */\n+\twhile (n_left_from >= 4) {\n+\n+\t\tif (likely(n_left_from >= 7)) {\n+\t\t\t/* Prefetch only next-mbuf struct and priv area.\n+\t\t\t * Data need not be prefetched as we only write.\n+\t\t\t */\n+\t\t\trte_prefetch0(pkts[4]);\n+\t\t\trte_prefetch0(pkts[5]);\n+\t\t\trte_prefetch0(pkts[6]);\n+\t\t\trte_prefetch0(pkts[7]);\n+\t\t}\n+\n+\t\tmbuf0 = pkts[0];\n+\t\tmbuf1 = pkts[1];\n+\t\tmbuf2 = pkts[2];\n+\t\tmbuf3 = pkts[3];\n+\n+\t\tpkts += 4;\n+\t\tn_left_from -= 4;\n+\t\tpriv01.u64[0] = rte_node_mbuf_priv1(mbuf0)->u;\n+\t\tpriv01.u64[1] = rte_node_mbuf_priv1(mbuf1)->u;\n+\t\tpriv23.u64[0] = rte_node_mbuf_priv1(mbuf2)->u;\n+\t\tpriv23.u64[1] = rte_node_mbuf_priv1(mbuf3)->u;\n+\n+\t\tpriv01.u16[2]++;\n+\t\tpriv01.u16[6]++;\n+\t\tpriv23.u16[2]++;\n+\t\tpriv23.u16[6]++;\n+\n+\t\tpriv01.u16[1]--;\n+\t\tpriv01.u16[5]--;\n+\t\tpriv23.u16[1]--;\n+\t\tpriv23.u16[5]--;\n+\n+\t\t/* Update ttl, rewrite ethernet hdr on mbuf0 */\n+\t\td0 = rte_pktmbuf_mtod(mbuf0, void *);\n+\t\trte_memcpy(d0,\n+\t\t\t\tnh[priv01.u16[0]].rewrite_data,\n+\t\t\t\tnh[priv01.u16[0]].rewrite_len);\n+\n+\t\tnext0 = nh[priv01.u16[0]].tx_node;\n+\t\tip0 = (struct rte_ipv4_hdr *)((uint8_t *)d0 +\n+\t\t\t\tsizeof(struct rte_ether_hdr));\n+\t\tip0->time_to_live = priv01.u16[1];\n+\t\tip0->hdr_checksum = priv01.u16[2];\n+\n+\n+\t\t/* Update ttl, rewrite ethernet hdr on mbuf1 */\n+\t\td1 = rte_pktmbuf_mtod(mbuf1, void *);\n+\t\trte_memcpy(d1,\n+\t\t\t\tnh[priv01.u16[4]].rewrite_data,\n+\t\t\t\tnh[priv01.u16[4]].rewrite_len);\n+\n+\t\tnext1 = nh[priv01.u16[4]].tx_node;\n+\t\tip1 = (struct rte_ipv4_hdr *)((uint8_t *)d1 +\n+\t\t\t\tsizeof(struct rte_ether_hdr));\n+\t\tip1->time_to_live = priv01.u16[5];\n+\t\tip1->hdr_checksum = priv01.u16[6];\n+\n+\n+\t\t/* Update ttl, rewrite ethernet hdr on mbuf2 */\n+\t\td2 = rte_pktmbuf_mtod(mbuf2, void *);\n+\t\trte_memcpy(d2,\n+\t\t\t\tnh[priv23.u16[0]].rewrite_data,\n+\t\t\t\tnh[priv23.u16[0]].rewrite_len);\n+\t\tnext2 = nh[priv23.u16[0]].tx_node;\n+\t\tip2 = (struct rte_ipv4_hdr *)((uint8_t *)d2 +\n+\t\t\t\tsizeof(struct rte_ether_hdr));\n+\t\tip2->time_to_live = priv23.u16[1];\n+\t\tip2->hdr_checksum = priv23.u16[2];\n+\n+\n+\t\t/* Update ttl, rewrite ethernet hdr on mbuf3 */\n+\t\td3 = rte_pktmbuf_mtod(mbuf3, void *);\n+\t\trte_memcpy(d3,\n+\t\t\t\tnh[priv23.u16[4]].rewrite_data,\n+\t\t\t\tnh[priv23.u16[4]].rewrite_len);\n+\n+\t\tnext3 = nh[priv23.u16[4]].tx_node;\n+\t\tip3 = (struct rte_ipv4_hdr *)((uint8_t *)d3 +\n+\t\t\t\tsizeof(struct rte_ether_hdr));\n+\t\tip3->time_to_live = priv23.u16[5];\n+\t\tip3->hdr_checksum = priv23.u16[6];\n+\n+\t\t/* Enqueue four to next node */\n+\t\t/* TODO: Do we need a macro for this ?*/\n+\t\trte_edge_t fix_spec = (next_index ^ next0) |\n+\t\t\t(next_index ^ next1) | (next_index ^ next2) |\n+\t\t\t(next_index ^ next3);\n+\n+\t\tif (unlikely(fix_spec)) {\n+\t\t\t/* Copy things succesfully speculated till now */\n+\t\t\trte_memcpy(to_next, from,\n+\t\t\t\t\tlast_spec * sizeof(from[0]));\n+\t\t\tfrom += last_spec;\n+\t\t\tto_next += last_spec;\n+\t\t\theld += last_spec;\n+\t\t\tlast_spec = 0;\n+\n+\t\t\t/* next0 */\n+\t\t\tif (next_index == next0) {\n+\t\t\t\tto_next[0] = from[0];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node,\n+\t\t\t\t\t\tnext0, from[0]);\n+\t\t\t}\n+\n+\t\t\t/* next1 */\n+\t\t\tif (next_index == next1) {\n+\t\t\t\tto_next[0] = from[1];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node,\n+\t\t\t\t\t\tnext1, from[1]);\n+\t\t\t}\n+\n+\t\t\t/* next2 */\n+\t\t\tif (next_index == next2) {\n+\t\t\t\tto_next[0] = from[2];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node,\n+\t\t\t\t\t\tnext2, from[2]);\n+\t\t\t}\n+\n+\t\t\t/* next3 */\n+\t\t\tif (next_index == next3) {\n+\t\t\t\tto_next[0] = from[3];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node,\n+\t\t\t\t\t\tnext3, from[3]);\n+\t\t\t}\n+\n+\t\t\tfrom += 4;\n+\n+\t\t\t/* Change speculation if last two are same */\n+\t\t\tif ((next_index != next3) &&\n+\t\t\t\t\t(next2 == next3)) {\n+\t\t\t\t/* Put the current speculated node */\n+\t\t\t\trte_node_next_stream_put(graph,\n+\t\t\t\t\t\tnode, next_index,\n+\t\t\t\t\t\theld);\n+\t\t\t\theld = 0;\n+\n+\t\t\t\t/* Get next speculated stream */\n+\t\t\t\tnext_index = next3;\n+\t\t\t\tto_next = rte_node_next_stream_get(\n+\t\t\t\t\t\tgraph, node,\n+\t\t\t\t\t\tnext_index, nb_objs);\n+\t\t\t}\n+\t\t} else {\n+\t\t\tlast_spec += 4;\n+\t\t}\n+\t}\n+\n+\twhile (n_left_from > 0) {\n+\t\tuint16_t chksum;\n+\t\tmbuf0 = pkts[0];\n+\n+\t\tpkts += 1;\n+\t\tn_left_from -= 1;\n+\n+\t\td0 = rte_pktmbuf_mtod(mbuf0, void *);\n+\t\trte_memcpy(d0,\n+\t\t\t\tnh[rte_node_mbuf_priv1(mbuf0)->nh].rewrite_data,\n+\t\t\t\tnh[rte_node_mbuf_priv1(mbuf0)->nh].rewrite_len);\n+\n+\t\tnext0 = nh[rte_node_mbuf_priv1(mbuf0)->nh].tx_node;\n+\t\tip0 = (struct rte_ipv4_hdr *)((uint8_t *)d0 +\n+\t\t\t\tsizeof(struct rte_ether_hdr));\n+\t\tchksum = rte_node_mbuf_priv1(mbuf0)->cksum +\n+\t\t\trte_cpu_to_be_16(0x0100);\n+\t\tchksum += chksum >= 0xffff;\n+\t\tip0->hdr_checksum = chksum;\n+\t\tip0->time_to_live = rte_node_mbuf_priv1(mbuf0)->ttl - 1;\n+\n+\t\tif (unlikely(next_index ^ next0)) {\n+\t\t\t/* Copy things succesfully speculated till now */\n+\t\t\trte_memcpy(to_next, from,\n+\t\t\t\t\tlast_spec * sizeof(from[0]));\n+\t\t\tfrom += last_spec;\n+\t\t\tto_next += last_spec;\n+\t\t\theld += last_spec;\n+\t\t\tlast_spec = 0;\n+\n+\t\t\trte_node_enqueue_x1(graph, node,\n+\t\t\t\t\tnext0, from[0]);\n+\t\t\tfrom += 1;\n+\t\t} else {\n+\t\t\tlast_spec += 1;\n+\t\t}\n+\t}\n+\n+\t/* !!! Home run !!! */\n+\tif (likely(last_spec == nb_objs)) {\n+\t\trte_node_next_stream_move(graph, node, next_index);\n+\t\treturn nb_objs;\n+\t}\n+\n+\theld += last_spec;\n+\trte_memcpy(to_next, from, last_spec * sizeof(from[0]));\n+\trte_node_next_stream_put(graph, node, next_index, held);\n+\t/* Save the last next used */\n+\t*(uint16_t *)node->ctx = next_index;\n+\n+\treturn nb_objs;\n+}\n+\n+static int\n+ip4_rewrite_node_init(const struct rte_graph *graph, struct rte_node *node)\n+{\n+\n+\tRTE_SET_USED(graph);\n+\tRTE_SET_USED(node);\n+\n+\tnode_dbg(\"ip4_rewrite\", \"Initialized ip4_rewrite node initialized\");\n+\treturn 0;\n+}\n+\n+\n+int\n+ip4_rewrite_set_next(uint16_t port_id, uint16_t next_index)\n+{\n+\tif (ip4_rewrite_nm == NULL) {\n+\t\tip4_rewrite_nm = rte_zmalloc(\"ip4_rewrite\",\n+\t\t\t\t\tsizeof(struct ip4_rewrite_node_main),\n+\t\t\t\t\tRTE_CACHE_LINE_SIZE);\n+\t\tif (ip4_rewrite_nm == NULL)\n+\t\t\treturn -ENOMEM;\n+\t}\n+\tip4_rewrite_nm->next_index[port_id] = next_index;\n+\n+\treturn 0;\n+}\n+\n+int\n+rte_node_ip4_rewrite_add(uint16_t next_hop, uint8_t *rewrite_data,\n+\t\t\t uint8_t rewrite_len, uint16_t dst_port)\n+{\n+\tstruct ip4_rewrite_nh_header *nh;\n+\n+\tif (next_hop >= RTE_GRAPH_IP4_REWRITE_MAX_NH)\n+\t\treturn -EINVAL;\n+\n+\tif (rewrite_len > RTE_GRAPH_IP4_REWRITE_MAX_LEN)\n+\t\treturn -EINVAL;\n+\n+\tif (ip4_rewrite_nm == NULL) {\n+\t\tip4_rewrite_nm = rte_zmalloc(\"ip4_rewrite\",\n+\t\t\t\t\tsizeof(struct ip4_rewrite_node_main),\n+\t\t\t\t\tRTE_CACHE_LINE_SIZE);\n+\t\tif (ip4_rewrite_nm == NULL)\n+\t\t\treturn -ENOMEM;\n+\t}\n+\n+\t/* Check if dst port doesn't exist as edge */\n+\tif (!ip4_rewrite_nm->next_index[dst_port])\n+\t\treturn -EINVAL;\n+\n+\t/* Update next hop */\n+\tnh = &ip4_rewrite_nm->nh[next_hop];\n+\n+\tmemcpy(nh->rewrite_data, rewrite_data, rewrite_len);\n+\tnh->tx_node = ip4_rewrite_nm->next_index[dst_port];\n+\tnh->rewrite_len = rewrite_len;\n+\tnh->enabled = true;\n+\n+\treturn 0;\n+}\n+\n+struct rte_node_register ip4_rewrite_node = {\n+\t.process = ip4_rewrite_node_process,\n+\t.name = \"ip4_rewrite\",\n+\t/* Default edge i.e '0' is pkt drop */\n+\t.nb_edges = 1,\n+\t.next_nodes = {\n+\t\t[0] = \"pkt_drop\",\n+\t},\n+\t.init = ip4_rewrite_node_init,\n+};\n+\n+RTE_NODE_REGISTER(ip4_rewrite_node);\ndiff --git a/lib/librte_node/ip4_rewrite_priv.h b/lib/librte_node/ip4_rewrite_priv.h\nnew file mode 100644\nindex 000000000..128148faa\n--- /dev/null\n+++ b/lib/librte_node/ip4_rewrite_priv.h\n@@ -0,0 +1,44 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+#ifndef __INCLUDE_IP4_REWRITE_PRIV_H__\n+#define __INCLUDE_IP4_REWRITE_PRIV_H__\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#include <rte_common.h>\n+\n+#define RTE_GRAPH_IP4_REWRITE_MAX_NH  64\n+#define RTE_GRAPH_IP4_REWRITE_MAX_LEN 56\n+\n+struct ip4_rewrite_nh_header {\n+    uint16_t rewrite_len;\n+    uint16_t tx_node;\n+    uint16_t enabled;\n+    uint16_t rsvd;\n+    union {\n+\tstruct {\n+\t    struct rte_ether_addr dst;\n+\t    struct rte_ether_addr src;\n+\t};\n+\tuint8_t rewrite_data[RTE_GRAPH_IP4_REWRITE_MAX_LEN];\n+    };\n+};\n+\n+struct ip4_rewrite_node_main {\n+    struct ip4_rewrite_nh_header nh[RTE_GRAPH_IP4_REWRITE_MAX_NH];\n+    /* Next index of each configured port */\n+    uint16_t next_index[RTE_MAX_ETHPORTS];\n+};\n+\n+extern struct rte_node_register ip4_rewrite_node;\n+\n+int ip4_rewrite_set_next(uint16_t port_id, uint16_t next_index);\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* __INCLUDE_IP4_REWRITE_PRIV_H__ */\ndiff --git a/lib/librte_node/log.c b/lib/librte_node/log.c\nnew file mode 100644\nindex 000000000..f035f91e8\n--- /dev/null\n+++ b/lib/librte_node/log.c\n@@ -0,0 +1,14 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#include \"node_private.h\"\n+\n+int rte_node_logtype;\n+\n+RTE_INIT(rte_node_init_log)\n+{\n+\trte_node_logtype = rte_log_register(\"lib.node\");\n+\tif (rte_node_logtype >= 0)\n+\t\trte_log_set_level(rte_node_logtype, RTE_LOG_INFO);\n+}\ndiff --git a/lib/librte_node/meson.build b/lib/librte_node/meson.build\nnew file mode 100644\nindex 000000000..59e11e5b4\n--- /dev/null\n+++ b/lib/librte_node/meson.build\n@@ -0,0 +1,8 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(C) 2020 Marvell International Ltd.\n+\n+sources = files('null.c', 'log.c', 'ethdev_rx.c', 'ethdev_tx.c', 'ip4_lookup.c',\n+\t\t'ip4_rewrite.c', 'pkt_drop.c', 'ethdev_ctrl.c')\n+headers = files('rte_node_ip4_api.h', 'rte_node_eth_api.h')\n+allow_experimental_apis = true\n+deps += ['graph', 'mbuf', 'lpm', 'ethdev', 'mempool', 'cryptodev']\ndiff --git a/lib/librte_node/node_private.h b/lib/librte_node/node_private.h\nnew file mode 100644\nindex 000000000..9f40ff222\n--- /dev/null\n+++ b/lib/librte_node/node_private.h\n@@ -0,0 +1,61 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#ifndef __NODE_PRIVATE_H__\n+#define __NODE_PRIVATE_H__\n+\n+#include <rte_common.h>\n+#include <rte_mbuf.h>\n+#include <rte_crypto.h>\n+#include <rte_log.h>\n+\n+extern int rte_node_logtype;\n+#define NODE_LOG(level, node_name, ...) \\\n+\trte_log(RTE_LOG_ ## level, rte_node_logtype,\t\t\t       \\\n+\t\tRTE_FMT(\"NODE %s: %s():%u \" RTE_FMT_HEAD(__VA_ARGS__,)\\\n+\t\t\t\"\\n\", node_name, __func__, __LINE__,\t       \\\n+\t\t\tRTE_FMT_TAIL(__VA_ARGS__,)))\n+\n+#define node_err(node_name, ...)\tNODE_LOG(ERR, node_name,  __VA_ARGS__)\n+#define node_info(node_name, ...)\tNODE_LOG(INFO, node_name,  __VA_ARGS__)\n+#define node_dbg(node_name,  ...)\tNODE_LOG(DEBUG, node_name,  __VA_ARGS__)\n+\n+struct rte_node_mbuf_priv1 {\n+\tunion {\n+\t\t/* IP4 rewrite */\n+\t\tstruct {\n+\t\t\tuint16_t nh;\n+\t\t\tuint16_t ttl;\n+\t\t\tuint32_t cksum;\n+\t\t};\n+\n+\t\tuint64_t u;\n+\t};\n+};\n+\n+struct rte_node_mbuf_priv2 {\n+\tunion {\n+\t\t/* Sym crypto */\n+\t\tstruct {\n+\t\t\tstruct rte_crypto_op op;\n+\t\t};\n+\t};\n+} __rte_cache_aligned;\n+\n+#define RTE_NODE_MBUF_PRIV2_SIZE sizeof(struct rte_node_mbuf_priv2)\n+\n+static __rte_always_inline struct rte_node_mbuf_priv1 *\n+rte_node_mbuf_priv1(struct rte_mbuf *m)\n+{\n+\treturn (struct rte_node_mbuf_priv1 *)&m->udata64;\n+}\n+\n+static __rte_always_inline struct rte_node_mbuf_priv2 *\n+rte_node_mbuf_priv2(struct rte_mbuf *m)\n+{\n+\treturn (struct rte_node_mbuf_priv2 *)rte_mbuf_to_priv(m);\n+}\n+\n+\n+#endif /* __NODE_PRIVATE_H__ */\ndiff --git a/lib/librte_node/null.c b/lib/librte_node/null.c\nnew file mode 100644\nindex 000000000..5359f958f\n--- /dev/null\n+++ b/lib/librte_node/null.c\n@@ -0,0 +1,23 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#include <rte_graph.h>\n+\n+static uint16_t\n+null(struct rte_graph *graph, struct rte_node *node, void **objs,\n+\tuint16_t nb_objs)\n+{\n+\tRTE_SET_USED(node);\n+\tRTE_SET_USED(objs);\n+\tRTE_SET_USED(graph);\n+\n+\treturn nb_objs;\n+}\n+\n+static struct rte_node_register null_node = {\n+\t.name\t = \"null\",\n+\t.process = null,\n+};\n+\n+RTE_NODE_REGISTER(null_node);\ndiff --git a/lib/librte_node/pkt_drop.c b/lib/librte_node/pkt_drop.c\nnew file mode 100644\nindex 000000000..643af6d75\n--- /dev/null\n+++ b/lib/librte_node/pkt_drop.c\n@@ -0,0 +1,26 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#include <rte_debug.h>\n+#include <rte_mbuf.h>\n+#include <rte_graph.h>\n+\n+static uint16_t\n+pkt_drop_process(struct rte_graph *graph, struct rte_node *node, void **objs,\n+\t\t uint16_t nb_objs)\n+{\n+\tRTE_SET_USED(node);\n+\tRTE_SET_USED(graph);\n+\n+\trte_pktmbuf_free_bulk((struct rte_mbuf **)objs, nb_objs);\n+\n+\treturn nb_objs;\n+}\n+\n+static struct rte_node_register pkt_drop_node = {\n+\t.process = pkt_drop_process,\n+\t.name = \"pkt_drop\",\n+};\n+\n+RTE_NODE_REGISTER(pkt_drop_node);\ndiff --git a/lib/librte_node/rte_node_eth_api.h b/lib/librte_node/rte_node_eth_api.h\nnew file mode 100644\nindex 000000000..80c69fa66\n--- /dev/null\n+++ b/lib/librte_node/rte_node_eth_api.h\n@@ -0,0 +1,31 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+#ifndef __INCLUDE_RTE_NODE_ETH_API_H__\n+#define __INCLUDE_RTE_NODE_ETH_API_H__\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#include <stdbool.h>\n+#include <rte_common.h>\n+#include <rte_mempool.h>\n+#include <rte_graph.h>\n+\n+struct rte_node_ethdev_config {\n+\tuint16_t port_id;\n+\tuint16_t num_rx_queues;\n+\tuint16_t num_tx_queues;\n+\tstruct rte_mempool **mp;\n+\tuint16_t mp_count;\n+};\n+\n+__rte_experimental int\n+rte_node_eth_config(struct rte_node_ethdev_config *cfg,\n+\t\t   uint16_t cnt, uint16_t nb_graphs);\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* __INCLUDE_RTE_NODE_ETH_API_H__ */\ndiff --git a/lib/librte_node/rte_node_ip4_api.h b/lib/librte_node/rte_node_ip4_api.h\nnew file mode 100644\nindex 000000000..7cbb018c2\n--- /dev/null\n+++ b/lib/librte_node/rte_node_ip4_api.h\n@@ -0,0 +1,33 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+#ifndef __INCLUDE_RTE_NODE_IP4_API_H__\n+#define __INCLUDE_RTE_NODE_IP4_API_H__\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+\n+/* IP4_LOOKUP node defines */\n+enum ip4_lookup_next_nodes {\n+    IP4_LOOKUP_NEXT_REWRITE,\n+    IP4_LOOKUP_NEXT_PKT_DROP,\n+    IP4_LOOKUP_NEXT_MAX,\n+};\n+\n+__rte_experimental\n+int rte_node_ip4_route_add(uint32_t ip, uint8_t depth,\n+\t\t\t   uint16_t next_hop,\n+\t\t\t   enum ip4_lookup_next_nodes next_node);\n+\n+__rte_experimental\n+int rte_node_ip4_rewrite_add(uint16_t next_hop, uint8_t *rewrite_data,\n+\t\t\t     uint8_t rewrite_len, uint16_t dst_port);\n+\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* __INCLUDE_RTE_NODE_IP4_API_H__ */\ndiff --git a/lib/librte_node/rte_node_version.map b/lib/librte_node/rte_node_version.map\nnew file mode 100644\nindex 000000000..a799b0d38\n--- /dev/null\n+++ b/lib/librte_node/rte_node_version.map\n@@ -0,0 +1,9 @@\n+EXPERIMENTAL {\n+\tglobal:\n+\n+\trte_node_eth_config;\n+\trte_node_ip4_route_add;\n+\trte_node_ip4_rewrite_add;\n+\trte_node_logtype;\n+\tlocal: *;\n+};\ndiff --git a/lib/meson.build b/lib/meson.build\nindex 4089ce0c3..60d7e5560 100644\n--- a/lib/meson.build\n+++ b/lib/meson.build\n@@ -30,7 +30,7 @@ libraries = [\n \t# add pkt framework libs which use other libs from above\n \t'port', 'table', 'pipeline',\n \t# flow_classify lib depends on pkt framework table lib\n-\t'flow_classify', 'bpf', 'graph', 'telemetry']\n+\t'flow_classify', 'bpf', 'graph', 'node', 'telemetry']\n \n if is_windows\n \tlibraries = ['kvargs','eal'] # only supported libraries for windows\n@@ -182,6 +182,9 @@ foreach l:libraries\n \n \t\t\tdpdk_libraries = [shared_lib] + dpdk_libraries\n \t\t\tdpdk_static_libraries = [static_lib] + dpdk_static_libraries\n+\t\t\tif libname == 'rte_node'\n+\t\t\t\tdpdk_graph_nodes = [static_lib]\n+\t\t\tendif\n \t\tendif # sources.length() > 0\n \n \t\tset_variable('shared_rte_' + name, shared_dep)\ndiff --git a/meson.build b/meson.build\nindex b7ae9c8d9..811c96421 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -16,6 +16,7 @@ cc = meson.get_compiler('c')\n dpdk_conf = configuration_data()\n dpdk_libraries = []\n dpdk_static_libraries = []\n+dpdk_graph_nodes = []\n dpdk_driver_classes = []\n dpdk_drivers = []\n dpdk_extra_ldflags = []\ndiff --git a/mk/rte.app.mk b/mk/rte.app.mk\nindex e169d7a7b..72e8f81cc 100644\n--- a/mk/rte.app.mk\n+++ b/mk/rte.app.mk\n@@ -99,6 +99,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER)        += -lrte_reorder\n _LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED)          += -lrte_sched\n _LDLIBS-$(CONFIG_RTE_LIBRTE_RCU)            += -lrte_rcu\n _LDLIBS-$(CONFIG_RTE_LIBRTE_GRAPH)          += -lrte_graph\n+_LDLIBS-$(CONFIG_RTE_LIBRTE_NODE)           += -lrte_node\n \n ifeq ($(CONFIG_RTE_EXEC_ENV_LINUX),y)\n _LDLIBS-$(CONFIG_RTE_LIBRTE_KNI)            += -lrte_kni\n",
    "prefixes": [
        "RFC",
        "2/5"
    ]
}