Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/128251/?format=api
http://patchwork.dpdk.org/api/patches/128251/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230607035144.1214492-5-zhirun.yan@intel.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20230607035144.1214492-5-zhirun.yan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230607035144.1214492-5-zhirun.yan@intel.com", "date": "2023-06-07T03:51:31", "name": "[v9,04/17] graph: add get/set graph worker model APIs", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "820e04d45e4763aeb80c81cdaa87fa7801f0aba7", "submitter": { "id": 1154, "url": "http://patchwork.dpdk.org/api/people/1154/?format=api", "name": "Yan, Zhirun", "email": "zhirun.yan@intel.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230607035144.1214492-5-zhirun.yan@intel.com/mbox/", "series": [ { "id": 28383, "url": "http://patchwork.dpdk.org/api/series/28383/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28383", "date": "2023-06-07T03:51:27", "name": "graph enhancement for multi-core dispatch", "version": 9, "mbox": "http://patchwork.dpdk.org/series/28383/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/128251/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/128251/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 3CA5642C46;\n\tWed, 7 Jun 2023 06:00:16 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2842442B8E;\n\tWed, 7 Jun 2023 06:00:16 +0200 (CEST)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 78FE341149\n for <dev@dpdk.org>; Wed, 7 Jun 2023 06:00:14 +0200 (CEST)", "from orsmga006.jf.intel.com ([10.7.209.51])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 06 Jun 2023 21:00:13 -0700", "from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94])\n by orsmga006.jf.intel.com with ESMTP; 06 Jun 2023 20:59:56 -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=1686110414; x=1717646414;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=zGmy4M/KmHqnKXj+x7V5VYTe7/K5AqJAn1bfsRAnPYE=;\n b=fqHcRsAgRM4WNq/W/UJ73xhm3BK1zDUygV/jfeJ14hG8h+Ll4o2SpRjN\n gu4vv7OFdYTNU5Od072SBgWl/cfkXn0wjiF1La3yg88lJGSeimRF3ysCX\n Ck6UW2+FOotqNsvWO2SmR1tvwQzVruI0Wo+2X6/WMHL7iq7hnD8NtzivX\n /qrN2k0iGos9rHOlO6Pk2XOyRsvRVw9r7LCBOYEKCmbplKxs+H6ItlIIf\n 1KRi+c+xXVTI8kWDLwjddjFrIWDeImhFQHUrMOV92LK/JM3Zj6OtGIpuk\n ejNtNXXrNKq7U23WJh/69ler9UUeWQENyNO3dHXhspq6hluh+Eg+1YbRb Q==;", "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,10733\"; a=\"359336593\"", "E=Sophos;i=\"6.00,222,1681196400\"; d=\"scan'208\";a=\"359336593\"", "E=McAfee;i=\"6600,9927,10733\"; a=\"686759218\"", "E=Sophos;i=\"6.00,222,1681196400\"; d=\"scan'208\";a=\"686759218\"" ], "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", "Cc": "cunming.liang@intel.com, haiyue.wang@intel.com,\n mattias.ronnblom@ericsson.com, Zhirun Yan <zhirun.yan@intel.com>", "Subject": "[PATCH v9 04/17] graph: add get/set graph worker model APIs", "Date": "Wed, 7 Jun 2023 11:51:31 +0800", "Message-Id": "<20230607035144.1214492-5-zhirun.yan@intel.com>", "X-Mailer": "git-send-email 2.37.2", "In-Reply-To": "<20230607035144.1214492-1-zhirun.yan@intel.com>", "References": "<20230606144746.708388-1-zhirun.yan@intel.com>\n <20230607035144.1214492-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": "Add new get/set APIs to configure graph worker model which is used to\ndetermine which model will be chosen.\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>\n---\n lib/graph/meson.build | 1 +\n lib/graph/rte_graph_worker.c | 21 ++++++++++\n lib/graph/rte_graph_worker_common.h | 61 +++++++++++++++++++++++++++++\n lib/graph/version.map | 3 ++\n 4 files changed, 86 insertions(+)\n create mode 100644 lib/graph/rte_graph_worker.c", "diff": "diff --git a/lib/graph/meson.build b/lib/graph/meson.build\nindex 3526d1b5d4..9fab8243da 100644\n--- a/lib/graph/meson.build\n+++ b/lib/graph/meson.build\n@@ -15,6 +15,7 @@ sources = files(\n 'graph_stats.c',\n 'graph_populate.c',\n 'graph_pcap.c',\n+ 'rte_graph_worker.c',\n )\n headers = files('rte_graph.h', 'rte_graph_worker.h')\n \ndiff --git a/lib/graph/rte_graph_worker.c b/lib/graph/rte_graph_worker.c\nnew file mode 100644\nindex 0000000000..b43330bc8d\n--- /dev/null\n+++ b/lib/graph/rte_graph_worker.c\n@@ -0,0 +1,21 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2023 Intel Corporation\n+ */\n+\n+#include \"rte_graph_worker_common.h\"\n+#include \"graph_private.h\"\n+\n+int\n+rte_graph_worker_model_set(uint32_t model)\n+{\n+\tstruct graph_head *graph_head = graph_list_head_get();\n+\tstruct graph *graph;\n+\n+\tif (!graph_model_is_valid(model))\n+\t\treturn -EINVAL;\n+\n+\tSTAILQ_FOREACH(graph, graph_head, next)\n+\t\t\tgraph->graph->model = model;\n+\n+\treturn 0;\n+}\ndiff --git a/lib/graph/rte_graph_worker_common.h b/lib/graph/rte_graph_worker_common.h\nindex 41428974db..5dba3c0edd 100644\n--- a/lib/graph/rte_graph_worker_common.h\n+++ b/lib/graph/rte_graph_worker_common.h\n@@ -29,6 +29,13 @@\n extern \"C\" {\n #endif\n \n+/** Graph worker models */\n+/* If adding new entry, then update graph_model_is_valid API. */\n+#define RTE_GRAPH_MODEL_RTC 0 /**< Run-To-Completion model. It is the default model. */\n+#define RTE_GRAPH_MODEL_DEFAULT RTE_GRAPH_MODEL_RTC /**< Default graph model. */\n+#define RTE_GRAPH_MODEL_MCORE_DISPATCH 1\n+/**< Dispatch model to support cross-core dispatching within core affinity. */\n+\n /**\n * @internal\n *\n@@ -41,6 +48,7 @@ struct rte_graph {\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+\tuint32_t model;\t\t /**< graph model */\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@@ -490,6 +498,59 @@ rte_node_next_stream_move(struct rte_graph *graph, struct rte_node *src,\n \t}\n }\n \n+/**\n+ * Test the validity of model.\n+ *\n+ * @param id\n+ * Node id to check.\n+ *\n+ * @return\n+ * true if graph model is valid, false otherwise.\n+ */\n+static __rte_always_inline\n+bool\n+graph_model_is_valid(uint32_t model)\n+{\n+\tif (model > RTE_GRAPH_MODEL_MCORE_DISPATCH)\n+\t\treturn false;\n+\n+\treturn true;\n+}\n+\n+/**\n+ * @note This function does not perform any locking, and is only safe to call\n+ * before graph running. It will set all graphs the same model.\n+ *\n+ * @param model\n+ * Name of the graph worker model.\n+ *\n+ * @return\n+ * 0 on success, -1 otherwise.\n+ */\n+__rte_experimental\n+int rte_graph_worker_model_set(uint32_t model);\n+\n+/**\n+ * Get the graph worker model\n+ *\n+ * @note All graph will use the same model and this function will get model from the first one\n+ *\n+ * @param graph\n+ * Graph pointer.\n+ *\n+ * @return\n+ * Graph worker model on success.\n+ */\n+__rte_experimental\n+static inline uint32_t\n+rte_graph_worker_model_get(struct rte_graph *graph)\n+{\n+\tif (!graph_model_is_valid(graph->model))\n+\t\treturn -EINVAL;\n+\n+\treturn graph->model;\n+}\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/graph/version.map b/lib/graph/version.map\nindex 13b838752d..eea73ec9ca 100644\n--- a/lib/graph/version.map\n+++ b/lib/graph/version.map\n@@ -43,5 +43,8 @@ EXPERIMENTAL {\n \trte_node_next_stream_put;\n \trte_node_next_stream_move;\n \n+\trte_graph_worker_model_set;\n+\trte_graph_worker_model_get;\n+\n \tlocal: *;\n };\n", "prefixes": [ "v9", "04/17" ] }{ "id": 128251, "url": "