get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 126458,
    "url": "http://patches.dpdk.org/api/patches/126458/?format=api",
    "web_url": "http://patches.dpdk.org/project/dts/patch/20230424101820.2598235-2-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": "<20230424101820.2598235-2-weix.ling@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dts/20230424101820.2598235-2-weix.ling@intel.com",
    "date": "2023-04-24T10:18:19",
    "name": "[V1,1/2] tests/pvp_virtio_user_4k_pages: add expected value to verify",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "6eff9c28b39e6a9e56453adc882e6f4ef9a3c531",
    "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/20230424101820.2598235-2-weix.ling@intel.com/mbox/",
    "series": [
        {
            "id": 27843,
            "url": "http://patches.dpdk.org/api/series/27843/?format=api",
            "web_url": "http://patches.dpdk.org/project/dts/list/?series=27843",
            "date": "2023-04-24T10:18:18",
            "name": "add expected value to verify",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/27843/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/126458/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/126458/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 AEC04429D8;\n\tMon, 24 Apr 2023 12:20:08 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A9ABC410EC;\n\tMon, 24 Apr 2023 12:20:08 +0200 (CEST)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by mails.dpdk.org (Postfix) with ESMTP id 9538F410EC\n for <dts@dpdk.org>; Mon, 24 Apr 2023 12:20:07 +0200 (CEST)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 24 Apr 2023 03:20:07 -0700",
            "from unknown (HELO localhost.localdomain) ([10.239.252.222])\n by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 24 Apr 2023 03:20:06 -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=1682331607; x=1713867607;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=0zB8TvuOhv+RRFRhSi38t3Vhc5Q1g00xIeJJ9A4rnuo=;\n b=Y3HGiFUHuPW0sfCh8wV+xIiq7YIEB8WLqCBI5RUnLhq13mvOy+8TKB+J\n FvvtdvVFLbNOG1iJ78nqjtxR/JNghfDhkZiDU+q2tfwlsDWrXLrKulKhz\n P38l/5gUstqEUkBlkvB/+yN6dofHo3fGoopeiXFP7ViJu5tUYWTy9atei\n s1DrEU2c0o9KaDAJlPh6eDUFR3iz/fxo5pbOU0i4XWV/99/QAiEh8/fVz\n gjGwJZHK8beMV24Hl//UjtSupgXw8azQUpXI5XKVvtVoL0HT0XYkMkR/d\n pSE4D8Nf1gwQBGngSLzh0Lu+pryf8gAzwZQC+v5rDOGXRBX1w2N1P/W1j A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10689\"; a=\"411688788\"",
            "E=Sophos;i=\"5.99,222,1677571200\"; d=\"scan'208\";a=\"411688788\"",
            "E=McAfee;i=\"6600,9927,10689\"; a=\"670457636\"",
            "E=Sophos;i=\"5.99,222,1677571200\"; d=\"scan'208\";a=\"670457636\""
        ],
        "X-ExtLoop1": "1",
        "From": "Wei Ling <weix.ling@intel.com>",
        "To": "dts@dpdk.org",
        "Cc": "Wei Ling <weix.ling@intel.com>",
        "Subject": "[dts][PATCH V1 1/2] tests/pvp_virtio_user_4k_pages: add expected\n value to verify",
        "Date": "Mon, 24 Apr 2023 18:18:19 +0800",
        "Message-Id": "<20230424101820.2598235-2-weix.ling@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230424101820.2598235-1-weix.ling@intel.com>",
        "References": "<20230424101820.2598235-1-weix.ling@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "Optimize the verify the expected value from the hard code to read from\nconf/pvp_virtio_user_4k_pages.cfg to adapt different platform.\n\nSigned-off-by: Wei Ling <weix.ling@intel.com>\n---\n tests/TestSuite_pvp_virtio_user_4k_pages.py | 131 +++++++++++++-------\n 1 file changed, 86 insertions(+), 45 deletions(-)",
    "diff": "diff --git a/tests/TestSuite_pvp_virtio_user_4k_pages.py b/tests/TestSuite_pvp_virtio_user_4k_pages.py\nindex 3e3e09b4..aa41cd50 100644\n--- a/tests/TestSuite_pvp_virtio_user_4k_pages.py\n+++ b/tests/TestSuite_pvp_virtio_user_4k_pages.py\n@@ -2,16 +2,11 @@\n # Copyright(c) 2019 Intel Corporation\n #\n \n-\"\"\"\n-DPDK Test suite.\n-vhost/virtio-user pvp with 4K pages.\n-\"\"\"\n+from copy import deepcopy\n \n-import time\n-\n-import framework.utils as utils\n from framework.packet import Packet\n from framework.pktgen import PacketGeneratorHelper\n+from framework.settings import UPDATE_EXPECTED, load_global_setting\n from framework.test_case import TestCase\n \n \n@@ -41,6 +36,8 @@ class TestPvpVirtioUser4kPages(TestCase):\n         self.core_list_virtio_user = self.core_list[0:2]\n         self.core_list_vhost_user = self.core_list[2:4]\n         self.pci_info = self.dut.ports_info[0][\"pci\"]\n+        self.nb_ports = 1\n+        self.gap = self.get_suite_cfg()[\"accepted_tolerance\"]\n         self.dst_mac = self.dut.get_mac_address(self.dut_ports[0])\n         self.frame_sizes = [64, 128, 256, 512, 1024, 1518]\n         self.logger.info(\n@@ -68,35 +65,19 @@ class TestPvpVirtioUser4kPages(TestCase):\n         self.dut.send_expect(\"killall -s INT %s\" % self.testpmd_name, \"# \")\n         self.vhost_user = self.dut.new_session(suite=\"vhost-user\")\n         self.virtio_user = self.dut.new_session(suite=\"virtio-user\")\n+        self.throughput = dict()\n+        self.test_result = dict()\n         # Prepare the result table\n         self.table_header = [\"Frame\"]\n-        self.table_header.append(\"Mode\")\n         self.table_header.append(\"Mpps\")\n-        self.table_header.append(\"Queue Num\")\n         self.table_header.append(\"% linerate\")\n-        self.result_table_create(self.table_header)\n \n-    @property\n-    def check_value(self):\n-        check_dict = dict.fromkeys(self.frame_sizes)\n-        linerate = {\n-            64: 0.08,\n-            128: 0.10,\n-            256: 0.18,\n-            512: 0.20,\n-            1024: 0.40,\n-            1280: 0.45,\n-            1518: 0.50,\n-        }\n-        for size in self.frame_sizes:\n-            speed = self.wirespeed(self.nic, size, self.number_of_ports)\n-            check_dict[size] = round(speed * linerate[size], 2)\n-        return check_dict\n-\n-    def send_and_verify(self):\n-        \"\"\"\n-        Send packet with packet generator and verify\n+    def perf_test(self):\n+        \"\"\"\n+        Send packet with packet generator\n         \"\"\"\n+        self.result_table_create(self.table_header)\n+        self.throughput = {}\n         for frame_size in self.frame_sizes:\n             tgen_input = []\n             rx_port = self.tester.get_local_port(self.dut_ports[0])\n@@ -110,21 +91,71 @@ class TestPvpVirtioUser4kPages(TestCase):\n             streams = self.pktgen_helper.prepare_stream_from_tginput(\n                 tgen_input, 100, None, self.tester.pktgen\n             )\n-            _, pps = self.tester.pktgen.measure_throughput(stream_ids=streams)\n-            Mpps = pps / 1000000.0\n-            self.verify(\n-                Mpps > self.check_value[frame_size],\n-                \"%s of frame size %d speed verify failed, expect %s, result %s\"\n-                % (self.running_case, frame_size, self.check_value[frame_size], Mpps),\n+            # set traffic option\n+            traffic_opt = {\n+                \"delay\": 5,\n+                \"duration\": self.get_suite_cfg()[\"test_duration\"],\n+            }\n+            _, pps = self.tester.pktgen.measure_throughput(\n+                stream_ids=streams, options=traffic_opt\n             )\n-            throughput = Mpps * 100 / float(self.wirespeed(self.nic, 64, 1))\n-\n+            Mpps = pps / 1000000.0\n+            line_rate = Mpps * 100 / float(self.wirespeed(self.nic, 64, 1))\n+            self.throughput[frame_size] = Mpps\n             results_row = [frame_size]\n-            results_row.append(\"4K pages\")\n             results_row.append(Mpps)\n-            results_row.append(\"1\")\n-            results_row.append(throughput)\n+            results_row.append(line_rate)\n             self.result_table_add(results_row)\n+        self.result_table_print()\n+\n+    def handle_expected(self):\n+        \"\"\"\n+        Update expected numbers to configurate file: $DTS_CFG_FOLDER/$suite_name.cfg\n+        \"\"\"\n+        if load_global_setting(UPDATE_EXPECTED) == \"yes\":\n+            for frame_size in self.frame_sizes:\n+                self.expected_throughput[frame_size] = round(\n+                    self.throughput[frame_size], 3\n+                )\n+\n+    def handle_results(self):\n+        \"\"\"\n+        results handled process:\n+        1, save to self.test_results\n+        2, create test results table\n+        \"\"\"\n+        # save test results to self.test_result\n+        header = self.table_header\n+        header.append(\"Expected Throughput(Mpps)\")\n+        header.append(\"Status\")\n+        self.result_table_create(self.table_header)\n+        for frame_size in self.frame_sizes:\n+            wirespeed = self.wirespeed(self.nic, frame_size, self.nb_ports)\n+            ret_data = {}\n+            ret_data[header[0]] = str(frame_size)\n+            _real = float(self.throughput[frame_size])\n+            _exp = float(self.expected_throughput[frame_size])\n+            ret_data[header[1]] = \"{:.3f}\".format(_real)\n+            ret_data[header[2]] = \"{:.3f}%\".format(_real * 100 / wirespeed)\n+            ret_data[header[3]] = \"{:.3f}\".format(_exp)\n+            gap = _exp * -self.gap * 0.01\n+            if _real > _exp + gap:\n+                ret_data[header[4]] = \"PASS\"\n+            else:\n+                ret_data[header[4]] = \"FAIL\"\n+            self.test_result[frame_size] = deepcopy(ret_data)\n+\n+        for frame_size in self.test_result.keys():\n+            table_row = list()\n+            for i in range(len(header)):\n+                table_row.append(self.test_result[frame_size][header[i]])\n+            self.result_table_add(table_row)\n+        # present test results to screen\n+        self.result_table_print()\n+        self.verify(\n+            \"FAIL\" not in self.test_result,\n+            \"Excessive gap between test results and expectations\",\n+        )\n \n     def start_testpmd_as_vhost(self):\n         \"\"\"\n@@ -187,22 +218,32 @@ class TestPvpVirtioUser4kPages(TestCase):\n         \"\"\"\n         Basic test for virtio-user 4K pages\n         \"\"\"\n+        self.test_target = self.running_case\n+        self.expected_throughput = self.get_suite_cfg()[\"expected_throughput\"][\n+            self.test_target\n+        ]\n         self.start_testpmd_as_vhost()\n         self.prepare_tmpfs_for_4k()\n         self.start_testpmd_as_virtio()\n-        self.send_and_verify()\n-        self.result_table_print()\n+        self.perf_test()\n+        self.handle_expected()\n+        self.handle_results()\n         self.close_all_apps()\n \n     def test_perf_pvp_virtio_user_packed_ring_with_4K_pages(self):\n         \"\"\"\n         Basic test for virtio-user 4K pages\n         \"\"\"\n+        self.test_target = self.running_case\n+        self.expected_throughput = self.get_suite_cfg()[\"expected_throughput\"][\n+            self.test_target\n+        ]\n         self.start_testpmd_as_vhost()\n         self.prepare_tmpfs_for_4k()\n         self.start_testpmd_as_virtio(packed=True)\n-        self.send_and_verify()\n-        self.result_table_print()\n+        self.perf_test()\n+        self.handle_expected()\n+        self.handle_results()\n         self.close_all_apps()\n \n     def tear_down(self):\n",
    "prefixes": [
        "V1",
        "1/2"
    ]
}