Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/128210/?format=api
http://patches.dpdk.org/api/patches/128210/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230606144746.708388-5-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": "<20230606144746.708388-5-zhirun.yan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230606144746.708388-5-zhirun.yan@intel.com", "date": "2023-06-06T14:47:33", "name": "[v8,04/17] graph: add get/set graph worker model APIs", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "1b49872291f2c1ceec6afb5baf7dc5aa338e4881", "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/20230606144746.708388-5-zhirun.yan@intel.com/mbox/", "series": [ { "id": 28374, "url": "http://patches.dpdk.org/api/series/28374/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28374", "date": "2023-06-06T14:47:29", "name": "graph enhancement for multi-core dispatch", "version": 8, "mbox": "http://patches.dpdk.org/series/28374/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/128210/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/128210/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 A1A8E42C40;\n\tTue, 6 Jun 2023 16:55:10 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B346B42D2C;\n\tTue, 6 Jun 2023 16:55:02 +0200 (CEST)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by mails.dpdk.org (Postfix) with ESMTP id E10D442D20\n for <dev@dpdk.org>; Tue, 6 Jun 2023 16:54:59 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 06 Jun 2023 07:54:56 -0700", "from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94])\n by fmsmga005.fm.intel.com with ESMTP; 06 Jun 2023 07:54:53 -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=1686063300; x=1717599300;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=RP7fhQAtDrfeSkqotzaE+h/ZpaOREV75sEAYMlRmT2k=;\n b=FdLv7JmrI5w4XGkI3/CkLkzJ0BkygLlxGz8OTWHEYmz1y3rbCWethHGr\n R76h9d0QEoCbYR1tH+hv0abierCkjrYWsF7+aLPTn8Z4RsR2bAy/klGiF\n sgP7d/LsZ6Ora2XWyigTGXfhir9vy7fXfy0MC+UEBJ+8A+mqhCL3n2MK2\n 6BBhhfOe9QGiOxwjqmU/6sxHJZJiih5er8wL0kCYFf7Ts9Rxi4pC05Jnb\n IgBe0aSC/xvBimgOy/Em2sZpnX0SjqAzl/jlX+bgURidsJU2KMumivk7G\n PZePebmr5XEE+QCkmaKOSGmVQlUdjSivpc0OZKN9f6fHzQbL7P67ZcFtk w==;", "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,10733\"; a=\"356705091\"", "E=Sophos;i=\"6.00,221,1681196400\"; d=\"scan'208\";a=\"356705091\"", "E=McAfee;i=\"6600,9927,10733\"; a=\"1039222437\"", "E=Sophos;i=\"6.00,221,1681196400\"; d=\"scan'208\";a=\"1039222437\"" ], "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 v8 04/17] graph: add get/set graph worker model APIs", "Date": "Tue, 6 Jun 2023 22:47:33 +0800", "Message-Id": "<20230606144746.708388-5-zhirun.yan@intel.com>", "X-Mailer": "git-send-email 2.37.2", "In-Reply-To": "<20230606144746.708388-1-zhirun.yan@intel.com>", "References": "<20230605111923.3772260-1-zhirun.yan@intel.com>\n <20230606144746.708388-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..3a4215f1a2\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": [ "v8", "04/17" ] }{ "id": 128210, "url": "