Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/48736/?format=api
http://patches.dpdk.org/api/patches/48736/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20181213050842.64587-6-vipin.varghese@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": "<20181213050842.64587-6-vipin.varghese@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20181213050842.64587-6-vipin.varghese@intel.com", "date": "2018-12-13T05:08:38", "name": "[v7,5/9] app/procinfo: add support for show tm", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "64bc1302eb2e17e5fccec4d78763ac30ec862fbf", "submitter": { "id": 882, "url": "http://patches.dpdk.org/api/people/882/?format=api", "name": "Varghese, Vipin", "email": "vipin.varghese@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/20181213050842.64587-6-vipin.varghese@intel.com/mbox/", "series": [ { "id": 2749, "url": "http://patches.dpdk.org/api/series/2749/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=2749", "date": "2018-12-13T05:08:33", "name": "app/proc-info: improve debug of proc-info tool", "version": 7, "mbox": "http://patches.dpdk.org/series/2749/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/48736/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/48736/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 909C11B4B2;\n\tThu, 13 Dec 2018 06:09:17 +0100 (CET)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 20B381B4B0\n\tfor <dev@dpdk.org>; Thu, 13 Dec 2018 06:09:15 +0100 (CET)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 Dec 2018 21:09:15 -0800", "from unknown (HELO saesrv02-S2600CWR.intel.com) ([10.224.122.203])\n\tby fmsmga001.fm.intel.com with ESMTP; 12 Dec 2018 21:09:13 -0800" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.56,347,1539673200\"; d=\"scan'208\";a=\"129528894\"", "From": "Vipin Varghese <vipin.varghese@intel.com>", "To": "konstantin.ananyev@intel.com, stephen@networkplumber.org,\n\treshma.pattan@intel.com, dev@dpdk.org, john.mcnamara@intel.com", "Cc": "thomas@monjalon.net, stephen1.byrne@intel.com, amol.patel@intel.com,\n\tVipin Varghese <vipin.varghese@intel.com>", "Date": "Thu, 13 Dec 2018 10:38:38 +0530", "Message-Id": "<20181213050842.64587-6-vipin.varghese@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20181213050842.64587-1-vipin.varghese@intel.com>", "References": "<20181203055000.39012-2-vipin.varghese@intel.com>\n\t<20181213050842.64587-1-vipin.varghese@intel.com>", "Subject": "[dpdk-dev] [PATCH v7 5/9] app/procinfo: add support for show tm", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Function show_tm is used for displaying the tm PMD under the\nprimary process. This covers basic and per node|level details with\nstats.\n\nSigned-off-by: Vipin Varghese <vipin.varghese@intel.com>\n---\n\nV6:\n - replace or with logical or - Reshma Pathan & Konstantin Ananyev\n\nV3:\n - memset for struct elements - Vipin Varghese\n - code cleanup for TM - Vipin Varghese\n - fetch for leaf nodes if node exist - Jasvinder Singh\n - display MARCO to function - Reshma Pathan & Stephen Hemminger\n\nV2:\n - MACRO for display node|level - cap - Vipin Varghese\n---\n app/proc-info/main.c | 276 ++++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 275 insertions(+), 1 deletion(-)", "diff": "diff --git a/app/proc-info/main.c b/app/proc-info/main.c\nindex 94dfdcd7f..6f2b757cf 100644\n--- a/app/proc-info/main.c\n+++ b/app/proc-info/main.c\n@@ -32,6 +32,7 @@\n #include <rte_cycles.h>\n #include <rte_security.h>\n #include <rte_cryptodev.h>\n+#include <rte_tm.h>\n \n /* Maximum long option length for option parsing. */\n #define MAX_LONG_OPT_SZ 64\n@@ -759,10 +760,283 @@ show_port(void)\n \tSTATS_BDR_STR(50, \"\");\n }\n \n+static void\n+display_nodecap_info(int is_leaf, struct rte_tm_node_capabilities *cap)\n+{\n+\tif (cap == NULL)\n+\t\treturn;\n+\n+\tif (!is_leaf) {\n+\t\tprintf(\"\\t -- nonleaf sched max:\\n\"\n+\t\t\t\"\\t\\t + children (%u)\\n\"\n+\t\t\t\"\\t\\t + sp priorities (%u)\\n\"\n+\t\t\t\"\\t\\t + wfq children per group (%u)\\n\"\n+\t\t\t\"\\t\\t + wfq groups (%u)\\n\"\n+\t\t\t\"\\t\\t + wfq weight (%u)\\n\",\n+\t\t\tcap->nonleaf.sched_n_children_max,\n+\t\t\tcap->nonleaf.sched_sp_n_priorities_max,\n+\t\t\tcap->nonleaf.sched_wfq_n_children_per_group_max,\n+\t\t\tcap->nonleaf.sched_wfq_n_groups_max,\n+\t\t\tcap->nonleaf.sched_wfq_weight_max);\n+\t} else {\n+\t\tprintf(\"\\t -- leaf cman support:\\n\"\n+\t\t\t\"\\t\\t + wred pkt mode (%d)\\n\"\n+\t\t\t\"\\t\\t + wred byte mode (%d)\\n\"\n+\t\t\t\"\\t\\t + head drop (%d)\\n\"\n+\t\t\t\"\\t\\t + wred context private (%d)\\n\"\n+\t\t\t\"\\t\\t + wred context shared (%u)\\n\",\n+\t\t\tcap->leaf.cman_wred_packet_mode_supported,\n+\t\t\tcap->leaf.cman_wred_byte_mode_supported,\n+\t\t\tcap->leaf.cman_head_drop_supported,\n+\t\t\tcap->leaf.cman_wred_context_private_supported,\n+\t\t\tcap->leaf.cman_wred_context_shared_n_max);\n+\t}\n+}\n+\n+static void\n+display_levelcap_info(int is_leaf, struct rte_tm_level_capabilities *cap)\n+{\n+\tif (cap == NULL)\n+\t\treturn;\n+\n+\tif (!is_leaf) {\n+\t\tprintf(\"\\t -- shaper private: (%d) dual rate (%d)\\n\",\n+\t\t\tcap->nonleaf.shaper_private_supported,\n+\t\t\tcap->nonleaf.shaper_private_dual_rate_supported);\n+\t\tprintf(\"\\t -- shaper share: (%u)\\n\",\n+\t\t\tcap->nonleaf.shaper_shared_n_max);\n+\t\tprintf(\"\\t -- non leaf sched MAX:\\n\"\n+\t\t\t\"\\t\\t + children (%u)\\n\"\n+\t\t\t\"\\t\\t + sp (%u)\\n\"\n+\t\t\t\"\\t\\t + wfq children per group (%u)\\n\"\n+\t\t\t\"\\t\\t + wfq groups (%u)\\n\"\n+\t\t\t\"\\t\\t + wfq weight (%u)\\n\",\n+\t\t\tcap->nonleaf.sched_n_children_max,\n+\t\t\tcap->nonleaf.sched_sp_n_priorities_max,\n+\t\t\tcap->nonleaf.sched_wfq_n_children_per_group_max,\n+\t\t\tcap->nonleaf.sched_wfq_n_groups_max,\n+\t\t\tcap->nonleaf.sched_wfq_weight_max);\n+\t} else {\n+\t\tprintf(\"\\t -- shaper private: (%d) dual rate (%d)\\n\",\n+\t\t\tcap->leaf.shaper_private_supported,\n+\t\t\tcap->leaf.shaper_private_dual_rate_supported);\n+\t\tprintf(\"\\t -- shaper share: (%u)\\n\",\n+\t\t\tcap->leaf.shaper_shared_n_max);\n+\t\tprintf(\" -- leaf cman support:\\n\"\n+\t\t\t\"\\t\\t + wred pkt mode (%d)\\n\"\n+\t\t\t\"\\t\\t + wred byte mode (%d)\\n\"\n+\t\t\t\"\\t\\t + head drop (%d)\\n\"\n+\t\t\t\"\\t\\t + wred context private (%d)\\n\"\n+\t\t\t\"\\t\\t + wred context shared (%u)\\n\",\n+\t\t\tcap->leaf.cman_wred_packet_mode_supported,\n+\t\t\tcap->leaf.cman_wred_byte_mode_supported,\n+\t\t\tcap->leaf.cman_head_drop_supported,\n+\t\t\tcap->leaf.cman_wred_context_private_supported,\n+\t\t\tcap->leaf.cman_wred_context_shared_n_max);\n+\t}\n+}\n+\n static void\n show_tm(void)\n {\n-\tprintf(\" tm\\n\");\n+\tint ret = 0, check_for_leaf = 0, is_leaf = 0;\n+\tunsigned int j, k;\n+\tuint16_t i = 0;\n+\n+\tsnprintf(bdr_str, MAX_STRING_LEN, \" show - TM PMD %\"PRIu64,\n+\t\t\trte_get_tsc_hz());\n+\tSTATS_BDR_STR(10, bdr_str);\n+\n+\tRTE_ETH_FOREACH_DEV(i) {\n+\t\tstruct rte_eth_dev_info dev_info;\n+\t\tstruct rte_tm_capabilities cap;\n+\t\tstruct rte_tm_error error;\n+\t\tstruct rte_tm_node_capabilities capnode;\n+\t\tstruct rte_tm_level_capabilities caplevel;\n+\t\tuint32_t n_leaf_nodes = 0;\n+\n+\t\tmemset(&dev_info, 0, sizeof(dev_info));\n+\t\tmemset(&cap, 0, sizeof(cap));\n+\t\tmemset(&error, 0, sizeof(error));\n+\n+\t\trte_eth_dev_info_get(i, &dev_info);\n+\t\tprintf(\" - Generic for port (%u)\\n\"\n+\t\t\t\"\\t -- driver name %s\\n\"\n+\t\t\t\"\\t -- max vf (%u)\\n\"\n+\t\t\t\"\\t -- max tx queues (%u)\\n\"\n+\t\t\t\"\\t -- number of tx queues (%u)\\n\",\n+\t\t\ti,\n+\t\t\tdev_info.driver_name,\n+\t\t\tdev_info.max_vfs,\n+\t\t\tdev_info.max_tx_queues,\n+\t\t\tdev_info.nb_tx_queues);\n+\n+\t\tret = rte_tm_capabilities_get(i, &cap, &error);\n+\t\tif (ret)\n+\t\t\tcontinue;\n+\n+\t\tprintf(\" - MAX: nodes (%u) levels (%u) children (%u)\\n\",\n+\t\t\tcap.n_nodes_max,\n+\t\t\tcap.n_levels_max,\n+\t\t\tcap.sched_n_children_max);\n+\n+\t\tprintf(\" - identical nodes: non leaf (%d) leaf (%d)\\n\",\n+\t\t\tcap.non_leaf_nodes_identical,\n+\t\t\tcap.leaf_nodes_identical);\n+\n+\t\tprintf(\" - Shaper MAX:\\n\"\n+\t\t\t\"\\t -- total (%u)\\n\"\n+\t\t\t\"\\t -- private (%u) private dual (%d)\\n\"\n+\t\t\t\"\\t -- shared (%u) shared dual (%u)\\n\",\n+\t\t\tcap.shaper_n_max,\n+\t\t\tcap.shaper_private_n_max,\n+\t\t\tcap.shaper_private_dual_rate_n_max,\n+\t\t\tcap.shaper_shared_n_max,\n+\t\t\tcap.shaper_shared_dual_rate_n_max);\n+\n+\t\tprintf(\" - mark support:\\n\");\n+\t\tprintf(\"\\t -- vlan dei: GREEN (%d) YELLOW (%d) RED (%d)\\n\",\n+\t\t\tcap.mark_vlan_dei_supported[RTE_TM_GREEN],\n+\t\t\tcap.mark_vlan_dei_supported[RTE_TM_YELLOW],\n+\t\t\tcap.mark_vlan_dei_supported[RTE_TM_RED]);\n+\t\tprintf(\"\\t -- ip ecn tcp: GREEN (%d) YELLOW (%d) RED (%d)\\n\",\n+\t\t\tcap.mark_ip_ecn_tcp_supported[RTE_TM_GREEN],\n+\t\t\tcap.mark_ip_ecn_tcp_supported[RTE_TM_YELLOW],\n+\t\t\tcap.mark_ip_ecn_tcp_supported[RTE_TM_RED]);\n+\t\tprintf(\"\\t -- ip ecn sctp: GREEN (%d) YELLOW (%d) RED (%d)\\n\",\n+\t\t\tcap.mark_ip_ecn_sctp_supported[RTE_TM_GREEN],\n+\t\t\tcap.mark_ip_ecn_sctp_supported[RTE_TM_YELLOW],\n+\t\t\tcap.mark_ip_ecn_sctp_supported[RTE_TM_RED]);\n+\t\tprintf(\"\\t -- ip dscp: GREEN (%d) YELLOW (%d) RED (%d)\\n\",\n+\t\t\tcap.mark_ip_dscp_supported[RTE_TM_GREEN],\n+\t\t\tcap.mark_ip_dscp_supported[RTE_TM_YELLOW],\n+\t\t\tcap.mark_ip_dscp_supported[RTE_TM_RED]);\n+\n+\t\tprintf(\" - mask stats (0x%\"PRIx64\")\"\n+\t\t\t\" dynamic update (0x%\"PRIx64\")\\n\",\n+\t\t\tcap.stats_mask,\n+\t\t\tcap.dynamic_update_mask);\n+\n+\t\tprintf(\" - sched MAX:\\n\"\n+\t\t\t\"\\t -- total (%u)\\n\"\n+\t\t\t\"\\t -- sp levels (%u)\\n\"\n+\t\t\t\"\\t -- wfq children per group (%u)\\n\"\n+\t\t\t\"\\t -- wfq groups (%u)\\n\"\n+\t\t\t\"\\t -- wfq weight (%u)\\n\",\n+\t\t\tcap.sched_sp_n_priorities_max,\n+\t\t\tcap.sched_sp_n_priorities_max,\n+\t\t\tcap.sched_wfq_n_children_per_group_max,\n+\t\t\tcap.sched_wfq_n_groups_max,\n+\t\t\tcap.sched_wfq_weight_max);\n+\n+\t\tprintf(\" - CMAN support:\\n\"\n+\t\t\t\"\\t -- WRED mode: pkt (%d) byte (%d)\\n\"\n+\t\t\t\"\\t -- head drop (%d)\\n\",\n+\t\t\tcap.cman_wred_packet_mode_supported,\n+\t\t\tcap.cman_wred_byte_mode_supported,\n+\t\t\tcap.cman_head_drop_supported);\n+\t\tprintf(\"\\t -- MAX WRED CONTEXT:\"\n+\t\t\t\" total (%u) private (%u) shared (%u)\\n\",\n+\t\t\tcap.cman_wred_context_n_max,\n+\t\t\tcap.cman_wred_context_private_n_max,\n+\t\t\tcap.cman_wred_context_shared_n_max);\n+\n+\t\tfor (j = 0; j < cap.n_nodes_max; j++) {\n+\t\t\tmemset(&capnode, 0, sizeof(capnode));\n+\t\t\tret = rte_tm_node_capabilities_get(i, j,\n+\t\t\t\t&capnode, &error);\n+\t\t\tif (ret)\n+\t\t\t\tcontinue;\n+\n+\t\t\tcheck_for_leaf = 1;\n+\n+\t\t\tprintf(\" NODE %u\\n\", j);\n+\t\t\tprintf(\"\\t - shaper private: (%d) dual rate (%d)\\n\",\n+\t\t\t\tcapnode.shaper_private_supported,\n+\t\t\t\tcapnode.shaper_private_dual_rate_supported);\n+\t\t\tprintf(\"\\t - shaper shared max: (%u)\\n\",\n+\t\t\t\tcapnode.shaper_shared_n_max);\n+\t\t\tprintf(\"\\t - stats mask %\"PRIx64\"\\n\",\n+\t\t\t\tcapnode.stats_mask);\n+\n+\t\t\tret = rte_tm_node_type_get(i, j, &is_leaf, &error);\n+\t\t\tif (ret)\n+\t\t\t\tcontinue;\n+\n+\t\t\tdisplay_nodecap_info(is_leaf, &capnode);\n+\t\t}\n+\n+\t\tfor (j = 0; j < cap.n_levels_max; j++) {\n+\t\t\tmemset(&caplevel, 0, sizeof(caplevel));\n+\t\t\tret = rte_tm_level_capabilities_get(i, j,\n+\t\t\t\t&caplevel, &error);\n+\t\t\tif (ret)\n+\t\t\t\tcontinue;\n+\n+\t\t\tprintf(\" - Level %u\\n\", j);\n+\t\t\tprintf(\"\\t -- node MAX: %u non leaf %u leaf %u\\n\",\n+\t\t\t\tcaplevel.n_nodes_max,\n+\t\t\t\tcaplevel.n_nodes_nonleaf_max,\n+\t\t\t\tcaplevel.n_nodes_leaf_max);\n+\t\t\tprintf(\"\\t -- indetical: non leaf %u leaf %u\\n\",\n+\t\t\t\tcaplevel.non_leaf_nodes_identical,\n+\t\t\t\tcaplevel.leaf_nodes_identical);\n+\n+\t\t\tfor (k = 0; k < caplevel.n_nodes_max; k++) {\n+\t\t\t\tret = rte_tm_node_type_get(i, k,\n+\t\t\t\t\t&is_leaf, &error);\n+\t\t\t\tif (ret)\n+\t\t\t\t\tcontinue;\n+\n+\t\t\t\tdisplay_levelcap_info(is_leaf, &caplevel);\n+\t\t\t}\n+\t\t}\n+\n+\t\tif (check_for_leaf) {\n+\t\t\tret = rte_tm_get_number_of_leaf_nodes(i,\n+\t\t\t\t\t&n_leaf_nodes, &error);\n+\t\t\tif (ret == 0)\n+\t\t\t\tprintf(\" - leaf nodes (%u)\\n\", n_leaf_nodes);\n+\t\t}\n+\n+\t\tfor (j = 0; j < n_leaf_nodes; j++) {\n+\t\t\tstruct rte_tm_node_stats stats;\n+\t\t\tmemset(&stats, 0, sizeof(stats));\n+\n+\t\t\tret = rte_tm_node_stats_read(i, j,\n+\t\t\t\t&stats, &cap.stats_mask, 0, &error);\n+\t\t\tif (ret)\n+\t\t\t\tcontinue;\n+\n+\t\t\tprintf(\" - STATS for node (%u)\\n\", j);\n+\t\t\tprintf(\" -- pkts (%\"PRIu64\") bytes (%\"PRIu64\")\\n\",\n+\t\t\t\tstats.n_pkts, stats.n_bytes);\n+\n+\t\t\tret = rte_tm_node_type_get(i, j, &is_leaf, &error);\n+\t\t\tif (ret || (!is_leaf))\n+\t\t\t\tcontinue;\n+\n+\t\t\tprintf(\" -- leaf queued:\"\n+\t\t\t\t\" pkts (%\"PRIu64\") bytes (%\"PRIu64\")\\n\",\n+\t\t\t\tstats.leaf.n_pkts_queued,\n+\t\t\t\tstats.leaf.n_bytes_queued);\n+\t\t\tprintf(\" - dropped:\\n\"\n+\t\t\t\t\"\\t -- GREEN:\"\n+\t\t\t\t\" pkts (%\"PRIu64\") bytes (%\"PRIu64\")\\n\"\n+\t\t\t\t\"\\t -- YELLOW:\"\n+\t\t\t\t\" pkts (%\"PRIu64\") bytes (%\"PRIu64\")\\n\"\n+\t\t\t\t\"\\t -- RED:\"\n+\t\t\t\t\" pkts (%\"PRIu64\") bytes (%\"PRIu64\")\\n\",\n+\t\t\t\tstats.leaf.n_pkts_dropped[RTE_TM_GREEN],\n+\t\t\t\tstats.leaf.n_bytes_dropped[RTE_TM_GREEN],\n+\t\t\t\tstats.leaf.n_pkts_dropped[RTE_TM_YELLOW],\n+\t\t\t\tstats.leaf.n_bytes_dropped[RTE_TM_YELLOW],\n+\t\t\t\tstats.leaf.n_pkts_dropped[RTE_TM_RED],\n+\t\t\t\tstats.leaf.n_bytes_dropped[RTE_TM_RED]);\n+\t\t}\n+\t}\n+\n+\tSTATS_BDR_STR(50, \"\");\n }\n \n static void\n", "prefixes": [ "v7", "5/9" ] }{ "id": 48736, "url": "