get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 115717,
    "url": "http://patches.dpdk.org/api/patches/115717/?format=api",
    "web_url": "http://patches.dpdk.org/project/dts/patch/20220901171257.12492-3-zhiminx.huang@intel.com/",
    "project": {
        "id": 3,
        "url": "http://patches.dpdk.org/api/projects/3/?format=api",
        "name": "DTS",
        "link_name": "dts",
        "list_id": "dts.dpdk.org",
        "list_email": "dts@dpdk.org",
        "web_url": "",
        "scm_url": "git://dpdk.org/tools/dts",
        "webscm_url": "http://git.dpdk.org/tools/dts/",
        "list_archive_url": "https://inbox.dpdk.org/dts",
        "list_archive_url_format": "https://inbox.dpdk.org/dts/{}",
        "commit_url_format": ""
    },
    "msgid": "<20220901171257.12492-3-zhiminx.huang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dts/20220901171257.12492-3-zhiminx.huang@intel.com",
    "date": "2022-09-01T17:12:57",
    "name": "[V2,3/3] tests/ice_enable_basic_hqos_on_pf:add new test suite",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "9fa5f1f7f555c2fe030c9564b8e37dd575a910aa",
    "submitter": {
        "id": 1685,
        "url": "http://patches.dpdk.org/api/people/1685/?format=api",
        "name": "Huang, ZhiminX",
        "email": "zhiminx.huang@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dts/patch/20220901171257.12492-3-zhiminx.huang@intel.com/mbox/",
    "series": [
        {
            "id": 24497,
            "url": "http://patches.dpdk.org/api/series/24497/?format=api",
            "web_url": "http://patches.dpdk.org/project/dts/list/?series=24497",
            "date": "2022-09-01T17:12:55",
            "name": "[V2,1/3] test_plans/index:add new testplan index",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/24497/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/115717/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/115717/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dts-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 DF40BA00C5;\n\tThu,  1 Sep 2022 10:57:51 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D80EE41614;\n\tThu,  1 Sep 2022 10:57:51 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by mails.dpdk.org (Postfix) with ESMTP id B782E40395\n for <dts@dpdk.org>; Thu,  1 Sep 2022 10:57:49 +0200 (CEST)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Sep 2022 01:57:48 -0700",
            "from unknown (HELO cvl_100g_103.icx.intel.com) ([10.239.252.93])\n by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Sep 2022 01:57:45 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1662022669; x=1693558669;\n h=from:to:cc:subject:date:message-id:in-reply-to: references;\n bh=o4WBz9lkPW9dYAPHDO9GgwXMQHVbKOidEbjTABUgtaI=;\n b=mVESQWPcl1jS6U5JapFmbNPQoU/UCCqWRiQqD2smz1laPWC4VRew7PjB\n dLlov5bcLU88L18MrTCn8Lzmu5SuKGnhUpEb+NMdKVOwaoek4WawsB01p\n TBx83I6EQ0JXY1obY/x+nknIqEAmZagqgUZdoi8dvLxZTDgjKyIC+SeVF\n VIlShF7BZyCk4wIhXO3jtLTpCrQGpChW4JVrN7mLvVdbc1dry+2J0w9Pw\n tATrldHB1nz/iG9CyO5EmRk+P5kHYGpoCdG6tj4LG7KkBWlvhDkWDelMj\n DlV/KjayyxmoHdWXgdgaDNAXx0eXA5c5+ggLSvXlTFO+C/j+G7H2+MTov A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10456\"; a=\"294400286\"",
            "E=Sophos;i=\"5.93,280,1654585200\"; d=\"scan'208\";a=\"294400286\"",
            "E=Sophos;i=\"5.93,280,1654585200\"; d=\"scan'208\";a=\"589406712\""
        ],
        "From": "Zhimin Huang <zhiminx.huang@intel.com>",
        "To": "dts@dpdk.org",
        "Cc": "Zhimin Huang <zhiminx.huang@intel.com>",
        "Subject": "[dts][PATCH V2 3/3] tests/ice_enable_basic_hqos_on_pf:add new test\n suite",
        "Date": "Fri,  2 Sep 2022 01:12:57 +0800",
        "Message-Id": "<20220901171257.12492-3-zhiminx.huang@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20220901171257.12492-1-zhiminx.huang@intel.com>",
        "References": "<20220901171257.12492-1-zhiminx.huang@intel.com>",
        "X-BeenThere": "dts@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "test suite reviews and discussions <dts.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dts>,\n <mailto:dts-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dts/>",
        "List-Post": "<mailto:dts@dpdk.org>",
        "List-Help": "<mailto:dts-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dts>,\n <mailto:dts-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dts-bounces@dpdk.org"
    },
    "content": "add 22.07 new feature test suite\n\nSigned-off-by: Zhimin Huang <zhiminx.huang@intel.com>\n---\n .../TestSuite_ice_enable_basic_hqos_on_pf.py  | 652 ++++++++++++++++++\n 1 file changed, 652 insertions(+)\n create mode 100644 tests/TestSuite_ice_enable_basic_hqos_on_pf.py",
    "diff": "diff --git a/tests/TestSuite_ice_enable_basic_hqos_on_pf.py b/tests/TestSuite_ice_enable_basic_hqos_on_pf.py\nnew file mode 100644\nindex 00000000..a35f06fb\n--- /dev/null\n+++ b/tests/TestSuite_ice_enable_basic_hqos_on_pf.py\n@@ -0,0 +1,652 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2010-2022 Intel Corporation\n+#\n+\"\"\"\n+DPDK Test suite.\n+ICE Enable basic HQoS on PF driver.\n+\"\"\"\n+\n+import re\n+from copy import deepcopy\n+from pprint import pformat\n+\n+from framework.packet import Packet\n+from framework.pktgen import TRANSMIT_CONT\n+from framework.pmd_output import PmdOutput\n+from framework.settings import HEADER_SIZE, get_nic_name\n+from framework.test_case import TestCase\n+\n+PKT_LEN = [64, 128, 256, 512, 1024, 1518, 512, 1024]\n+STREAM_UP_CONFIG = [0, 1, 2, 0, 0, 0, 0, 0]\n+LINERATE = 100\n+\n+\n+class TestIceEnableBasicHqosOnPF(TestCase):\n+    def set_up_all(self):\n+        self.dut_ports = self.dut.get_ports()\n+        self.verify(len(self.dut_ports) >= 2, \"Insufficient ports\")\n+        \"test topo is port 0 is 100G-E810C and port 1 is 25G-E810\"\n+        self.skip_case(\n+            self.check_require_nic_for_test(),\n+            \"Topology is ICE_100G-E810C_QSFP and ICE_25G-E810_XXV_SFP\",\n+        )\n+        self.cores = \"1S/9C/1T\"\n+        # check core num\n+        core_list = self.dut.get_core_list(self.cores)\n+        self.verify(len(core_list) >= 9, \"Insufficient cores for testing\")\n+        self.tester_port0 = self.tester.get_local_port(self.dut_ports[0])\n+        self.tester_port1 = self.tester.get_local_port(self.dut_ports[1])\n+        self.dut_port0_mac = self.dut.get_mac_address(self.dut_ports[0])\n+\n+        self.pmd_output = PmdOutput(self.dut)\n+\n+    def get_nic_info_from_ports_cfg(self):\n+        \"\"\"\n+        get port.cfg nic type/intf/pci list\n+        :return: port config nic list\n+        \"\"\"\n+        nic_list = []\n+        for id in self.dut.get_ports():\n+            nic_dict = {}\n+            for info in [\"type\", \"intf\", \"pci\"]:\n+                nic_dict[info] = self.dut.ports_info[id][info]\n+                if info == \"type\":\n+                    nic_dict[\"name\"] = get_nic_name(nic_dict[info])\n+            nic_list.append(nic_dict)\n+        return nic_list\n+\n+    def check_require_nic_for_test(self):\n+        \"\"\"\n+        check port 0 is E810_100G and port 1 is E810_25G\n+        :return: check status, True or False\n+        \"\"\"\n+        for id, _nic in enumerate(self.get_nic_info_from_ports_cfg()):\n+            if _nic[\"name\"] not in [\"ICE_100G-E810C_QSFP\", \"ICE_25G-E810_XXV_SFP\"]:\n+                return False\n+            if id == 0 and _nic[\"name\"] != \"ICE_100G-E810C_QSFP\":\n+                return False\n+        return True\n+\n+    def launch_testpmd(self, param=\"\"):\n+        \"\"\"\n+        start testpmd and check testpmd link status\n+        :param param: rxq/txq\n+        \"\"\"\n+        self.pmd_output.start_testpmd(self.cores, param=param)\n+        res = self.pmd_output.wait_link_status_up(\"all\", timeout=15)\n+        self.verify(res is True, \"there have port link is down\")\n+        self.testpmd_flag = True\n+\n+    def close_testpmd(self):\n+        \"\"\"\n+        close testpmd\n+        \"\"\"\n+        if not self.testpmd_flag:\n+            return\n+        try:\n+            self.pmd_output.quit()\n+        except Exception as e:\n+            self.logger.error(\"The testpmd status is incorrect\")\n+        self.testpmd_flag = False\n+\n+    def get_queue_packets_stats(self, port=1):\n+        \"\"\"\n+        get testpmd tx pkts stats\n+        :param port: tx port\n+        :return: pkts list\n+        \"\"\"\n+        output = self.pmd_output.execute_cmd(\"stop\")\n+        self.pmd_output.execute_cmd(\"start\")\n+        p = re.compile(\"TX Port= %d/Queue=.*\\n.*TX-packets: ([0-9]+)\\s\" % port)\n+        tx_pkts = list(map(int, p.findall(output)))\n+        return tx_pkts\n+\n+    def add_stream_to_pktgen(self, txport, rxport, send_pkts, option):\n+        \"\"\"\n+        add streams to pktgen and return streams id\n+        \"\"\"\n+        stream_ids = []\n+        for pkt in send_pkts:\n+            _option = deepcopy(option)\n+            _option[\"pcap\"] = pkt\n+            stream_id = self.tester.pktgen.add_stream(txport, rxport, send_pkts[0])\n+            self.tester.pktgen.config_stream(stream_id, _option)\n+            stream_ids.append(stream_id)\n+        return stream_ids\n+\n+    def config_stream(self, fields, frame_size=64):\n+        \"\"\"\n+        config stream and return pkt\n+        \"\"\"\n+        pri = fields\n+        pkt_config = {\n+            \"type\": \"VLAN_UDP\",\n+            \"pkt_layers\": {\n+                \"ether\": {\"dst\": self.dut_port0_mac},\n+                \"vlan\": {\"vlan\": pri, \"prio\": pri},\n+                \"raw\": {\"payload\": [\"58\"] * self.get_pkt_len(frame_size)},\n+            },\n+        }\n+        pkt_type = pkt_config.get(\"type\")\n+        pkt_layers = pkt_config.get(\"pkt_layers\")\n+        pkt = Packet(pkt_type=pkt_type)\n+        for layer in list(pkt_layers.keys()):\n+            pkt.config_layer(layer, pkt_layers[layer])\n+        return pkt.pktgen.pkt\n+\n+    def testpmd_query_stats(self):\n+        \"\"\"\n+        traffic callback function, return port 1 stats\n+        \"\"\"\n+        output = self.pmd_output.execute_cmd(\"show port stats 1\")\n+        if not output:\n+            return\n+        port_pat = \".*NIC statistics for (port \\d+) .*\"\n+        rx_pat = \".*Rx-pps:\\s+(\\d+)\\s+Rx-bps:\\s+(\\d+).*\"\n+        tx_pat = \".*Tx-pps:\\s+(\\d+)\\s+Tx-bps:\\s+(\\d+).*\"\n+        port = re.findall(port_pat, output, re.M)\n+        rx = re.findall(rx_pat, output, re.M)\n+        tx = re.findall(tx_pat, output, re.M)\n+        if not port or not rx or not tx:\n+            return\n+        stat = {}\n+        for port_id, (rx_pps, rx_bps), (tx_pps, tx_bps) in zip(port, rx, tx):\n+            stat[port_id] = {\n+                \"rx_pps\": float(rx_pps),\n+                \"rx_bps\": float(rx_bps),\n+                \"tx_pps\": float(tx_pps),\n+                \"tx_bps\": float(tx_bps),\n+            }\n+        self.pmd_stat = stat\n+\n+    def get_pkt_len(self, frame_size):\n+        HEADER_SIZE[\"vlan\"] = 4\n+        headers_size = sum([HEADER_SIZE[x] for x in [\"eth\", \"ip\", \"vlan\", \"udp\"]])\n+        pktlen = frame_size - headers_size\n+        return pktlen\n+\n+    def start_traffic(self, send_pkts):\n+        \"\"\"\n+        send stream and return results\n+        \"\"\"\n+        self.tester.pktgen.clear_streams()\n+        duration = 20\n+        s_option = {\n+            \"stream_config\": {\n+                \"txmode\": {},\n+                \"transmit_mode\": TRANSMIT_CONT,\n+                \"rate\": LINERATE,\n+            },\n+            \"fields_config\": {\n+                \"ip\": {\n+                    \"src\": {\n+                        \"start\": \"198.18.0.0\",\n+                        \"end\": \"198.18.0.255\",\n+                        \"step\": 1,\n+                        \"action\": \"random\",\n+                    },\n+                },\n+            },\n+        }\n+        stream_ids = self.add_stream_to_pktgen(\n+            self.tester_port0, self.tester_port0, send_pkts, s_option\n+        )\n+        traffic_opt = {\n+            \"method\": \"throughput\",\n+            \"duration\": duration,\n+            \"interval\": duration - 5,\n+            \"callback\": self.testpmd_query_stats,\n+        }\n+        result = self.tester.pktgen.measure(stream_ids, traffic_opt)\n+        return result\n+\n+    def get_traffic_results(self):\n+        \"\"\"\n+        get traffic results, append results, port stats, queue stats\n+        \"\"\"\n+        stream = []\n+        results = []\n+        for id in range(len(STREAM_UP_CONFIG)):\n+            pkt = self.config_stream(STREAM_UP_CONFIG[id], frame_size=PKT_LEN[id])\n+            stream.append(pkt)\n+        result = self.start_traffic(stream)\n+        queue_stats = self.get_queue_packets_stats()\n+        results.append([result, self.pmd_stat, queue_stats])\n+        return results\n+\n+    def check_traffic_throughput(self, expect_results, rel_results):\n+        \"\"\"\n+        compare traffic throughput with expect results\n+        \"\"\"\n+        status = False\n+        for traffic_task, _result in zip(expect_results, rel_results):\n+            _expected, unit, port = traffic_task\n+            result, pmd_stat, _ = _result\n+            real_stat = pmd_stat.get(f\"port {port}\", {})\n+            real_bps = real_stat.get(\"tx_bps\")\n+            bias = 10\n+            if unit == \"MBps\":\n+                status = ((real_bps / 8 / 1e6 - _expected) * 100 / _expected) < bias\n+            elif unit == \"-MBps\":\n+                status = real_bps / 8 / 1e6 < _expected\n+            elif unit in [\"Gbps\", \"rGbps\"]:\n+                status = abs(((real_bps / 1e9 - _expected) * 100 / _expected)) < bias\n+            msg = (\n+                f\"{pformat(traffic_task)}\"\n+                \" not get expected throughput value, real is: \"\n+                f\"{pformat(pmd_stat)}\"\n+            )\n+            self.verify(status, msg)\n+\n+    def check_queue_pkts_ratio(self, expected, results):\n+        \"\"\"\n+        check queue ratio\n+        \"\"\"\n+        for result in results:\n+            queue_group0 = result[-1][:4]\n+            queue_group1 = result[-1][4:]\n+            queue_group2 = []\n+            if len(expected) == 3:\n+                queue_group1 = result[-1][4:8]\n+                queue_group2 = result[-1][8:]\n+            queue_stats = [queue_group0, queue_group1, queue_group2]\n+            for id, ex in enumerate(expected):\n+                total_pkts = sum(queue_stats[id])\n+                total_ratio = sum(ex)\n+                if not ex:\n+                    self.verify(not total_pkts, \"Queue group 1 has not TX throughput\")\n+                    return\n+                ratio = []\n+                for idx, queue_stat in enumerate(queue_stats[id]):\n+                    percentage = queue_stat / total_pkts * 100\n+                    ratio.append(percentage)\n+                bias = 10\n+                for idx, percentage in enumerate(ex):\n+                    percentage = percentage / total_ratio * 100\n+                    _bias = abs(ratio[idx] - percentage) / percentage * 100\n+                    self.logger.info(\n+                        \"ratio and percentage:{}\".format((ratio[idx], percentage))\n+                    )\n+                    if _bias < bias:\n+                        continue\n+                    else:\n+                        msg = \"can not get expected queue ratio\"\n+                        self.verify(False, msg)\n+\n+    def check_queue_group_throughput(self, expected, results):\n+        \"\"\"\n+        check queue group ratio\n+        \"\"\"\n+        for result in results:\n+            queue_group0 = result[-1][:4]\n+            queue_group1 = result[-1][4:]\n+            queue_group2 = []\n+            if len(expected) == 3:\n+                queue_group1 = result[-1][4:8]\n+                queue_group2 = result[-1][8:]\n+            queue_stats = [queue_group0, queue_group1, queue_group2]\n+            total_pkts = sum(queue_stats)\n+            total_ratio = sum(expected)\n+            ratio = []\n+            for idx, queue_stat in enumerate(queue_stats):\n+                percentage = queue_stat / total_pkts * 100\n+                ratio.append(percentage)\n+            bias = 10\n+            for idx, percentage in enumerate(expected):\n+                percentage = percentage / total_ratio * 100\n+                _bias = abs(ratio[idx] - percentage) / percentage * 100\n+                self.logger.info(\n+                    \"ratio and percentage:{}\".format((ratio[idx], percentage))\n+                )\n+                if _bias < bias:\n+                    continue\n+                else:\n+                    msg = \"can not get expected queue ratio\"\n+                    self.verify(False, msg)\n+\n+    def test_perf_queuegroup_RR_queue_WFQ_RR_nolimit(self):\n+\n+        self.launch_testpmd(param=\"--rxq=8 --txq=8\")\n+        cmds = [\n+            \"add port tm node shaper profile 1 1 100000000 0 100000000 0 0 0\",\n+            \"add port tm nonleaf node 1 1000000 -1 0 1 0 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 900000 1000000 0 1 1 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 800000 900000 0 1 2 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 700000 800000 0 1 3 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 600000 800000 0 1 3 -1 1 0 0\",\n+            \"add port tm leaf node 1 0 700000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 1 700000 0 2 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 2 700000 0 3 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 3 700000 0 4 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 4 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 5 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 6 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 7 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"port tm hierarchy commit 1 no\",\n+            \"start\",\n+        ]\n+        for cmd in cmds:\n+            self.pmd_output.execute_cmd(cmd)\n+\n+        traffic_tasks = [\n+            [8.25, \"Gbps\", 1],\n+        ]\n+        results = self.get_traffic_results()\n+        self.check_traffic_throughput(traffic_tasks, results)\n+        expected = [[1, 2, 3, 4], [1, 1, 1, 1]]\n+        self.check_queue_pkts_ratio(expected, results)\n+        expected = [1, 1]\n+        self.check_queue_group_throughput(expected, results)\n+\n+    def test_perf_queuegroup_SP_queue_WFQ_RR_nolimit(self):\n+\n+        self.launch_testpmd(param=\"--rxq=8 --txq=8\")\n+        cmds = [\n+            \"add port tm node shaper profile 1 1 100000000 0 100000000 0 0 0\",\n+            \"add port tm nonleaf node 1 1000000 -1 0 1 0 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 900000 1000000 0 1 1 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 800000 900000 0 1 2 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 700000 800000 0 1 3 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 600000 800000 1 1 3 -1 1 0 0\",\n+            \"add port tm leaf node 1 0 700000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 1 700000 0 2 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 2 700000 0 3 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 3 700000 0 4 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 4 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 5 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 6 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 7 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"port tm hierarchy commit 1 no\",\n+            \"start\",\n+        ]\n+        for cmd in cmds:\n+            self.pmd_output.execute_cmd(cmd)\n+\n+        traffic_tasks = [\n+            [8.25, \"Gbps\", 1],\n+        ]\n+        results = self.get_traffic_results()\n+        self.check_traffic_throughput(traffic_tasks, results)\n+        expected = [[1, 2, 3, 4], []]\n+        self.check_queue_pkts_ratio(expected, results)\n+\n+    def test_perf_queuegroup_RR_queue_WFQ_RR(self):\n+\n+        self.launch_testpmd(param=\"--rxq=8 --txq=8\")\n+        cmds = [\n+            \"add port tm node shaper profile 1 1 300000000 0 300000000 0 0 0\",\n+            \"add port tm nonleaf node 1 1000000 -1 0 1 0 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 900000 1000000 0 1 1 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 800000 900000 0 1 2 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 700000 800000 0 1 3 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 600000 800000 0 1 3 1 1 0 0\",\n+            \"add port tm leaf node 1 0 700000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 1 700000 0 2 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 2 700000 0 3 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 3 700000 0 4 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 4 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 5 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 6 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 7 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"port tm hierarchy commit 1 no\",\n+            \"start\",\n+        ]\n+        for cmd in cmds:\n+            self.pmd_output.execute_cmd(cmd)\n+\n+        traffic_tasks = [\n+            [8.25, \"Gbps\", 1],\n+        ]\n+        results = self.get_traffic_results()\n+        self.check_traffic_throughput(traffic_tasks, results)\n+        expected = [[1, 2, 3, 4], [8, 8, 80, 16, 300, 400, 1, 10]]\n+        self.check_queue_pkts_ratio(expected, results)\n+\n+    def test_perf_queuegroup_SP_queue_WFQ_SP(self):\n+\n+        self.launch_testpmd(param=\"--rxq=12 --txq=12\")\n+        cmds = [\n+            \"add port tm node shaper profile 1 1 300 0 300000000 0 0 0\",\n+            \"add port tm node shaper profile 1 2 300 0 100000000 0 0 0\",\n+            \"add port tm node shaper profile 1 3 300 0 10000000 0 0 0\",\n+            \"add port tm node shaper profile 1 4 300 0 20000000 0 0 0\",\n+            \"add port tm node shaper profile 1 5 200 0 400000000 0 0 0\",\n+            \"add port tm nonleaf node 1 1000000 -1 0 1 0 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 900000 1000000 0 1 1 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 800000 900000 0 1 2 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 700000 800000 0 1 3 1 1 0 0\",\n+            \"add port tm nonleaf node 1 600000 800000 7 1 3 -1 1 0 0\",\n+            \"add port tm leaf node 1 0 700000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 1 700000 0 2 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 2 700000 0 3 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 3 700000 0 4 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 4 600000 0 1 4 3 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 5 600000 2 1 4 3 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 6 600000 1 1 4 2 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 7 600000 2 1 4 4 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 8 600000 3 1 4 1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 9 600000 3 1 4 5 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 10 600000 5 1 4 3 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 11 600000 7 1 4 3 0 0xffffffff 0 0\",\n+            \"port tm hierarchy commit 1 no\",\n+            \"start\",\n+        ]\n+        for cmd in cmds:\n+            self.pmd_output.execute_cmd(cmd)\n+\n+        traffic_tasks = [\n+            [8.25, \"Gbps\", 1],\n+        ]\n+        results = self.get_traffic_results()\n+        self.check_traffic_throughput(traffic_tasks, results)\n+        expected = [[1, 2, 3, 4], [8, 8, 80, 16, 240, 240, 1, 1]]\n+        self.check_queue_pkts_ratio(expected, results)\n+        expected = [2, 1]\n+        self.check_queue_group_throughput(expected, results)\n+\n+    def test_perf_queuegroup_RR_queue_RR_SP_WFQ(self):\n+\n+        self.launch_testpmd(param=\"--rxq=16 --txq=16\")\n+        cmds = [\n+            \"add port tm node shaper profile 1 1 300 0 300000000 0 0 0\",\n+            \"add port tm node shaper profile 1 2 100 0 100000000 0 0 0\",\n+            \"add port tm nonleaf node 1 1000000 -1 0 1 0 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 900000 1000000 0 1 1 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 800000 900000 0 1 2 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 700000 800000 0 1 3 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 600000 800000 0 1 3 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 500000 800000 0 1 3 -1 1 0 0\",\n+            \"add port tm leaf node 1 0 700000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 1 700000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 2 700000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 3 700000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 4 600000 0 1 4 2 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 5 600000 4 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 6 600000 1 1 4 1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 7 600000 7 1 4 2 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 8 500000 0 4 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 9 500000 0 2 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 10 500000 0 2 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 11 500000 0 100 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 12 500000 0 3 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 13 500000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 14 500000 0 5 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 15 500000 0 7 4 -1 0 0xffffffff 0 0\",\n+            \"port tm hierarchy commit 1 no\",\n+            \"start\",\n+        ]\n+        for cmd in cmds:\n+            self.pmd_output.execute_cmd(cmd)\n+\n+        traffic_tasks = [\n+            [8.25, \"Gbps\", 1],\n+        ]\n+        results = self.get_traffic_results()\n+        self.check_traffic_throughput(traffic_tasks, results)\n+        expected = [[1, 1, 1, 1], [8, 1, 20, 1], [4, 2, 2, 100, 3, 1, 5, 7]]\n+        self.check_queue_pkts_ratio(expected, results)\n+        expected = [1, 1, 1]\n+        self.check_queue_group_throughput(expected, results)\n+\n+    def test_perf_queuegroup_SP_queue_RR_SP_WFQ(self):\n+\n+        self.launch_testpmd(param=\"--rxq=16 --txq=16\")\n+        cmds = [\n+            \"add port tm node shaper profile 1 1 300 0 300000000 0 0 0\",\n+            \"add port tm node shaper profile 1 2 100 0 100000000 0 0 0\",\n+            \"add port tm nonleaf node 1 1000000 -1 0 1 0 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 900000 1000000 0 1 1 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 800000 900000 0 1 2 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 700000 800000 0 1 3 2 1 0 0\",\n+            \"add port tm nonleaf node 1 600000 800000 1 1 3 2 1 0 0\",\n+            \"add port tm nonleaf node 1 500000 800000 2 1 3 1 1 0 0\",\n+            \"add port tm leaf node 1 0 700000 0 1 4 1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 1 700000 0 1 4 1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 2 700000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 3 700000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 4 600000 0 1 4 1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 5 600000 4 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 6 600000 1 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 7 600000 7 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 8 500000 0 4 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 9 500000 0 2 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 10 500000 0 2 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 11 500000 0 100 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 12 500000 0 3 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 13 500000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 14 500000 0 5 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 15 500000 0 7 4 -1 0 0xffffffff 0 0\",\n+            \"port tm hierarchy commit 1 no\",\n+            \"start\",\n+        ]\n+        for cmd in cmds:\n+            self.pmd_output.execute_cmd(cmd)\n+\n+        traffic_tasks = [\n+            [4, \"Gbps\", 1],\n+        ]\n+        results = self.get_traffic_results()\n+        self.check_traffic_throughput(traffic_tasks, results)\n+        expected = [[1, 1, 1, 1], [800, 1, 1, 1], [4, 2, 2, 100, 3, 1, 5, 7]]\n+        self.check_queue_pkts_ratio(expected, results)\n+        expected = [1, 1, 3]\n+        self.check_queue_group_throughput(expected, results)\n+\n+    def test_perf_queuegroup_RR_queue_WFQ_WFQ(self):\n+\n+        self.launch_testpmd(param=\"--rxq=8 --txq=8\")\n+        cmds = [\n+            \"add port tm node shaper profile 1 1 10000000 0 10000000 0 0 0\",\n+            \"add port tm node shaper profile 1 2 20000000 0 20000000 0 0 0\",\n+            \"add port tm node shaper profile 1 3 30000000 0 30000000 0 0 0\",\n+            \"add port tm node shaper profile 1 4 40000000 0 40000000 0 0 0\",\n+            \"add port tm nonleaf node 1 1000000 -1 0 1 0 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 900000 1000000 0 1 1 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 800000 900000 0 1 2 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 700000 800000 0 1 3 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 600000 800000 0 1 3 -1 1 0 0\",\n+            \"add port tm leaf node 1 0 700000 0 1 4 1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 1 700000 0 2 4 1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 2 700000 0 3 4 4 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 3 700000 0 4 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 4 600000 0 1 4 4 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 5 600000 0 2 4 3 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 6 600000 0 3 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 7 600000 0 4 4 -1 0 0xffffffff 0 0\",\n+            \"port tm hierarchy commit 1 no\",\n+            \"start\",\n+        ]\n+        for cmd in cmds:\n+            self.pmd_output.execute_cmd(cmd)\n+\n+        traffic_tasks = [\n+            [8.25, \"Gbps\", 1],\n+        ]\n+        results = self.get_traffic_results()\n+        self.check_traffic_throughput(traffic_tasks, results)\n+        expected = [[4, 3, 170, 220], [1, 1, 1, 300]]\n+        self.check_queue_pkts_ratio(expected, results)\n+        expected = [1, 1]\n+        self.check_queue_group_throughput(expected, results)\n+\n+    def test_perf_negative_case(self):\n+\n+        self.launch_testpmd(param=\"--rxq=16 --txq=16\")\n+        cmd1 = [\n+            \"add port tm node shaper profile 1 1 100000000 0 100000000 0 0 0\",\n+            \"add port tm nonleaf node 1 1000000 -1 0 1 0 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 900000 1000000 0 1 1 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 800000 900000 0 1 2 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 700000 800000 0 1 3 -1 1 0 0\",\n+            \"add port tm nonleaf node 1 600000 800000 0 2 3 -1 1 0 0\",\n+        ]\n+        output = \"\"\n+        for cmd in cmd1:\n+            output += self.pmd_output.execute_cmd(cmd)\n+        check_msg = \"ice_tm_node_add(): weight != 1 not supported in level 3\"\n+        self.verify(\n+            check_msg in output, \"Configure invalid parameters, report expected errors.\"\n+        )\n+        cmd2 = [\n+            \"port stop 1\",\n+            \"del port tm node 1 600000\",\n+            \"add port tm nonleaf node 1 600000 800000 0 1 3 -1 1 0 0\",\n+            \"port start 1\",\n+            \"add port tm leaf node 1 0 700000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 1 700000 0 2 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 2 700000 0 3 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 3 700000 0 201 4 -1 0 0xffffffff 0 0\",\n+        ]\n+        output = \"\"\n+        for cmd in cmd2:\n+            output += self.pmd_output.execute_cmd(cmd)\n+        check_msg = \"node weight: weight must be between 1 and 200 (error 21)\"\n+        self.verify(\n+            check_msg in output, \"Configure invalid parameters, report expected errors.\"\n+        )\n+        cmd3 = [\n+            \"add port tm leaf node 1 3 700000 0 200 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 4 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 5 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 6 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 7 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 8 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 9 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 10 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 11 600000 8 1 4 -1 0 0xffffffff 0 0\",\n+        ]\n+        output = \"\"\n+        for cmd in cmd3:\n+            output += self.pmd_output.execute_cmd(cmd)\n+        check_msg = \"node priority: priority should be less than 8 (error 20)\"\n+        self.verify(\n+            check_msg in output, \"Configure invalid parameters, report expected errors.\"\n+        )\n+        cmd4 = [\n+            \"add port tm leaf node 1 11 600000 7 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 12 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 13 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 14 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"add port tm leaf node 1 15 600000 0 1 4 -1 0 0xffffffff 0 0\",\n+            \"port tm hierarchy commit 1 no\",\n+        ]\n+        output = \"\"\n+        for cmd in cmd4:\n+            output += self.pmd_output.execute_cmd(cmd)\n+        check_msg = \"ice_move_recfg_lan_txq(): move lan queue 12 failed\\r\\nice_hierarchy_commit(): move queue 12 failed\\r\\ncause unspecified: (no stated reason) (error 1)\"\n+        self.verify(\n+            check_msg in output, \"Configure invalid parameters, report expected errors.\"\n+        )\n+\n+    def tear_down(self):\n+        \"\"\"\n+        Run after each test case.\n+        \"\"\"\n+        self.close_testpmd()\n+        self.dut.kill_all()\n+\n+    def tear_down_all(self):\n+        \"\"\"\n+        Run after each test suite.\n+        \"\"\"\n+        self.dut.kill_all()\n",
    "prefixes": [
        "V2",
        "3/3"
    ]
}