get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 5327,
    "url": "https://patches.dpdk.org/api/patches/5327/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1433862646-91880-8-git-send-email-maryam.tahhan@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1433862646-91880-8-git-send-email-maryam.tahhan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1433862646-91880-8-git-send-email-maryam.tahhan@intel.com",
    "date": "2015-06-09T15:10:46",
    "name": "[dpdk-dev,v2,7/7] app: add a new app proc_info",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "668a0d123c5b509fda9001a9fd7fd5dc6480f097",
    "submitter": {
        "id": 259,
        "url": "https://patches.dpdk.org/api/people/259/?format=api",
        "name": "Tahhan, Maryam",
        "email": "maryam.tahhan@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1433862646-91880-8-git-send-email-maryam.tahhan@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/5327/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/5327/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 98AAEC33E;\n\tTue,  9 Jun 2015 17:11:06 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id D6E4DC318\n\tfor <dev@dpdk.org>; Tue,  9 Jun 2015 17:11:02 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP; 09 Jun 2015 08:11:04 -0700",
            "from sie-lab-212-170.ir.intel.com (HELO\n\tsilpixa00378251.ir.intel.com) ([10.237.212.170])\n\tby orsmga002.jf.intel.com with ESMTP; 09 Jun 2015 08:11:03 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.13,581,1427785200\"; d=\"scan'208\";a=\"743677477\"",
        "From": "Maryam Tahhan <maryam.tahhan@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue,  9 Jun 2015 16:10:46 +0100",
        "Message-Id": "<1433862646-91880-8-git-send-email-maryam.tahhan@intel.com>",
        "X-Mailer": "git-send-email 1.9.3",
        "In-Reply-To": "<1433862646-91880-1-git-send-email-maryam.tahhan@intel.com>",
        "References": "<1433862646-91880-1-git-send-email-maryam.tahhan@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 7/7] app: add a new app proc_info",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "proc_info displays statistics information including extened stats for\ngiven DPDK ports and dumps the memory information for DPDK.\n\nSigned-off-by: Maryam Tahhan <maryam.tahhan@intel.com>\n---\n MAINTAINERS            |   4 +\n app/Makefile           |   1 +\n app/proc_info/Makefile |  45 +++++\n app/proc_info/main.c   | 514 +++++++++++++++++++++++++++++++++++++++++++++++++\n mk/rte.sdktest.mk      |   4 +-\n 5 files changed, 566 insertions(+), 2 deletions(-)\n create mode 100644 app/proc_info/Makefile\n create mode 100644 app/proc_info/main.c",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 9362c19..94e0300 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -485,3 +485,7 @@ F: doc/guides/sample_app_ug/skeleton.rst\n F: examples/vmdq/\n F: examples/vmdq_dcb/\n F: doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst\n+\n+M: Maryam Tahhan <maryam.tahhan@intel.com\n+M: John McNamara <john.mcnamara@intel.com>\n+F: app/proc_info/\ndiff --git a/app/Makefile b/app/Makefile\nindex 81bd222..88c0bad 100644\n--- a/app/Makefile\n+++ b/app/Makefile\n@@ -36,5 +36,6 @@ DIRS-$(CONFIG_RTE_LIBRTE_ACL) += test-acl\n DIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += test-pipeline\n DIRS-$(CONFIG_RTE_TEST_PMD) += test-pmd\n DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_test\n+DIRS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += proc_info\n \n include $(RTE_SDK)/mk/rte.subdir.mk\ndiff --git a/app/proc_info/Makefile b/app/proc_info/Makefile\nnew file mode 100644\nindex 0000000..6759547\n--- /dev/null\n+++ b/app/proc_info/Makefile\n@@ -0,0 +1,45 @@\n+#   BSD LICENSE\n+#\n+#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+#   All rights reserved.\n+#\n+#   Redistribution and use in source and binary forms, with or without\n+#   modification, are permitted provided that the following conditions\n+#   are met:\n+#\n+#     * Redistributions of source code must retain the above copyright\n+#       notice, this list of conditions and the following disclaimer.\n+#     * Redistributions in binary form must reproduce the above copyright\n+#       notice, this list of conditions and the following disclaimer in\n+#       the documentation and/or other materials provided with the\n+#       distribution.\n+#     * Neither the name of Intel Corporation nor the names of its\n+#       contributors may be used to endorse or promote products derived\n+#       from this software without specific prior written permission.\n+#\n+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+#   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+\n+include $(RTE_SDK)/mk/rte.vars.mk\n+\n+APP = proc_info\n+\n+CFLAGS += $(WERROR_FLAGS)\n+\n+# all source are stored in SRCS-y\n+\n+SRCS-y := main.c\n+\n+# this application needs libraries first\n+DEPDIRS-y += lib\n+\n+include $(RTE_SDK)/mk/rte.app.mk\ndiff --git a/app/proc_info/main.c b/app/proc_info/main.c\nnew file mode 100644\nindex 0000000..e948d7f\n--- /dev/null\n+++ b/app/proc_info/main.c\n@@ -0,0 +1,514 @@\n+/*\n+ *   BSD LICENSE\n+ *\n+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ *   All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of Intel Corporation nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <stdio.h>\n+#include <string.h>\n+#include <stdint.h>\n+#include <errno.h>\n+#include <stdarg.h>\n+#include <inttypes.h>\n+#include <sys/queue.h>\n+#include <stdlib.h>\n+#include <getopt.h>\n+\n+#include <rte_eal.h>\n+#include <rte_config.h>\n+#include <rte_common.h>\n+#include <rte_debug.h>\n+#include <rte_ethdev.h>\n+#include <rte_malloc.h>\n+#include <rte_memory.h>\n+#include <rte_memzone.h>\n+#include <rte_launch.h>\n+#include <rte_tailq.h>\n+#include <rte_per_lcore.h>\n+#include <rte_lcore.h>\n+#include <rte_debug.h>\n+#include <rte_log.h>\n+#include <rte_atomic.h>\n+#include <rte_branch_prediction.h>\n+#include <rte_string_fns.h>\n+\n+/* Maximum long option length for option parsing. */\n+#define MAX_LONG_OPT_SZ 64\n+#define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1\n+#define MAX_TX_QUEUE_STATS_MAPPINGS 1024 /* MAX_PORT of 32 @ 32 tx_queues/port */\n+#define MAX_RX_QUEUE_STATS_MAPPINGS 4096 /* MAX_PORT of 32 @ 128 rx_queues/port */\n+\n+/**< mask of enabled ports */\n+static uint32_t enabled_port_mask = 0;\n+/**< Enable stats. */\n+static uint32_t enable_stats = 0;\n+/**< Enable xstats. */\n+static uint32_t enable_xstats = 0;\n+/**< Enable stats reset. */\n+static uint32_t reset_stats = 0;\n+/**< Enable xstats reset. */\n+static uint32_t reset_xstats = 0;\n+/**< Enable memory info. */\n+static uint32_t mem_info = 0;\n+/**\n+ * The data structure associated with each port.\n+ */\n+struct rte_port {\n+\tuint8_t tx_queue_stats_mapping_enabled;\n+\tuint8_t rx_queue_stats_mapping_enabled;\n+};\n+\n+struct rte_port *ports;\t       /**< For all probed ethernet ports. */\n+\n+struct queue_stats_mappings {\n+\tuint8_t port_id;\n+\tuint16_t queue_id;\n+\tuint8_t stats_counter_id;\n+} __rte_cache_aligned;\n+\n+static struct queue_stats_mappings\n+\t\ttx_queue_stats_mappings_array[MAX_TX_QUEUE_STATS_MAPPINGS];\n+static struct queue_stats_mappings\n+\t\trx_queue_stats_mappings_array[MAX_RX_QUEUE_STATS_MAPPINGS];\n+\n+static struct queue_stats_mappings *tx_queue_stats_mappings =\n+\t\ttx_queue_stats_mappings_array;\n+static struct queue_stats_mappings *rx_queue_stats_mappings =\n+\t\trx_queue_stats_mappings_array;\n+\n+static uint16_t nb_tx_queue_stats_mappings = 0;\n+static uint16_t nb_rx_queue_stats_mappings = 0;\n+\n+/*\n+ * Configurable number of RX/TX queues.\n+ */\n+static uint16_t nb_rxq = 1; /**< Number of RX queues per port. */\n+static uint16_t nb_txq = 1; /**< Number of TX queues per port. */\n+\n+/**< display usage */\n+static void\n+proc_info_usage(const char *prgname)\n+{\n+\tprintf(\"%s [EAL options] -- -p PORTMASK\\n\"\n+\t\t\"  -m to display DPDK memory zones, segments and TAILQ information\\n\"\n+\t\t\"  -p PORTMASK: hexadecimal bitmask of ports to retrieve stats for\\n\"\n+\t\t\"  --stats: to display port statistics, enabled by default\\n\"\n+\t\t\"  --xstats: to display extended port statistics, disabled by\"\n+\t\t\t\"default\\n\"\n+\t\t\"  --stats-reset: to reset port statistics\\n\"\n+\t\t\"  --xstats-reset: to reset port extended statistics\\n\",\n+\t\tprgname);\n+\treturn;\n+}\n+\n+/*\n+ * Parse the portmask provided at run time.\n+ */\n+static int\n+parse_portmask(const char *portmask)\n+{\n+\tchar *end = NULL;\n+\tunsigned long pm;\n+\n+\terrno = 0;\n+\n+\t/* parse hexadecimal string */\n+\tpm = strtoul(portmask, &end, 16);\n+\tif ((portmask[0] == '\\0') || (end == NULL) || (*end != '\\0') ||\n+\t\t(errno != 0)) {\n+\t\tprintf(\"%s ERROR parsing the port mask\\n\", __func__);\n+\t\treturn -1;\n+\t}\n+\n+\tif (pm == 0)\n+\t\treturn -1;\n+\n+\treturn pm;\n+\n+}\n+\n+/* Parse the argument given in the command line of the application */\n+static int\n+proc_info_parse_args(int argc, char **argv)\n+{\n+\tint opt;\n+\tint option_index;\n+\tchar *prgname = argv[0];\n+\tstatic struct option long_option[] = {\n+\t\t{\"stats\", 0, NULL, 0},\n+\t\t{\"stats-reset\", 0, NULL, 0},\n+\t\t{\"xstats\", 0, NULL, 0},\n+\t\t{\"xstats-reset\", 0, NULL, 0},\n+\t\t{NULL, 0, 0, 0}\n+\t};\n+\n+\t/* Parse command line */\n+\twhile ((opt = getopt_long(argc, argv, \"p:m\",\n+\t\t\tlong_option, &option_index)) != EOF) {\n+\t\tswitch (opt) {\n+\t\t/* portmask */\n+\t\tcase 'p':\n+\t\t\tenabled_port_mask = parse_portmask(optarg);\n+\t\t\tif (enabled_port_mask == 0) {\n+\t\t\t\tprintf(\"invalid portmask\\n\");\n+\t\t\t\tproc_info_usage(prgname);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tbreak;\n+\t\tcase 'm':\n+\t\t\tmem_info = 1;\n+\t\t\tbreak;\n+\t\tcase 0:\n+\t\t\t/* Print stats */\n+\t\t\tif (!strncmp(long_option[option_index].name, \"stats\",\n+\t\t\t\t\tMAX_LONG_OPT_SZ))\n+\t\t\t\tenable_stats = 1;\n+\t\t\t/* Print xstats */\n+\t\t\telse if (!strncmp(long_option[option_index].name, \"xstats\",\n+\t\t\t\t\tMAX_LONG_OPT_SZ))\n+\t\t\t\tenable_xstats = 1;\n+\t\t\t/* Print stats */\n+\t\t\tif (!strncmp(long_option[option_index].name, \"stats-reset\",\n+\t\t\t\t\tMAX_LONG_OPT_SZ))\n+\t\t\t\treset_stats = 1;\n+\t\t\t/* Print xstats */\n+\t\t\telse if (!strncmp(long_option[option_index].name, \"xstats-reset\",\n+\t\t\t\t\tMAX_LONG_OPT_SZ))\n+\t\t\t\treset_xstats = 1;\n+\t\t\tbreak;\n+\n+\t\tdefault:\n+\t\t\tproc_info_usage(prgname);\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n+static void\n+meminfo_display(void)\n+{\n+\tprintf(\"----------- MEMORY_SEGMENTS -----------\\n\");\n+\trte_dump_physmem_layout(stdout);\n+\tprintf(\"--------- END_MEMORY_SEGMENTS ---------\\n\");\n+\n+\tprintf(\"------------ MEMORY_ZONES -------------\\n\");\n+\trte_memzone_dump(stdout);\n+\tprintf(\"---------- END_MEMORY_ZONES -----------\\n\");\n+\n+\tprintf(\"------------- TAIL_QUEUES -------------\\n\");\n+\trte_dump_tailq(stdout);\n+\tprintf(\"---------- END_TAIL_QUEUES ------------\\n\");\n+}\n+\n+static void\n+nic_stats_display(uint8_t port_id)\n+{\n+\tstruct rte_eth_stats stats;\n+\tuint8_t i;\n+\tstruct rte_port *port = &ports[port_id];\n+\n+\tstatic const char *nic_stats_border = \"########################\";\n+\n+\trte_eth_stats_get(port_id, &stats);\n+\tprintf(\"\\n  %s NIC statistics for port %-2d %s\\n\",\n+\t\t   nic_stats_border, port_id, nic_stats_border);\n+\n+\tif ((!port->rx_queue_stats_mapping_enabled) && (!port->tx_queue_stats_mapping_enabled)) {\n+\t\tprintf(\"  RX-packets: %-10\"PRIu64\" RX-missed: %-10\"PRIu64\" RX-bytes:  \"\n+\t\t       \"%-\"PRIu64\"\\n\",\n+\t\t       stats.ipackets, stats.imissed, stats.ibytes);\n+\t\tprintf(\"  RX-badcrc:  %-10\"PRIu64\" RX-badlen: %-10\"PRIu64\" RX-errors: \"\n+\t\t       \"%-\"PRIu64\"\\n\",\n+\t\t       stats.ibadcrc, stats.ibadlen, stats.ierrors);\n+\t\tprintf(\"  RX-nombuf:  %-10\"PRIu64\"\\n\",\n+\t\t       stats.rx_nombuf);\n+\t\tprintf(\"  TX-packets: %-10\"PRIu64\" TX-errors: %-10\"PRIu64\" TX-bytes:  \"\n+\t\t       \"%-\"PRIu64\"\\n\",\n+\t\t       stats.opackets, stats.oerrors, stats.obytes);\n+\t} else {\n+\t\tprintf(\"  RX-packets:              %10\"PRIu64\"    RX-errors: %10\"PRIu64\n+\t\t       \"    RX-bytes: %10\"PRIu64\"\\n\",\n+\t\t       stats.ipackets, stats.ierrors, stats.ibytes);\n+\t\tprintf(\"  RX-badcrc:               %10\"PRIu64\"    RX-badlen: %10\"PRIu64\n+\t\t       \"  RX-errors:  %10\"PRIu64\"\\n\",\n+\t\t       stats.ibadcrc, stats.ibadlen, stats.ierrors);\n+\t\tprintf(\"  RX-nombuf:               %10\"PRIu64\"\\n\",\n+\t\t       stats.rx_nombuf);\n+\t\tprintf(\"  TX-packets:              %10\"PRIu64\"    TX-errors: %10\"PRIu64\n+\t\t       \"    TX-bytes: %10\"PRIu64\"\\n\",\n+\t\t       stats.opackets, stats.oerrors, stats.obytes);\n+\t}\n+\n+\tprintf(\"  RX-MAC-errors: %-10\"PRIu64\" RX-PHY-errors: %-10\"PRIu64\"\\n\",\n+\t       stats.imacerr, stats.iphyerr);\n+\tprintf(\"  RX-nombuf:  %-10\"PRIu64\"  RX-dropped: %-10\"PRIu64\"\\n\",\n+\t       stats.rx_nombuf, stats.idrop);\n+\n+\tif (port->rx_queue_stats_mapping_enabled) {\n+\t\tprintf(\"\\n\");\n+\t\tfor (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {\n+\t\t\tprintf(\"  Stats reg %2d RX-packets: %10\"PRIu64\n+\t\t\t       \"    RX-errors: %10\"PRIu64\n+\t\t\t       \"    RX-bytes: %10\"PRIu64\"\\n\",\n+\t\t\t       i, stats.q_ipackets[i], stats.q_errors[i], stats.q_ibytes[i]);\n+\t\t}\n+\t}\n+\tif (port->tx_queue_stats_mapping_enabled) {\n+\t\tprintf(\"\\n\");\n+\t\tfor (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS; i++) {\n+\t\t\tprintf(\"  Stats reg %2d TX-packets: %10\"PRIu64\n+\t\t\t       \"                             TX-bytes: %10\"PRIu64\"\\n\",\n+\t\t\t       i, stats.q_opackets[i], stats.q_obytes[i]);\n+\t\t}\n+\t}\n+\n+\t/* Display statistics of XON/XOFF pause frames, if any. */\n+\tif ((stats.tx_pause_xon  | stats.rx_pause_xon |\n+\t\t stats.tx_pause_xoff | stats.rx_pause_xoff) > 0) {\n+\t\tprintf(\"  RX-XOFF:    %-10\"PRIu64\" RX-XON:    %-10\"PRIu64\"\\n\",\n+\t\t\t   stats.rx_pause_xoff, stats.rx_pause_xon);\n+\t\tprintf(\"  TX-XOFF:    %-10\"PRIu64\" TX-XON:    %-10\"PRIu64\"\\n\",\n+\t\t\t   stats.tx_pause_xoff, stats.tx_pause_xon);\n+\t}\n+\tprintf(\"  %s############################%s\\n\",\n+\t\t   nic_stats_border, nic_stats_border);\n+}\n+\n+static void\n+nic_stats_clear(uint8_t port_id)\n+{\n+\tprintf(\"\\n Clearing NIC stats for port %d\\n\", port_id);\n+\trte_eth_stats_reset(port_id);\n+\tprintf(\"\\n  NIC statistics for port %d cleared\\n\", port_id);\n+}\n+\n+static void\n+nic_xstats_display(uint8_t port_id)\n+{\n+\tstruct rte_eth_xstats *xstats;\n+\tint len, ret, i;\n+\tstatic const char *nic_stats_border = \"########################\";\n+\n+\tlen = rte_eth_xstats_get(port_id, NULL, 0);\n+\tif (len < 0) {\n+\t\tprintf(\"Cannot get xstats count\\n\");\n+\t\treturn;\n+\t}\n+\txstats = malloc(sizeof(xstats[0]) * len);\n+\tif (xstats == NULL) {\n+\t\tprintf(\"Cannot allocate memory for xstats\\n\");\n+\t\treturn;\n+\t}\n+\n+\tprintf(\"###### NIC extended statistics for port %-2d #########\\n\",\n+\t\t\t   port_id);\n+\tprintf(\"%s############################\\n\",\n+\t\t\t   nic_stats_border);\n+\tret = rte_eth_xstats_get(port_id, xstats, len);\n+\tif (ret < 0 || ret > len) {\n+\t\tprintf(\"Cannot get xstats\\n\");\n+\t\tfree(xstats);\n+\t\treturn;\n+\t}\n+\n+\tfor (i = 0; i < len; i++)\n+\t\tprintf(\"%s: %\"PRIu64\"\\n\", xstats[i].name, xstats[i].value);\n+\n+\tprintf(\"%s############################\\n\",\n+\t\t\t   nic_stats_border);\n+\tfree(xstats);\n+}\n+\n+static void\n+nic_xstats_clear(uint8_t port_id)\n+{\n+\tprintf(\"\\n Clearing NIC xstats for port %d\\n\", port_id);\n+\trte_eth_xstats_reset(port_id);\n+\tprintf(\"\\n  NIC extended statistics for port %d cleared\\n\", port_id);\n+}\n+\n+static int\n+set_tx_queue_stats_mapping_registers(uint8_t port_id, struct rte_port *port)\n+{\n+\tuint16_t i;\n+\tint diag;\n+\tuint8_t mapping_found = 0;\n+\n+\tfor (i = 0; i < nb_tx_queue_stats_mappings; i++) {\n+\t\tif ((tx_queue_stats_mappings[i].port_id == port_id) &&\n+\t\t\t\t(tx_queue_stats_mappings[i].queue_id < nb_txq)) {\n+\t\t\tdiag = rte_eth_dev_set_tx_queue_stats_mapping(port_id,\n+\t\t\t\t\ttx_queue_stats_mappings[i].queue_id,\n+\t\t\t\t\ttx_queue_stats_mappings[i].stats_counter_id);\n+\t\t\tif (diag != 0)\n+\t\t\t\treturn diag;\n+\t\t\tmapping_found = 1;\n+\t\t}\n+\t}\n+\n+\tif (mapping_found)\n+\t\tport->tx_queue_stats_mapping_enabled = 1;\n+\n+\treturn 0;\n+}\n+\n+static int\n+set_rx_queue_stats_mapping_registers(uint8_t port_id, struct rte_port *port)\n+{\n+\tuint16_t i;\n+\tint diag;\n+\tuint8_t mapping_found = 0;\n+\n+\tfor (i = 0; i < nb_rx_queue_stats_mappings; i++) {\n+\t\tif ((rx_queue_stats_mappings[i].port_id == port_id) &&\n+\t\t\t\t(rx_queue_stats_mappings[i].queue_id < nb_rxq)) {\n+\t\t\tdiag = rte_eth_dev_set_rx_queue_stats_mapping(port_id,\n+\t\t\t\t\trx_queue_stats_mappings[i].queue_id,\n+\t\t\t\t\trx_queue_stats_mappings[i].stats_counter_id);\n+\t\t\tif (diag != 0)\n+\t\t\t\treturn diag;\n+\t\t\tmapping_found = 1;\n+\t\t}\n+\t}\n+\n+\tif (mapping_found)\n+\t\tport->rx_queue_stats_mapping_enabled = 1;\n+\n+\treturn 0;\n+}\n+\n+static void\n+map_port_queue_stats_mapping_registers(uint8_t pi, struct rte_port *port)\n+{\n+\tint diag = 0;\n+\n+\tdiag = set_tx_queue_stats_mapping_registers(pi, port);\n+\tif (diag != 0) {\n+\t\tif (diag == -ENOTSUP) {\n+\t\t\tport->tx_queue_stats_mapping_enabled = 0;\n+\t\t\tprintf(\"TX queue stats mapping not supported port id=%d\\n\",\n+\t\t\t\t\tpi);\n+\t\t} else\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\"set_tx_queue_stats_mapping_registers \"\n+\t\t\t\t\t\"failed for port id=%d diag=%d\\n\",\n+\t\t\t\t\tpi, diag);\n+\t}\n+\n+\tdiag = set_rx_queue_stats_mapping_registers(pi, port);\n+\tif (diag != 0) {\n+\t\tif (diag == -ENOTSUP) {\n+\t\t\tport->rx_queue_stats_mapping_enabled = 0;\n+\t\t\tprintf(\"RX queue stats mapping not supported port id=%d\\n\",\n+\t\t\t\t\tpi);\n+\t\t} else\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\"set_rx_queue_stats_mapping_registers \"\n+\t\t\t\t\t\"failed for port id=%d diag=%d\\n\",\n+\t\t\t\t\tpi, diag);\n+\t}\n+}\n+\n+int\n+main(int argc, char **argv)\n+{\n+\tint ret;\n+\tint i;\n+\tchar c_flag[] = \"-c1\";\n+\tchar n_flag[] = \"-n4\";\n+\tchar mp_flag[] = \"--proc-type=secondary\";\n+\tchar *argp[argc + 3];\n+\tuint8_t nb_ports;\n+\n+\targp[0] = argv[0];\n+\targp[1] = c_flag;\n+\targp[2] = n_flag;\n+\targp[3] = mp_flag;\n+\n+\tfor (i = 1; i < argc; i++)\n+\t\targp[i + 3] = argv[i];\n+\n+\targc += 3;\n+\n+\tret = rte_eal_init(argc, argp);\n+\tif (ret < 0)\n+\t\trte_panic(\"Cannot init EAL\\n\");\n+\n+\targc -= ret;\n+\targv += (ret - 3);\n+\n+\t/* parse app arguments */\n+\tret = proc_info_parse_args(argc, argv);\n+\tif (ret < 0)\n+\t\trte_exit(EXIT_FAILURE, \"Invalid argument\\n\");\n+\n+\tif (mem_info) {\n+\t\tmeminfo_display();\n+\t\treturn 0;\n+\t}\n+\n+\tnb_ports = rte_eth_dev_count();\n+\tif (nb_ports == 0)\n+\t\trte_exit(EXIT_FAILURE, \"No Ethernet ports - bye\\n\");\n+\n+\n+\tif (nb_ports > RTE_MAX_ETHPORTS)\n+\t\tnb_ports = RTE_MAX_ETHPORTS;\n+\n+\t/* Configuration of Ethernet ports. */\n+\tports = rte_zmalloc(\"proc_info: ports\",\n+\t\t\t\tsizeof(struct rte_port) * nb_ports,\n+\t\t\t\tRTE_CACHE_LINE_SIZE);\n+\tif (ports == NULL)\n+\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\"rte_zmalloc(%d struct rte_port) failed\\n\",\n+\t\t\t\tnb_ports);\n+\n+\t/* If no port mask was specified*/\n+\tif (enabled_port_mask == 0 && (enable_xstats || enable_stats))\n+\t\tenabled_port_mask = 0xffff;\n+\n+\tfor (i = 0; i < nb_ports; i++) {\n+\t\tmap_port_queue_stats_mapping_registers(i, &ports[i]);\n+\t\tif (enabled_port_mask & (1 << i)) {\n+\t\t\tif (enable_stats)\n+\t\t\t\tnic_stats_display(i);\n+\t\t\telse if (enable_xstats)\n+\t\t\t\tnic_xstats_display(i);\n+\t\t\telse if (reset_stats)\n+\t\t\t\tnic_stats_clear(i);\n+\t\t\telse if (reset_xstats)\n+\t\t\t\tnic_xstats_clear(i);\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\ndiff --git a/mk/rte.sdktest.mk b/mk/rte.sdktest.mk\nindex 2696142..59a29de 100644\n--- a/mk/rte.sdktest.mk\n+++ b/mk/rte.sdktest.mk\n@@ -66,7 +66,7 @@ test fast_test ring_test mempool_test perf_test:\n \tfi\n \n # this is a special target to ease the pain of running coverage tests\n-# this runs all the autotests, cmdline_test script and dump_cfg\n+# this runs all the autotests, cmdline_test script and proc_info\n coverage:\n \t@mkdir -p $(AUTOTEST_DIR) ; \\\n \tcd $(AUTOTEST_DIR) ; \\\n@@ -78,7 +78,7 @@ coverage:\n \t\t\t$(RTE_OUTPUT)/app/test \\\n \t\t\t$(RTE_TARGET) \\\n \t\t\t$(BLACKLIST) $(WHITELIST) ; \\\n-\t\t$(RTE_OUTPUT)/app/dump_cfg --file-prefix=ring_perf ; \\\n+\t\t$(RTE_OUTPUT)/app/proc_info --file-prefix=ring_perf -- -m; \\\n \telse \\\n \t\techo \"No test found, please do a 'make build' first, or specify O=\" ;\\\n \tfi\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "7/7"
    ]
}