Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/128402/?format=api
http://patches.dpdk.org/api/patches/128402/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230608095759.1800617-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": "<20230608095759.1800617-5-zhirun.yan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230608095759.1800617-5-zhirun.yan@intel.com", "date": "2023-06-08T09:57:47", "name": "[v10,04/16] graph: add get/set graph worker model APIs", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "1a3f768614dea3efb92175e1322fc18129c5c615", "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/20230608095759.1800617-5-zhirun.yan@intel.com/mbox/", "series": [ { "id": 28417, "url": "http://patches.dpdk.org/api/series/28417/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28417", "date": "2023-06-08T09:57:43", "name": "graph enhancement for multi-core dispatch", "version": 10, "mbox": "http://patches.dpdk.org/series/28417/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/128402/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/128402/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 648E442C5C;\n\tThu, 8 Jun 2023 12:05:32 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5864242D30;\n\tThu, 8 Jun 2023 12:05:20 +0200 (CEST)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by mails.dpdk.org (Postfix) with ESMTP id DB3DC427F5\n for <dev@dpdk.org>; Thu, 8 Jun 2023 12:05:18 +0200 (CEST)", "from orsmga001.jf.intel.com ([10.7.209.18])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 08 Jun 2023 03:05:17 -0700", "from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94])\n by orsmga001.jf.intel.com with ESMTP; 08 Jun 2023 03:05:09 -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=1686218719; x=1717754719;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=ETiUL2xz7//VURybVxXoyFFdELGyo7N2iWLmP8G1aws=;\n b=m0gHh47co/xS+NZ/kT1seBcJ6jcDwsBky1g6wrMTZhzi2gYYumudlR8p\n CXMXLmqIYercsucFWj6dY1WHZGCpKaAlehWJRJSxVmkD0RrJXpVik57IU\n VsNrYoYLqEc37651QeREzd24jIdGYLSo8xwoVSIu2jPk87nqDWd9xigMS\n 5AbJAdfypJhlwgrD4UeFFdETKkvmGXc2HSu9MYyE14qaWTLlmo17XjNDD\n 04rg9sdAqJxgF6JSdaWEh1AZMKE5kCj2EPgM8q72+MPK1LVGyBinqdLHv\n F3uFxbJGicHaa5KmbezLy1Nq3cH/GfX0qLQ23Rs+0gVMCVNy2ZO8DR+R6 A==;", "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,10734\"; a=\"336896198\"", "E=Sophos;i=\"6.00,226,1681196400\"; d=\"scan'208\";a=\"336896198\"", "E=McAfee;i=\"6600,9927,10734\"; a=\"743053678\"", "E=Sophos;i=\"6.00,226,1681196400\"; d=\"scan'208\";a=\"743053678\"" ], "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 v10 04/16] graph: add get/set graph worker model APIs", "Date": "Thu, 8 Jun 2023 17:57:47 +0800", "Message-Id": "<20230608095759.1800617-5-zhirun.yan@intel.com>", "X-Mailer": "git-send-email 2.37.2", "In-Reply-To": "<20230608095759.1800617-1-zhirun.yan@intel.com>", "References": "<20230607035144.1214492-1-zhirun.yan@intel.com>\n <20230608095759.1800617-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 | 39 ++++++++++++++++\n lib/graph/rte_graph_worker_common.h | 69 +++++++++++++++++++++++++++++\n lib/graph/version.map | 5 +++\n 4 files changed, 114 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..7e2a918fae\n--- /dev/null\n+++ b/lib/graph/rte_graph_worker.c\n@@ -0,0 +1,39 @@\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+bool\n+rte_graph_model_is_valid(uint8_t model)\n+{\n+\tif (model > RTE_GRAPH_MODEL_MCORE_DISPATCH)\n+\t\treturn false;\n+\n+\treturn true;\n+}\n+\n+int\n+rte_graph_worker_model_set(uint8_t model)\n+{\n+\tstruct graph_head *graph_head = graph_list_head_get();\n+\tstruct graph *graph;\n+\n+\tif (!rte_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+}\n+\n+uint8_t\n+rte_graph_worker_model_get(struct rte_graph *graph)\n+{\n+\tif (!rte_graph_model_is_valid(graph->model))\n+\t\treturn -EINVAL;\n+\n+\treturn graph->model;\n+}\ndiff --git a/lib/graph/rte_graph_worker_common.h b/lib/graph/rte_graph_worker_common.h\nindex 41428974db..71fd620035 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_MCORE_DISPATCH 1\n+/**< Dispatch model to support cross-core dispatching within core affinity. */\n+#define RTE_GRAPH_MODEL_DEFAULT RTE_GRAPH_MODEL_RTC /**< Default graph model. */\n+\n /**\n * @internal\n *\n@@ -41,6 +48,9 @@ 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+\tuint8_t model;\t\t /**< graph model */\n+\tuint8_t reserved1;\t /**< Reserved for future use. */\n+\tuint16_t reserved2;\t /**< Reserved for future use. */\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 +500,65 @@ 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 model\n+ * Model to check.\n+ *\n+ * @return\n+ * True if graph model is valid, false otherwise.\n+ */\n+bool\n+rte_graph_model_is_valid(uint8_t model);\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(uint8_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+ * Used for slow path.\n+ *\n+ * @param graph\n+ * Graph pointer.\n+ *\n+ * @return\n+ * Graph worker model on success.\n+ */\n+__rte_experimental\n+uint8_t rte_graph_worker_model_get(struct rte_graph *graph);\n+\n+/**\n+ * Get the graph worker model without check\n+ *\n+ * @note All graph will use the same model and this function will get model from the first one.\n+ * Used for fast path.\n+ *\n+ * @param graph\n+ * Graph pointer.\n+ *\n+ * @return\n+ * Graph worker model on success.\n+ */\n+__rte_experimental\n+static __rte_always_inline\n+uint8_t rte_graph_worker_model_no_check_get(struct rte_graph *graph)\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..d8b66640bd 100644\n--- a/lib/graph/version.map\n+++ b/lib/graph/version.map\n@@ -43,5 +43,10 @@ EXPERIMENTAL {\n \trte_node_next_stream_put;\n \trte_node_next_stream_move;\n \n+\tgraph_model_is_valid;\n+\trte_graph_worker_model_set;\n+\trte_graph_worker_model_get;\n+\trte_graph_worker_model_no_check_get;\n+\n \tlocal: *;\n };\n", "prefixes": [ "v10", "04/16" ] }{ "id": 128402, "url": "