Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/125490/?format=api
https://patches.dpdk.org/api/patches/125490/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230324021622.1369006-7-zhirun.yan@intel.com/", "project": { "id": 1, "url": "https://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": "<20230324021622.1369006-7-zhirun.yan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230324021622.1369006-7-zhirun.yan@intel.com", "date": "2023-03-24T02:16:13", "name": "[v2,06/15] graph: introduce graph bind unbind API", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "c6c97c0abf45937a5fe77fd565e624eab12695f3", "submitter": { "id": 1154, "url": "https://patches.dpdk.org/api/people/1154/?format=api", "name": "Yan, Zhirun", "email": "zhirun.yan@intel.com" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230324021622.1369006-7-zhirun.yan@intel.com/mbox/", "series": [ { "id": 27532, "url": "https://patches.dpdk.org/api/series/27532/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=27532", "date": "2023-03-24T02:16:07", "name": "graph enhancement for multi-core dispatch", "version": 2, "mbox": "https://patches.dpdk.org/series/27532/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/125490/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/125490/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 6B85D4281E;\n\tFri, 24 Mar 2023 04:17:10 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B061542D2D;\n\tFri, 24 Mar 2023 04:16:46 +0100 (CET)", "from mga06.intel.com (mga06b.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id 2FE9C42C76\n for <dev@dpdk.org>; Fri, 24 Mar 2023 04:16:43 +0100 (CET)", "from fmsmga007.fm.intel.com ([10.253.24.52])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 23 Mar 2023 20:16:43 -0700", "from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.68])\n by fmsmga007.fm.intel.com with ESMTP; 23 Mar 2023 20:16:41 -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=1679627804; x=1711163804;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=KvffPVut01BMQ6onAjS4VEulxb5OrYeG76XzuTei3Fs=;\n b=CecHSr/1LHrAZsy0egzGBYh3BZ3jXlZUAUlXyDx0jSCE5D2DjPtkEJvB\n AQjna3cllKLXoKpXxLgJKURXdfuoijh+1OlsJTJOjgDTrgD8GTMzStCV2\n p/0uv8cK9EZ2NAPXpTi4IUKdX6vlQP8uCT5EMYBuSWTDOou9amTVWkvtj\n gNjZybj5WFPY5T3STQxLzlEV9zyFYy1+3kQRHEbJrGOVnJYQbHhx1Oibb\n KUpnYh4nQ/Go/eM/tuNHohhGeX3ZRD3Hyvn4mRJv2tcdZWz5w9z/b5PDO\n zeHNKYM5GmWRT/KXhZ5lWCfKdXHKeI+A51CwX6gAjH50Ky6Mselo61CgA g==;", "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,10658\"; a=\"402266434\"", "E=Sophos;i=\"5.98,286,1673942400\"; d=\"scan'208\";a=\"402266434\"", "E=McAfee;i=\"6600,9927,10658\"; a=\"684998529\"", "E=Sophos;i=\"5.98,286,1673942400\"; d=\"scan'208\";a=\"684998529\"" ], "X-ExtLoop1": "1", "From": "Zhirun Yan <zhirun.yan@intel.com>", "To": "dev@dpdk.org, jerinj@marvell.com, kirankumark@marvell.com,\n ndabilpuram@marvell.com", "Cc": "cunming.liang@intel.com, haiyue.wang@intel.com,\n Zhirun Yan <zhirun.yan@intel.com>", "Subject": "[PATCH v2 06/15] graph: introduce graph bind unbind API", "Date": "Fri, 24 Mar 2023 11:16:13 +0900", "Message-Id": "<20230324021622.1369006-7-zhirun.yan@intel.com>", "X-Mailer": "git-send-email 2.37.2", "In-Reply-To": "<20230324021622.1369006-1-zhirun.yan@intel.com>", "References": "<20221117050926.136974-1-zhirun.yan@intel.com>\n <20230324021622.1369006-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 a839a2803b..b39a99aac6 100644\n--- a/lib/graph/graph.c\n+++ b/lib/graph/graph.c\n@@ -254,6 +254,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@@ -340,6 +398,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 409eed3284..ad1d058945 100644\n--- a/lib/graph/graph_private.h\n+++ b/lib/graph/graph_private.h\n@@ -98,6 +98,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": [ "v2", "06/15" ] }{ "id": 125490, "url": "