Show a patch.

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

{
    "id": 74492,
    "url": "https://patches.dpdk.org/api/patches/74492/",
    "web_url": "https://patches.dpdk.org/patch/74492/",
    "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": "<20200720111907.30717-4-ciara.power@intel.com>",
    "date": "2020-07-20T11:19:07",
    "name": "[v6,3/3] ethdev: add common stats for telemetry",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e2cd73a4fbcb78f92b434f239c01239c0a87aa62",
    "submitter": {
        "id": 978,
        "url": "https://patches.dpdk.org/api/people/978/",
        "name": "Ciara Power",
        "email": "ciara.power@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/patch/74492/mbox/",
    "series": [
        {
            "id": 11169,
            "url": "https://patches.dpdk.org/api/series/11169/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11169",
            "date": "2020-07-20T11:19:04",
            "name": "add basic ethdev stats with data object recursion",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/11169/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74492/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/74492/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=\"234743049\"",
            "E=Sophos;i=\"5.75,374,1589266800\"; d=\"scan'208\";a=\"234743049\"",
            "E=Sophos;i=\"5.75,374,1589266800\"; d=\"scan'208\";a=\"487211121\""
        ],
        "IronPort-SDR": [
            "\n 29nLzriapGhPYE+YiQvwG1ZHw/SDtAah58rbqyfmZYS3N0Xv1I32GyuDMUOltKE+Dg1fnSEylE\n I/fNxgpg2nkw==",
            "\n eSzGJVXMiu5FJhnjYOsMgSUwWb15lnsrmxrnUFhgvU4j8TiKnMfLOFtQNwxtrdahAR5Hnu//yE\n umiFm8buuqQQ=="
        ],
        "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 <20200720111907.30717-1-ciara.power@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v6 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 13F43A0540;\n\tMon, 20 Jul 2020 13:24:45 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9421A1BEB4;\n\tMon, 20 Jul 2020 13:24:27 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by dpdk.org (Postfix) with ESMTP id CACB52C57\n for <dev@dpdk.org>; Mon, 20 Jul 2020 13:24:23 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 20 Jul 2020 04:24:23 -0700",
            "from silpixa00399953.ir.intel.com (HELO\n silpixa00399953.ger.corp.intel.com) ([10.237.222.53])\n by fmsmga006.fm.intel.com with ESMTP; 20 Jul 2020 04:24:21 -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 12:19:07 +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": "<20200720111907.30717-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": "<20200720111907.30717-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": [
        "v6",
        "3/3"
    ]
}