get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 87618,
    "url": "http://patches.dpdk.org/api/patches/87618/?format=api",
    "web_url": "http://patches.dpdk.org/project/dts/patch/20210202151650.3878529-1-weix.ling@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": "<20210202151650.3878529-1-weix.ling@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dts/20210202151650.3878529-1-weix.ling@intel.com",
    "date": "2021-02-02T15:16:50",
    "name": "[V5] tests/virtio_smoke:add virtio smoke test suite with test plan",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "960fd520bd97f2eb664b2e0193bfd32394779543",
    "submitter": {
        "id": 1828,
        "url": "http://patches.dpdk.org/api/people/1828/?format=api",
        "name": "Ling, WeiX",
        "email": "weix.ling@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dts/patch/20210202151650.3878529-1-weix.ling@intel.com/mbox/",
    "series": [
        {
            "id": 15088,
            "url": "http://patches.dpdk.org/api/series/15088/?format=api",
            "web_url": "http://patches.dpdk.org/project/dts/list/?series=15088",
            "date": "2021-02-02T15:16:50",
            "name": "[V5] tests/virtio_smoke:add virtio smoke test suite with test plan",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/15088/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/87618/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/87618/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 E3D8FA052A;\n\tTue,  2 Feb 2021 08:23:46 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DE5C2240286;\n\tTue,  2 Feb 2021 08:23:46 +0100 (CET)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by mails.dpdk.org (Postfix) with ESMTP id 75B4A240286\n for <dts@dpdk.org>; Tue,  2 Feb 2021 08:23:44 +0100 (CET)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Feb 2021 23:23:41 -0800",
            "from unknown (HELO localhost.localdomain) ([10.240.183.222])\n by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 01 Feb 2021 23:23:38 -0800"
        ],
        "IronPort-SDR": [
            "\n NEscoBnJeQCYA9ttui3kNZK4z0D3esfVzXeDkNm9Zwzaxn1DmG6Z43bWc8o0EHw+Cm+Z9SKKf2\n v7O3c+3AC5RQ==",
            "\n Wm+RSQqZJHJKuH8qh4MAB4zw989m0P51I5084mIo4ba3MbKsZqXNdsksStrGAfy1xcVoG7V5ex\n Nvj6nS1JQ+ag=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9882\"; a=\"160576340\"",
            "E=Sophos;i=\"5.79,394,1602572400\"; d=\"scan'208\";a=\"160576340\"",
            "E=Sophos;i=\"5.79,394,1602572400\"; d=\"scan'208\";a=\"432770770\""
        ],
        "From": "Ling Wei <weix.ling@intel.com>",
        "To": "dts@dpdk.org",
        "Cc": "Ling Wei <weix.ling@intel.com>",
        "Date": "Tue,  2 Feb 2021 15:16:50 +0000",
        "Message-Id": "<20210202151650.3878529-1-weix.ling@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "quoted-printable",
        "Subject": "[dts] [PATCH V5] tests/virtio_smoke:add virtio smoke test suite\n with test plan",
        "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",
        "Sender": "\"dts\" <dts-bounces@dpdk.org>"
    },
    "content": "v1:\nAdd virtio smoke test suite sync with test plan.\n\nv2:\n1.Modiry Copyrint(c)<2019> to Copyrint(c)<2021>.\n2.Fix CentOS check hugepagesize return ' 2048' dts issue.\n3.Add test case run exception handing 'kill dpdk-testpmd'\n  in set_up and tear_down.\n\nv3:\nModify patch subject and comments description error.\n\nv4:\nModify set_up method,kill testpmd then remove vhost-net*.\n\nv5:\nFix patch spelling error.\n\nSigned-off-by: Ling Wei <weix.ling@intel.com>\n---\n tests/TestSuite_virtio_smoke.py | 202 ++++++++++++++++++++++++++++++++\n 1 file changed, 202 insertions(+)\n create mode 100644 tests/TestSuite_virtio_smoke.py",
    "diff": "diff --git a/tests/TestSuite_virtio_smoke.py b/tests/TestSuite_virtio_smoke.py\nnew file mode 100644\nindex 0000000..85d9457\n--- /dev/null\n+++ b/tests/TestSuite_virtio_smoke.py\n@@ -0,0 +1,202 @@\n+# BSD LICENSE\r\n+#\r\n+# Copyright(c) <2021> Intel Corporation. All rights reserved.\r\n+# All rights reserved.\r\n+#\r\n+# Redistribution and use in source and binary forms, with or without\r\n+# modification, are permitted provided that the following conditions\r\n+# are met:\r\n+#\r\n+#   * Redistributions of source code must retain the above copyright\r\n+#     notice, this list of conditions and the following disclaimer.\r\n+#   * Redistributions in binary form must reproduce the above copyright\r\n+#     notice, this list of conditions and the following disclaimer in\r\n+#     the documentation and/or other materials provided with the\r\n+#     distribution.\r\n+#   * Neither the name of Intel Corporation nor the names of its\r\n+#     contributors may be used to endorse or promote products derived\r\n+#     from this software without specific prior written permission.\r\n+#\r\n+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r\n+# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r\n+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r\n+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r\n+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r\n+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r\n+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r\n+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r\n+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n+\r\n+\"\"\"\r\n+DPDK Test suite.\r\n+\"\"\"\r\n+\r\n+import re\r\n+from test_case import TestCase\r\n+from pmd_output import PmdOutput\r\n+DEFAULT_MTU = 1500\r\n+TSO_MTU = 9000\r\n+\r\n+class TestVirtioSmoke(TestCase):\r\n+\r\n+\r\n+    def set_up_all(self):\r\n+        \"\"\"\r\n+        Run at the start of each test suite.\r\n+        \"\"\"\r\n+        self.dst_mac = \"00:01:02:03:04:05\"\r\n+        self.dut_ports = self.dut.get_ports()\r\n+        self.txItf = self.tester.get_interface(self.tester.get_local_port(self.dut_ports[0]))\r\n+        self.socket = self.dut.get_numa_id(self.dut_ports[0])\r\n+        self.cores = self.dut.get_core_list(\"all\", socket=self.socket)\r\n+        self.vhost_cores = self.cores[0:3]\r\n+        self.virtio1_cores = self.cores[3:6]\r\n+        self.base_dir = self.dut.base_dir.replace('~', '/root')\r\n+        self.path = self.dut.apps_name['test-pmd']\r\n+        self.testpmd_name = self.path.split(\"/\")[-1]\r\n+        self.vhost_user = self.dut.new_session(suite=\"vhost-user\")\r\n+        self.virtio_user1 = self.dut.new_session(suite=\"virtio-user1\")\r\n+        self.pmdout_vhost_user = PmdOutput(self.dut, self.vhost_user)\r\n+        self.pmdout_virtio_user1 = PmdOutput(self.dut, self.virtio_user1)\r\n+\r\n+    def set_up(self):\r\n+        \"\"\"\r\n+        Run before each test case.\r\n+        \"\"\"\r\n+        self.dut.send_expect(\"rm -rf %s/vhost-net*\" % self.base_dir, \"#\")\r\n+        self.dut.send_expect(\"killall -s INT %s\" % self.testpmd_name, \"#\")\r\n+\r\n+    @property\r\n+    def check_2M_env(self):\r\n+        out = self.dut.send_expect(\"cat /proc/meminfo |grep Hugepagesize|awk '{print($2)}'\", \"# \")\r\n+        # On CentOS, sometimes return ' 2048'\r\n+        resp = out.replace(' ', '')\r\n+        return True if resp == '2048' else False\r\n+\r\n+    def launch_testpmd_as_vhost_user(self, param, cores=\"Default\", udev=\"\", ports=[], no_pci=True):\r\n+        self.pmdout_vhost_user.start_testpmd(cores=cores, param=param, vdevs=[udev], ports=ports, prefix=\"vhost\",\r\n+                                             fixed_prefix=True, no_pci=no_pci)\r\n+        self.pmdout_vhost_user.execute_cmd('set fwd mac')\r\n+\r\n+    def launch_testpmd_as_virtio_user1(self, param, cores=\"Default\", udev=\"\", no_pci=True):\r\n+        eal_param = \"\"\r\n+        if self.check_2M_env:\r\n+            eal_param += \" --single-file-segments\"\r\n+        if 'vectorized' in self.running_case:\r\n+            eal_param += \" --force-max-simd-bitwidth=512\"\r\n+        self.pmdout_virtio_user1.start_testpmd(cores=cores, param=param, vdevs=[udev], ports=[], prefix=\"virtio1\",\r\n+                                               fixed_prefix=True, eal_param=eal_param, no_pci=no_pci)\r\n+\r\n+    def verify_vhost_queue_rx_tx_pkts(self, queue_list):\r\n+        out = self.pmdout_vhost_user.execute_cmd('stop')\r\n+        for queue_index in queue_list:\r\n+            queue = \"Queue= %d\" % queue_index\r\n+            index = out.find(queue)\r\n+            rx = re.search(\"RX-packets:\\s*(\\d*)\", out[index:])\r\n+            tx = re.search(\"TX-packets:\\s*(\\d*)\", out[index:])\r\n+            rx_packets = int(rx.group(1))\r\n+            tx_packets = int(tx.group(1))\r\n+            self.verify(rx_packets > 0 and tx_packets > 0,\r\n+                        \"The queue %d rx-packets or tx-packets is 0 about \" % queue_index +\r\n+                        \"rx-packets:%d, tx-packets:%d\" % (rx_packets, tx_packets))\r\n+\r\n+    def test_virtio_loopback(self):\r\n+        param = \" --nb-cores={} --rxq={} --txq={}\"\r\n+        other_param = \" --tx-offloads=0x0 --enable-hw-vlan-strip --rss-ip\"\r\n+        vhost_dev = f\"'eth_vhost0,iface=vhost-net,client=1,queues=8'\"\r\n+        virtio_dev = f\"'net_virtio_user0,mac={self.dst_mac},path=./vhost-net,server=1,queues=8,mrg_rxbuf=1,in_order=1'\"\r\n+\r\n+        self.logger.info(\"Launch vhost as client mode with 2 queues\")\r\n+        nb_core = 2\r\n+        vhost_rxq_txq = 2\r\n+        virtio_rxq_txq = 8\r\n+        vhost_param = param.format(nb_core, vhost_rxq_txq, vhost_rxq_txq)\r\n+        virtio_param = (other_param + param).format(nb_core, virtio_rxq_txq, virtio_rxq_txq)\r\n+        self.launch_testpmd_as_vhost_user(param=vhost_param, cores=self.vhost_cores, udev=vhost_dev, no_pci=True)\r\n+        self.pmdout_vhost_user.execute_cmd('start')\r\n+        self.logger.info(\"Launch virtio-user as server mode with 8 queues\")\r\n+        self.launch_testpmd_as_virtio_user1(param=virtio_param, cores=self.virtio1_cores, udev=virtio_dev, no_pci=True)\r\n+        self.pmdout_virtio_user1.execute_cmd('set fwd mac')\r\n+        self.pmdout_virtio_user1.execute_cmd('start tx_first 32')\r\n+        self.verify_vhost_queue_rx_tx_pkts(queue_list=range(vhost_rxq_txq))\r\n+        self.pmdout_vhost_user.execute_cmd('quit', '#')\r\n+\r\n+        self.logger.info(\"Relaunch vhost with 8 queues and send packets\")\r\n+        vhost_rxq_txq = 8\r\n+        vhost_param = param.format(nb_core, vhost_rxq_txq, vhost_rxq_txq)\r\n+        self.launch_testpmd_as_vhost_user(param=vhost_param, cores=self.cores[0:3], udev=vhost_dev, no_pci=True)\r\n+        self.pmdout_vhost_user.execute_cmd('start tx_first 32')\r\n+        self.pmdout_vhost_user.execute_cmd('stop')\r\n+        self.pmdout_vhost_user.execute_cmd('set burst 1')\r\n+        self.pmdout_vhost_user.execute_cmd('start tx_first 1')\r\n+        self.verify_vhost_queue_rx_tx_pkts(queue_list=range(vhost_rxq_txq))\r\n+\r\n+        self.pmdout_virtio_user1.execute_cmd('quit', '#')\r\n+        self.pmdout_vhost_user.execute_cmd('quit', '#')\r\n+\r\n+    def send_packets(self, frame_size, pkt_count):\r\n+        pkt = \"Ether(dst='%s')/IP()/('x'*%d)\" %(self.dst_mac, frame_size)\r\n+        self.tester.scapy_append('sendp([%s], iface=\"%s\", count=%s)' % (pkt, self.txItf, pkt_count))\r\n+        self.tester.scapy_execute()\r\n+\r\n+    def verify_virtio_user_receive_packets(self, pkt_count):\r\n+        out = self.pmdout_virtio_user1.execute_cmd('show port stats all')\r\n+        rx = re.search(\"RX-packets:\\s*(\\d*)\", out)\r\n+        tx = re.search(\"TX-packets:\\s*(\\d*)\", out)\r\n+        rx_packets = int(rx.group(1))\r\n+        tx_packets = int(tx.group(1))\r\n+        self.verify(rx_packets >= pkt_count and tx_packets >= pkt_count,\r\n+                    \"Virtio-user receive no enough packets, RX-packets: {},RX-packets: {}\".format(rx_packets, tx_packets))\r\n+\r\n+    def test_virtio_pvp(self):\r\n+        param = \" --nb-cores={} --txd={} --rxd={}\"\r\n+        vhost_dev = f\"'net_vhost0,iface=vhost-net,queues=1'\"\r\n+        virtio_dev = f\"'net_virtio_user0,mac={self.dst_mac},path=./vhost-net,packed_vq=1,mrg_rxbuf=0,in_order=1,\" \\\r\n+            f\"vectorized=1,queue_size=1024'\"\r\n+        self.logger.info(\"Launch vhost\")\r\n+        nb_core = 2\r\n+        vhost_rxd_txd = 1024\r\n+        vhost_param = param.format(nb_core, vhost_rxd_txd, vhost_rxd_txd)\r\n+        port = self.dut.ports_info[self.dut_ports[0]]['pci']\r\n+        self.launch_testpmd_as_vhost_user(param=vhost_param, cores=self.vhost_cores, udev=vhost_dev,\r\n+                                          ports=[port], no_pci=False)\r\n+        self.pmdout_vhost_user.execute_cmd('start')\r\n+\r\n+        self.logger.info(\"Launch virtio\")\r\n+        nb_core = 1\r\n+        virtio_param = param.format(nb_core, vhost_rxd_txd, vhost_rxd_txd)\r\n+        self.launch_testpmd_as_virtio_user1(param=virtio_param, cores=self.virtio1_cores, udev=virtio_dev, no_pci=True)\r\n+        self.pmdout_virtio_user1.execute_cmd('set fwd mac')\r\n+        self.pmdout_virtio_user1.execute_cmd('start')\r\n+\r\n+        self.logger.info(\"Start send packets and verify\")\r\n+        # set tester port MTU=9000 when nedd to send big packets.\r\n+        self.tester.send_expect(\"ifconfig %s mtu %s\" % (self.txItf, TSO_MTU), \"# \")\r\n+        # set vhost testpmd port MTU=9000\r\n+        self.pmdout_vhost_user.execute_cmd('stop')\r\n+        self.pmdout_vhost_user.execute_cmd('port stop 0')\r\n+        self.pmdout_vhost_user.execute_cmd('port config mtu 0 %s' % TSO_MTU)\r\n+        self.pmdout_vhost_user.execute_cmd('port start 0')\r\n+        self.pmdout_vhost_user.execute_cmd('start')\r\n+        self.send_packets(frame_size=64, pkt_count=10)\r\n+        self.send_packets(frame_size=1518, pkt_count=10)\r\n+        self.verify_virtio_user_receive_packets(pkt_count=20)\r\n+\r\n+        self.pmdout_virtio_user1.execute_cmd('quit', '#')\r\n+        self.pmdout_vhost_user.execute_cmd('quit', '#')\r\n+\r\n+    def tear_down(self):\r\n+        \"\"\"\r\n+        Run after each test case.\r\n+        \"\"\"\r\n+        self.dut.send_expect(\"killall -s INT %s\" % self.testpmd_name, \"#\")\r\n+\r\n+    def tear_down_all(self):\r\n+        \"\"\"\r\n+        Run after each test suite.\r\n+        \"\"\"\r\n+        self.dut.close_session(self.vhost_user)\r\n+        self.dut.close_session(self.virtio_user1)\r\n+        self.tester.send_expect(\"ifconfig %s mtu %s\" % (self.txItf, DEFAULT_MTU), \"# \")\r\n",
    "prefixes": [
        "V5"
    ]
}