get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/128214/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 128214,
    "url": "http://patches.dpdk.org/api/patches/128214/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230606144746.708388-9-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": "<20230606144746.708388-9-zhirun.yan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230606144746.708388-9-zhirun.yan@intel.com",
    "date": "2023-06-06T14:47:37",
    "name": "[v8,08/17] graph: introduce graph clone API for other worker core",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "aefe8291037ae9368e7e75f06dbfa1d3e48181c9",
    "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/20230606144746.708388-9-zhirun.yan@intel.com/mbox/",
    "series": [
        {
            "id": 28374,
            "url": "http://patches.dpdk.org/api/series/28374/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28374",
            "date": "2023-06-06T14:47:29",
            "name": "graph enhancement for multi-core dispatch",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/28374/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/128214/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/128214/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 A16DD42C40;\n\tTue,  6 Jun 2023 16:55:36 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A35FD410D7;\n\tTue,  6 Jun 2023 16:55:19 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by mails.dpdk.org (Postfix) with ESMTP id 5EDEB40223\n for <dev@dpdk.org>; Tue,  6 Jun 2023 16:55:17 +0200 (CEST)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 06 Jun 2023 07:55:08 -0700",
            "from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94])\n by fmsmga005.fm.intel.com with ESMTP; 06 Jun 2023 07:55:04 -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=1686063317; x=1717599317;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=bjzZXdhOIWivGSccAcjMm8BBQEP4qdcqII0IpSkXr6Y=;\n b=nHy0O7w4JvNXqteHl32YvzfMM0hQAC+gmCqV5pGRRpPLU8naOkOgceyh\n wlPD8SjbbAQZNJls2LRKwVRPIPgHKZD9izI66k1Mw3c9oigF5BXrTDpoW\n l3cJDbiI8PfVOBaoTC293ImZ7JcIEHWUqHVTbc3BDkIQFEi7OvgNN5RqG\n RASYyfXqmbv0qIiuyor9jHZ0VMpVLnYpXkbDrlHcx2O1FYiyDm2aG9mQF\n MMtRyBWc9arOs/ZLollL1i/dE6eaCwCJEo+Rp6lbU+sMVQTlh5gW5/Qnp\n wOZkf8chGkHWr+S6q1ZECSZbxCDOCprZI41dgsLcv+hoG5cLy9IPKW58J g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10733\"; a=\"356705313\"",
            "E=Sophos;i=\"6.00,221,1681196400\"; d=\"scan'208\";a=\"356705313\"",
            "E=McAfee;i=\"6600,9927,10733\"; a=\"1039222674\"",
            "E=Sophos;i=\"6.00,221,1681196400\"; d=\"scan'208\";a=\"1039222674\""
        ],
        "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 v8 08/17] graph: introduce graph clone API for other worker\n core",
        "Date": "Tue,  6 Jun 2023 22:47:37 +0800",
        "Message-Id": "<20230606144746.708388-9-zhirun.yan@intel.com>",
        "X-Mailer": "git-send-email 2.37.2",
        "In-Reply-To": "<20230606144746.708388-1-zhirun.yan@intel.com>",
        "References": "<20230605111923.3772260-1-zhirun.yan@intel.com>\n <20230606144746.708388-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": "This patch adds graph API for supporting to clone the graph object for\na specified worker core. The new graph will also clone all nodes.\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         | 89 +++++++++++++++++++++++++++++++++++++++\n lib/graph/graph_private.h |  2 +\n lib/graph/rte_graph.h     | 20 +++++++++\n lib/graph/version.map     |  1 +\n 4 files changed, 112 insertions(+)",
    "diff": "diff --git a/lib/graph/graph.c b/lib/graph/graph.c\nindex f8243fa61a..84e01d11d0 100644\n--- a/lib/graph/graph.c\n+++ b/lib/graph/graph.c\n@@ -403,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->parent_id = RTE_GRAPH_ID_INVALID;\n \tgraph->lcore_id = RTE_MAX_LCORE;\n \tgraph->num_pkt_to_capture = prm->num_pkt_to_capture;\n \tif (prm->pcap_filename)\n@@ -467,6 +468,94 @@ rte_graph_destroy(rte_graph_t id)\n \treturn rc;\n }\n \n+static rte_graph_t\n+graph_clone(struct graph *parent_graph, const char *name)\n+{\n+\tstruct graph_node *graph_node;\n+\tstruct graph *graph;\n+\n+\tgraph_spinlock_lock();\n+\n+\t/* Don't allow to clone a node from a cloned graph */\n+\tif (parent_graph->parent_id != RTE_GRAPH_ID_INVALID)\n+\t\tSET_ERR_JMP(EEXIST, fail, \"A cloned graph is not allowed to be cloned\");\n+\n+\t/* Create graph object */\n+\tgraph = calloc(1, sizeof(*graph));\n+\tif (graph == NULL)\n+\t\tSET_ERR_JMP(ENOMEM, fail, \"Failed to calloc cloned graph object\");\n+\n+\t/* Naming ceremony of the new graph. name is node->name + \"-\" + name */\n+\tif (clone_name(graph->name, parent_graph->name, name))\n+\t\tgoto free;\n+\n+\t/* Check for existence of duplicate graph */\n+\tif (rte_graph_from_name(graph->name) != RTE_GRAPH_ID_INVALID)\n+\t\tSET_ERR_JMP(EEXIST, free, \"Found duplicate graph %s\",\n+\t\t\t    graph->name);\n+\n+\t/* Clone nodes from parent graph firstly */\n+\tSTAILQ_INIT(&graph->node_list);\n+\tSTAILQ_FOREACH(graph_node, &parent_graph->node_list, next) {\n+\t\tif (graph_node_add(graph, graph_node->node))\n+\t\t\tgoto graph_cleanup;\n+\t}\n+\n+\t/* Just update adjacency list of all nodes in the graph */\n+\tif (graph_adjacency_list_update(graph))\n+\t\tgoto graph_cleanup;\n+\n+\t/* Initialize the graph object */\n+\tgraph->src_node_count = parent_graph->src_node_count;\n+\tgraph->node_count = parent_graph->node_count;\n+\tgraph->parent_id = parent_graph->id;\n+\tgraph->lcore_id = parent_graph->lcore_id;\n+\tgraph->socket = parent_graph->socket;\n+\tgraph->id = graph_id;\n+\n+\t/* Allocate the Graph fast path memory and populate the data */\n+\tif (graph_fp_mem_create(graph))\n+\t\tgoto graph_cleanup;\n+\n+\t/* Clone the graph model */\n+\tgraph->graph->model = parent_graph->graph->model;\n+\n+\t/* Call init() of the all the nodes in the graph */\n+\tif (graph_node_init(graph))\n+\t\tgoto graph_mem_destroy;\n+\n+\t/* All good, Lets add the graph to the list */\n+\tgraph_id++;\n+\tSTAILQ_INSERT_TAIL(&graph_list, graph, next);\n+\n+\tgraph_spinlock_unlock();\n+\treturn graph->id;\n+\n+graph_mem_destroy:\n+\tgraph_fp_mem_destroy(graph);\n+graph_cleanup:\n+\tgraph_cleanup(graph);\n+free:\n+\tfree(graph);\n+fail:\n+\tgraph_spinlock_unlock();\n+\treturn RTE_GRAPH_ID_INVALID;\n+}\n+\n+rte_graph_t\n+rte_graph_clone(rte_graph_t id, const char *name)\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\treturn graph_clone(graph, name);\n+\n+fail:\n+\treturn RTE_GRAPH_ID_INVALID;\n+}\n+\n rte_graph_t\n rte_graph_from_name(const char *name)\n {\ndiff --git a/lib/graph/graph_private.h b/lib/graph/graph_private.h\nindex a6d8c6e98b..354dc8ac0a 100644\n--- a/lib/graph/graph_private.h\n+++ b/lib/graph/graph_private.h\n@@ -102,6 +102,8 @@ struct graph {\n \t/**< Circular buffer mask for wrap around. */\n \trte_graph_t id;\n \t/**< Graph identifier. */\n+\trte_graph_t parent_id;\n+\t/**< Parent 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;\ndiff --git a/lib/graph/rte_graph.h b/lib/graph/rte_graph.h\nindex f70c694e77..998cade200 100644\n--- a/lib/graph/rte_graph.h\n+++ b/lib/graph/rte_graph.h\n@@ -247,6 +247,26 @@ rte_graph_t rte_graph_create(const char *name, struct rte_graph_param *prm);\n __rte_experimental\n int rte_graph_destroy(rte_graph_t id);\n \n+/**\n+ * Clone Graph.\n+ *\n+ * Clone a graph from static graph (graph created from rte_graph_create()). And\n+ * all cloned graphs attached to the parent graph MUST be destroyed together\n+ * for fast schedule design limitation (stop ALL graph walk firstly).\n+ *\n+ * @param id\n+ *   Static graph id to clone from.\n+ * @param name\n+ *   Name of the new graph. The library prepends the parent graph name to the\n+ * user-specified name. The final graph name will be,\n+ * \"parent graph name\" + \"-\" + name.\n+ *\n+ * @return\n+ *   Valid graph id on success, RTE_GRAPH_ID_INVALID otherwise.\n+ */\n+__rte_experimental\n+rte_graph_t rte_graph_clone(rte_graph_t id, const char *name);\n+\n /**\n  * Get graph id from graph name.\n  *\ndiff --git a/lib/graph/version.map b/lib/graph/version.map\nindex 132e666b79..eccecc8767 100644\n--- a/lib/graph/version.map\n+++ b/lib/graph/version.map\n@@ -7,6 +7,7 @@ EXPERIMENTAL {\n \n \trte_graph_create;\n \trte_graph_destroy;\n+\trte_graph_clone;\n \trte_graph_dump;\n \trte_graph_export;\n \trte_graph_from_name;\n",
    "prefixes": [
        "v8",
        "08/17"
    ]
}