get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 128607,
    "url": "http://patches.dpdk.org/api/patches/128607/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230613140445.2155542-5-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-5-zhirun.yan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230613140445.2155542-5-zhirun.yan@intel.com",
    "date": "2023-06-13T14:04:33",
    "name": "[v14,04/16] graph: add get/set graph worker model APIs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "31977197f3988ebe4bfc2af8884c2dad785ec254",
    "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-5-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/128607/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/128607/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 5FE7342CAB;\n\tTue, 13 Jun 2023 16:12:29 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id EFFE242D13;\n\tTue, 13 Jun 2023 16:12:12 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id 9190542D12\n for <dev@dpdk.org>; Tue, 13 Jun 2023 16:12:10 +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:09 -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:06 -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=1686665530; x=1718201530;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=ERhwuJLn0yryRw8xvHlvjydjD6kplI7pY0bp3ltMxec=;\n b=kQu3G6aX1z4OGq6BGlNiR1LVtFOe6SB1MTB8y8GYd2KCIDo2231tNUV8\n jQ2Q/OW05/iKed3AqBSQ64xyiz9qeZolIPvr38VZCnCTR7QKpuU16psgr\n +eHlZ60UmzXE3hMYJRKwYpiy/JlY5qHxVwitCOt8PW7DWN8CrhF216EME\n 9beYp2KUnwPlGj+x0n8VM71/n4+vjgyawJUqBMFKlHZgSXEzNGDwztwUe\n EJFUvDSsYFG6FRlimy0ppeHQ4LYktTHLKubtp47mxMyj7LgrDCBa7iCB+\n FgVE8+KjjjliuwKS6gdwB0v0oHGO1bXo4lJA4P+HcBgltxn/9I3C3i7F2 g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10740\"; a=\"355839694\"",
            "E=Sophos;i=\"6.00,239,1681196400\"; d=\"scan'208\";a=\"355839694\"",
            "E=McAfee;i=\"6600,9927,10740\"; a=\"741439308\"",
            "E=Sophos;i=\"6.00,239,1681196400\"; d=\"scan'208\";a=\"741439308\""
        ],
        "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 04/16] graph: add get/set graph worker model APIs",
        "Date": "Tue, 13 Jun 2023 22:04:33 +0800",
        "Message-Id": "<20230613140445.2155542-5-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 new get/set APIs to configure graph worker model which is used to\ndetermine which model will be chosen.\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/meson.build               |  1 +\n lib/graph/rte_graph_worker.c        | 39 ++++++++++++++++\n lib/graph/rte_graph_worker_common.h | 70 +++++++++++++++++++++++++++++\n lib/graph/version.map               |  5 +++\n 4 files changed, 115 insertions(+)\n create mode 100644 lib/graph/rte_graph_worker.c",
    "diff": "diff --git a/lib/graph/meson.build b/lib/graph/meson.build\nindex 31d78a1dc2..5661dd855b 100644\n--- a/lib/graph/meson.build\n+++ b/lib/graph/meson.build\n@@ -15,6 +15,7 @@ sources = files(\n         'graph_stats.c',\n         'graph_populate.c',\n         'graph_pcap.c',\n+        'rte_graph_worker.c',\n )\n headers = files('rte_graph.h', 'rte_graph_worker.h')\n indirect_headers += files(\ndiff --git a/lib/graph/rte_graph_worker.c b/lib/graph/rte_graph_worker.c\nnew file mode 100644\nindex 0000000000..7e2a918fae\n--- /dev/null\n+++ b/lib/graph/rte_graph_worker.c\n@@ -0,0 +1,39 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2023 Intel Corporation\n+ */\n+\n+#include \"rte_graph_worker_common.h\"\n+#include \"graph_private.h\"\n+\n+bool\n+rte_graph_model_is_valid(uint8_t model)\n+{\n+\tif (model > RTE_GRAPH_MODEL_MCORE_DISPATCH)\n+\t\treturn false;\n+\n+\treturn true;\n+}\n+\n+int\n+rte_graph_worker_model_set(uint8_t model)\n+{\n+\tstruct graph_head *graph_head = graph_list_head_get();\n+\tstruct graph *graph;\n+\n+\tif (!rte_graph_model_is_valid(model))\n+\t\treturn -EINVAL;\n+\n+\tSTAILQ_FOREACH(graph, graph_head, next)\n+\t\t\tgraph->graph->model = model;\n+\n+\treturn 0;\n+}\n+\n+uint8_t\n+rte_graph_worker_model_get(struct rte_graph *graph)\n+{\n+\tif (!rte_graph_model_is_valid(graph->model))\n+\t\treturn -EINVAL;\n+\n+\treturn graph->model;\n+}\ndiff --git a/lib/graph/rte_graph_worker_common.h b/lib/graph/rte_graph_worker_common.h\nindex a90addb172..123600f939 100644\n--- a/lib/graph/rte_graph_worker_common.h\n+++ b/lib/graph/rte_graph_worker_common.h\n@@ -29,6 +29,13 @@\n extern \"C\" {\n #endif\n \n+/** Graph worker models */\n+/* When adding a new graph model entry, update rte_graph_model_is_valid() implementation. */\n+#define RTE_GRAPH_MODEL_RTC 0 /**< Run-To-Completion model. It is the default model. */\n+#define RTE_GRAPH_MODEL_MCORE_DISPATCH 1\n+/**< Dispatch model to support cross-core dispatching within core affinity. */\n+#define RTE_GRAPH_MODEL_DEFAULT RTE_GRAPH_MODEL_RTC /**< Default graph model. */\n+\n /**\n  * @internal\n  *\n@@ -41,6 +48,9 @@ struct rte_graph {\n \trte_node_t nb_nodes;\t     /**< Number of nodes in the graph. */\n \trte_graph_off_t *cir_start;  /**< Pointer to circular buffer. */\n \trte_graph_off_t nodes_start; /**< Offset at which node memory starts. */\n+\tuint8_t model;\t\t     /**< graph model */\n+\tuint8_t reserved1;\t     /**< Reserved for future use. */\n+\tuint16_t reserved2;\t     /**< Reserved for future use. */\n \trte_graph_t id;\t/**< Graph identifier. */\n \tint socket;\t/**< Socket ID where memory is allocated. */\n \tchar name[RTE_GRAPH_NAMESIZE];\t/**< Name of the graph. */\n@@ -490,6 +500,66 @@ rte_node_next_stream_move(struct rte_graph *graph, struct rte_node *src,\n \t}\n }\n \n+/**\n+ * Test the validity of model.\n+ *\n+ * @param model\n+ *   Model to check.\n+ *\n+ * @return\n+ *   True if graph model is valid, false otherwise.\n+ */\n+__rte_experimental\n+bool\n+rte_graph_model_is_valid(uint8_t model);\n+\n+/**\n+ * @note This function does not perform any locking, and is only safe to call\n+ *    before graph running. It will set all graphs the same model.\n+ *\n+ * @param model\n+ *   Name of the graph worker model.\n+ *\n+ * @return\n+ *   0 on success, -1 otherwise.\n+ */\n+__rte_experimental\n+int rte_graph_worker_model_set(uint8_t model);\n+\n+/**\n+ * Get the graph worker model\n+ *\n+ * @note All graph will use the same model and this function will get model from the first one.\n+ *    Used for slow path.\n+ *\n+ * @param graph\n+ *   Graph pointer.\n+ *\n+ * @return\n+ *   Graph worker model on success.\n+ */\n+__rte_experimental\n+uint8_t rte_graph_worker_model_get(struct rte_graph *graph);\n+\n+/**\n+ * Get the graph worker model without check\n+ *\n+ * @note All graph will use the same model and this function will get model from the first one.\n+ *    Used for fast path.\n+ *\n+ * @param graph\n+ *   Graph pointer.\n+ *\n+ * @return\n+ *   Graph worker model on success.\n+ */\n+__rte_experimental\n+static __rte_always_inline\n+uint8_t rte_graph_worker_model_no_check_get(struct rte_graph *graph)\n+{\n+\treturn graph->model;\n+}\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/graph/version.map b/lib/graph/version.map\nindex 13b838752d..e9a680a45e 100644\n--- a/lib/graph/version.map\n+++ b/lib/graph/version.map\n@@ -14,10 +14,15 @@ EXPERIMENTAL {\n \trte_graph_lookup;\n \trte_graph_list_dump;\n \trte_graph_max_count;\n+\trte_graph_model_is_valid;\n \trte_graph_node_get;\n \trte_graph_node_get_by_name;\n \trte_graph_obj_dump;\n \trte_graph_walk;\n+\trte_graph_worker_model_get;\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",
    "prefixes": [
        "v14",
        "04/16"
    ]
}