List comments

GET /api/patches/73429/comments/
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

[
    {
        "id": 116265,
        "web_url": "https://patches.dpdk.org/comment/116265/",
        "msgid": "<8CE3E05A3F976642AAB0F4675D0AD20E0BC822A4@SHSMSX101.ccr.corp.intel.com>",
        "date": "2020-07-20T07:12:29",
        "subject": "Re: [dpdk-dev] [dts] [PATCH] speed-capabilities: added Speed\n Capabilities test case",
        "submitter": {
            "id": 1098,
            "url": "https://patches.dpdk.org/api/people/1098/",
            "name": "Lijuan Tu",
            "email": "lijuan.tu@intel.com"
        },
        "content": "Applied, thanks\n\n> -----Original Message-----\n> From: dts <dts-bounces@dpdk.org> On Behalf Of dkirichok@iol.unh.edu\n> Sent: 2020年7月7日 21:41\n> To: dts@dpdk.org\n> Cc: mb@smartsharesystems.com; lylavoie@iol.unh.edu; thomas@monjalon.net;\n> dev@dpdk.org; david.marchand@redhat.com; Yigit, Ferruh\n> <ferruh.yigit@intel.com>; arybchenko@solarflare.com; i.dyukov@samsung.com;\n> rasland@mellanox.com; j.hendergart@f5.com; dliu@iol.unh.edu;\n> ohilyard@iol.unh.edu; Daniel Kirichok <dkirichok@iol.unh.edu>\n> Subject: [dts] [PATCH] speed-capabilities: added Speed Capabilities test case\n> \n> From: Daniel Kirichok <dkirichok@iol.unh.edu>\n> \n> Added test case for checking speed capabilities.\n> \n> Signed-off-by: Daniel Kirichok <dkirichok@iol.unh.edu>\n> ---\n>  conf/speed_capabilities.cfg                 |   4 +\n>  test_plans/speed_capabilities_test_plan.rst |  84 ++++++++++++++\n>  tests/TestSuite_speed_capabilities.py       | 120 ++++++++++++++++++++\n>  3 files changed, 208 insertions(+)\n>  create mode 100644 conf/speed_capabilities.cfg  create mode 100644\n> test_plans/speed_capabilities_test_plan.rst\n>  create mode 100644 tests/TestSuite_speed_capabilities.py\n> \n> diff --git a/conf/speed_capabilities.cfg b/conf/speed_capabilities.cfg new file\n> mode 100644 index 0000000..c22f531\n> --- /dev/null\n> +++ b/conf/speed_capabilities.cfg\n> @@ -0,0 +1,4 @@\n> +[suite]\n> +# The format for entering expected speeds is {'<INTERFACE>':'<EXPECTED\n> +SPEED>',...} # Unit for speed must be in G or M\n> +expected_speeds={'interface1': '10G', 'interface2': '100M'}\n> diff --git a/test_plans/speed_capabilities_test_plan.rst\n> b/test_plans/speed_capabilities_test_plan.rst\n> new file mode 100644\n> index 0000000..2821612\n> --- /dev/null\n> +++ b/test_plans/speed_capabilities_test_plan.rst\n> @@ -0,0 +1,84 @@\n> +.. # BSD LICENSE\n> +    #\n> +    # Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n> +    # Copyright © 2018[, 2019] The University of New Hampshire. All rights\n> 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\n> CONTRIBUTORS\n> +    # \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT\n> NOT\n> +    # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n> FITNESS FOR\n> +    # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n> COPYRIGHT\n> +    # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n> INCIDENTAL,\n> +    # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n> NOT\n> +    # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\n> OF USE,\n> +    # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n> ON ANY\n> +    # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n> TORT\n> +    # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n> THE USE\n> +    # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n> DAMAGE.\n> +\n> +=======================\n> +Speed Capabilities Test\n> +=======================\n> +\n> +The Speed Capabilities Test checks the speeds that the device lists and\n> +compares it to a user-defined set of expected speeds set in the\n> ``speed_capabilities.cfg``.\n> +\n> +Prerequisites\n> +=============\n> +\n> +If using vfio the kernel must be >= 3.6+ and VT-d must be enabled in\n> +bios.When using vfio, use the following commands to load the vfio\n> +driver and bind it to the device under test::\n> +\n> +   modprobe vfio\n> +   modprobe vfio-pci\n> +   usertools/dpdk-devbind.py --bind=vfio-pci device_bus_id\n> +\n> +Assuming that ports ``0`` and ``1`` of the test target are directly\n> +connected to the traffic generator, launch the ``testpmd`` application\n> +with the following\n> +arguments::\n> +\n> +  ./build/app/testpmd -- -i --portmask=0x3\n> +\n> +Start packet forwarding in the ``testpmd`` application with the\n> +``start`` command. Then, for each port on the target make the Traffic\n> +Generator transmit a packet to the port of arbitrary size less than the\n> +MTU of the target port, checking that the same amount of frames and\n> +bytes are received back by the Traffic Generator from the port.\n> +\n> +Ensure that the ``speed_capabilities.cfg`` file correctly reflects the\n> +speeds the device is expected to run at.\n> +\n> +\n> +Test Case : Speed Capabilities Test\n> +===================================\n> +\n> +1. Use testpmd to retrieve the speed information that the interface is linked at::\n> +\n> +      testpmd> show port info <PORT_ID>\n> +\n> +2. Compares the speed value against the rate in the speed_capabilities.cfg file.\n> +   The supported options for expected speeds are 1G, 10G, 25G, 40G, and 100G.\n> Each interface must have an expected speed associated with it.\n> +   Example file below::\n> +\n> +      [suite]\n> +      expected_speeds={'interface1': '10G', 'interface2': '100M'}\n> +\n> +\n> +3. Verifies that the speeds matches accordingly.\n> +\n> +4. Repeats the verification for each NIC and interface found on the system.\n> diff --git a/tests/TestSuite_speed_capabilities.py\n> b/tests/TestSuite_speed_capabilities.py\n> new file mode 100644\n> index 0000000..25c45e4\n> --- /dev/null\n> +++ b/tests/TestSuite_speed_capabilities.py\n> @@ -0,0 +1,120 @@\n> +# BSD LICENSE\n> +#\n> +# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n> +# Copyright © 2018[, 2019] The University of New Hampshire. All rights\n> 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\n> CONTRIBUTORS #\n> +\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #\n> +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n> FOR #\n> +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n> COPYRIGHT #\n> +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n> INCIDENTAL, #\n> +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n> #\n> +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF\n> USE, #\n> +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n> ANY #\n> +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT #\n> +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE\n> USE #\n> +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n> +\n> +\"\"\"\n> +DPDK Test suite.\n> +\"\"\"\n> +import utils\n> +from pmd_output import PmdOutput\n> +from test_case import TestCase\n> +\n> +\n> +class TestSpeedCapabilities(TestCase):\n> +    def set_up_all(self):\n> +        \"\"\"\n> +        Run at the start of each test suite.\n> +        \"\"\"\n> +        self.ports = self.dut.get_ports()\n> +        self.ports_socket = self.dut.get_numa_id(self.ports[0])\n> +\n> +        for port in self.ports:\n> +            self.tester.send_expect(f\"ifconfig\n> {self.tester.get_interface(self.tester.get_local_port(port))} mtu 5000\"\n> +                                    , \"# \")\n> +\n> +        self.pmdout = PmdOutput(self.dut)\n> +        self.vm_env_done = False\n> +\n> +    def test_speed_capabilities(self):\n> +        self.pmdout.start_testpmd(\"Default\")\n> +\n> +        cfg_content = self.get_suite_cfg()\n> +        expected_speeds = cfg_content.get('expected_speeds')\n> +\n> +        detected_interfaces = []\n> +\n> +        for port in self.ports:\n> +            interface_name =\n> + self.tester.get_interface(self.tester.get_local_port(port))\n> +\n> +            # Gives the speed in Mb/s\n> +            interface_speed = self.pmdout.get_port_link_speed(port)\n> +\n> +            self.verify(interface_name in expected_speeds, f\"The interface\n> {interface_name} does not have an expected \"\n> +                                                           f\"speed\n> + associated with it.\")\n> +\n> +            detected_interfaces.append(interface_name)\n> +\n> +            expected_speed = expected_speeds[interface_name]\n> +\n> +            # Isolates the unit (Either M or G)\n> +            expected_speed_unit = ''.join(i for i in expected_speed if\n> + not i.isdigit())\n> +\n> +            # Removes the unit from the speed\n> +            expected_speed = ''.join(i for i in expected_speed if\n> + i.isdigit())\n> +\n> +            self.verify(len(interface_speed) > 0,\n> +                        f\"A valid speed could not be read for the\n> + interface {interface_name}.\")\n> +\n> +            # Converts Gb/s to Mb/s for consistent comparison\n> +            if expected_speed_unit == \"G\":\n> +                expected_speed += \"000\"\n> +\n> +            self.verify(interface_speed == expected_speed,\n> +                        f\"Detected speed: {interface_speed} Mb/s for the interface\n> {interface_name}, \"\n> +                        f\"but expected speed: {expected_speed} Mb/s\")\n> +\n> +        for key, value in expected_speeds.items():\n> +            self.verify(key in detected_interfaces, f\"The interface {key} expected the\n> speed {value} in \"\n> +\n> + \"speed_capabilities.cfg file, but it did not detect that interface.\")\n> +\n> +    def tear_down(self):\n> +        \"\"\"\n> +        Run after each test case.\n> +        \"\"\"\n> +        self.dut.kill_all()\n> +        self.pmdout.start_testpmd(\"Default\", \"--portmask=%s --port-\n> topology=loop\" % utils.create_mask(self.ports),\n> +                                  socket=self.ports_socket)\n> +        ports_num = len(self.ports)\n> +        # link up test, to avoid failing further tests if link was down\n> +        for i in range(ports_num):\n> +            # sometimes output text messing up testpmd prompt so trimmed prompt\n> +            self.dut.send_expect(\"set link-up port %d\" % i, \">\")\n> +        # start ports, to avoid failing further tests if ports are stopped\n> +        self.dut.send_expect(\"port start all\", \"testpmd> \", 100)\n> +        self.dut.send_expect(\"quit\", \"# \")\n> +\n> +    def tear_down_all(self):\n> +        \"\"\"\n> +        Run after each test suite.\n> +        \"\"\"\n> +        if self.vm_env_done:\n> +            self.destroy_vm_env()\n> +        self.dut.kill_all()\n> --\n> 2.17.1",
        "headers": {
            "X-Mailman-Version": "2.1.15",
            "X-MS-TNEF-Correlator": "",
            "X-ExtLoop1": "1",
            "Thread-Topic": "[dts] [PATCH] speed-capabilities: added Speed Capabilities\n test case",
            "dlp-product": "dlpe-windows",
            "X-Amp-Result": "SKIPPED(no attachment in message)",
            "x-originating-ip": "[10.239.127.40]",
            "Received": [
                "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id B861DA0540;\n\tMon, 20 Jul 2020 09:12:36 +0200 (CEST)",
                "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9A6331BF5D;\n\tMon, 20 Jul 2020 09:12:36 +0200 (CEST)",
                "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id AE3BE1BEDE;\n Mon, 20 Jul 2020 09:12:34 +0200 (CEST)",
                "from orsmga007.jf.intel.com ([10.7.209.58])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 20 Jul 2020 00:12:33 -0700",
                "from fmsmsx105.amr.corp.intel.com ([10.18.124.203])\n by orsmga007.jf.intel.com with ESMTP; 20 Jul 2020 00:12:33 -0700",
                "from fmsmsx121.amr.corp.intel.com (10.18.125.36) by\n FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS)\n id 14.3.439.0; Mon, 20 Jul 2020 00:12:32 -0700",
                "from shsmsx154.ccr.corp.intel.com (10.239.6.54) by\n fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS)\n id 14.3.439.0; Mon, 20 Jul 2020 00:12:32 -0700",
                "from shsmsx101.ccr.corp.intel.com ([169.254.1.22]) by\n SHSMSX154.ccr.corp.intel.com ([169.254.7.32]) with mapi id 14.03.0439.000;\n Mon, 20 Jul 2020 15:12:30 +0800"
            ],
            "References": "<20200707134039.13165-1-dkirichok@iol.unh.edu>",
            "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
            "MIME-Version": "1.0",
            "dlp-reaction": "no-action",
            "Message-ID": "\n <8CE3E05A3F976642AAB0F4675D0AD20E0BC822A4@SHSMSX101.ccr.corp.intel.com>",
            "Accept-Language": "zh-CN, en-US",
            "Thread-Index": "AQHWVGRjfSGryyFkxE2EFwkTguHbX6kQIXHg",
            "Errors-To": "dev-bounces@dpdk.org",
            "X-IronPort-AV": [
                "E=McAfee;i=\"6000,8403,9687\"; a=\"137347754\"",
                "E=Sophos;i=\"5.75,374,1589266800\"; d=\"scan'208\";a=\"137347754\"",
                "E=Sophos;i=\"5.75,374,1589266800\"; d=\"scan'208\";a=\"327444197\""
            ],
            "Content-Language": "en-US",
            "X-Amp-File-Uploaded": "False",
            "From": "\"Tu, Lijuan\" <lijuan.tu@intel.com>",
            "X-Original-To": "patchwork@inbox.dpdk.org",
            "Content-Type": "text/plain; charset=\"utf-8\"",
            "List-Post": "<mailto:dev@dpdk.org>",
            "Return-Path": "<dev-bounces@dpdk.org>",
            "Sender": "\"dev\" <dev-bounces@dpdk.org>",
            "X-MS-Has-Attach": "",
            "CC": "\"mb@smartsharesystems.com\" <mb@smartsharesystems.com>,\n \"lylavoie@iol.unh.edu\" <lylavoie@iol.unh.edu>, \"thomas@monjalon.net\"\n <thomas@monjalon.net>, \"dev@dpdk.org\" <dev@dpdk.org>,\n \"david.marchand@redhat.com\" <david.marchand@redhat.com>, \"Yigit, Ferruh\"\n <ferruh.yigit@intel.com>, \"arybchenko@solarflare.com\"\n <arybchenko@solarflare.com>, \"i.dyukov@samsung.com\" <i.dyukov@samsung.com>,\n \"rasland@mellanox.com\" <rasland@mellanox.com>, \"j.hendergart@f5.com\"\n <j.hendergart@f5.com>, \"dliu@iol.unh.edu\" <dliu@iol.unh.edu>,\n \"ohilyard@iol.unh.edu\" <ohilyard@iol.unh.edu>",
            "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
            "In-Reply-To": "<20200707134039.13165-1-dkirichok@iol.unh.edu>",
            "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
            "To": "\"dkirichok@iol.unh.edu\" <dkirichok@iol.unh.edu>, \"dts@dpdk.org\"\n <dts@dpdk.org>",
            "IronPort-SDR": [
                "\n lAW5Y9S243CrffjKIVUAwvYKim7KDPfAXYT7COTomK319XGapzMboU/3mQPsACdITAB+rS83if\n 2KOgS2P67c9g==",
                "\n ClvL6BeENRcqO+Lrcp1jDytZ1HwhojOlNQV1mBsFQZR3e4rIZEsoKmbvciGIql9aZpBGqJnbaa\n 3kwCfT4sPhLg=="
            ],
            "Precedence": "list",
            "Delivered-To": "patchwork@inbox.dpdk.org",
            "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
            "Subject": "Re: [dpdk-dev] [dts] [PATCH] speed-capabilities: added Speed\n Capabilities test case",
            "dlp-version": "11.2.0.6",
            "Content-Transfer-Encoding": "base64",
            "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
            "X-BeenThere": "dev@dpdk.org",
            "Date": "Mon, 20 Jul 2020 07:12:29 +0000"
        }
    }
]