get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 128212,
    "url": "http://patches.dpdk.org/api/patches/128212/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230606144746.708388-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": "<20230606144746.708388-7-zhirun.yan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230606144746.708388-7-zhirun.yan@intel.com",
    "date": "2023-06-06T14:47:35",
    "name": "[v8,06/17] graph: introduce graph bind unbind API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "6efadea6d4b6ba3b2e7d9bf5f2ce5b40406f1811",
    "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-7-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/128212/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/128212/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 EBB8142C40;\n\tTue,  6 Jun 2023 16:55:24 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4CC6B42D32;\n\tTue,  6 Jun 2023 16:55:12 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by mails.dpdk.org (Postfix) with ESMTP id 2605442D32\n for <dev@dpdk.org>; Tue,  6 Jun 2023 16:55:10 +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:02 -0700",
            "from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94])\n by fmsmga005.fm.intel.com with ESMTP; 06 Jun 2023 07:54:59 -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=1686063311; x=1717599311;\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=cBlQMN37rKaQtl/qSioYeUejj3LEXdORkHq+b9k2AwMKItPXAAwUE/6I\n 3e0aQpPFANEaYBOj1bqXRv2T7/dd1Rgg0B+Y339AeUT67+APMw2EiBacm\n gX+PmJoSa0mfe33Vb8Fi5jxuaR623PsFnNBLvWqZ3fxCDkO23AjalyCQv\n /bdLAUvf1IGTD5z3JIp5TQdOGEwUV6hHi+o+Ojlr4v3X/MLem8k7v5pus\n 30HolUxkuuco/JUBffJD+0nWqDnPi7UThlXrDsTAhFYSfYxWt1wPqnIUz\n e6slVcJiTHRJzfKCnHjqvkpEIjAC3lwgs5WKVZyg+8k6KHOhNI2MmZufu Q==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10733\"; a=\"356705207\"",
            "E=Sophos;i=\"6.00,221,1681196400\"; d=\"scan'208\";a=\"356705207\"",
            "E=McAfee;i=\"6600,9927,10733\"; a=\"1039222558\"",
            "E=Sophos;i=\"6.00,221,1681196400\"; d=\"scan'208\";a=\"1039222558\""
        ],
        "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 06/17] graph: introduce graph bind unbind API",
        "Date": "Tue,  6 Jun 2023 22:47:35 +0800",
        "Message-Id": "<20230606144746.708388-7-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": "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": [
        "v8",
        "06/17"
    ]
}