Show a patch.

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

{
    "id": 73429,
    "url": "https://patches.dpdk.org/api/patches/73429/?format=api",
    "web_url": "https://patches.dpdk.org/patch/73429/",
    "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"
    },
    "msgid": "<20200707134039.13165-1-dkirichok@iol.unh.edu>",
    "date": "2020-07-07T13:40:39",
    "name": "speed-capabilities: added Speed Capabilities test case",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "3d25aedcc5aaeadb602b20e6fe742ab2ecd6b43e",
    "submitter": {
        "id": 1797,
        "url": "https://patches.dpdk.org/api/people/1797/?format=api",
        "name": "Daniel Kirichok",
        "email": "dkirichok@iol.unh.edu"
    },
    "delegate": {
        "id": 4476,
        "url": "https://patches.dpdk.org/api/users/4476/?format=api",
        "username": "ci",
        "first_name": "CI",
        "last_name": "",
        "email": "ci@dpdk.org"
    },
    "mbox": "https://patches.dpdk.org/patch/73429/mbox/",
    "series": [
        {
            "id": 10850,
            "url": "https://patches.dpdk.org/api/series/10850/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10850",
            "date": "2020-07-07T13:40:39",
            "name": "speed-capabilities: added Speed Capabilities test case",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/10850/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73429/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/73429/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "X-Gm-Message-State": "AOAM5313ygZ6sLW7ACHU/GJ+Q0DHlgloYvPirLx0t0Ma5UoISwnOpSVV\n f8twbgsaw5OwVb391joGcOR7c4iARySKRNPRRIduHb/5QBFvW/bswpJtOBrNKPcz6rkm8c8PTuG\n G7l+LAH2lo1W5gT7h7jYYESnLcUSml7WU7toncNsewkXoRNvZ6etf/QZ/oZeM9W552Hofw3LAL/\n MCqFOU79jRkI9SkQ==",
        "X-Google-Smtp-Source": "\n ABdhPJxOS599mXKB3ATvtsRdf9njWBa/qWruhKYnTNKd6AT0dQ5Z8dV0NNhrnLCw6/A5lXDi+mt57nC5Faan",
        "List-Post": "<mailto:dev@dpdk.org>",
        "MIME-Version": "1.0",
        "X-BeenThere": "dev@dpdk.org",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH] speed-capabilities: added Speed Capabilities\n\ttest case",
        "Content-Type": "text/plain; charset=UTF-8",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 7AA00A00BE;\n\tTue,  7 Jul 2020 15:41:40 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3406D1D9FC;\n\tTue,  7 Jul 2020 15:41:39 +0200 (CEST)",
            "from mail-ot1-f98.google.com (mail-ot1-f98.google.com\n [209.85.210.98]) by dpdk.org (Postfix) with ESMTP id 955FC1D931\n for <dev@dpdk.org>; Tue,  7 Jul 2020 15:41:37 +0200 (CEST)",
            "by mail-ot1-f98.google.com with SMTP id n24so32105931otr.13\n for <dev@dpdk.org>; Tue, 07 Jul 2020 06:41:37 -0700 (PDT)",
            "from postal.iol.unh.edu (postal.iol.unh.edu.\n [2606:4100:3880:1234::84])\n by smtp-relay.gmail.com with ESMTPS id r2sm54186oof.2.2020.07.07.06.41.35\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Tue, 07 Jul 2020 06:41:35 -0700 (PDT)",
            "from localhost.localdomain (unknown [10.31.0.117])\n by postal.iol.unh.edu (Postfix) with ESMTP id 7AC606052500;\n Tue,  7 Jul 2020 09:41:34 -0400 (EDT)"
        ],
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "X-Mailer": "git-send-email 2.17.1",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n :content-transfer-encoding;\n bh=5cpjn7qJamP9Q090c7TJYI+Vw68G90ZOrPyptrZutA0=;\n b=lpKGD2QMqgOVxmC4bGiXaMfXdXiHaVCeAGEZUrSSrWl/7dztwZMPr/hSFMx74FGkMp\n JmwblFF0URXZPjPmDmUvdIZcr2PPUh/I+eU+5c4OH5C6ETUgAnHGNeteo+voeZWGaWnv\n j0hd+jG/S4DNL/nopIvy+EsKli3hztAAIvSjnchjX/c8D+sq49EzdDw1Efkt4CQh7AjN\n F+g6s4qSFWZoZUXJMaC78O/Zd+gwiS/Q/WmAIv4Xn60C1oHyQ+HBb0DwC/FGoxs5xYS2\n 7AGWmoVcnOEK2yQ5VDRaM2Ttzax0UvBaJBPrU9KRPswNES6rov9RGfPoJz/3CCnGonQD\n XA+w==",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu;\n s=unh-iol;\n h=from:to:cc:subject:date:message-id:mime-version\n :content-transfer-encoding;\n bh=5cpjn7qJamP9Q090c7TJYI+Vw68G90ZOrPyptrZutA0=;\n b=HaTy0Vxz9n2+AvQMrYZv4RaPNEbZXv0apVdzklPRN5rfBA3EYZAaBSKOLWjiVBSjVN\n QnphXGoYkNunChIgWAhWeJ+4kFeBvxhngyrenPkbL+3zO8BviSuBjljJ1aZ+iJXmWmhm\n n6X3QHsZXroWnW1WW7lQnVqbh2/pNlBRMkIyM=",
        "Date": "Tue,  7 Jul 2020 09:40:39 -0400",
        "Content-Transfer-Encoding": "8bit",
        "X-Received": "by 2002:a9d:3ea:: with SMTP id f97mr2552830otf.300.1594129295883;\n Tue, 07 Jul 2020 06:41:35 -0700 (PDT)",
        "To": "dts@dpdk.org",
        "X-Relaying-Domain": "iol.unh.edu",
        "From": "dkirichok@iol.unh.edu",
        "Errors-To": "dev-bounces@dpdk.org",
        "Cc": "mb@smartsharesystems.com, lylavoie@iol.unh.edu, thomas@monjalon.net,\n dev@dpdk.org, david.marchand@redhat.com, ferruh.yigit@intel.com,\n arybchenko@solarflare.com, i.dyukov@samsung.com, rasland@mellanox.com,\n j.hendergart@f5.com, dliu@iol.unh.edu, ohilyard@iol.unh.edu,\n Daniel Kirichok <dkirichok@iol.unh.edu>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Message-Id": "<20200707134039.13165-1-dkirichok@iol.unh.edu>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "From: Daniel Kirichok <dkirichok@iol.unh.edu>\n\nAdded test case for checking speed capabilities.\n\nSigned-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\n create mode 100644 test_plans/speed_capabilities_test_plan.rst\n create mode 100644 tests/TestSuite_speed_capabilities.py",
    "diff": "diff --git a/conf/speed_capabilities.cfg b/conf/speed_capabilities.cfg\nnew file mode 100644\nindex 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 SPEED>',...}\n+# Unit for speed must be in G or M\n+expected_speeds={'interface1': '10G', 'interface2': '100M'}\ndiff --git a/test_plans/speed_capabilities_test_plan.rst b/test_plans/speed_capabilities_test_plan.rst\nnew file mode 100644\nindex 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 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+Speed Capabilities Test\n+=======================\n+\n+The Speed Capabilities Test checks the speeds that the device lists and compares\n+it to a user-defined set of expected speeds set in the ``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 bios.When\n+using vfio, use the following commands to load the vfio driver and bind it\n+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 connected\n+to the traffic generator, launch the ``testpmd`` application with the following\n+arguments::\n+\n+  ./build/app/testpmd -- -i --portmask=0x3\n+\n+Start packet forwarding in the ``testpmd`` application with the ``start``\n+command. Then, for each port on the target make the Traffic Generator\n+transmit a packet to the port of arbitrary size less than the MTU of\n+the target port, checking that the same amount of frames and bytes\n+are received back by the Traffic Generator from the port.\n+\n+Ensure that the ``speed_capabilities.cfg`` file correctly reflects the speeds\n+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. 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.\ndiff --git a/tests/TestSuite_speed_capabilities.py b/tests/TestSuite_speed_capabilities.py\nnew file mode 100644\nindex 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 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+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 {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 = 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 {interface_name} does not have an expected \"\n+                                                           f\"speed 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 not i.isdigit())\n+\n+            # Removes the unit from the speed\n+            expected_speed = ''.join(i for i in expected_speed if i.isdigit())\n+\n+            self.verify(len(interface_speed) > 0,\n+                        f\"A valid speed could not be read for the 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 {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 speed {value} in \"\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-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",
    "prefixes": []
}