get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 120730,
    "url": "https://patches.dpdk.org/api/patches/120730/?format=api",
    "web_url": "https://patches.dpdk.org/project/dts/patch/20221212014617.444033-3-ke1.xu@intel.com/",
    "project": {
        "id": 3,
        "url": "https://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": "<20221212014617.444033-3-ke1.xu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dts/20221212014617.444033-3-ke1.xu@intel.com",
    "date": "2022-12-12T01:46:15",
    "name": "[V2,2/4] tests/vf_offload: add vf checksum hw offload case for tunneling packets.",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "cf67d8f3b6183aa52ce1dc7e92e0dbd413fe4246",
    "submitter": {
        "id": 2810,
        "url": "https://patches.dpdk.org/api/people/2810/?format=api",
        "name": "Ke Xu",
        "email": "ke1.xu@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dts/patch/20221212014617.444033-3-ke1.xu@intel.com/mbox/",
    "series": [
        {
            "id": 26071,
            "url": "https://patches.dpdk.org/api/series/26071/?format=api",
            "web_url": "https://patches.dpdk.org/project/dts/list/?series=26071",
            "date": "2022-12-12T01:46:13",
            "name": "add vf checksum offload and tso case for tunnel packets.",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/26071/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/120730/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/120730/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 D1941A04FD;\n\tMon, 12 Dec 2022 02:47:45 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C988040687;\n\tMon, 12 Dec 2022 02:47:45 +0100 (CET)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by mails.dpdk.org (Postfix) with ESMTP id 2F96542BD9\n for <dts@dpdk.org>; Mon, 12 Dec 2022 02:47:43 +0100 (CET)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 11 Dec 2022 17:47:42 -0800",
            "from dpdk-xuke-lab.sh.intel.com ([10.67.119.8])\n by fmsmga002.fm.intel.com with ESMTP; 11 Dec 2022 17:47:40 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1670809663; x=1702345663;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=XuoYad/z4YyIelZVnd4k1DUWDMJGlKWluwOVkerX2Fg=;\n b=W8G+fHJj5sexvAlAlIMsbuN7i0PIajkGIRV3b6aCA5Em9w18/CkWKEyp\n pX/GginP6Y8hwpKFnQwNu6Ee572KaxZ/hVpYsbnfZkjYpQDJPf0iMijLU\n ubsOowYCcUfperRzQUDa+AjNVU/5M0RPNVi29hRTO/KqL27xtRrKMEpZz\n qRnyKUhbXCMBvzdbFbsOx3+H1G4Bfwy8DlIFE6+KwsZhgEIhshypCpAed\n bIGVjay+90KewQSTuYW+DX1MVRwo57/A40/ixLUTy/a3pCuuUYXd/VPsp\n TKhUWYXuW/tpz/SeDrezKLrRj9+ExYV376Dkf6FQX82nNlSH+mz+P5+Rt g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10558\"; a=\"301168463\"",
            "E=Sophos;i=\"5.96,237,1665471600\"; d=\"scan'208\";a=\"301168463\"",
            "E=McAfee;i=\"6500,9779,10558\"; a=\"754754326\"",
            "E=Sophos;i=\"5.96,237,1665471600\"; d=\"scan'208\";a=\"754754326\""
        ],
        "X-ExtLoop1": "1",
        "From": "Ke Xu <ke1.xu@intel.com>",
        "To": "dts@dpdk.org",
        "Cc": "ke1.xu@intel.com, weiyuanx.li@intel.com, lijuan.tu@intel.com,\n qi.fu@intel.com",
        "Subject": "[DTS][PATCH V2 2/4] tests/vf_offload: add vf checksum hw offload case\n for tunneling packets.",
        "Date": "Mon, 12 Dec 2022 09:46:15 +0800",
        "Message-Id": "<20221212014617.444033-3-ke1.xu@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20221212014617.444033-1-ke1.xu@intel.com>",
        "References": "<20221212014617.444033-1-ke1.xu@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": "In DPDK 22.11, tunneling packets checksum offload for inner and outer checksum is supported.\n This case supporting validation these packets.\n\nSigned-off-by: Weiyuan Li <weiyuanx.li@intel.com>\nSigned-off-by: Ke Xu <ke1.xu@intel.com>\n---\n tests/TestSuite_vf_offload.py | 217 +++++++++++++++++++++++++++++++++-\n 1 file changed, 215 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/tests/TestSuite_vf_offload.py b/tests/TestSuite_vf_offload.py\nindex c7f618e3..4a32084c 100644\n--- a/tests/TestSuite_vf_offload.py\n+++ b/tests/TestSuite_vf_offload.py\n@@ -1,5 +1,5 @@\n # SPDX-License-Identifier: BSD-3-Clause\n-# Copyright(c) 2020 Intel Corporation\n+# Copyright(c) 2020-2022 Intel Corporation\n #\n \n import re\n@@ -10,7 +10,7 @@ import framework.utils as utils\n from framework.crb import Crb\n from framework.pmd_output import PmdOutput\n from framework.settings import DPDK_DCFMODE_SETTING, HEADER_SIZE, load_global_setting\n-from framework.test_case import TestCase\n+from framework.test_case import TestCase, check_supported_nic, skip_unsupported_pkg\n from framework.utils import GREEN, RED\n from framework.virt_common import VM\n from nics.net_device import NetDevice\n@@ -196,6 +196,18 @@ class TestVfOffload(TestCase):\n         dut.send_expect(\"csum set sctp hw %d\" % port, \"testpmd>\")\n         dut.send_expect(\"port start all\", \"testpmd>\")\n \n+    def checksum_enablehw_tunnel(self, port, dut):\n+        dut.send_expect(\"port stop %d\" % port, \"testpmd>\")\n+        dut.send_expect(\"csum set ip hw %d\" % port, \"testpmd>\")\n+        dut.send_expect(\"csum set udp hw %d\" % port, \"testpmd>\")\n+        dut.send_expect(\"csum set tcp hw %d\" % port, \"testpmd>\")\n+        dut.send_expect(\"csum set sctp hw %d\" % port, \"testpmd>\")\n+        dut.send_expect(\"csum set outer-ip hw %d\" % port, \"testpmd>\")\n+        dut.send_expect(\"csum set outer-udp hw %d\" % port, \"testpmd>\")\n+        dut.send_expect(\"csum parse-tunnel on %d\" % port, \"testpmd>\")\n+        dut.send_expect(\"rx_vxlan_port add 4789 %d\" % port, \"testpmd>\")\n+        dut.send_expect(\"port start %d\" % port, \"testpmd>\")\n+\n     def checksum_enablesw(self, port, dut):\n         dut.send_expect(\"port stop all\", \"testpmd>\")\n         dut.send_expect(\"csum set ip sw %d\" % port, \"testpmd>\")\n@@ -365,6 +377,207 @@ class TestVfOffload(TestCase):\n \n         self.verify(len(result) == 0, \",\".join(list(result.values())))\n \n+    def checksum_validate_tunnel(self, packets_sent, packets_expected):\n+        \"\"\"\n+        Validate the checksum.\n+        \"\"\"\n+        tx_interface = self.tester.get_interface(\n+            self.tester.get_local_port(self.dut_ports[0])\n+        )\n+        rx_interface = self.tester.get_interface(\n+            self.tester.get_local_port(self.dut_ports[1])\n+        )\n+        sniff_src = self.vm0_testpmd.get_port_mac(0)\n+        checksum_pattern = re.compile(\"chksum.*=.*(0x[0-9a-z]+)\")\n+        sniff_src = \"52:00:00:00:00:00\"\n+        chksum = dict()\n+        # self.tester.send_expect(\"scapy\", \">>> \")\n+\n+        for packet_type in list(packets_expected.keys()):\n+            self.tester.send_expect(\"scapy\", \">>> \")\n+            self.tester.send_expect(\"p = %s\" % packets_expected[packet_type], \">>>\")\n+            out = self.tester.send_expect(\"p.show2()\", \">>>\")\n+            import pdb\n+\n+            pdb.set_trace()\n+            chksums = checksum_pattern.findall(out)\n+            expected_chksum = chksums\n+            chksum[packet_type] = chksums\n+            print(packet_type, \": \", chksums)\n+\n+            self.tester.send_expect(\"exit()\", \"#\")\n+\n+            self.tester.scapy_background()\n+            inst = self.tester.tcpdump_sniff_packets(\n+                intf=rx_interface,\n+                count=len(packets_sent),\n+                filters=[{\"layer\": \"ether\", \"config\": {\"src\": sniff_src}}],\n+            )\n+\n+            # Send packet.\n+            self.tester.scapy_foreground()\n+\n+            self.tester.scapy_append(\n+                'sendp([%s], iface=\"%s\")' % (packets_sent[packet_type], tx_interface)\n+            )\n+            self.tester.scapy_execute()\n+            out = self.tester.scapy_get_result()\n+            p = self.tester.load_tcpdump_sniff_packets(inst)\n+            nr_packets = len(p)\n+            print(p)\n+            packets_received = [\n+                p[i].sprintf(\n+                    \"%IP.chksum%;%UDP.chksum%;%IP:2.chksum%;%UDP:2.chksum%;%TCP.chksum%;%SCTP.chksum%\"\n+                )\n+                for i in range(nr_packets)\n+            ]\n+\n+            packets_received = [\n+                item\n+                for item in packets_received[0].replace(\"??\", \"\").split(\";\")\n+                if item != \"\"\n+            ]\n+            self.logger.debug(f\"packets_received=>{packets_received}\")\n+            self.logger.debug(f\"expected_chksum=>{expected_chksum}\")\n+            self.verify(\n+                len(expected_chksum) == len(packets_received),\n+                f\"The chksum type {packet_type} length of the actual result is inconsistent with the expected length!\",\n+            )\n+            self.verify(\n+                packets_received == expected_chksum,\n+                f\"The actually received chksum {packet_type} is inconsistent with the expectation\",\n+            )\n+\n+    @skip_unsupported_pkg([\"os default\"])\n+    @check_supported_nic(\n+        [\"ICE_100G-E810C_QSFP\", \"ICE_25G-E810C_SFP\", \"ICE_25G-E810_XXV_SFP\"]\n+    )\n+    def test_checksum_offload_tunnel_enable(self):\n+        \"\"\"\n+        Enable HW checksum offload.\n+        Send packet with inner and outer incorrect checksum,\n+        can rx it and report the checksum error,\n+        verify forwarded packets have correct checksum.\n+        \"\"\"\n+        self.launch_testpmd(\n+            dcf_flag=self.dcf_mode,\n+            param=\"--portmask=%s \" % (self.portMask) + \"--enable-rx-cksum \" + \"\",\n+        )\n+        self.vm0_testpmd.execute_cmd(\"set fwd csum\")\n+        self.vm0_testpmd.execute_cmd(\"set promisc 1 on\")\n+        self.vm0_testpmd.execute_cmd(\"set promisc 0 on\")\n+        self.vm0_testpmd.execute_cmd(\"csum mac-swap off 0\", \"testpmd>\")\n+        self.vm0_testpmd.execute_cmd(\"csum mac-swap off 1\", \"testpmd>\")\n+        time.sleep(2)\n+        port_id_0 = 0\n+        mac = self.vm0_testpmd.get_port_mac(0)\n+        sndIP = \"10.0.0.1\"\n+        sndIPv6 = \"::1\"\n+        expIP = sndIP\n+        expIPv6 = sndIPv6\n+\n+        pkts_outer = {\n+            \"IP/UDP/VXLAN-GPE\": f'IP(src = \"{sndIP}\") / UDP(sport = 4790, dport = 4790, chksum = 0xff) / VXLAN()',\n+            \"IP/UDP/VXLAN-GPE/ETH\": f'IP(src = \"{sndIP}\") / UDP(sport = 4790, dport = 4790, chksum = 0xff) / VXLAN() / Ether()',\n+            \"IPv6/UDP/VXLAN-GPE\": f'IPv6(src = \"{sndIPv6}\") / UDP(sport = 4790, dport = 4790, chksum = 0xff) / VXLAN()',\n+            \"IPv6/UDP/VXLAN-GPE/ETH\": f'IPv6(src = \"{sndIPv6}\") / UDP(sport = 4790, dport = 4790, chksum = 0xff) / VXLAN() / Ether()',\n+            \"IP/GRE\": f'IP(src = \"{sndIP}\", proto = 47, chksum = 0xff) / GRE()',\n+            \"IP/GRE/ETH\": f'IP(src = \"{sndIP}\", proto = 47, chksum = 0xff) / GRE() / Ether()',\n+            \"IP/NVGRE/ETH\": f'IP(src = \"{sndIP}\", proto = 47, chksum = 0xff) / GRE(key_present=1, proto=0x6558, key=0x00000100) / Ether()',\n+            \"IPv6/GRE\": f'IPv6(src = \"{sndIPv6}\", nh = 47) / GRE()',\n+            \"IPv6/GRE/ETH\": f'IPv6(src = \"{sndIPv6}\", nh = 47) / GRE() / Ether()',\n+            \"IPv6/NVGRE/ETH\": f'IPv6(src = \"{sndIPv6}\", nh = 47) / GRE(key_present=1, proto=0x6558, key=0x00000100) / Ether()',\n+            \"IP/UDP/GTPU\": f'IP(src = \"{sndIP}\", chksum = 0xff) / UDP(dport = 2152, chksum = 0xff) / GTP_U_Header(gtp_type=255, teid=0x123456)',\n+            \"IPv6/UDP/GTPU\": f'IPv6(src = \"{sndIPv6}\") / UDP(dport = 2152, chksum = 0xff) / GTP_U_Header(gtp_type=255, teid=0x123456)',\n+        }\n+        pkts_inner = {\n+            \"IP/UDP\": f'IP(src = \"{sndIP}\", chksum = 0xff) / UDP(sport = 29999, dport = 30000, chksum = 0xff) / Raw(\"x\" * 100)',\n+            \"IP/TCP\": f'IP(src = \"{sndIP}\", chksum = 0xff) / TCP(sport = 29999, dport = 30000, chksum = 0xff) / Raw(\"x\" * 100)',\n+            \"IP/SCTP\": f'IP(src = \"{sndIP}\", chksum = 0xff) / SCTP(sport = 29999, dport = 30000, chksum = 0xff) / Raw(\"x\" * 128)',\n+            \"IPv6/UDP\": f'IPv6(src = \"{sndIPv6}\") / UDP(sport = 29999, dport = 30000, chksum = 0xff) / Raw(\"x\" * 100)',\n+            \"IPv6/TCP\": f'IPv6(src = \"{sndIPv6}\") / TCP(sport = 29999, dport = 30000, chksum = 0xff) / Raw(\"x\" * 100)',\n+            \"IPv6/SCTP\": f'IPv6(src = \"{sndIPv6}\") / SCTP(sport = 29999, dport = 30000, chksum = 0xff) / Raw(\"x\" * 128)',\n+        }\n+\n+        if self.dcf_mode == \"enable\":\n+            pkts_outer[\n+                \"IP/UDP/VXLAN/ETH\"\n+            ] = f'IP(src = \"{sndIP}\") / UDP(sport = 4789, dport = 4789, chksum = 0xff) / VXLAN() / Ether()'\n+            pkts_outer[\n+                \"IPv6/UDP/VXLAN/ETH\"\n+            ] = f'IPv6(src = \"{sndIPv6}\") / UDP(sport = 4789, dport = 4789, chksum = 0xff) / VXLAN() / Ether()'\n+\n+        pkts = {\n+            key_outer\n+            + \"/\"\n+            + key_inner: f'Ether(dst=\"{mac}\", src=\"52:00:00:00:00:00\") / '\n+            + p_outer\n+            + \" / \"\n+            + p_inner\n+            for key_outer, p_outer in pkts_outer.items()\n+            for key_inner, p_inner in pkts_inner.items()\n+        }\n+\n+        pkts_outer_ref = {\n+            \"IP/UDP/VXLAN-GPE\": f'IP(src = \"{expIP}\") / UDP(sport = 4790, dport = 4790) / VXLAN()',\n+            \"IP/UDP/VXLAN-GPE/ETH\": f'IP(src = \"{expIP}\") / UDP(sport = 4790, dport = 4790) / VXLAN() / Ether()',\n+            \"IPv6/UDP/VXLAN-GPE\": f'IPv6(src = \"{expIPv6}\") / UDP(sport = 4790, dport = 4790) / VXLAN()',\n+            \"IPv6/UDP/VXLAN-GPE/ETH\": f'IPv6(src = \"{expIPv6}\") / UDP(sport = 4790, dport = 4790) / VXLAN() / Ether()',\n+            \"IP/GRE\": f'IP(src = \"{expIP}\", proto = 47) / GRE()',\n+            \"IP/GRE/ETH\": f'IP(src = \"{expIP}\", proto = 47) / GRE() / Ether()',\n+            \"IP/NVGRE/ETH\": f'IP(src = \"{expIP}\", proto = 47) / GRE(key_present=1, proto=0x6558, key=0x00000100) / Ether()',\n+            \"IPv6/GRE\": f'IPv6(src = \"{expIPv6}\", nh = 47) / GRE()',\n+            \"IPv6/GRE/ETH\": f'IPv6(src = \"{expIPv6}\", nh = 47) / GRE() / Ether()',\n+            \"IPv6/NVGRE/ETH\": f'IPv6(src = \"{expIPv6}\", nh = 47) / GRE(key_present=1, proto=0x6558, key=0x00000100) / Ether()',\n+            \"IP/UDP/GTPU\": f'IP(src = \"{expIP}\") / UDP(dport = 2152) / GTP_U_Header(gtp_type=255, teid=0x123456)',\n+            \"IPv6/UDP/GTPU\": f'IPv6(src = \"{expIPv6}\") / UDP(dport = 2152) / GTP_U_Header(gtp_type=255, teid=0x123456)',\n+        }\n+        pkts_inner_ref = {\n+            \"IP/UDP\": f'IP(src = \"{expIP}\") / UDP(sport = 29999, dport = 30000) / Raw(\"x\" * 100)',\n+            \"IP/TCP\": f'IP(src = \"{expIP}\") / TCP(sport = 29999, dport = 30000) / Raw(\"x\" * 100)',\n+            \"IP/SCTP\": f'IP(src = \"{expIP}\") / SCTP(sport = 29999, dport = 30000) / Raw(\"x\" * 128)',\n+            \"IPv6/UDP\": f'IPv6(src = \"{expIPv6}\") / UDP(sport = 29999, dport = 30000) / Raw(\"x\" * 100)',\n+            \"IPv6/TCP\": f'IPv6(src = \"{expIPv6}\") / TCP(sport = 29999, dport = 30000) / Raw(\"x\" * 100)',\n+            \"IPv6/SCTP\": f'IPv6(src = \"{expIPv6}\") / SCTP(sport = 29999, dport = 30000) / Raw(\"x\" * 128)',\n+        }\n+\n+        if self.dcf_mode == \"enable\":\n+            pkts_outer_ref[\n+                \"IP/UDP/VXLAN/ETH\"\n+            ] = f'IP(src = \"{sndIP}\") / UDP(sport = 4789, dport = 4789) / VXLAN() / Ether()'\n+            pkts_outer_ref[\n+                \"IPv6/UDP/VXLAN/ETH\"\n+            ] = f'IPv6(src = \"{sndIPv6}\") / UDP(sport = 4789, dport = 4789) / VXLAN() / Ether()'\n+\n+        pkts_ref = {\n+            key_outer\n+            + \"/\"\n+            + key_inner: f'Ether(dst=\"{mac}\", src=\"52:00:00:00:00:00\") / '\n+            + p_outer\n+            + \" / \"\n+            + p_inner\n+            for key_outer, p_outer in pkts_outer_ref.items()\n+            for key_inner, p_inner in pkts_inner_ref.items()\n+        }\n+\n+        self.checksum_enablehw_tunnel(0, self.vm_dut_0)\n+        self.checksum_enablehw_tunnel(1, self.vm_dut_0)\n+\n+        self.vm0_testpmd.execute_cmd(\"start\")\n+        self.vm0_testpmd.wait_link_status_up(0)\n+        self.vm0_testpmd.wait_link_status_up(1)\n+        self.checksum_validate_tunnel(pkts, pkts_ref)\n+        # Validate checksum on the receive packet\n+        out = self.vm0_testpmd.execute_cmd(\"stop\")\n+        bad_outer_ipcsum = self.vm0_testpmd.get_pmd_value(\"Bad-outer-ipcsum:\", out)\n+        bad_outer_l4csum = self.vm0_testpmd.get_pmd_value(\"Bad-outer-l4csum:\", out)\n+        bad_inner_ipcsum = self.vm0_testpmd.get_pmd_value(\"Bad-ipcsum:\", out)\n+        bad_inner_l4csum = self.vm0_testpmd.get_pmd_value(\"Bad-l4csum:\", out)\n+        self.verify(bad_outer_ipcsum == 42, \"Bad-outer-ipcsum check error\")\n+        self.verify(bad_outer_l4csum == 66, \"Bad-outer-l4csum check error\")\n+        self.verify(bad_inner_ipcsum == 42, \"Bad-ipcsum check error\")\n+        self.verify(bad_inner_l4csum == 84, \"Bad-l4csum check error\")\n+\n     def test_checksum_offload_disable(self):\n         \"\"\"\n         Enable SW checksum offload.\n",
    "prefixes": [
        "V2",
        "2/4"
    ]
}