Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/128254/?format=api
https://patches.dpdk.org/api/patches/128254/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230607035144.1214492-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": "<20230607035144.1214492-7-zhirun.yan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230607035144.1214492-7-zhirun.yan@intel.com", "date": "2023-06-07T03:51:33", "name": "[v9,06/17] graph: introduce graph bind unbind API", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "6efadea6d4b6ba3b2e7d9bf5f2ce5b40406f1811", "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/20230607035144.1214492-7-zhirun.yan@intel.com/mbox/", "series": [ { "id": 28383, "url": "https://patches.dpdk.org/api/series/28383/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=28383", "date": "2023-06-07T03:51:27", "name": "graph enhancement for multi-core dispatch", "version": 9, "mbox": "https://patches.dpdk.org/series/28383/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/128254/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/128254/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 80B7B42C46;\n\tWed, 7 Jun 2023 06:00:34 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3CE9E42D3E;\n\tWed, 7 Jun 2023 06:00:21 +0200 (CEST)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id E52A142D33\n for <dev@dpdk.org>; Wed, 7 Jun 2023 06:00:17 +0200 (CEST)", "from orsmga006.jf.intel.com ([10.7.209.51])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 06 Jun 2023 21:00:16 -0700", "from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94])\n by orsmga006.jf.intel.com with ESMTP; 06 Jun 2023 21:00:02 -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=1686110418; x=1717646418;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=SV3ha7I9nN4px+aKIzkbIxh/sFhH35idWd+xRafWeTA=;\n b=MN7iWGGpIjDjEhAZZAg6NjkFQ4ZVaKWHtO4IEoE/PqQwceJIZH6IWwpQ\n eeb1SYveEd1CiaNeiaFs9O5s55qoc7H0MIrLgY3StloH9Jh2FZ3Ggx5zj\n 3NY+x+Od6cC7qsY963YXR5Ukj4txL444sXnTDFqNgPA7WS7EZWa0K+5cN\n dUwhhJvvTHblFqESGEtAt7kcx7YGK/nJF3yS0GteEpivYsGJLU1LrUmB7\n 7KYNnl9zy39PweuO3k6/NGfRWLWHAtvgkA6PC8iWxgWIvQGS3gNp+3cXO\n IpCoJx0UqVv8yFBnb2y5naEjRahKFMG5mGd2tM5XtHsX6REDqMnw+QT56 A==;", "X-IronPort-AV": [ "E=McAfee;i=\"6600,9927,10733\"; a=\"359336612\"", "E=Sophos;i=\"6.00,222,1681196400\"; d=\"scan'208\";a=\"359336612\"", "E=McAfee;i=\"6600,9927,10733\"; a=\"686759246\"", "E=Sophos;i=\"6.00,222,1681196400\"; d=\"scan'208\";a=\"686759246\"" ], "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 v9 06/17] graph: introduce graph bind unbind API", "Date": "Wed, 7 Jun 2023 11:51:33 +0800", "Message-Id": "<20230607035144.1214492-7-zhirun.yan@intel.com>", "X-Mailer": "git-send-email 2.37.2", "In-Reply-To": "<20230607035144.1214492-1-zhirun.yan@intel.com>", "References": "<20230606144746.708388-1-zhirun.yan@intel.com>\n <20230607035144.1214492-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 | 58 +++++++++++++++++++++++++++++++++++++++\n lib/graph/graph_private.h | 2 ++\n lib/graph/rte_graph.h | 22 +++++++++++++++\n lib/graph/version.map | 2 ++\n 4 files changed, 84 insertions(+)", "diff": "diff --git a/lib/graph/graph.c b/lib/graph/graph.c\nindex 5582631b53..f8243fa61a 100644\n--- a/lib/graph/graph.c\n+++ b/lib/graph/graph.c\n@@ -260,6 +260,63 @@ graph_mem_fixup_secondary(struct rte_graph *graph)\n \treturn graph_mem_fixup_node_ctx(graph);\n }\n \n+static 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_mcore_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, \"lcore %d not enabled\", lcore);\n+\n+\tSTAILQ_FOREACH(graph, &graph_list, next)\n+\t\tif (graph->id == id)\n+\t\t\tbreak;\n+\n+\tRTE_ASSERT(graph->graph->model == RTE_GRAPH_MODEL_MCORE_DISPATCH);\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_mcore_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 +403,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 ea4409448d..6d2137c81b 100644\n--- a/lib/graph/graph_private.h\n+++ b/lib/graph/graph_private.h\n@@ -100,6 +100,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. Used for mcore dispatch model. */\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..f70c694e77 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 for mcore dispatch model.\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_mcore_dispatch_core_bind(rte_graph_t id, int lcore);\n+\n+/**\n+ * Unbind graph with lcore for mcore dispatch model\n+ *\n+ * @param id\n+ * Graph id to get the pointer of graph object\n+ */\n+__rte_experimental\n+void rte_graph_model_mcore_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 f39a65e902..132e666b79 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_mcore_dispatch_core_bind;\n+\trte_graph_model_mcore_dispatch_core_unbind;\n \n \trte_graph_cluster_stats_create;\n \trte_graph_cluster_stats_destroy;\n", "prefixes": [ "v9", "06/17" ] }{ "id": 128254, "url": "