get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 128609,
    "url": "http://patches.dpdk.org/api/patches/128609/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230613140445.2155542-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": "<20230613140445.2155542-7-zhirun.yan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230613140445.2155542-7-zhirun.yan@intel.com",
    "date": "2023-06-13T14:04:35",
    "name": "[v14,06/16] graph: introduce graph bind unbind API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ca2f12066810819d6fcc7c218345a6f615af163c",
    "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/20230613140445.2155542-7-zhirun.yan@intel.com/mbox/",
    "series": [
        {
            "id": 28485,
            "url": "http://patches.dpdk.org/api/series/28485/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28485",
            "date": "2023-06-13T14:04:29",
            "name": "graph enhancement for multi-core dispatch",
            "version": 14,
            "mbox": "http://patches.dpdk.org/series/28485/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/128609/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/128609/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 6727042CAB;\n\tTue, 13 Jun 2023 16:12:45 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3585B42D3B;\n\tTue, 13 Jun 2023 16:12:20 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id 4357442D3B\n for <dev@dpdk.org>; Tue, 13 Jun 2023 16:12:17 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Jun 2023 07:12:16 -0700",
            "from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94])\n by orsmga008.jf.intel.com with ESMTP; 13 Jun 2023 07:12:13 -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=1686665538; x=1718201538;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=z7g+FJRvryMqEjie9HFv3RgOudicqZCoX3cX2fjlvPk=;\n b=R5YU6mBkIVQ8aVCnNdDtbvpGAolbOjq5CfnkskhntW7aeNP8xzVxl49t\n yEaA9F6Jkmu7vwuFsdayeE0sRswQtlrCsc4LIPpLr7x2lwPlsiGboCu66\n g1Zv2c4RkhBkPZ6XvvVhlI4pEK0sCCiwmJwQ4PvIixknkjVaPS12rKoIv\n qLytHUqLGQD42YjzsMH0GMoiVnrlaRuS3xvjcmH+n3q+v1Imkpyn48evk\n ETrZDNXMqJihcn91C22idB7McgX6dLQY+eRhSQT8Zvd1o0yVpmHTlpPwc\n xfEyCRkH8v3ZAroQ6ygHxHixZOcMH7juqKUfVg7aNEonahr43x6VQ5Cfv A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10740\"; a=\"355839749\"",
            "E=Sophos;i=\"6.00,239,1681196400\"; d=\"scan'208\";a=\"355839749\"",
            "E=McAfee;i=\"6600,9927,10740\"; a=\"741439341\"",
            "E=Sophos;i=\"6.00,239,1681196400\"; d=\"scan'208\";a=\"741439341\""
        ],
        "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 v14 06/16] graph: introduce graph bind unbind API",
        "Date": "Tue, 13 Jun 2023 22:04:35 +0800",
        "Message-Id": "<20230613140445.2155542-7-zhirun.yan@intel.com>",
        "X-Mailer": "git-send-email 2.37.2",
        "In-Reply-To": "<20230613140445.2155542-1-zhirun.yan@intel.com>",
        "References": "<20230613101404.1787790-1-zhirun.yan@intel.com>\n <20230613140445.2155542-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>\nAcked-by: Jerin Jacob <jerinj@marvell.com>\n---\n lib/graph/graph.c         | 60 +++++++++++++++++++++++++++++++++++++++\n lib/graph/graph_private.h |  2 ++\n lib/graph/rte_graph.h     | 22 ++++++++++++++\n lib/graph/version.map     |  3 +-\n 4 files changed, 86 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/graph/graph.c b/lib/graph/graph.c\nindex 5582631b53..8d5bd8b9ae 100644\n--- a/lib/graph/graph.c\n+++ b/lib/graph/graph.c\n@@ -260,6 +260,65 @@ 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+\tif (graph->graph->model == RTE_GRAPH_MODEL_MCORE_DISPATCH)\n+\t\tgoto fail;\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_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 +405,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 6ae19b0d6e..9a20dba5e7 100644\n--- a/lib/graph/version.map\n+++ b/lib/graph/version.map\n@@ -15,6 +15,8 @@ EXPERIMENTAL {\n \trte_graph_list_dump;\n \trte_graph_max_count;\n \trte_graph_model_is_valid;\n+\trte_graph_model_mcore_dispatch_core_bind;\n+\trte_graph_model_mcore_dispatch_core_unbind;\n \trte_graph_model_mcore_dispatch_node_lcore_affinity_set;\n \trte_graph_node_get;\n \trte_graph_node_get_by_name;\n@@ -24,7 +26,6 @@ EXPERIMENTAL {\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 \trte_graph_cluster_stats_get;\n",
    "prefixes": [
        "v14",
        "06/16"
    ]
}