get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 129561,
    "url": "http://patchwork.dpdk.org/api/patches/129561/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dts/patch/20230716140054.3222247-4-yaqi.tang@intel.com/",
    "project": {
        "id": 3,
        "url": "http://patchwork.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": "<20230716140054.3222247-4-yaqi.tang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dts/20230716140054.3222247-4-yaqi.tang@intel.com",
    "date": "2023-07-16T14:00:54",
    "name": "[V1,3/3] tests/igc_tx_timestamp: igc enable tx timestamp offloading",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c48c09cf25a510b254be4d5b0a1e90f6cbdc2043",
    "submitter": {
        "id": 2357,
        "url": "http://patchwork.dpdk.org/api/people/2357/?format=api",
        "name": "Yaqi Tang",
        "email": "yaqi.tang@intel.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.dpdk.org/project/dts/patch/20230716140054.3222247-4-yaqi.tang@intel.com/mbox/",
    "series": [
        {
            "id": 28946,
            "url": "http://patchwork.dpdk.org/api/series/28946/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dts/list/?series=28946",
            "date": "2023-07-16T14:00:51",
            "name": "IGC Enable Tx Timestamp Offloading",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/28946/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/129561/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/129561/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 41ABB42E8D;\n\tSun, 16 Jul 2023 16:01:57 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3CBD342BAC;\n\tSun, 16 Jul 2023 16:01:57 +0200 (CEST)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by mails.dpdk.org (Postfix) with ESMTP id 241F642BAC\n for <dts@dpdk.org>; Sun, 16 Jul 2023 16:01:54 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 16 Jul 2023 07:01:54 -0700",
            "from dpdk-yaqi.sh.intel.com ([10.67.118.189])\n by orsmga005.jf.intel.com with ESMTP; 16 Jul 2023 07:01:52 -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=1689516115; x=1721052115;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=nlsUr2ARcN1g9gM9KdwjxS+2Vqd3u4Iv7W4AkHD7+AE=;\n b=Do5ZjwDDBsHugjVhTMXEommpWcybzHkIX/QbetOwTFttIkRK2kfpZAIL\n oIYlPA5J7pzQbPwM/x1ZgkETwFgXi5ef0/V1wSgsqx4kfCAkjCXbBcM8y\n 9vWytvAjdTxFFeS0XI/9A0JVVRFkHww7fBERpeDqJBlTp+1nGRkH7Xsef\n 039mZHcPch2tozz+43OQ4ZPWpuowRV1/b6197SXgJe8WMz9JXNwxzviH1\n 4u+5t9CVZUdL/kqxT62awZ0+21nPJB/3enWhnsfS652H+v+BOOZhrgBqW\n /rvLOoorg4zny4kMKeUiF4XvTHjSRalpj1stXPq9+eqvaoM6R5ba/ngIF A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10773\"; a=\"345351256\"",
            "E=Sophos;i=\"6.01,210,1684825200\"; d=\"scan'208\";a=\"345351256\"",
            "E=McAfee;i=\"6600,9927,10773\"; a=\"896930531\"",
            "E=Sophos;i=\"6.01,210,1684825200\"; d=\"scan'208\";a=\"896930531\""
        ],
        "X-ExtLoop1": "1",
        "From": "Yaqi Tang <yaqi.tang@intel.com>",
        "To": "dts@dpdk.org",
        "Cc": "Yaqi Tang <yaqi.tang@intel.com>",
        "Subject": "[PATCH V1 3/3] tests/igc_tx_timestamp: igc enable tx timestamp\n offloading",
        "Date": "Sun, 16 Jul 2023 14:00:54 +0000",
        "Message-Id": "<20230716140054.3222247-4-yaqi.tang@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230716140054.3222247-1-yaqi.tang@intel.com>",
        "References": "<20230716140054.3222247-1-yaqi.tang@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": "IGC Enable Tx timestamp offloading by leveraging I225 NIC's \"Launch Time\".\n\nSigned-off-by: Yaqi Tang <yaqi.tang@intel.com>\n---\n tests/TestSuite_igc_tx_timestamp.py | 184 ++++++++++++++++++++++++++++\n 1 file changed, 184 insertions(+)\n create mode 100644 tests/TestSuite_igc_tx_timestamp.py",
    "diff": "diff --git a/tests/TestSuite_igc_tx_timestamp.py b/tests/TestSuite_igc_tx_timestamp.py\nnew file mode 100644\nindex 00000000..5fa0ee32\n--- /dev/null\n+++ b/tests/TestSuite_igc_tx_timestamp.py\n@@ -0,0 +1,184 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2023 Intel Corporation\n+#\n+\n+import re\n+import time\n+\n+from framework.pmd_output import PmdOutput\n+from framework.test_case import TestCase\n+from framework.utils import GREEN, RED\n+\n+\n+class TimestampTest(TestCase):\n+    def set_up_all(self):\n+        \"\"\"\n+        Run at the start of each test suite.\n+        Generic filter Prerequistites\n+        \"\"\"\n+        self.verify(\n+            self.nic in [\"IGC-I225_LM\", \"IGC-I226_LM\"],\n+            \"%s nic not support tx timestamp\" % self.nic,\n+        )\n+        self.dut_ports = self.dut.get_ports(self.nic)\n+        self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])\n+        # Verify that enough ports are available\n+        self.verify(len(self.dut_ports) >= 1, \"Insufficient ports\")\n+        self.tester_port0 = self.tester.get_local_port(self.dut_ports[0])\n+        self.tester_iface0 = self.tester.get_interface(self.tester_port0)\n+        self.pmdout = PmdOutput(self.dut)\n+        self.pf_pci = self.dut.ports_info[self.dut_ports[0]][\"pci\"]\n+\n+        apps_name = \"test-timestamp\"\n+        self.build_test_app(apps_name)\n+\n+    def set_up(self):\n+        \"\"\"\n+        Run before each test case.\n+        \"\"\"\n+        pass\n+\n+    def build_test_app(self, apps_name):\n+        # Compile test app\n+        print(self.tester.send_expect(\"ls\", \"#\", 5))\n+        test_rx_timestamp = \"/root/pkt_rx_tx.c\"\n+        out = self.tester.send_expect(\n+            \"gcc %s -o %s -lpthread\" % (test_rx_timestamp, apps_name), \"#\", 15\n+        )\n+        self.verify(\"Error\" not in out, \"Compilation %s error\" % apps_name)\n+        output = self.tester.send_expect(\"find -name %s\" % apps_name, \"#\")\n+        self.verify(\"%s\" % apps_name in output, \"Compilation %s error\" % apps_name)\n+\n+    def launch_testpmd(self, param, intra):\n+        \"\"\"\n+        start testpmd\n+        \"\"\"\n+        # Prepare testpmd EAL and parameters\n+        self.pmdout.start_testpmd(\n+            param=param,\n+            eal_param=f\"-a {self.pf_pci}\",\n+            socket=self.ports_socket,\n+        )\n+        # Test link status\n+        res = self.pmdout.wait_link_status_up(\"all\", 5)\n+        self.verify(res is True, \"there have port link is down\")\n+        self.pmdout.execute_cmd(\"set fwd txonly\")\n+        self.pmdout.execute_cmd(\"set txtimes 30000000,%d\" % intra)\n+        self.pmdout.execute_cmd(\"start\", \"testpmd>\", 5)\n+        self.pmdout.execute_cmd(\"stop\")\n+\n+    def launch_test_app(self, apps_name):\n+        print(self.tester.send_expect(\"ls\", \"#\", 5))\n+        self.tester.send_command(\"./%s -i %s -t\" % (apps_name, self.tester_iface0), \"#\")\n+        out = self.tester.get_session_output(timeout=0.1)\n+        self.verify(\"Press Enter to continue\" in out, \"Launch test app failed.\")\n+\n+    def check_time_interval_error(self, interval):\n+        out = self.tester.get_session_output(timeout=0.1)\n+        rx_ts_pat = \".*ts\\s+(\\d+)\"\n+        rx_ts = re.findall(rx_ts_pat, out, re.M)\n+        rx_ts = list(map(int, rx_ts))\n+        self.error_msgs = []\n+        intervals = []\n+        if len(rx_ts) != 32:\n+            error_msg = \"Tester should recieve 32 RX timestamps.\"\n+            self.logger.error(error_msg)\n+            self.error_msgs.append(error_msg)\n+        else:\n+            for i in range(len(rx_ts) - 1):\n+                rx = rx_ts[i + 1] - rx_ts[i]\n+                intervals.append(rx)\n+            self.logger.info(\"Rx time intervals: {}\".format(intervals))\n+            error = [abs((x - interval) / interval) * 100 for x in intervals]\n+            error = [round(x, 2) for x in error]\n+            self.logger.info(\"Rx time interval error: {}\".format(error))\n+            if all(x < 50 for x in error) == False:\n+                error_msg = \"The time interval error for Rx timestamp is too large.\"\n+                self.logger.error(error_msg)\n+                self.error_msgs.append(error_msg)\n+            else:\n+                self.logger.info(\n+                    \"max_error={}%, min_error={}%\".format(max(error), min(error))\n+                )\n+        self.verify(not self.error_msgs, \"some subcases failed\")\n+\n+    def handle_tx_timestamp_case(self, apps_name, param, intra, interval):\n+        self.launch_test_app(apps_name)\n+        self.launch_testpmd(param, intra)\n+        self.check_time_interval_error(interval)\n+        self.pmdout.execute_cmd(\"quit\", \"#\")\n+\n+    def test_with_tx_timestamp_check_time_interval(self, apps_name=\"test-timestamp\"):\n+        # Subcase 1: set txtimes intra 2000ns, check the time interval of Rx timestamp is 2000ns and measure MAX/MIN error.\n+        self.logger.info(\n+            \"===================Test subcase 1: set txtimes intra 2000ns ================\"\n+        )\n+        self.handle_tx_timestamp_case(\n+            apps_name, param=\"--tx-offloads=0x200000\", intra=2000, interval=2000\n+        )\n+\n+        # Subcase 2: set txtimes intra 1000ns, check the time interval of Rx timestamp is 1000ns and measure MAX/MIN error.\n+        self.logger.info(\n+            \"===================Test subcase 2: set txtimes intra 1000ns ================\"\n+        )\n+        self.handle_tx_timestamp_case(\n+            apps_name, param=\"--tx-offloads=0x200000\", intra=1000, interval=1000\n+        )\n+\n+        # Subcase 3: set txtimes intra 400ns, check the time interval of Rx timestamp is 400ns and measure MAX/MIN error.\n+        self.logger.info(\n+            \"===================Test subcase 3: set txtimes intra 400ns ================\"\n+        )\n+        self.handle_tx_timestamp_case(\n+            apps_name, param=\"--tx-offloads=0x200000\", intra=400, interval=400\n+        )\n+\n+        # Subcase 4: set txtimes intra 300ns, check the time interval of Rx timestamp is 300ns and measure MAX/MIN error.\n+        self.logger.info(\n+            \"===================Test subcase 4: set txtimes intra 300ns ================\"\n+        )\n+        self.handle_tx_timestamp_case(\n+            apps_name, param=\"--tx-offloads=0x200000\", intra=300, interval=300\n+        )\n+\n+        # Subcase 5: set txtimes intra 200ns, check the time interval of Rx timestamp is 300ns and measure MAX/MIN error.\n+        self.logger.info(\n+            \"===================Test subcase 5: set txtimes intra 200ns ================\"\n+        )\n+        self.handle_tx_timestamp_case(\n+            apps_name, param=\"--tx-offloads=0x200000\", intra=200, interval=300\n+        )\n+\n+    def test_without_tx_timestamp_check_time_interval(self, apps_name=\"test-timestamp\"):\n+        # Subcase 1: set txtimes intra 2000ns, check the time interval of Rx timestamp is 300ns and measure MAX/MIN error.\n+        self.logger.info(\n+            \"===================Test subcase 1: set txtimes intra 2000ns ================\"\n+        )\n+        self.handle_tx_timestamp_case(apps_name, param=\"\", intra=2000, interval=300)\n+\n+        # Subcase 2: set txtimes intra 1000ns, check the time interval of Rx timestamp is 300ns and measure MAX/MIN error.\n+        self.logger.info(\n+            \"===================Test subcase 2: set txtimes intra 1000ns ================\"\n+        )\n+        self.handle_tx_timestamp_case(apps_name, param=\"\", intra=1000, interval=300)\n+\n+        # Subcase 3: set txtimes intra 400ns, check the time interval of Rx timestamp is 300ns and measure MAX/MIN error.\n+        self.logger.info(\n+            \"===================Test subcase 3: set txtimes intra 400ns ================\"\n+        )\n+        self.handle_tx_timestamp_case(apps_name, param=\"\", intra=400, interval=300)\n+\n+    def tear_down(self):\n+        \"\"\"\n+        Run after each test case.\n+        \"\"\"\n+        # Bind the interfaces to the igc driver, then bind to the vfio-pci driver.\n+        self.pmdout.execute_cmd(\"quit\", \"#\")\n+        self.dut.bind_interfaces_linux(\"igc\")\n+        self.dut.bind_interfaces_linux(\"vfio-pci\")\n+\n+    def tear_down_all(self):\n+        \"\"\"\n+        Run after each test suite.\n+        \"\"\"\n+        self.dut.kill_all()\n",
    "prefixes": [
        "V1",
        "3/3"
    ]
}