Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/128485/?format=api
http://patches.dpdk.org/api/patches/128485/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230609191245.252521-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": "<20230609191245.252521-5-zhirun.yan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230609191245.252521-5-zhirun.yan@intel.com", "date": "2023-06-09T19:12:33", "name": "[v12,04/16] graph: add get/set graph worker model APIs", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "8fca90d59cfb20e2a294f336c9cad15284c34085", "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-5-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/128485/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/128485/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 1BB0542C71;\n\tFri, 9 Jun 2023 21:20:22 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 116E142D30;\n\tFri, 9 Jun 2023 21:20:03 +0200 (CEST)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 39C5242D2C\n for <dev@dpdk.org>; Fri, 9 Jun 2023 21:20:01 +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:20:00 -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:57 -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=1686338401; x=1717874401;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=vpi1N5BxNES4t4q/a0t3n2p5pS80Q4v3uxnVZllt9vQ=;\n b=bPL9qFWTPR+rzXJ7bQj0r51dYpudPY0Nak1WOI0yEjPFCCFdf3vWjJww\n 7v98VwKoHmE1gcaLU+5CQ6kV4J05m7qoQ5LlvVBC0thEgqAbAoZ3TPcPn\n RnE65vWStpZi6lRxf6i+Z7ifQqbkurW0vKhTZqDdJKhHQngkceuCWxOBI\n b2d/sTiFMes2f0BlwPZm78XUHqgygv9cyG8/lna7h5+VXAaIc5tCy9HHN\n 7h/MTJWPVK2juhLLJx8u01g5GGx4CoRJOVS8Fkh6VpbyGHFNuXtx/WdDx\n S07HQ/19wPa9hVJewFqekKlJgoIrf76Hd7JsZMaospohDQ+uEjnxRIlPm A==;", "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,10736\"; a=\"360154963\"", "E=Sophos;i=\"6.00,230,1681196400\"; d=\"scan'208\";a=\"360154963\"", "E=McAfee;i=\"6600,9927,10736\"; a=\"957254642\"", "E=Sophos;i=\"6.00,230,1681196400\"; d=\"scan'208\";a=\"957254642\"" ], "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 04/16] graph: add get/set graph worker model APIs", "Date": "Sat, 10 Jun 2023 03:12:33 +0800", "Message-Id": "<20230609191245.252521-5-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": "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>\nAcked-by: Jerin Jacob <jerinj@marvell.com>\n---\n lib/graph/meson.build | 1 +\n lib/graph/rte_graph_worker.c | 39 ++++++++++++++++\n lib/graph/rte_graph_worker_common.h | 70 +++++++++++++++++++++++++++++\n lib/graph/version.map | 5 +++\n 4 files changed, 115 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 a90addb172..123600f939 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+/* When adding a new graph model entry, update rte_graph_model_is_valid() implementation. */\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,66 @@ 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+__rte_experimental\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..e9a680a45e 100644\n--- a/lib/graph/version.map\n+++ b/lib/graph/version.map\n@@ -14,10 +14,15 @@ EXPERIMENTAL {\n \trte_graph_lookup;\n \trte_graph_list_dump;\n \trte_graph_max_count;\n+\trte_graph_model_is_valid;\n \trte_graph_node_get;\n \trte_graph_node_get_by_name;\n \trte_graph_obj_dump;\n \trte_graph_walk;\n+\trte_graph_worker_model_get;\n+\trte_graph_worker_model_no_check_get;\n+\trte_graph_worker_model_set;\n+\n \n \trte_graph_cluster_stats_create;\n \trte_graph_cluster_stats_destroy;\n", "prefixes": [ "v12", "04/16" ] }{ "id": 128485, "url": "