Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/128483/?format=api
http://patches.dpdk.org/api/patches/128483/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230609191245.252521-3-zhirun.yan@intel.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": "<20230609191245.252521-3-zhirun.yan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230609191245.252521-3-zhirun.yan@intel.com", "date": "2023-06-09T19:12:31", "name": "[v12,02/16] graph: split graph worker into common and default model", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "b724b98753b75c236de7ec86b0bbcb1668113d3f", "submitter": { "id": 1154, "url": "http://patches.dpdk.org/api/people/1154/?format=api", "name": "Yan, Zhirun", "email": "zhirun.yan@intel.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/20230609191245.252521-3-zhirun.yan@intel.com/mbox/", "series": [ { "id": 28444, "url": "http://patches.dpdk.org/api/series/28444/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28444", "date": "2023-06-09T19:12:29", "name": "graph enhancement for multi-core dispatch", "version": 12, "mbox": "http://patches.dpdk.org/series/28444/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/128483/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/128483/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 73B7442C71;\n\tFri, 9 Jun 2023 21:20:07 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D3BDF42D12;\n\tFri, 9 Jun 2023 21:19:57 +0200 (CEST)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 6E83342D12\n for <dev@dpdk.org>; Fri, 9 Jun 2023 21:19:55 +0200 (CEST)", "from fmsmga006.fm.intel.com ([10.253.24.20])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Jun 2023 12:19:54 -0700", "from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94])\n by fmsmga006.fm.intel.com with ESMTP; 09 Jun 2023 12:19:51 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1686338395; x=1717874395;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=rRIGmbx9MfZtMW/TqYBPHfPViTj6EY2eFS4HJ/tCyuY=;\n b=bPdIrbRWkjGhh3kgrB+JqSkn/+0dqwiGRhGKQBbVPiyVe/cKiMLyQ8uw\n IJAmtJdj9oFw/4wUx0Tabx8ueGjt7N0oT2KZfkTqRoyysYUHOMQdVhxxd\n 7clEi/KwiiId4CEMHwxk0k2P44gagBw3hXr0ND1FBbYP6wsto+glqvDRy\n UC5PJcIKvN3dfv+Lz/0IX0vCNqHNjVbLAeizst778EJv8fLgFsCj6ypEJ\n sjbAc2SHbwloV2bU6FhyXB2xeBdNeV5i/lKncSctGUA2gumkOUbCHx28e\n Ci31lkjqJ428uDnYAUm7z4H/nonUfDYZxkR+BcCv4vSxrasrAfQEkcH/o Q==;", "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,10736\"; a=\"360154931\"", "E=Sophos;i=\"6.00,230,1681196400\"; d=\"scan'208\";a=\"360154931\"", "E=McAfee;i=\"6600,9927,10736\"; a=\"957254621\"", "E=Sophos;i=\"6.00,230,1681196400\"; d=\"scan'208\";a=\"957254621\"" ], "X-ExtLoop1": "1", "From": "Zhirun Yan <zhirun.yan@intel.com>", "To": "dev@dpdk.org, jerinj@marvell.com, kirankumark@marvell.com,\n ndabilpuram@marvell.com, stephen@networkplumber.org,\n pbhagavatula@marvell.com, jerinjacobk@gmail.com, david.marchand@redhat.com", "Cc": "cunming.liang@intel.com, haiyue.wang@intel.com,\n mattias.ronnblom@ericsson.com, Zhirun Yan <zhirun.yan@intel.com>", "Subject": "[PATCH v12 02/16] graph: split graph worker into common and default\n model", "Date": "Sat, 10 Jun 2023 03:12:31 +0800", "Message-Id": "<20230609191245.252521-3-zhirun.yan@intel.com>", "X-Mailer": "git-send-email 2.37.2", "In-Reply-To": "<20230609191245.252521-1-zhirun.yan@intel.com>", "References": "<20230608151844.1823783-1-zhirun.yan@intel.com>\n <20230609191245.252521-1-zhirun.yan@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "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" }, "content": "To support multiple graph worker model, split graph into common\nand default. Naming the current walk function as rte_graph_model_rtc\ncause the default model is RTC(Run-to-completion).\n\nSigned-off-by: Haiyue Wang <haiyue.wang@intel.com>\nSigned-off-by: Cunming Liang <cunming.liang@intel.com>\nSigned-off-by: Zhirun Yan <zhirun.yan@intel.com>\nAcked-by: Jerin Jacob <jerinj@marvell.com>\n---\n app/test/test_graph.c | 2 +-\n app/test/test_graph_perf.c | 2 +-\n doc/api/doxy-api-index.md | 2 +-\n doc/guides/prog_guide/graph_lib.rst | 2 +-\n examples/l3fwd-graph/main.c | 2 +-\n lib/graph/graph_pcap.c | 2 +-\n lib/graph/graph_private.h | 2 +-\n lib/graph/meson.build | 2 +-\n lib/graph/rte_graph_model_rtc.h | 62 +++++++++++++++++++++++++++++\n lib/graph/rte_graph_worker.h | 35 ++++++++++++++++\n lib/graph/rte_graph_worker_common.h | 57 --------------------------\n lib/node/ethdev_rx.c | 2 +-\n lib/node/ethdev_tx.c | 2 +-\n lib/node/ip4_lookup.c | 2 +-\n lib/node/ip4_rewrite.c | 2 +-\n lib/node/pkt_cls.c | 2 +-\n 16 files changed, 110 insertions(+), 70 deletions(-)\n create mode 100644 lib/graph/rte_graph_model_rtc.h\n create mode 100644 lib/graph/rte_graph_worker.h", "diff": "diff --git a/app/test/test_graph.c b/app/test/test_graph.c\nindex c2c855f776..1a2d1e6fab 100644\n--- a/app/test/test_graph.c\n+++ b/app/test/test_graph.c\n@@ -24,7 +24,7 @@ test_node_list_dump(void)\n #else\n \n #include <rte_graph.h>\n-#include <rte_graph_worker_common.h>\n+#include <rte_graph_worker.h>\n #include <rte_mbuf.h>\n #include <rte_mbuf_dyn.h>\n #include <rte_random.h>\ndiff --git a/app/test/test_graph_perf.c b/app/test/test_graph_perf.c\nindex 5c4e9c917b..c5b463f700 100644\n--- a/app/test/test_graph_perf.c\n+++ b/app/test/test_graph_perf.c\n@@ -23,7 +23,7 @@ test_graph_perf_func(void)\n #else\n \n #include <rte_graph.h>\n-#include <rte_graph_worker_common.h>\n+#include <rte_graph_worker.h>\n #include <rte_lcore.h>\n #include <rte_malloc.h>\n #include <rte_mbuf.h>\ndiff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md\nindex 6804d02c3c..c709fd48ad 100644\n--- a/doc/api/doxy-api-index.md\n+++ b/doc/api/doxy-api-index.md\n@@ -201,7 +201,7 @@ The public API headers are grouped by topics:\n [table_em](@ref rte_swx_table_em.h)\n [table_wm](@ref rte_swx_table_wm.h)\n * [graph](@ref rte_graph.h):\n- [graph_worker](@ref rte_graph_worker_common.h)\n+ [graph_worker](@ref rte_graph_worker.h)\n * graph_nodes:\n [eth_node](@ref rte_node_eth_api.h),\n [ip4_node](@ref rte_node_ip4_api.h)\ndiff --git a/doc/guides/prog_guide/graph_lib.rst b/doc/guides/prog_guide/graph_lib.rst\nindex 3eaa4b7f92..1cfdc86433 100644\n--- a/doc/guides/prog_guide/graph_lib.rst\n+++ b/doc/guides/prog_guide/graph_lib.rst\n@@ -26,7 +26,7 @@ Features of the Graph library are:\n - Low overhead statistics collection infrastructure.\n - Support to export the graph as a Graphviz dot file. See ``rte_graph_export()``.\n - Allow having another graph walk implementation in the future by segregating\n- the fast path(``rte_graph_worker_common.h``) and slow path code.\n+ the fast path(``rte_graph_worker.h``) and slow path code.\n \n Advantages of Graph architecture\n --------------------------------\ndiff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c\nindex 48825da0ce..5feeab4f0f 100644\n--- a/examples/l3fwd-graph/main.c\n+++ b/examples/l3fwd-graph/main.c\n@@ -23,7 +23,7 @@\n #include <rte_cycles.h>\n #include <rte_eal.h>\n #include <rte_ethdev.h>\n-#include <rte_graph_worker_common.h>\n+#include <rte_graph_worker.h>\n #include <rte_launch.h>\n #include <rte_lcore.h>\n #include <rte_log.h>\ndiff --git a/lib/graph/graph_pcap.c b/lib/graph/graph_pcap.c\nindex 8a220370fa..6c43330029 100644\n--- a/lib/graph/graph_pcap.c\n+++ b/lib/graph/graph_pcap.c\n@@ -10,7 +10,7 @@\n #include <rte_mbuf.h>\n #include <rte_pcapng.h>\n \n-#include \"rte_graph_worker_common.h\"\n+#include \"rte_graph_worker.h\"\n \n #include \"graph_pcap_private.h\"\n \ndiff --git a/lib/graph/graph_private.h b/lib/graph/graph_private.h\nindex 307e5f70bc..eacdef45f0 100644\n--- a/lib/graph/graph_private.h\n+++ b/lib/graph/graph_private.h\n@@ -13,7 +13,7 @@\n #include <rte_spinlock.h>\n \n #include \"rte_graph.h\"\n-#include \"rte_graph_worker_common.h\"\n+#include \"rte_graph_worker.h\"\n \n extern int rte_graph_logtype;\n \ndiff --git a/lib/graph/meson.build b/lib/graph/meson.build\nindex 4e2b612ad3..3526d1b5d4 100644\n--- a/lib/graph/meson.build\n+++ b/lib/graph/meson.build\n@@ -16,6 +16,6 @@ sources = files(\n 'graph_populate.c',\n 'graph_pcap.c',\n )\n-headers = files('rte_graph.h', 'rte_graph_worker_common.h')\n+headers = files('rte_graph.h', 'rte_graph_worker.h')\n \n deps += ['eal', 'pcapng']\ndiff --git a/lib/graph/rte_graph_model_rtc.h b/lib/graph/rte_graph_model_rtc.h\nnew file mode 100644\nindex 0000000000..10b359772f\n--- /dev/null\n+++ b/lib/graph/rte_graph_model_rtc.h\n@@ -0,0 +1,62 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ * Copyright(C) 2023 Intel Corporation\n+ */\n+\n+#include \"rte_graph_worker_common.h\"\n+\n+/**\n+ * Perform graph walk on the circular buffer and invoke the process function\n+ * of the nodes and collect the stats.\n+ *\n+ * @param graph\n+ * Graph pointer returned from rte_graph_lookup function.\n+ *\n+ * @see rte_graph_lookup()\n+ */\n+static inline void\n+rte_graph_walk_rtc(struct rte_graph *graph)\n+{\n+\tconst rte_graph_off_t *cir_start = graph->cir_start;\n+\tconst rte_node_t mask = graph->cir_mask;\n+\tuint32_t head = graph->head;\n+\tstruct rte_node *node;\n+\tuint64_t start;\n+\tuint16_t rc;\n+\tvoid **objs;\n+\n+\t/*\n+\t * Walk on the source node(s) ((cir_start - head) -> cir_start) and then\n+\t * on the pending streams (cir_start -> (cir_start + mask) -> cir_start)\n+\t * in a circular buffer fashion.\n+\t *\n+\t *\t+-----+ <= cir_start - head [number of source nodes]\n+\t *\t| |\n+\t *\t| ... | <= source nodes\n+\t *\t| |\n+\t *\t+-----+ <= cir_start [head = 0] [tail = 0]\n+\t *\t| |\n+\t *\t| ... | <= pending streams\n+\t *\t| |\n+\t *\t+-----+ <= cir_start + mask\n+\t */\n+\twhile (likely(head != graph->tail)) {\n+\t\tnode = (struct rte_node *)RTE_PTR_ADD(graph, cir_start[(int32_t)head++]);\n+\t\tRTE_ASSERT(node->fence == RTE_GRAPH_FENCE);\n+\t\tobjs = node->objs;\n+\t\trte_prefetch0(objs);\n+\n+\t\tif (rte_graph_has_stats_feature()) {\n+\t\t\tstart = rte_rdtsc();\n+\t\t\trc = node->process(graph, node, objs, node->idx);\n+\t\t\tnode->total_cycles += rte_rdtsc() - start;\n+\t\t\tnode->total_calls++;\n+\t\t\tnode->total_objs += rc;\n+\t\t} else {\n+\t\t\tnode->process(graph, node, objs, node->idx);\n+\t\t}\n+\t\t\tnode->idx = 0;\n+\t\t\thead = likely((int32_t)head > 0) ? head & mask : head;\n+\t}\n+\tgraph->tail = 0;\n+}\ndiff --git a/lib/graph/rte_graph_worker.h b/lib/graph/rte_graph_worker.h\nnew file mode 100644\nindex 0000000000..5b58f7bda9\n--- /dev/null\n+++ b/lib/graph/rte_graph_worker.h\n@@ -0,0 +1,35 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ * Copyright(C) 2023 Intel Corporation\n+ */\n+\n+#ifndef _RTE_GRAPH_WORKER_H_\n+#define _RTE_GRAPH_WORKER_H_\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#include \"rte_graph_model_rtc.h\"\n+\n+/**\n+ * Perform graph walk on the circular buffer and invoke the process function\n+ * of the nodes and collect the stats.\n+ *\n+ * @param graph\n+ * Graph pointer returned from rte_graph_lookup function.\n+ *\n+ * @see rte_graph_lookup()\n+ */\n+__rte_experimental\n+static inline void\n+rte_graph_walk(struct rte_graph *graph)\n+{\n+\trte_graph_walk_rtc(graph);\n+}\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* _RTE_GRAPH_WORKER_H_ */\ndiff --git a/lib/graph/rte_graph_worker_common.h b/lib/graph/rte_graph_worker_common.h\nindex 5a4b54e490..475ccdc0ee 100644\n--- a/lib/graph/rte_graph_worker_common.h\n+++ b/lib/graph/rte_graph_worker_common.h\n@@ -128,63 +128,6 @@ __rte_experimental\n void __rte_node_stream_alloc_size(struct rte_graph *graph,\n \t\t\t\t struct rte_node *node, uint16_t req_size);\n \n-/**\n- * Perform graph walk on the circular buffer and invoke the process function\n- * of the nodes and collect the stats.\n- *\n- * @param graph\n- * Graph pointer returned from rte_graph_lookup function.\n- *\n- * @see rte_graph_lookup()\n- */\n-__rte_experimental\n-static inline void\n-rte_graph_walk(struct rte_graph *graph)\n-{\n-\tconst rte_graph_off_t *cir_start = graph->cir_start;\n-\tconst rte_node_t mask = graph->cir_mask;\n-\tuint32_t head = graph->head;\n-\tstruct rte_node *node;\n-\tuint64_t start;\n-\tuint16_t rc;\n-\tvoid **objs;\n-\n-\t/*\n-\t * Walk on the source node(s) ((cir_start - head) -> cir_start) and then\n-\t * on the pending streams (cir_start -> (cir_start + mask) -> cir_start)\n-\t * in a circular buffer fashion.\n-\t *\n-\t *\t+-----+ <= cir_start - head [number of source nodes]\n-\t *\t| |\n-\t *\t| ... | <= source nodes\n-\t *\t| |\n-\t *\t+-----+ <= cir_start [head = 0] [tail = 0]\n-\t *\t| |\n-\t *\t| ... | <= pending streams\n-\t *\t| |\n-\t *\t+-----+ <= cir_start + mask\n-\t */\n-\twhile (likely(head != graph->tail)) {\n-\t\tnode = (struct rte_node *)RTE_PTR_ADD(graph, cir_start[(int32_t)head++]);\n-\t\tRTE_ASSERT(node->fence == RTE_GRAPH_FENCE);\n-\t\tobjs = node->objs;\n-\t\trte_prefetch0(objs);\n-\n-\t\tif (rte_graph_has_stats_feature()) {\n-\t\t\tstart = rte_rdtsc();\n-\t\t\trc = node->process(graph, node, objs, node->idx);\n-\t\t\tnode->total_cycles += rte_rdtsc() - start;\n-\t\t\tnode->total_calls++;\n-\t\t\tnode->total_objs += rc;\n-\t\t} else {\n-\t\t\tnode->process(graph, node, objs, node->idx);\n-\t\t}\n-\t\tnode->idx = 0;\n-\t\thead = likely((int32_t)head > 0) ? head & mask : head;\n-\t}\n-\tgraph->tail = 0;\n-}\n-\n /* Fast path helper functions */\n \n /**\ndiff --git a/lib/node/ethdev_rx.c b/lib/node/ethdev_rx.c\nindex e681f9f6ec..a19237b42f 100644\n--- a/lib/node/ethdev_rx.c\n+++ b/lib/node/ethdev_rx.c\n@@ -6,7 +6,7 @@\n #include <rte_ethdev.h>\n #include <rte_ether.h>\n #include <rte_graph.h>\n-#include <rte_graph_worker_common.h>\n+#include <rte_graph_worker.h>\n \n #include \"ethdev_rx_priv.h\"\n #include \"node_private.h\"\ndiff --git a/lib/node/ethdev_tx.c b/lib/node/ethdev_tx.c\nindex 17231d8b34..7d2d72f823 100644\n--- a/lib/node/ethdev_tx.c\n+++ b/lib/node/ethdev_tx.c\n@@ -5,7 +5,7 @@\n #include <rte_debug.h>\n #include <rte_ethdev.h>\n #include <rte_graph.h>\n-#include <rte_graph_worker_common.h>\n+#include <rte_graph_worker.h>\n \n #include \"ethdev_tx_priv.h\"\n \ndiff --git a/lib/node/ip4_lookup.c b/lib/node/ip4_lookup.c\nindex b84c066fe3..8bce03d7db 100644\n--- a/lib/node/ip4_lookup.c\n+++ b/lib/node/ip4_lookup.c\n@@ -8,7 +8,7 @@\n #include <rte_ethdev.h>\n #include <rte_ether.h>\n #include <rte_graph.h>\n-#include <rte_graph_worker_common.h>\n+#include <rte_graph_worker.h>\n #include <rte_ip.h>\n #include <rte_lpm.h>\n \ndiff --git a/lib/node/ip4_rewrite.c b/lib/node/ip4_rewrite.c\nindex 72ca4b1370..34a920df5e 100644\n--- a/lib/node/ip4_rewrite.c\n+++ b/lib/node/ip4_rewrite.c\n@@ -5,7 +5,7 @@\n #include <rte_ethdev.h>\n #include <rte_ether.h>\n #include <rte_graph.h>\n-#include <rte_graph_worker_common.h>\n+#include <rte_graph_worker.h>\n #include <rte_ip.h>\n #include <rte_malloc.h>\n #include <rte_vect.h>\ndiff --git a/lib/node/pkt_cls.c b/lib/node/pkt_cls.c\nindex 03f8b03f6c..3e75f2cf78 100644\n--- a/lib/node/pkt_cls.c\n+++ b/lib/node/pkt_cls.c\n@@ -3,7 +3,7 @@\n */\n \n #include <rte_graph.h>\n-#include <rte_graph_worker_common.h>\n+#include <rte_graph_worker.h>\n \n #include \"pkt_cls_priv.h\"\n #include \"node_private.h\"\n", "prefixes": [ "v12", "02/16" ] }{ "id": 128483, "url": "