Show a patch.

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

{
    "id": 74500,
    "url": "https://patches.dpdk.org/api/patches/74500/",
    "web_url": "https://patches.dpdk.org/patch/74500/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20200720140403.69865-4-ciara.power@intel.com>",
    "date": "2020-07-20T14:04:03",
    "name": "[v7,3/3] ethdev: add common stats for telemetry",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "e2cd73a4fbcb78f92b434f239c01239c0a87aa62",
    "submitter": {
        "id": 978,
        "url": "https://patches.dpdk.org/api/people/978/",
        "name": "Ciara Power",
        "email": "ciara.power@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "https://patches.dpdk.org/patch/74500/mbox/",
    "series": [
        {
            "id": 11173,
            "url": "https://patches.dpdk.org/api/series/11173/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11173",
            "date": "2020-07-20T14:04:00",
            "name": "add basic ethdev stats with data object recursion",
            "version": 7,
            "mbox": "https://patches.dpdk.org/series/11173/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74500/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/74500/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9687\"; a=\"211458206\"",
            "E=Sophos;i=\"5.75,375,1589266800\"; d=\"scan'208\";a=\"211458206\"",
            "E=Sophos;i=\"5.75,375,1589266800\"; d=\"scan'208\";a=\"309857139\""
        ],
        "IronPort-SDR": [
            "\n vtehAJCTBTgA/Q5Yrp5VBAFQ8am/u3XwS0wKmA9ACCc6QOjlpSDg+iX3Il0Lbb2di4NOtkDH+u\n 7YiQ0gsXx5AQ==",
            "\n X6gtMCBUo/Op6G6Q0I1CVmklxFh5zJhRrWqi7YbNWKnYAOERbb4oQgFpu+KrbDE7S6tHAYLfpz\n xwRHQ5wDBupA=="
        ],
        "X-Amp-File-Uploaded": "False",
        "Precedence": "list",
        "X-Mailman-Version": "2.1.15",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "X-BeenThere": "dev@dpdk.org",
        "References": "<20200612105344.15383-1-ciara.power@intel.com>\n <20200720140403.69865-1-ciara.power@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v7 3/3] ethdev: add common stats for telemetry",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 79517A0540;\n\tMon, 20 Jul 2020 16:09:57 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7F4141BEBF;\n\tMon, 20 Jul 2020 16:09:37 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n by dpdk.org (Postfix) with ESMTP id 32A6C1AFB\n for <dev@dpdk.org>; Mon, 20 Jul 2020 16:09:32 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 20 Jul 2020 07:09:19 -0700",
            "from silpixa00399953.ir.intel.com (HELO\n silpixa00399953.ger.corp.intel.com) ([10.237.222.53])\n by fmsmga004.fm.intel.com with ESMTP; 20 Jul 2020 07:09:17 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Mailer": "git-send-email 2.17.1",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-ExtLoop1": "1",
        "Date": "Mon, 20 Jul 2020 15:04:03 +0100",
        "To": "kevin.laatz@intel.com, thomas@monjalon.net, ferruh.yigit@intel.com,\n arybchenko@solarflare.com",
        "From": "Ciara Power <ciara.power@intel.com>",
        "In-Reply-To": "<20200720140403.69865-1-ciara.power@intel.com>",
        "Cc": "dev@dpdk.org, keith.wiles@intel.com, bruce.richardson@intel.com,\n Ciara Power <ciara.power@intel.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20200720140403.69865-4-ciara.power@intel.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "The ethdev library now registers a telemetry command for common ethdev\nstatistics.\n\nAn example usage is shown below:\n\nConnecting to /var/run/dpdk/rte/dpdk_telemetry.v2\n{\"version\": \"DPDK 20.08.0-rc1\", \"pid\": 14119, \"max_output_len\": 16384}\n--> /ethdev/stats,0\n{\"/ethdev/stats\": {\"ipackets\": 0, \"opackets\": 0, \"ibytes\": 0, \"obytes\": \\\n    0, \"imissed\": 0, \"ierrors\": 0, \"oerrors\": 0, \"rx_nombuf\": 0, \\\n    \"q_ipackets\": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \\\n    \"q_opackets\": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \\\n    \"q_ibytes\": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \\\n    \"q_obytes\": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \\\n    \"q_errors\": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}}\n\nSigned-off-by: Ciara Power <ciara.power@intel.com>\nAcked-by: Bruce Richardson <bruce.richardson@intel.com>\n\n---\nv3:\n  - Updated help text and commit subject line.\nv2:\n  - Updated to use memory management APIs.\n---\n lib/librte_ethdev/rte_ethdev.c | 53 ++++++++++++++++++++++++++++++++++\n 1 file changed, 53 insertions(+)",
    "diff": "diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 7858ad5f1..8ee14b1b5 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -5275,6 +5275,57 @@ handle_port_list(const char *cmd __rte_unused,\n \treturn 0;\n }\n \n+static void\n+add_port_queue_stats(struct rte_tel_data *d, uint64_t *q_stats,\n+\t\tconst char *stat_name)\n+{\n+\tint q;\n+\tstruct rte_tel_data *q_data = rte_tel_data_alloc();\n+\trte_tel_data_start_array(q_data, RTE_TEL_U64_VAL);\n+\tfor (q = 0; q < RTE_ETHDEV_QUEUE_STAT_CNTRS; q++)\n+\t\trte_tel_data_add_array_u64(q_data, q_stats[q]);\n+\trte_tel_data_add_dict_container(d, stat_name, q_data, 0);\n+}\n+\n+#define ADD_DICT_STAT(stats, s) rte_tel_data_add_dict_u64(d, #s, stats.s)\n+\n+static int\n+handle_port_stats(const char *cmd __rte_unused,\n+\t\tconst char *params,\n+\t\tstruct rte_tel_data *d)\n+{\n+\tstruct rte_eth_stats stats;\n+\tint port_id, ret;\n+\n+\tif (params == NULL || strlen(params) == 0 || !isdigit(*params))\n+\t\treturn -1;\n+\n+\tport_id = atoi(params);\n+\tif (!rte_eth_dev_is_valid_port(port_id))\n+\t\treturn -1;\n+\n+\tret = rte_eth_stats_get(port_id, &stats);\n+\tif (ret < 0)\n+\t\treturn -1;\n+\n+\trte_tel_data_start_dict(d);\n+\tADD_DICT_STAT(stats, ipackets);\n+\tADD_DICT_STAT(stats, opackets);\n+\tADD_DICT_STAT(stats, ibytes);\n+\tADD_DICT_STAT(stats, obytes);\n+\tADD_DICT_STAT(stats, imissed);\n+\tADD_DICT_STAT(stats, ierrors);\n+\tADD_DICT_STAT(stats, oerrors);\n+\tADD_DICT_STAT(stats, rx_nombuf);\n+\tadd_port_queue_stats(d, stats.q_ipackets, \"q_ipackets\");\n+\tadd_port_queue_stats(d, stats.q_opackets, \"q_opackets\");\n+\tadd_port_queue_stats(d, stats.q_ibytes, \"q_ibytes\");\n+\tadd_port_queue_stats(d, stats.q_obytes, \"q_obytes\");\n+\tadd_port_queue_stats(d, stats.q_errors, \"q_errors\");\n+\n+\treturn 0;\n+}\n+\n static int\n handle_port_xstats(const char *cmd __rte_unused,\n \t\tconst char *params,\n@@ -5361,6 +5412,8 @@ RTE_INIT(ethdev_init_telemetry)\n {\n \trte_telemetry_register_cmd(\"/ethdev/list\", handle_port_list,\n \t\t\t\"Returns list of available ethdev ports. Takes no parameters\");\n+\trte_telemetry_register_cmd(\"/ethdev/stats\", handle_port_stats,\n+\t\t\t\"Returns the common stats for a port. Parameters: int port_id\");\n \trte_telemetry_register_cmd(\"/ethdev/xstats\", handle_port_xstats,\n \t\t\t\"Returns the extended stats for a port. Parameters: int port_id\");\n \trte_telemetry_register_cmd(\"/ethdev/link_status\",\n",
    "prefixes": [
        "v7",
        "3/3"
    ]
}