get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 128220,
    "url": "http://patches.dpdk.org/api/patches/128220/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230606144746.708388-15-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-15-zhirun.yan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230606144746.708388-15-zhirun.yan@intel.com",
    "date": "2023-06-06T14:47:43",
    "name": "[v8,14/17] graph: add stats for cross-core dispatching",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "49facec1da990f8d0bb16d8633ea8933ca0f9fb6",
    "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-15-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/128220/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/128220/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 C3FDF42C40;\n\tTue,  6 Jun 2023 16:56:13 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C873042D69;\n\tTue,  6 Jun 2023 16:55:36 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by mails.dpdk.org (Postfix) with ESMTP id B4A9540A84\n for <dev@dpdk.org>; Tue,  6 Jun 2023 16:55:34 +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:25 -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:22 -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=1686063334; x=1717599334;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=EqDyHTzCc0irCnKAMbTd2N+aF6559vss049R5DiJJCY=;\n b=XOEMzxVL8Cz5TZa45epjpNVxDw73C8fyd8RzxIC58atLoRE7Up29/49e\n ejnUHYgbC8ByLwJ1O9o7w/NdKWrP6ww0XyXzCeeTL1z46nUnpN9xyW4sx\n kERAI4pbREBvBwu6fJ9+XU4gb5w0qkwQLFJ+VVPHMjzHkRzpszivXV+Dg\n oOFcgvLshvhGLdkS8TeaMazGw1CEyp7yDBiDb7q4Bjw83Qq1+QFDWVMjb\n JNN3kvq2MwERGWUjujmX6/z/o4pyXVwCbhLppfk8Lb6kerUpsG6+JOoNn\n yrbgnIVUymrbFQq0ruzh5WArovbGVrklJjsXr4NkJq47mgJn3FObNPx5n g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10733\"; a=\"356705623\"",
            "E=Sophos;i=\"6.00,221,1681196400\"; d=\"scan'208\";a=\"356705623\"",
            "E=McAfee;i=\"6600,9927,10733\"; a=\"1039222935\"",
            "E=Sophos;i=\"6.00,221,1681196400\"; d=\"scan'208\";a=\"1039222935\""
        ],
        "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 14/17] graph: add stats for cross-core dispatching",
        "Date": "Tue,  6 Jun 2023 22:47:43 +0800",
        "Message-Id": "<20230606144746.708388-15-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 stats for cross-core dispatching scheduler if stats collection is\nenabled.\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_debug.c                    |  6 ++\n lib/graph/graph_stats.c                    | 76 +++++++++++++++++++---\n lib/graph/rte_graph.h                      | 10 +++\n lib/graph/rte_graph_model_mcore_dispatch.c |  3 +\n lib/graph/rte_graph_worker_common.h        |  2 +\n 5 files changed, 89 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/lib/graph/graph_debug.c b/lib/graph/graph_debug.c\nindex b84412f5dd..cbb512e120 100644\n--- a/lib/graph/graph_debug.c\n+++ b/lib/graph/graph_debug.c\n@@ -74,6 +74,12 @@ rte_graph_obj_dump(FILE *f, struct rte_graph *g, bool all)\n \t\tfprintf(f, \"       size=%d\\n\", n->size);\n \t\tfprintf(f, \"       idx=%d\\n\", n->idx);\n \t\tfprintf(f, \"       total_objs=%\" PRId64 \"\\n\", n->total_objs);\n+\t\tif (rte_graph_worker_model_get(g) == RTE_GRAPH_MODEL_MCORE_DISPATCH) {\n+\t\t\tfprintf(f, \"       total_sched_objs=%\" PRId64 \"\\n\",\n+\t\t\t\tn->total_sched_objs);\n+\t\t\tfprintf(f, \"       total_sched_fail=%\" PRId64 \"\\n\",\n+\t\t\t\tn->total_sched_fail);\n+\t\t}\n \t\tfprintf(f, \"       total_calls=%\" PRId64 \"\\n\", n->total_calls);\n \t\tfor (i = 0; i < n->nb_edges; i++)\n \t\t\tfprintf(f, \"          edge[%d] <%s>\\n\", i,\ndiff --git a/lib/graph/graph_stats.c b/lib/graph/graph_stats.c\nindex c0140ba922..210ba01f5c 100644\n--- a/lib/graph/graph_stats.c\n+++ b/lib/graph/graph_stats.c\n@@ -40,13 +40,19 @@ struct rte_graph_cluster_stats {\n \tstruct cluster_node clusters[];\n } __rte_cache_aligned;\n \n+#define boarder_model_dispatch()                                                              \\\n+\tfprintf(f, \"+-------------------------------+---------------+--------\" \\\n+\t\t   \"-------+---------------+---------------+---------------+\" \\\n+\t\t   \"---------------+---------------+-\" \\\n+\t\t   \"----------+\\n\")\n+\n #define boarder()                                                              \\\n \tfprintf(f, \"+-------------------------------+---------------+--------\" \\\n \t\t   \"-------+---------------+---------------+---------------+-\" \\\n \t\t   \"----------+\\n\")\n \n static inline void\n-print_banner(FILE *f)\n+print_banner_default(FILE *f)\n {\n \tboarder();\n \tfprintf(f, \"%-32s%-16s%-16s%-16s%-16s%-16s%-16s\\n\", \"|Node\", \"|calls\",\n@@ -55,6 +61,28 @@ print_banner(FILE *f)\n \tboarder();\n }\n \n+static inline void\n+print_banner_dispatch(FILE *f)\n+{\n+\tboarder_model_dispatch();\n+\tfprintf(f, \"%-32s%-16s%-16s%-16s%-16s%-16s%-16s%-16s%-16s\\n\",\n+\t\t\"|Node\", \"|calls\",\n+\t\t\"|objs\", \"|sched objs\", \"|sched fail\",\n+\t\t\"|realloc_count\", \"|objs/call\", \"|objs/sec(10E6)\",\n+\t\t\"|cycles/call|\");\n+\tboarder_model_dispatch();\n+}\n+\n+static inline void\n+print_banner(FILE *f)\n+{\n+\tif (rte_graph_worker_model_get(STAILQ_FIRST(graph_list_head_get())->graph) ==\n+\t    RTE_GRAPH_MODEL_MCORE_DISPATCH)\n+\t\tprint_banner_dispatch(f);\n+\telse\n+\t\tprint_banner_default(f);\n+}\n+\n static inline void\n print_node(FILE *f, const struct rte_graph_cluster_node_stats *stat)\n {\n@@ -76,11 +104,22 @@ print_node(FILE *f, const struct rte_graph_cluster_node_stats *stat)\n \tobjs_per_sec = ts_per_hz ? (objs - prev_objs) / ts_per_hz : 0;\n \tobjs_per_sec /= 1000000;\n \n-\tfprintf(f,\n-\t\t\"|%-31s|%-15\" PRIu64 \"|%-15\" PRIu64 \"|%-15\" PRIu64\n-\t\t\"|%-15.3f|%-15.6f|%-11.4f|\\n\",\n-\t\tstat->name, calls, objs, stat->realloc_count, objs_per_call,\n-\t\tobjs_per_sec, cycles_per_call);\n+\tif (rte_graph_worker_model_get(STAILQ_FIRST(graph_list_head_get())->graph) ==\n+\t    RTE_GRAPH_MODEL_MCORE_DISPATCH) {\n+\t\tfprintf(f,\n+\t\t\t\"|%-31s|%-15\" PRIu64 \"|%-15\" PRIu64 \"|%-15\" PRIu64\n+\t\t\t\"|%-15\" PRIu64 \"|%-15\" PRIu64\n+\t\t\t\"|%-15.3f|%-15.6f|%-11.4f|\\n\",\n+\t\t\tstat->name, calls, objs, stat->dispatch.sched_objs,\n+\t\t\tstat->dispatch.sched_fail, stat->realloc_count, objs_per_call,\n+\t\t\tobjs_per_sec, cycles_per_call);\n+\t} else {\n+\t\tfprintf(f,\n+\t\t\t\"|%-31s|%-15\" PRIu64 \"|%-15\" PRIu64 \"|%-15\" PRIu64\n+\t\t\t\"|%-15.3f|%-15.6f|%-11.4f|\\n\",\n+\t\t\tstat->name, calls, objs, stat->realloc_count, objs_per_call,\n+\t\t\tobjs_per_sec, cycles_per_call);\n+\t}\n }\n \n static int\n@@ -88,13 +127,20 @@ graph_cluster_stats_cb(bool is_first, bool is_last, void *cookie,\n \t\t       const struct rte_graph_cluster_node_stats *stat)\n {\n \tFILE *f = cookie;\n+\tint model;\n+\n+\tmodel = rte_graph_worker_model_get(STAILQ_FIRST(graph_list_head_get())->graph);\n \n \tif (unlikely(is_first))\n \t\tprint_banner(f);\n \tif (stat->objs)\n \t\tprint_node(f, stat);\n-\tif (unlikely(is_last))\n-\t\tboarder();\n+\tif (unlikely(is_last)) {\n+\t\tif (model == RTE_GRAPH_MODEL_MCORE_DISPATCH)\n+\t\t\tboarder_model_dispatch();\n+\t\telse\n+\t\t\tboarder();\n+\t}\n \n \treturn 0;\n };\n@@ -333,12 +379,20 @@ cluster_node_arregate_stats(struct cluster_node *cluster)\n {\n \tuint64_t calls = 0, cycles = 0, objs = 0, realloc_count = 0;\n \tstruct rte_graph_cluster_node_stats *stat = &cluster->stat;\n+\tuint64_t sched_objs = 0, sched_fail = 0;\n \tstruct rte_node *node;\n \trte_node_t count;\n+\tint model;\n \n+\tmodel = rte_graph_worker_model_get(STAILQ_FIRST(graph_list_head_get())->graph);\n \tfor (count = 0; count < cluster->nb_nodes; count++) {\n \t\tnode = cluster->nodes[count];\n \n+\t\tif (model == RTE_GRAPH_MODEL_MCORE_DISPATCH) {\n+\t\t\tsched_objs += node->total_sched_objs;\n+\t\t\tsched_fail += node->total_sched_fail;\n+\t\t}\n+\n \t\tcalls += node->total_calls;\n \t\tobjs += node->total_objs;\n \t\tcycles += node->total_cycles;\n@@ -348,6 +402,12 @@ cluster_node_arregate_stats(struct cluster_node *cluster)\n \tstat->calls = calls;\n \tstat->objs = objs;\n \tstat->cycles = cycles;\n+\n+\tif (model == RTE_GRAPH_MODEL_MCORE_DISPATCH) {\n+\t\tstat->dispatch.sched_objs = sched_objs;\n+\t\tstat->dispatch.sched_fail = sched_fail;\n+\t}\n+\n \tstat->ts = rte_get_timer_cycles();\n \tstat->realloc_count = realloc_count;\n }\ndiff --git a/lib/graph/rte_graph.h b/lib/graph/rte_graph.h\nindex 2ffee520b1..28e50e49b8 100644\n--- a/lib/graph/rte_graph.h\n+++ b/lib/graph/rte_graph.h\n@@ -220,6 +220,16 @@ struct rte_graph_cluster_node_stats {\n \tuint64_t prev_objs;\t/**< Previous number of processed objs. */\n \tuint64_t prev_cycles;\t/**< Previous number of cycles. */\n \n+\tRTE_STD_C11\n+\tunion {\n+\t\tstruct {\n+\t\t\tuint64_t sched_objs;\n+\t\t\t/**< Previous number of scheduled objs for dispatch model. */\n+\t\t\tuint64_t sched_fail;\n+\t\t\t/**< Previous number of failed schedule objs for dispatch model. */\n+\t\t} dispatch;\n+\t};\n+\n \tuint64_t realloc_count; /**< Realloc count. */\n \n \trte_node_t id;\t/**< Node identifier of stats. */\ndiff --git a/lib/graph/rte_graph_model_mcore_dispatch.c b/lib/graph/rte_graph_model_mcore_dispatch.c\nindex 1d99384816..b379568d6c 100644\n--- a/lib/graph/rte_graph_model_mcore_dispatch.c\n+++ b/lib/graph/rte_graph_model_mcore_dispatch.c\n@@ -96,6 +96,7 @@ __graph_sched_node_enqueue(struct rte_node *node, struct rte_graph *graph)\n \t\trte_pause();\n \n \toff += size;\n+\tnode->total_sched_objs += size;\n \tnode->idx -= size;\n \tif (node->idx > 0)\n \t\tgoto submit_again;\n@@ -107,6 +108,8 @@ __graph_sched_node_enqueue(struct rte_node *node, struct rte_graph *graph)\n \t\tmemmove(&node->objs[0], &node->objs[off],\n \t\t\tnode->idx * sizeof(void *));\n \n+\tnode->total_sched_fail += node->idx;\n+\n \treturn false;\n }\n \ndiff --git a/lib/graph/rte_graph_worker_common.h b/lib/graph/rte_graph_worker_common.h\nindex a9a72a6005..cd49518164 100644\n--- a/lib/graph/rte_graph_worker_common.h\n+++ b/lib/graph/rte_graph_worker_common.h\n@@ -110,6 +110,8 @@ struct rte_node {\n \t\t\tunsigned int lcore_id;  /**< Node running lcore. */\n \t\t} dispatch;\n \t};\n+\tuint64_t total_sched_objs; /**< Number of objects scheduled. */\n+\tuint64_t total_sched_fail; /**< Number of scheduled failure. */\n \t/* Fast path area  */\n #define RTE_NODE_CTX_SZ 16\n \tuint8_t ctx[RTE_NODE_CTX_SZ] __rte_cache_aligned; /**< Node Context. */\n",
    "prefixes": [
        "v8",
        "14/17"
    ]
}