get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 125668,
    "url": "http://patches.dpdk.org/api/patches/125668/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230331040306.3143693-14-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": "<20230331040306.3143693-14-zhirun.yan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230331040306.3143693-14-zhirun.yan@intel.com",
    "date": "2023-03-31T04:03:04",
    "name": "[v5,13/15] graph: add stats for cross-core dispatching",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "71de09a3f09b498a5b2e943a5328292aa363b145",
    "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/20230331040306.3143693-14-zhirun.yan@intel.com/mbox/",
    "series": [
        {
            "id": 27590,
            "url": "http://patches.dpdk.org/api/series/27590/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27590",
            "date": "2023-03-31T04:02:51",
            "name": "graph enhancement for multi-core dispatch",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/27590/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/125668/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/125668/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 5BAAA4287E;\n\tFri, 31 Mar 2023 06:04:48 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 11FB942D79;\n\tFri, 31 Mar 2023 06:03:46 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id 9F52442D56\n for <dev@dpdk.org>; Fri, 31 Mar 2023 06:03:43 +0200 (CEST)",
            "from fmsmga007.fm.intel.com ([10.253.24.52])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 30 Mar 2023 21:03:43 -0700",
            "from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.68])\n by fmsmga007.fm.intel.com with ESMTP; 30 Mar 2023 21:03:41 -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=1680235423; x=1711771423;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=LVhckUaRkO+6TmsxwmLz/KPOPMLLS8UCjv+USsYZWwA=;\n b=jJBY1D2eZuCK4uELuk+Xg+nFK9HhtP4XB9nZzBn3e8ns4dXVJZNhiy+s\n 5GA2VOE72kFALaSguLshy2RRGseOZwsnL6hOAf6mirgbbEs0aqaVxurJw\n /N99XtsIXLWss7qSKSeHPdHacTFV7lUBIOr9KcJ28r0nTcm8LRXnpBtdQ\n /JD019lVjlvDozd21l4IEDLpFAP/x3IIFvNP5BVB0r8gjrzRx2WtqvWqG\n 3qLssPuuqNi/Mk5ceICETHOL9+WdNUHJqX+VFogG5Duu5B+zV70+Izg1D\n xCZZ4mmP9bq6xPPGFGiS3h7NtIDBHDOQg0XgFicw77+/Jfi7esAUsoJYj A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10665\"; a=\"338849136\"",
            "E=Sophos;i=\"5.98,306,1673942400\"; d=\"scan'208\";a=\"338849136\"",
            "E=McAfee;i=\"6600,9927,10665\"; a=\"687502325\"",
            "E=Sophos;i=\"5.98,306,1673942400\"; d=\"scan'208\";a=\"687502325\""
        ],
        "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",
        "Cc": "cunming.liang@intel.com, haiyue.wang@intel.com,\n Zhirun Yan <zhirun.yan@intel.com>",
        "Subject": "[PATCH v5 13/15] graph: add stats for cross-core dispatching",
        "Date": "Fri, 31 Mar 2023 13:03:04 +0900",
        "Message-Id": "<20230331040306.3143693-14-zhirun.yan@intel.com>",
        "X-Mailer": "git-send-email 2.37.2",
        "In-Reply-To": "<20230331040306.3143693-1-zhirun.yan@intel.com>",
        "References": "<20230330061834.3118201-1-zhirun.yan@intel.com>\n <20230331040306.3143693-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              | 74 +++++++++++++++++++++++++---\n lib/graph/rte_graph.h                |  2 +\n lib/graph/rte_graph_model_dispatch.c |  3 ++\n lib/graph/rte_graph_worker_common.h  |  2 +\n 5 files changed, 79 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/lib/graph/graph_debug.c b/lib/graph/graph_debug.c\nindex b84412f5dd..7dcf07b080 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() == 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..aa22cc403c 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,27 @@ 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() == 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 +103,21 @@ 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() == 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->sched_objs,\n+\t\t\tstat->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 +125,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();\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@@ -332,13 +376,21 @@ static inline void\n cluster_node_arregate_stats(struct cluster_node *cluster)\n {\n \tuint64_t calls = 0, cycles = 0, objs = 0, realloc_count = 0;\n+\tuint64_t sched_objs = 0, sched_fail = 0;\n \tstruct rte_graph_cluster_node_stats *stat = &cluster->stat;\n \tstruct rte_node *node;\n \trte_node_t count;\n+\tint model;\n \n+\tmodel = rte_graph_worker_model_get();\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 +400,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->sched_objs = sched_objs;\n+\t\tstat->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 2f86c17de7..7d77a790ac 100644\n--- a/lib/graph/rte_graph.h\n+++ b/lib/graph/rte_graph.h\n@@ -208,6 +208,8 @@ struct rte_graph_cluster_node_stats {\n \tuint64_t prev_calls;\t/**< Previous number of calls. */\n \tuint64_t prev_objs;\t/**< Previous number of processed objs. */\n \tuint64_t prev_cycles;\t/**< Previous number of cycles. */\n+\tuint64_t sched_objs;\t/**< Previous number of scheduled objs. */\n+\tuint64_t sched_fail;\t/**< Previous number of failed schedule objs. */\n \n \tuint64_t realloc_count; /**< Realloc count. */\n \ndiff --git a/lib/graph/rte_graph_model_dispatch.c b/lib/graph/rte_graph_model_dispatch.c\nindex a300fefb85..9db60eb463 100644\n--- a/lib/graph/rte_graph_model_dispatch.c\n+++ b/lib/graph/rte_graph_model_dispatch.c\n@@ -83,6 +83,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@@ -94,6 +95,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 dc0a0b5554..d94983589c 100644\n--- a/lib/graph/rte_graph_worker_common.h\n+++ b/lib/graph/rte_graph_worker_common.h\n@@ -95,6 +95,8 @@ struct rte_node {\n \t\t/* Fast schedule area for mcore dispatch model */\n \t\tunsigned int lcore_id;  /**< Node running lcore. */\n \t\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": [
        "v5",
        "13/15"
    ]
}