Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/126786/?format=api
http://patches.dpdk.org/api/patches/126786/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230509060347.1237884-7-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": "<20230509060347.1237884-7-zhirun.yan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230509060347.1237884-7-zhirun.yan@intel.com", "date": "2023-05-09T06:03:38", "name": "[v6,06/15] graph: introduce graph bind unbind API", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "c6c97c0abf45937a5fe77fd565e624eab12695f3", "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/20230509060347.1237884-7-zhirun.yan@intel.com/mbox/", "series": [ { "id": 27966, "url": "http://patches.dpdk.org/api/series/27966/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27966", "date": "2023-05-09T06:03:32", "name": "graph enhancement for multi-core dispatch", "version": 6, "mbox": "http://patches.dpdk.org/series/27966/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/126786/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/126786/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 31A2E42AA0;\n\tTue, 9 May 2023 08:04:48 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 987A3427EE;\n\tTue, 9 May 2023 08:04:15 +0200 (CEST)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id EC1CD42D44\n for <dev@dpdk.org>; Tue, 9 May 2023 08:04:13 +0200 (CEST)", "from fmsmga007.fm.intel.com ([10.253.24.52])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 08 May 2023 23:04:13 -0700", "from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94])\n by fmsmga007.fm.intel.com with ESMTP; 08 May 2023 23:04:11 -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=1683612254; x=1715148254;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=7LT7PudsIXJpl8yQoD1GACMthd/Zgjf+7gCNRlaQI9g=;\n b=JvQsYJGtEYTWr6UjP8IE/4y+xXTlBx2uAhkvZ3lD6txei5pv7VNAmgLi\n zo/u7OmjRG7WO7n19Cj/i+FuMT0LoSZ/Rtnm+eC1WNbJUcbDuX3tbLjcG\n DjupgsGb12VKF7539hvc3fOs/D591Oyy56cBEvP8J6DrGEsSQgmBS9iGg\n 0q0cNAJdCNWpXGcgkXQqwuCOgtnlGiILf3AMsMsIBtl3pexSVp7A7VPPK\n p5i/4HS8pcLDnoeiyKFiwJmzUsEKl/cNYoSfX9uN6Levj7+rCHQ/AZYeS\n M6sYstcNNAW9bb7yvDohH5TVjWVoJuDHmzE/mPh8QvqVlyIHneA8ZtNyA w==;", "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,10704\"; a=\"351983107\"", "E=Sophos;i=\"5.99,261,1677571200\"; d=\"scan'208\";a=\"351983107\"", "E=McAfee;i=\"6600,9927,10704\"; a=\"701700252\"", "E=Sophos;i=\"5.99,261,1677571200\"; d=\"scan'208\";a=\"701700252\"" ], "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", "Cc": "cunming.liang@intel.com, haiyue.wang@intel.com,\n Zhirun Yan <zhirun.yan@intel.com>", "Subject": "[PATCH v6 06/15] graph: introduce graph bind unbind API", "Date": "Tue, 9 May 2023 15:03:38 +0900", "Message-Id": "<20230509060347.1237884-7-zhirun.yan@intel.com>", "X-Mailer": "git-send-email 2.37.2", "In-Reply-To": "<20230509060347.1237884-1-zhirun.yan@intel.com>", "References": "<20230331040306.3143693-1-zhirun.yan@intel.com>\n <20230509060347.1237884-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 lcore_id for graph to hold affinity core id where graph would run on.\nAdd bind/unbind API to set/unset graph affinity attribute. lcore_id will\nbe set as MAX by default, it means not enable this attribute.\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/graph.c | 59 +++++++++++++++++++++++++++++++++++++++\n lib/graph/graph_private.h | 2 ++\n lib/graph/rte_graph.h | 22 +++++++++++++++\n lib/graph/version.map | 2 ++\n 4 files changed, 85 insertions(+)", "diff": "diff --git a/lib/graph/graph.c b/lib/graph/graph.c\nindex 5582631b53..b8ef86da45 100644\n--- a/lib/graph/graph.c\n+++ b/lib/graph/graph.c\n@@ -260,6 +260,64 @@ graph_mem_fixup_secondary(struct rte_graph *graph)\n \treturn graph_mem_fixup_node_ctx(graph);\n }\n \n+static __rte_always_inline bool\n+graph_src_node_avail(struct graph *graph)\n+{\n+\tstruct graph_node *graph_node;\n+\n+\tSTAILQ_FOREACH(graph_node, &graph->node_list, next)\n+\t\tif ((graph_node->node->flags & RTE_NODE_SOURCE_F) &&\n+\t\t (graph_node->node->lcore_id == RTE_MAX_LCORE ||\n+\t\t graph->lcore_id == graph_node->node->lcore_id))\n+\t\t\treturn true;\n+\n+\treturn false;\n+}\n+\n+int\n+rte_graph_model_dispatch_core_bind(rte_graph_t id, int lcore)\n+{\n+\tstruct graph *graph;\n+\n+\tGRAPH_ID_CHECK(id);\n+\tif (!rte_lcore_is_enabled(lcore))\n+\t\tSET_ERR_JMP(ENOLINK, fail,\n+\t\t\t \"lcore %d not enabled\\n\",\n+\t\t\t lcore);\n+\n+\tSTAILQ_FOREACH(graph, &graph_list, next)\n+\t\tif (graph->id == id)\n+\t\t\tbreak;\n+\n+\tgraph->lcore_id = lcore;\n+\tgraph->socket = rte_lcore_to_socket_id(lcore);\n+\n+\t/* check the availability of source node */\n+\tif (!graph_src_node_avail(graph))\n+\t\tgraph->graph->head = 0;\n+\n+\treturn 0;\n+\n+fail:\n+\treturn -rte_errno;\n+}\n+\n+void\n+rte_graph_model_dispatch_core_unbind(rte_graph_t id)\n+{\n+\tstruct graph *graph;\n+\n+\tGRAPH_ID_CHECK(id);\n+\tSTAILQ_FOREACH(graph, &graph_list, next)\n+\t\tif (graph->id == id)\n+\t\t\tbreak;\n+\n+\tgraph->lcore_id = RTE_MAX_LCORE;\n+\n+fail:\n+\treturn;\n+}\n+\n struct rte_graph *\n rte_graph_lookup(const char *name)\n {\n@@ -346,6 +404,7 @@ rte_graph_create(const char *name, struct rte_graph_param *prm)\n \tgraph->src_node_count = src_node_count;\n \tgraph->node_count = graph_nodes_count(graph);\n \tgraph->id = graph_id;\n+\tgraph->lcore_id = RTE_MAX_LCORE;\n \tgraph->num_pkt_to_capture = prm->num_pkt_to_capture;\n \tif (prm->pcap_filename)\n \t\trte_strscpy(graph->pcap_filename, prm->pcap_filename, RTE_GRAPH_PCAP_FILE_SZ);\ndiff --git a/lib/graph/graph_private.h b/lib/graph/graph_private.h\nindex bd4c576324..f63b339d81 100644\n--- a/lib/graph/graph_private.h\n+++ b/lib/graph/graph_private.h\n@@ -99,6 +99,8 @@ struct graph {\n \t/**< Circular buffer mask for wrap around. */\n \trte_graph_t id;\n \t/**< Graph identifier. */\n+\tunsigned int lcore_id;\n+\t/**< Lcore identifier where the graph prefer to run on. */\n \tsize_t mem_sz;\n \t/**< Memory size of the graph. */\n \tint socket;\ndiff --git a/lib/graph/rte_graph.h b/lib/graph/rte_graph.h\nindex c9a77297fc..c523809d1f 100644\n--- a/lib/graph/rte_graph.h\n+++ b/lib/graph/rte_graph.h\n@@ -285,6 +285,28 @@ char *rte_graph_id_to_name(rte_graph_t id);\n __rte_experimental\n int rte_graph_export(const char *name, FILE *f);\n \n+/**\n+ * Bind graph with specific lcore\n+ *\n+ * @param id\n+ * Graph id to get the pointer of graph object\n+ * @param lcore\n+ * The lcore where the graph will run on\n+ * @return\n+ * 0 on success, error otherwise.\n+ */\n+__rte_experimental\n+int rte_graph_model_dispatch_core_bind(rte_graph_t id, int lcore);\n+\n+/**\n+ * Unbind graph with lcore\n+ *\n+ * @param id\n+ * Graph id to get the pointer of graph object\n+ */\n+__rte_experimental\n+void rte_graph_model_dispatch_core_unbind(rte_graph_t id);\n+\n /**\n * Get graph object from its name.\n *\ndiff --git a/lib/graph/version.map b/lib/graph/version.map\nindex 1f090be74e..7de6f08f59 100644\n--- a/lib/graph/version.map\n+++ b/lib/graph/version.map\n@@ -18,6 +18,8 @@ EXPERIMENTAL {\n \trte_graph_node_get_by_name;\n \trte_graph_obj_dump;\n \trte_graph_walk;\n+\trte_graph_model_dispatch_core_bind;\n+\trte_graph_model_dispatch_core_unbind;\n \n \trte_graph_cluster_stats_create;\n \trte_graph_cluster_stats_destroy;\n", "prefixes": [ "v6", "06/15" ] }{ "id": 126786, "url": "