get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 123360,
    "url": "https://patches.dpdk.org/api/patches/123360/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230207163309.3070261-1-abdullah.sevincer@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": "<20230207163309.3070261-1-abdullah.sevincer@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230207163309.3070261-1-abdullah.sevincer@intel.com",
    "date": "2023-02-07T16:33:09",
    "name": "[v5] app/procinfo: display eventdev xstats for PMD data",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0fb3a28a011aac6cda4f11a2e062dad7865d9937",
    "submitter": {
        "id": 2843,
        "url": "https://patches.dpdk.org/api/people/2843/?format=api",
        "name": "Sevincer, Abdullah",
        "email": "abdullah.sevincer@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230207163309.3070261-1-abdullah.sevincer@intel.com/mbox/",
    "series": [
        {
            "id": 26862,
            "url": "https://patches.dpdk.org/api/series/26862/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=26862",
            "date": "2023-02-07T16:33:09",
            "name": "[v5] app/procinfo: display eventdev xstats for PMD data",
            "version": 5,
            "mbox": "https://patches.dpdk.org/series/26862/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/123360/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/123360/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 3BADE41C30;\n\tTue,  7 Feb 2023 17:33:38 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2361542B7E;\n\tTue,  7 Feb 2023 17:33:38 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id 098BC40151\n for <dev@dpdk.org>; Tue,  7 Feb 2023 17:33:35 +0100 (CET)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 07 Feb 2023 08:33:11 -0800",
            "from txanpdk02.an.intel.com ([10.123.117.76])\n by orsmga006.jf.intel.com with ESMTP; 07 Feb 2023 08:33:10 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1675787616; x=1707323616;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=ZJaCL5gdOMk3ea4vN7Igv0V5uDqgkW0NV/LPJu2s3ww=;\n b=JAy21XulgtdugiVhOUHkvarBgheJmcXHl6Nc56+U39u55GemFftas+m9\n t5S1/nZ8vGU8VlRJk7qnmfuH41uIs9yP6b5v+V6Sm+jwtsEUkynJK4qXD\n F0z82+7phU0HB/YbRl10/aALF4z0Nontkx1CSfD5FIrmUlzAP27VUcvVE\n X8Nd+nBlsNhkRdVSJ6lQps8I5oYg7pUzo7WW/HV5FyVE/+WhUu959zlH4\n q4pfh5ObIu/CyHRgiFRIoDEd/n3IXMybbe+GCm88S5Qxa4eapkmkGIeFX\n 7OnAm0v5rHL8pHYldxXdDcPG1DMZ7jZW9U1tpiiB8sk/qiTrf1qKJhXT1 w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10614\"; a=\"356924760\"",
            "E=Sophos;i=\"5.97,278,1669104000\"; d=\"scan'208\";a=\"356924760\"",
            "E=McAfee;i=\"6500,9779,10614\"; a=\"644511673\"",
            "E=Sophos;i=\"5.97,278,1669104000\"; d=\"scan'208\";a=\"644511673\""
        ],
        "X-ExtLoop1": "1",
        "From": "Abdullah Sevincer <abdullah.sevincer@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "jerinj@marvell.com,\n\tAbdullah Sevincer <abdullah.sevincer@intel.com>",
        "Subject": "[PATCH v5] app/procinfo: display eventdev xstats for PMD data",
        "Date": "Tue,  7 Feb 2023 10:33:09 -0600",
        "Message-Id": "<20230207163309.3070261-1-abdullah.sevincer@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220409153056.1010236-1-timothy.mcdaniel@intel.com>",
        "References": "<20220409153056.1010236-1-timothy.mcdaniel@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": "This commit extends proc-info application to\ndisplay xstats and PMD dump data for the eventdev\ndevices.\n\nNew command line arguments are introduced to\ndisplay stats for eventdev devices. The command\nexample is like:\n\nFor displaying a specific port stats (e.g. port 1):\ndpdk-proc-info -- --edev-stats-enable --edev-port=1\n\nedev-stats-enable: This parameters enables proc-info\nto display xstats for eventdev devices. If the parameter\nis enabled through proc-info command line, proc-info\nwill only dump event_dev data and exit.\nUsers should not enable this flag if they desire to\ndump other proc-info data suc as Rx/Tx descriptor dump.\nMore information can be found in proc-info app doc.\n\nSigned-off-by: Abdullah Sevincer <abdullah.sevincer@intel.com>\n---\n app/proc-info/main.c           | 208 ++++++++++++++++++++++++++++++++-\n app/proc-info/meson.build      |   2 +-\n doc/guides/tools/proc_info.rst |  42 ++++++-\n 3 files changed, 249 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/app/proc-info/main.c b/app/proc-info/main.c\nindex 53e852a07c..25b36205d0 100644\n--- a/app/proc-info/main.c\n+++ b/app/proc-info/main.c\n@@ -40,11 +40,17 @@\n #include <rte_tm.h>\n #include <rte_hexdump.h>\n #include <rte_version.h>\n+#include <rte_eventdev.h>\n \n /* Maximum long option length for option parsing. */\n #define MAX_LONG_OPT_SZ 64\n #define MAX_STRING_LEN 256\n \n+/* Note: Port_queue_id in xstats APIs is 8 bits, so we have a maximum of\n+ * 256 ports and queues for event_Dev\n+ */\n+#define MAX_PORTS_QUEUES 256\n+\n #define ETHDEV_FWVERS_LEN 32\n #define RTE_RETA_CONF_GROUP_NUM 32\n #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))\n@@ -121,6 +127,19 @@ static uint32_t enable_shw_module_eeprom;\n static uint32_t enable_shw_rx_desc_dump;\n static uint32_t enable_shw_tx_desc_dump;\n \n+static uint32_t enable_eventdev_stats;\n+static uint32_t enable_shw_all_eventdev_queues;\n+static uint32_t enable_shw_all_eventdev_ports;\n+static uint32_t enable_dump_eventdev;\n+static uint32_t enable_eventdev_reset_stats;\n+static uint32_t enable_shw_eventdev_device_stats;\n+\n+static uint8_t evdev_id;\n+static uint8_t num_ports;\n+static uint8_t ports[MAX_PORTS_QUEUES];\n+static uint8_t num_queues;\n+static uint8_t queues[MAX_PORTS_QUEUES];\n+\n #define DESC_PARAM_NUM 3\n \n struct desc_param {\n@@ -172,7 +191,15 @@ proc_info_usage(const char *prgname)\n \t\t\t\"offset: The offset of the descriptor starting from tail. \"\n \t\t\t\"num: The number of the descriptors to dump.\\n\"\n \t\t\"  --iter-mempool=name: iterate mempool elements to display content\\n\"\n-\t\t\"  --dump-regs=file-prefix: dump registers to file with the file-prefix\\n\",\n+\t\t\"  --dump-regs=file-prefix: dump registers to file with the file-prefix\\n\"\n+\t\t\"  --edev-stats-enable to enable stats for all event_dev queues, ports, device etc;\\n\"\n+\t\t\"  --all-edev-queues to get stats for all event_dev queues;\\n\"\n+\t\t\"  --edev-queue=queue_num to get queue stats for specified queue;\\n\"\n+\t\t\"  --all-edev-ports to get stats for all event_dev ports;\\n\"\n+\t\t\"  --edev-port=port_num to get queue stats for specified port;\\n\"\n+\t\t\"  --edev-dump to dump all event_dev stats;\\n\"\n+\t\t\"  --edev-reset to reset event_dev stats after reading;\\n\"\n+\t\t\"  --edev-device-stats to get event_dev device stats;\\n\",\n \t\tprgname);\n }\n \n@@ -302,6 +329,14 @@ proc_info_parse_args(int argc, char **argv)\n \t\t{\"show-module-eeprom\", 0, NULL, 0},\n \t\t{\"show-rx-descriptor\", required_argument, NULL, 1},\n \t\t{\"show-tx-descriptor\", required_argument, NULL, 1},\n+\t\t{\"edev-stats-enable\", 0, NULL, 0},\n+\t\t{\"all-edev-queues\", 0, NULL, 0},\n+\t\t{\"edev-queue\", required_argument, NULL, 0},\n+\t\t{\"all-edev-ports\", 0, NULL, 0},\n+\t\t{\"edev-port\", required_argument, NULL, 0},\n+\t\t{\"edev-dump\", 0, NULL, 0},\n+\t\t{\"edev-reset\", 0, NULL, 0},\n+\t\t{\"edev-device-stats\", 0, NULL, 0},\n \t\t{NULL, 0, 0, 0}\n \t};\n \n@@ -385,6 +420,33 @@ proc_info_parse_args(int argc, char **argv)\n \t\t\telse if (!strncmp(long_option[option_index].name,\n \t\t\t\t\t\"show-module-eeprom\", MAX_LONG_OPT_SZ))\n \t\t\t\tenable_shw_module_eeprom = 1;\n+\t\t\telse if (!strncmp(long_option[option_index].name,\n+\t\t\t\t\t\"edev-stats-enable\", MAX_LONG_OPT_SZ)) {\n+\t\t\t\tenable_eventdev_stats = 1;\n+\t\t\t} else if (!strncmp(long_option[option_index].name,\n+\t\t\t\t\t\"all-edev-queues\", MAX_LONG_OPT_SZ)) {\n+\t\t\t\tenable_shw_all_eventdev_queues = 1;\n+\t\t\t} else if (!strncmp(long_option[option_index].name,\n+\t\t\t\t\t\"all-edev-ports\", MAX_LONG_OPT_SZ)) {\n+\t\t\t\tenable_shw_all_eventdev_ports = 1;\n+\t\t\t} else if (!strncmp(long_option[option_index].name,\n+\t\t\t\t\t\"edev-dump\", MAX_LONG_OPT_SZ)) {\n+\t\t\t\tenable_dump_eventdev = 1;\n+\t\t\t} else if (!strncmp(long_option[option_index].name,\n+\t\t\t\t\t\"edev-reset\", MAX_LONG_OPT_SZ)) {\n+\t\t\t\tenable_eventdev_reset_stats = 1;\n+\t\t\t} else if (!strncmp(long_option[option_index].name,\n+\t\t\t\t\t\"edev-device-stats\", MAX_LONG_OPT_SZ)) {\n+\t\t\t\tenable_shw_eventdev_device_stats = 1;\n+\t\t\t} else if (!strncmp(long_option[option_index].name,\n+\t\t\t\t\t\"edev-queue\", MAX_LONG_OPT_SZ)) {\n+\t\t\t\tqueues[num_queues] = atoi(optarg);\n+\t\t\t\tnum_queues++;\n+\t\t\t} else if (!strncmp(long_option[option_index].name,\n+\t\t\t\t\t\"edev-port\", MAX_LONG_OPT_SZ)) {\n+\t\t\t\tports[num_ports] = atoi(optarg);\n+\t\t\t\tnum_ports++;\n+\t\t\t}\n \t\t\tbreak;\n \t\tcase 1:\n \t\t\t/* Print xstat single value given by name*/\n@@ -1744,6 +1806,126 @@ nic_tx_descriptor_display(uint16_t port_id, struct desc_param *desc)\n \t\t\tstrerror(-ret));\n }\n \n+static void\n+get_eventdev_stats(uint8_t dev_id,\n+\t  enum rte_event_dev_xstats_mode mode,\n+\t  uint8_t queue_port_id,\n+\t  bool reset)\n+{\n+\tint ret;\n+\tstruct rte_event_dev_xstats_name *xstats_names;\n+\tuint64_t *ids;\n+\tunsigned int size;\n+\tint i;\n+\n+\n+\t/* Get amount of storage required */\n+\tret = rte_event_dev_xstats_names_get(dev_id,\n+\t\t\t\t\t     mode,\n+\t\t\t\t\t     queue_port_id,\n+\t\t\t\t\t     NULL, /* names */\n+\t\t\t\t\t     NULL, /* ids */\n+\t\t\t\t\t     0);   /* num */\n+\n+\tif (ret < 0)\n+\t\trte_panic(\"rte_event_dev_xstats_names_get err %d\\n\", ret);\n+\n+\tif (ret == 0) {\n+\t\tprintf(\n+\t\t\"No stats available for this item, mode=%d, queue_port_id=%d\\n\",\n+\t\t\tmode, queue_port_id);\n+\t\treturn;\n+\t}\n+\n+\tsize = (unsigned int)ret; /* number of names */\n+\n+\t/* Get memory to hold stat names, IDs, and values */\n+\n+\txstats_names = malloc(sizeof(struct rte_event_dev_xstats_name) * size);\n+\tids = malloc(sizeof(unsigned int) * size);\n+\n+\n+\tif (!xstats_names || !ids)\n+\t\trte_panic(\"unable to alloc memory for stats retrieval\\n\");\n+\n+\tret = rte_event_dev_xstats_names_get(dev_id, mode, queue_port_id,\n+\t\t\t\t\t     xstats_names, ids,\n+\t\t\t\t\t     size);\n+\tif (ret != (int)size)\n+\t\trte_panic(\"rte_event_dev_xstats_names_get err %d\\n\", ret);\n+\n+\tif (!reset) {\n+\t\tuint64_t *values;\n+\n+\t\tvalues = malloc(sizeof(uint64_t) * size);\n+\t\tif (!values)\n+\t\t\trte_panic(\"unable to alloc memory for stats retrieval\\n\");\n+\n+\t\tret = rte_event_dev_xstats_get(dev_id, mode, queue_port_id,\n+\t\t\t\t\t       ids, values, size);\n+\n+\t\tif (ret != (int)size)\n+\t\t\trte_panic(\"rte_event_dev_xstats_get err %d\\n\", ret);\n+\n+\t\tfor (i = 0; i < (int)size; i++) {\n+\t\t\tprintf(\"id %\"PRIu64\"  %s = %\"PRIu64\"\\n\",\n+\t\t\t\tids[i], &xstats_names[i].name[0], values[i]);\n+\t\t}\n+\n+\t\tfree(values);\n+\t} else\n+\t\trte_event_dev_xstats_reset(dev_id, mode, queue_port_id,\n+\t\t\t\t\t   ids, size);\n+\n+\tfree(xstats_names);\n+\tfree(ids);\n+}\n+\n+static void\n+process_eventdev_stats(bool reset)\n+{\n+\tint i;\n+\n+\tif (enable_shw_eventdev_device_stats) {\n+\t\tget_eventdev_stats(evdev_id,\n+\t\t\t  RTE_EVENT_DEV_XSTATS_DEVICE,\n+\t\t\t  0,\n+\t\t\t  reset);\n+\t}\n+\n+\tif (enable_shw_all_eventdev_ports) {\n+\t\tfor (i = 0; i < MAX_PORTS_QUEUES; i++) {\n+\t\t\tget_eventdev_stats(evdev_id,\n+\t\t\t\t  RTE_EVENT_DEV_XSTATS_PORT,\n+\t\t\t\t  i,\n+\t\t\t\t  reset);\n+\t\t}\n+\t} else {\n+\t\tfor (i = 0; i < num_ports; i++) {\n+\t\t\tget_eventdev_stats(evdev_id,\n+\t\t\t\t  RTE_EVENT_DEV_XSTATS_PORT,\n+\t\t\t\t  ports[i],\n+\t\t\t\t  reset);\n+\t\t}\n+\t}\n+\n+\tif (enable_shw_all_eventdev_queues) {\n+\t\tfor (i = 0; i < MAX_PORTS_QUEUES; i++) {\n+\t\t\tget_eventdev_stats(evdev_id,\n+\t\t\t\t  RTE_EVENT_DEV_XSTATS_QUEUE,\n+\t\t\t\t  i,\n+\t\t\t\t  reset);\n+\t\t}\n+\t} else {\n+\t\tfor (i = 0; i < num_queues; i++) {\n+\t\t\tget_eventdev_stats(evdev_id,\n+\t\t\t\t  RTE_EVENT_DEV_XSTATS_QUEUE,\n+\t\t\t\t  queues[i],\n+\t\t\t\t  reset);\n+\t\t}\n+\t}\n+}\n+\n int\n main(int argc, char **argv)\n {\n@@ -1794,6 +1976,30 @@ main(int argc, char **argv)\n \t\treturn 0;\n \t}\n \n+\tif (enable_eventdev_stats) {\n+\t\tconst uint8_t ndevs = rte_event_dev_count();\n+\n+\t\tif (ndevs == 0)\n+\t\t\trte_panic(\"No event devs found. Do you need\"\n+\t\t\t  \" to pass in a --vdev flag?\\n\");\n+\n+\t\tif (ndevs > 1)\n+\t\t\tprintf(\"Warning: More than one event dev, but using idx 0\\n\");\n+\n+\t\tif (enable_dump_eventdev) {\n+\t\t\tret = rte_event_dev_dump(evdev_id, stdout);\n+\t\t\tif (ret)\n+\t\t\t\trte_panic(\"dump failed with err=%d\\n\", ret);\n+\t\t}\n+\n+\t\tprocess_eventdev_stats(false);\n+\n+\t\tif (enable_eventdev_reset_stats)\n+\t\t\tprocess_eventdev_stats(true);\n+\n+\t\treturn 0;\n+\t}\n+\n \tnb_ports = rte_eth_dev_count_avail();\n \tif (nb_ports == 0)\n \t\trte_exit(EXIT_FAILURE, \"No Ethernet ports - bye\\n\");\ndiff --git a/app/proc-info/meson.build b/app/proc-info/meson.build\nindex 1563ce656a..4f83f29a64 100644\n--- a/app/proc-info/meson.build\n+++ b/app/proc-info/meson.build\n@@ -8,7 +8,7 @@ if is_windows\n endif\n \n sources = files('main.c')\n-deps += ['ethdev', 'security']\n+deps += ['ethdev', 'security', 'eventdev']\n if dpdk_conf.has('RTE_LIB_METRICS')\n     deps += 'metrics'\n endif\ndiff --git a/doc/guides/tools/proc_info.rst b/doc/guides/tools/proc_info.rst\nindex cf3502a8cb..59d8ff2490 100644\n--- a/doc/guides/tools/proc_info.rst\n+++ b/doc/guides/tools/proc_info.rst\n@@ -22,7 +22,9 @@ The application has a number of command line options:\n    --show-ring[=name] | --show-mempool[=name] | --iter-mempool=name |\n    --show-port-private | --version | --firmware-version | --show-rss-reta |\n    --show-module-eeprom | --show-rx-descriptor queue_id:offset:num |\n-   --show-tx-descriptor queue_id:offset:num ]\n+   --show-tx-descriptor queue_id:offset:num | --edev-stats-enable |\n+   --all-edev-queues | --edev-queue=queue_num | --all-edev-ports |\n+   --edev-port=port_num | --edev-dump | --edev-reset | --edev-device-stats]\n \n Parameters\n ~~~~~~~~~~\n@@ -101,6 +103,44 @@ queue_id: A Tx queue identifier on this port.\n offset: The offset of the descriptor starting from tail.\n num: The number of the descriptors to dump.\n \n+**--edev-stats-enable**\n+The edev-stats-enable parameter enables proc-info application\n+to display stats for eventdev devices. If the parameter is entered\n+through proc-info application command line, proc-info application will\n+only dump eventdev data and exit from the application. Hence,\n+this parameter is required and a must  with other eventdev parameters\n+explained below. Users should not enable this flag if they desire to dump\n+other proc-info application stats such as Rx/Tx descriptor dump.\n+\n+**--all-edev-queues**\n+The all-edev-queues parameter enables stats for all eventdev queues.\n+\n+**--edev-queue**\n+The edev-queue parameter enables stats for specified queue.\n+queue_num: The queue number to get queue stats for this specified queue.\n+\n+**--all-edev-ports**\n+The all-edev-ports parameter enables stats for all eventdev ports.\n+\n+**--edev-port**\n+The edev-port parameter enables stats for specified port.\n+queue_num: The port number to get port stats for this specified port.\n+\n+**--edev-dump**\n+The edev-dump parameter dumps all eventdev stats.\n+\n+**--edev-reset**\n+The edev-reset parameter resets eventdev stats after reading.\n+\n+**--edev-device-stats**\n+The edev-device-stats parameter displays eventdev device stats.\n+\n+A typical command line usage for eventdev stats:\n+\n+    .. code-block:: console\n+\n+       ./dpdk-proc-info -- --edev-stats-enable --edev-port=1\n+\n Limitations\n -----------\n \n",
    "prefixes": [
        "v5"
    ]
}