Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/120688/?format=api
https://patches.dpdk.org/api/patches/120688/?format=api", "web_url": "https://patches.dpdk.org/project/dts/patch/20221209070807.1134-3-linglix.chen@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": "<20221209070807.1134-3-linglix.chen@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dts/20221209070807.1134-3-linglix.chen@intel.com", "date": "2022-12-09T07:08:04", "name": "[V2,2/5] tests/generic_flow_api: add pf action subcase", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "4e96e123ac1ab88941861d53544ad8d33a06d324", "submitter": { "id": 1843, "url": "https://patches.dpdk.org/api/people/1843/?format=api", "name": "Lingli Chen", "email": "linglix.chen@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dts/patch/20221209070807.1134-3-linglix.chen@intel.com/mbox/", "series": [ { "id": 26057, "url": "https://patches.dpdk.org/api/series/26057/?format=api", "web_url": "https://patches.dpdk.org/project/dts/list/?series=26057", "date": "2022-12-09T07:08:02", "name": "use decorator to skip igb_uio cases", "version": 2, "mbox": "https://patches.dpdk.org/series/26057/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/120688/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/120688/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 06812A0093;\n\tFri, 9 Dec 2022 09:05:01 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 00FAF42D23;\n\tFri, 9 Dec 2022 09:05:01 +0100 (CET)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by mails.dpdk.org (Postfix) with ESMTP id 71FFF40E0F\n for <dts@dpdk.org>; Fri, 9 Dec 2022 09:04:58 +0100 (CET)", "from orsmga008.jf.intel.com ([10.7.209.65])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Dec 2022 00:04:58 -0800", "from unknown (HELO localhost.localdomain) ([10.239.252.99])\n by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Dec 2022 00:04:56 -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=1670573098; x=1702109098;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=nw+IXKao+2VhsO5FlAPpl4dyQsNkCISvnP1eHkG6JNw=;\n b=MnDsCro6uf5bUebSm7JKYJhrSqw32eN13InpINbD0sltawY/ZLS2ajiU\n eFhuLtmdrZLiEF80vb7wc921Ig3P2F31g2vDIpafCTv8jiotV++sv4RDH\n 4y6CaKtkl7r34v6+paWQ52uuMX/eUrBoa5TyH1KWYISVzBDCdFIq/VzJF\n d4/FqRyjJuVU2SmFRCJkNBDvA3HNM3Bta+7S12vhK+1yQoxo2TaD7qDTW\n qWwgisw093PDsGI7U4u87YzAW7RrdKstYGPEdyUNZTycH8dhQc1yjEO3r\n 0Q9cgiiLomNbfxkoI1h3wgA/BgqnyLEIgS1gVBz7XBc/axmdu5sntrNd/ g==;", "X-IronPort-AV": [ "E=McAfee;i=\"6500,9779,10555\"; a=\"305051965\"", "E=Sophos;i=\"5.96,230,1665471600\"; d=\"scan'208\";a=\"305051965\"", "E=McAfee;i=\"6500,9779,10555\"; a=\"678074577\"", "E=Sophos;i=\"5.96,230,1665471600\"; d=\"scan'208\";a=\"678074577\"" ], "From": "Lingli Chen <linglix.chen@intel.com>", "To": "dts@dpdk.org", "Cc": "zhiminx.huang@intel.com,\n\tLingli Chen <linglix.chen@intel.com>", "Subject": "[dts][PATCH V2 2/5] tests/generic_flow_api: add pf action subcase", "Date": "Fri, 9 Dec 2022 02:08:04 -0500", "Message-Id": "<20221209070807.1134-3-linglix.chen@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20221209070807.1134-1-linglix.chen@intel.com>", "References": "<20221209070807.1134-1-linglix.chen@intel.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=y", "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": "1. According to dpdk commit 5007ac1318 (ethdev: remove deprecated Flow Director configuration)\n remove --pkt-filter-mode.\n2. This commit also removed '--pkt-filter-report-hash', so test_fdir_for_match_report no need test on NNT.\n3. add 5 pf action subcase (bind the pf to vfio-pci).\n4. According to dpdk commit 5c45fde3e9 (ethdev: remove deprecated flow item VF)\n remove fdir_wrong_parameters case create vf rule part.\n\nSigned-off-by: Lingli Chen <linglix.chen@intel.com>\n---\nV2: modify case name xxx_PF_vfio/xxxx_PF_igb_uio\n\n tests/TestSuite_generic_flow_api.py | 1167 ++++++++++++++++++++-------\n 1 file changed, 883 insertions(+), 284 deletions(-)", "diff": "diff --git a/tests/TestSuite_generic_flow_api.py b/tests/TestSuite_generic_flow_api.py\nindex 417131f2..84fa9ccf 100644\n--- a/tests/TestSuite_generic_flow_api.py\n+++ b/tests/TestSuite_generic_flow_api.py\n@@ -25,7 +25,11 @@ from framework.exception import VerifyFailure\n from framework.pmd_output import PmdOutput\n from framework.project_dpdk import DPDKdut\n from framework.settings import DRIVERS, HEADER_SIZE\n-from framework.test_case import TestCase, check_supported_nic\n+from framework.test_case import (\n+ TestCase,\n+ check_supported_nic,\n+ skip_unsupported_host_driver,\n+)\n from framework.virt_dut import VirtDut\n \n MAX_VLAN = 4095\n@@ -222,41 +226,6 @@ class TestGeneric_flow_api(TestCase):\n self.session_third.send_expect(\"start\", \"testpmd> \")\n return out_pf\n \n- def launch_start_testpmd(\n- self,\n- queue=\"\",\n- pkt_filter_mode=\"\",\n- report_hash=\"\",\n- disable_rss=False,\n- fwd=\"\",\n- verbose=\"\",\n- ):\n- \"\"\"\n- Launch and start testpmd\n- \"\"\"\n- param = \"\"\n- eal_param = \"\"\n- if queue:\n- param += \"--rxq={} --txq={} \".format(queue, queue)\n- if pkt_filter_mode:\n- param += \"--pkt-filter-mode={} \".format(pkt_filter_mode)\n- if disable_rss:\n- param += \"--disable-rss \"\n- if report_hash:\n- param += \"--pkt-filter-report-hash={} \".format(report_hash)\n- self.pmdout.start_testpmd(\n- \"{}\".format(self.cores), param=param, eal_param=eal_param\n- )\n- if fwd:\n- self.pmdout.execute_cmd(\n- \"set fwd rxonly\",\n- )\n- if verbose:\n- self.pmdout.execute_cmd(\"set verbose 1\")\n- self.pmdout.execute_cmd(\"start\")\n- self.pmdout.execute_cmd(\"show port info all\")\n- self.pmdout.wait_link_status_up(self.dut_ports[0])\n-\n def compare_memory_rules(self, expectedRules):\n \"\"\"\n dump all flow rules that have been created in memory and compare that total rules number with the given expected number\n@@ -2043,7 +2012,249 @@ class TestGeneric_flow_api(TestCase):\n \"Invalid\",\n )\n \n- def test_fdir_for_vlan(self):\n+ support_nic = [\n+ \"I40E_10G-SFP_XL710\",\n+ \"I40E_25G-25G_SFP28\",\n+ \"I40E_40G-QSFP_A\",\n+ \"I40E_10G-10G_BASE_T_BC\",\n+ \"I40E_40G-QSFP_B\",\n+ \"I40E_10G-SFP_X722\",\n+ \"I40E_10G-10G_BASE_T_X722\",\n+ ]\n+\n+ @check_supported_nic(support_nic)\n+ def test_fdir_for_vlan_PF_vfio(self):\n+ \"\"\"\n+ only supported by i40e\n+ \"\"\"\n+ # start testpmd on pf\n+ self.pmdout.start_testpmd(\n+ \"%s\" % self.pf_cores,\n+ \"--disable-rss --rxq=%d --txq=%d\" % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n+ \"-a %s --file-prefix=pf --socket-mem 1024,1024 --legacy-mem\" % self.pf_pci,\n+ )\n+ self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \", 120)\n+ self.dut.send_expect(\"set verbose 1\", \"testpmd> \", 120)\n+ self.dut.send_expect(\"start\", \"testpmd> \", 120)\n+ time.sleep(2)\n+ # Get the firmware version information\n+ try:\n+ fwversion, _, _ = self.pmdout.get_firmware_version(\n+ self.dut_ports[0]\n+ ).split()\n+ except ValueError:\n+ # nic IXGBE, IGC\n+ fwversion = self.pmdout.get_firmware_version(self.dut_ports[0]).split()\n+ # Because the kernel forces enable Qinq and cannot be closed,\n+ # the dpdk can only add 'extend on' to make the single VLAN filter work normally.\n+ if self.kdriver == \"i40e\" and fwversion >= \"8.40\":\n+ self.dut.send_expect(\"vlan set extend on 0\", \"testpmd> \")\n+ self.dut.send_expect(\"show port info all\", \"testpmd> \", 120)\n+\n+ # create the flow rules\n+ basic_flow_actions = [\n+ {\"create\": \"create\", \"flows\": [\"vlan\", \"ipv4\"], \"actions\": [\"queue\"]},\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"vlan\", \"ipv4\", \"udp\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"vlan\", \"ipv4\", \"tcp\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"vlan\", \"ipv4\", \"sctp\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"vlan\", \"ipv4\", \"sctp\"],\n+ \"actions\": [\"drop\"],\n+ },\n+ {\"create\": \"create\", \"flows\": [\"vlan\", \"ipv6\"], \"actions\": [\"queue\"]},\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"vlan\", \"ipv6\", \"udp\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"vlan\", \"ipv6\", \"tcp\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"vlan\", \"ipv6\", \"sctp\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"vlan\", \"ipv6\", \"sctp\"],\n+ \"actions\": [\"drop\"],\n+ },\n+ {\"create\": \"validate\", \"flows\": [\"vlan\", \"ipv4\"], \"actions\": [\"queue\"]},\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"vlan\", \"ipv4\", \"udp\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"vlan\", \"ipv4\", \"tcp\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"vlan\", \"ipv4\", \"sctp\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"vlan\", \"ipv4\", \"sctp\"],\n+ \"actions\": [\"drop\"],\n+ },\n+ {\"create\": \"validate\", \"flows\": [\"vlan\", \"ipv6\"], \"actions\": [\"queue\"]},\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"vlan\", \"ipv6\", \"udp\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"vlan\", \"ipv6\", \"tcp\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"vlan\", \"ipv6\", \"sctp\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"vlan\", \"ipv6\", \"sctp\"],\n+ \"actions\": [\"drop\"],\n+ },\n+ ]\n+ extrapkt_rulenum = self.all_flows_process(basic_flow_actions)\n+ extra_packet = extrapkt_rulenum[\"extrapacket\"]\n+ # send the packets with dst/src ip and dst/src port.\n+ self.sendpkt(\n+ pktstr='Ether(dst=\"%s\")/Dot1Q(vlan=%s)/IP(src=\"192.168.0.1\", dst=\"192.168.0.2\", proto=3)/Raw(\"x\" * 20)'\n+ % (self.pf_mac, extra_packet[0][\"vlan\"])\n+ )\n+ self.verify_result(\n+ \"pf\",\n+ expect_rxpkts=\"1\",\n+ expect_queue=extrapkt_rulenum[\"queue\"][0],\n+ verify_mac=self.pf_mac,\n+ )\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/Dot1Q(vlan=%s)/IP(src=\"192.168.0.1\", dst=\"192.168.0.2\", tos=3)/UDP()/Raw(\"x\" * 20)'\n+ % (self.pf_mac, extra_packet[1][\"vlan\"])\n+ )\n+ self.verify_result(\n+ \"pf\",\n+ expect_rxpkts=\"1\",\n+ expect_queue=extrapkt_rulenum[\"queue\"][1],\n+ verify_mac=self.pf_mac,\n+ )\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/Dot1Q(vlan=%s)/IP(src=\"192.168.0.1\", dst=\"192.168.0.2\", ttl=3)/TCP()/Raw(\"x\" * 20)'\n+ % (self.pf_mac, extra_packet[2][\"vlan\"])\n+ )\n+ self.verify_result(\n+ \"pf\",\n+ expect_rxpkts=\"1\",\n+ expect_queue=extrapkt_rulenum[\"queue\"][2],\n+ verify_mac=self.pf_mac,\n+ )\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/Dot1Q(vlan=%s)/IP(src=\"192.168.0.1\", dst=\"192.168.0.2\", tos=3, ttl=3)/SCTP()/Raw(\"x\" * 20)'\n+ % (self.pf_mac, extra_packet[3][\"vlan\"])\n+ )\n+ self.verify_result(\n+ \"pf\",\n+ expect_rxpkts=\"1\",\n+ expect_queue=extrapkt_rulenum[\"queue\"][3],\n+ verify_mac=self.pf_mac,\n+ )\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/Dot1Q(vlan=%s)/IP(src=\"192.168.0.1\", dst=\"192.168.0.2\", ttl=3)/TCP()/Raw(\"x\" * 20)'\n+ % (self.pf_mac, extra_packet[3][\"vlan\"])\n+ )\n+ self.verify_result(\n+ \"pf\", expect_rxpkts=\"1\", expect_queue=\"0\", verify_mac=self.pf_mac\n+ )\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/Dot1Q(vlan=%s)/IP()/UDP()/Raw(\"x\" * 20)'\n+ % (self.pf_mac, extra_packet[2][\"vlan\"])\n+ )\n+ self.verify_result(\n+ \"pf\", expect_rxpkts=\"1\", expect_queue=\"0\", verify_mac=self.pf_mac\n+ )\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/Dot1Q(vlan=%s)/IP(src=\"192.168.0.5\", dst=\"192.168.0.6\", tos=3, ttl=3)/SCTP(sport=44,dport=45,tag=1)/Raw(\"x\" * 20)'\n+ % (self.pf_mac, extra_packet[4][\"vlan\"])\n+ )\n+ self.verify_result(\n+ \"pf\", expect_rxpkts=\"0\", expect_queue=\"NULL\", verify_mac=self.pf_mac\n+ )\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/Dot1Q(vlan=%s)/IPv6(src=\"2001::1\", dst=\"2001::2\", tc=1, nh=5, hlim=10)/Raw(\"x\" * 20)'\n+ % (self.pf_mac, extra_packet[5][\"vlan\"])\n+ )\n+ self.verify_result(\n+ \"pf\",\n+ expect_rxpkts=\"1\",\n+ expect_queue=extrapkt_rulenum[\"queue\"][5],\n+ verify_mac=self.pf_mac,\n+ )\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/Dot1Q(vlan=%s)/IPv6(src=\"2001::1\", dst=\"2001::2\", tc=2, hlim=20)/UDP(sport=22,dport=23)/Raw(\"x\" * 20)'\n+ % (self.pf_mac, extra_packet[6][\"vlan\"])\n+ )\n+ self.verify_result(\n+ \"pf\",\n+ expect_rxpkts=\"1\",\n+ expect_queue=extrapkt_rulenum[\"queue\"][6],\n+ verify_mac=self.pf_mac,\n+ )\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/Dot1Q(vlan=%s)/IPv6(src=\"2001::1\", dst=\"2001::2\", tc=2, hlim=20)/TCP(sport=32,dport=33)/Raw(\"x\" * 20)'\n+ % (self.pf_mac, extra_packet[7][\"vlan\"])\n+ )\n+ self.verify_result(\n+ \"pf\",\n+ expect_rxpkts=\"1\",\n+ expect_queue=extrapkt_rulenum[\"queue\"][7],\n+ verify_mac=self.pf_mac,\n+ )\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/Dot1Q(vlan=%s)/IPv6(src=\"2001::1\", dst=\"2001::2\", tc=4, nh=132, hlim=40)/SCTP(sport=44,dport=45,tag=1)/SCTPChunkData(data=\"X\" * 20)'\n+ % (self.pf_mac, extra_packet[8][\"vlan\"])\n+ )\n+ self.verify_result(\n+ \"pf\",\n+ expect_rxpkts=\"1\",\n+ expect_queue=extrapkt_rulenum[\"queue\"][8],\n+ verify_mac=self.pf_mac,\n+ )\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/Dot1Q(vlan=%s)/IPv6(src=\"2001::1\", dst=\"2001::2\", tc=4, nh=132, hlim=40)/SCTP(sport=44,dport=45,tag=1)/SCTPChunkData(data=\"X\" * 20)'\n+ % (self.pf_mac, extra_packet[9][\"vlan\"])\n+ )\n+ self.verify_result(\n+ \"pf\", expect_rxpkts=\"0\", expect_queue=\"NULL\", verify_mac=self.pf_mac\n+ )\n+\n+ rule_num = extrapkt_rulenum[\"rulenum\"]\n+ self.verify_rulenum(rule_num)\n+\n+ @skip_unsupported_host_driver([\"vfio-pci\"])\n+ def test_fdir_for_vlan_PF_igb_uio(self):\n \"\"\"\n only supported by i40e\n \"\"\"\n@@ -2373,9 +2584,10 @@ class TestGeneric_flow_api(TestCase):\n rule_num = extrapkt_rulenum[\"rulenum\"]\n self.verify_rulenum(rule_num)\n \n- def test_fdir_for_ipv4(self):\n+ @skip_unsupported_host_driver([\"vfio-pci\"])\n+ def test_fdir_for_ipv4_PF_igb_uio(self):\n \"\"\"\n- only supported by i40e and ixgbe\n+ only supported by i40e\n \"\"\"\n self.verify(\n self.nic\n@@ -2671,32 +2883,243 @@ class TestGeneric_flow_api(TestCase):\n rule_num = extrapkt_rulenum[\"rulenum\"]\n self.verify_rulenum(rule_num)\n \n- # ixgbe\n- else:\n- self.pmdout.start_testpmd(\n- \"%s\" % self.cores,\n- \"--pkt-filter-mode=perfect --disable-rss --rxq=%d --txq=%d\"\n- % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n- )\n- self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \", 120)\n- self.dut.send_expect(\"set verbose 1\", \"testpmd> \", 120)\n- self.dut.send_expect(\"start\", \"testpmd> \", 120)\n- time.sleep(2)\n-\n- if self.nic in [\"IXGBE_10G-X550EM_X_10G_T\", \"IXGBE_10G-X550T\"]:\n- # create the flow rules\n- basic_flow_actions = [\n- {\n- \"create\": \"validate\",\n- \"flows\": [\"ipv4\", \"sip\", \"dip\", \"udp\", \"sport\", \"dport\"],\n- \"actions\": [\"queue\"],\n- },\n- {\n- \"create\": \"validate\",\n- \"flows\": [\"ipv4\", \"sip\", \"dip\", \"tcp\", \"sport\", \"dport\"],\n- \"actions\": [\"queue\"],\n- },\n- {\n+ def test_fdir_for_ipv4_PF_vfio(self):\n+ \"\"\"\n+ only supported by i40e and ixgbe\n+ \"\"\"\n+ self.verify(\n+ self.nic\n+ in [\n+ \"IXGBE_10G-82599_SFP\",\n+ \"IXGBE_10G-X550EM_X_10G_T\",\n+ \"IXGBE_10G-X550T\",\n+ \"I40E_10G-SFP_XL710\",\n+ \"I40E_25G-25G_SFP28\",\n+ \"I40E_40G-QSFP_A\",\n+ \"I40E_10G-10G_BASE_T_BC\",\n+ \"I40E_40G-QSFP_B\",\n+ \"I40E_10G-SFP_X722\",\n+ \"I40E_10G-10G_BASE_T_X722\",\n+ ],\n+ \"%s nic not support fdir ipv4 filter\" % self.nic,\n+ )\n+ # i40e\n+ if self.nic in [\n+ \"I40E_10G-SFP_XL710\",\n+ \"I40E_25G-25G_SFP28\",\n+ \"I40E_40G-QSFP_A\",\n+ \"I40E_40G-QSFP_B\",\n+ \"I40E_10G-SFP_X722\",\n+ \"I40E_10G-10G_BASE_T_X722\",\n+ \"I40E_10G-10G_BASE_T_BC\",\n+ ]:\n+ # start testpmd on pf\n+ self.pmdout.start_testpmd(\n+ \"%s\" % self.pf_cores,\n+ \"--disable-rss --rxq=%d --txq=%d\" % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n+ \"-a %s --file-prefix=pf --socket-mem 1024,1024 --legacy-mem\"\n+ % self.pf_pci,\n+ )\n+ self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \", 120)\n+ self.dut.send_expect(\"set verbose 1\", \"testpmd> \", 120)\n+ self.dut.send_expect(\"start\", \"testpmd> \", 120)\n+ time.sleep(2)\n+\n+ # validate and create the flow rules\n+ basic_flow_actions = [\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"sip\", \"dip\", \"proto\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"sip\", \"dip\", \"ttl\", \"udp\", \"sport\", \"dport\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"sip\", \"dip\", \"tos\", \"tcp\", \"sport\", \"dport\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\n+ \"vlan\",\n+ \"ipv4\",\n+ \"sip\",\n+ \"dip\",\n+ \"tos\",\n+ \"ttl\",\n+ \"sctp\",\n+ \"sport\",\n+ \"dport\",\n+ \"tag\",\n+ ],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\n+ \"vlan\",\n+ \"ipv4\",\n+ \"sip\",\n+ \"dip\",\n+ \"tos\",\n+ \"ttl\",\n+ \"sctp\",\n+ \"sport\",\n+ \"dport\",\n+ \"tag\",\n+ ],\n+ \"actions\": [\"drop\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\n+ \"vlan\",\n+ \"ipv4\",\n+ \"sip\",\n+ \"dip\",\n+ \"tos\",\n+ \"ttl\",\n+ \"sctp\",\n+ \"sport\",\n+ \"dport\",\n+ \"tag\",\n+ ],\n+ \"actions\": [\"passthru\", \"flag\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"sip\", \"dip\", \"ttl\", \"udp\", \"sport\", \"dport\"],\n+ \"actions\": [\"queue\", \"flag\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"sip\", \"dip\", \"tos\", \"tcp\", \"sport\", \"dport\"],\n+ \"actions\": [\"queue\", \"mark\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"sip\", \"dip\", \"proto\"],\n+ \"actions\": [\"passthru\", \"mark\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"ipv4\", \"sip\", \"dip\", \"proto\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"ipv4\", \"sip\", \"dip\", \"ttl\", \"udp\", \"sport\", \"dport\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"ipv4\", \"sip\", \"dip\", \"tos\", \"tcp\", \"sport\", \"dport\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\n+ \"vlan\",\n+ \"ipv4\",\n+ \"sip\",\n+ \"dip\",\n+ \"tos\",\n+ \"ttl\",\n+ \"sctp\",\n+ \"sport\",\n+ \"dport\",\n+ \"tag\",\n+ ],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\n+ \"vlan\",\n+ \"ipv4\",\n+ \"sip\",\n+ \"dip\",\n+ \"tos\",\n+ \"ttl\",\n+ \"sctp\",\n+ \"sport\",\n+ \"dport\",\n+ \"tag\",\n+ ],\n+ \"actions\": [\"drop\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\n+ \"vlan\",\n+ \"ipv4\",\n+ \"sip\",\n+ \"dip\",\n+ \"tos\",\n+ \"ttl\",\n+ \"sctp\",\n+ \"sport\",\n+ \"dport\",\n+ \"tag\",\n+ ],\n+ \"actions\": [\"passthru\", \"flag\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"ipv4\", \"sip\", \"dip\", \"ttl\", \"udp\", \"sport\", \"dport\"],\n+ \"actions\": [\"queue\", \"flag\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"ipv4\", \"sip\", \"dip\", \"tos\", \"tcp\", \"sport\", \"dport\"],\n+ \"actions\": [\"queue\", \"mark\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"ipv4\", \"sip\", \"dip\", \"proto\"],\n+ \"actions\": [\"passthru\", \"mark\"],\n+ },\n+ ]\n+ extrapkt_rulenum = self.all_flows_process(basic_flow_actions)\n+ extra_packet = extrapkt_rulenum[\"extrapacket\"]\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/IP(src=\"192.168.0.3\", dst=\"192.168.0.4\", proto=%s)/Raw(\"x\" * 20)'\n+ % (self.pf_mac, extra_packet[0][\"proto\"])\n+ )\n+ self.verify_result(\n+ \"pf\", expect_rxpkts=\"1\", expect_queue=\"0\", verify_mac=self.pf_mac\n+ )\n+ rule_num = extrapkt_rulenum[\"rulenum\"]\n+ self.verify_rulenum(rule_num)\n+ # ixgbe\n+ else:\n+ self.pmdout.start_testpmd(\n+ \"%s\" % self.cores,\n+ \"--disable-rss --rxq=%d --txq=%d\" % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n+ )\n+ self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \", 120)\n+ self.dut.send_expect(\"set verbose 1\", \"testpmd> \", 120)\n+ self.dut.send_expect(\"start\", \"testpmd> \", 120)\n+ time.sleep(2)\n+\n+ if self.nic in [\"IXGBE_10G-X550EM_X_10G_T\", \"IXGBE_10G-X550T\"]:\n+ # create the flow rules\n+ basic_flow_actions = [\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"sip\", \"dip\", \"udp\", \"sport\", \"dport\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"sip\", \"dip\", \"tcp\", \"sport\", \"dport\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n \"create\": \"validate\",\n \"flows\": [\"ipv4\", \"sip\", \"dip\", \"sctp\", \"sport\", \"dport\"],\n \"actions\": [\"queue\"],\n@@ -2799,9 +3222,10 @@ class TestGeneric_flow_api(TestCase):\n rule_num = extrapkt_rulenum[\"rulenum\"]\n self.verify_rulenum(rule_num)\n \n- def test_fdir_for_ipv6(self):\n+ @skip_unsupported_host_driver([\"vfio-pci\"])\n+ def test_fdir_for_ipv6_PF_igb_uio(self):\n \"\"\"\n- only supported by i40e and ixgbe\n+ only supported by i40e\n \"\"\"\n self.verify(\n self.nic\n@@ -3108,12 +3532,203 @@ class TestGeneric_flow_api(TestCase):\n rule_num = extrapkt_rulenum[\"rulenum\"]\n self.verify_rulenum(rule_num)\n \n+ def test_fdir_for_ipv6_PF_vfio(self):\n+ \"\"\"\n+ only supported by i40e and ixgbe\n+ \"\"\"\n+ self.verify(\n+ self.nic\n+ in [\n+ \"IXGBE_10G-82599_SFP\",\n+ \"IXGBE_10G-X550EM_X_10G_T\",\n+ \"IXGBE_10G-X550T\",\n+ \"I40E_10G-SFP_XL710\",\n+ \"I40E_25G-25G_SFP28\",\n+ \"I40E_40G-QSFP_A\",\n+ \"I40E_10G-10G_BASE_T_BC\",\n+ \"I40E_40G-QSFP_B\",\n+ \"I40E_10G-SFP_X722\",\n+ \"I40E_10G-10G_BASE_T_X722\",\n+ \"IGC-I225_LM\",\n+ \"IGC-I226_LM\",\n+ ],\n+ \"%s nic not support fdir ipv6 filter\" % self.nic,\n+ )\n+ # i40e\n+ if self.nic in [\n+ \"I40E_10G-SFP_XL710\",\n+ \"I40E_25G-25G_SFP28\",\n+ \"I40E_40G-QSFP_A\",\n+ \"I40E_40G-QSFP_B\",\n+ \"I40E_10G-SFP_X722\",\n+ \"I40E_10G-10G_BASE_T_X722\",\n+ \"I40E_10G-10G_BASE_T_BC\",\n+ ]:\n+ self.pmdout.start_testpmd(\n+ \"%s\" % self.pf_cores,\n+ \"--disable-rss --rxq=%d --txq=%d\" % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n+ \"-a %s --file-prefix=pf --socket-mem 1024,1024 --legacy-mem\"\n+ % self.pf_pci,\n+ )\n+ self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \", 120)\n+ self.dut.send_expect(\"set verbose 1\", \"testpmd> \", 120)\n+ self.dut.send_expect(\"start\", \"testpmd> \", 120)\n+ time.sleep(2)\n+\n+ # create the flow rules\n+ basic_flow_actions = [\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"vlan\", \"ipv6\", \"sip\", \"dip\", \"proto\", \"tc\", \"hop\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\n+ \"vlan\",\n+ \"ipv6\",\n+ \"sip\",\n+ \"dip\",\n+ \"tc\",\n+ \"hop\",\n+ \"udp\",\n+ \"sport\",\n+ \"dport\",\n+ ],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\n+ \"vlan\",\n+ \"ipv6\",\n+ \"sip\",\n+ \"dip\",\n+ \"tc\",\n+ \"hop\",\n+ \"tcp\",\n+ \"sport\",\n+ \"dport\",\n+ ],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\n+ \"vlan\",\n+ \"ipv6\",\n+ \"sip\",\n+ \"dip\",\n+ \"tc\",\n+ \"hop\",\n+ \"sctp\",\n+ \"sport\",\n+ \"dport\",\n+ \"tag\",\n+ ],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\n+ \"vlan\",\n+ \"ipv6\",\n+ \"sip\",\n+ \"dip\",\n+ \"tc\",\n+ \"hop\",\n+ \"sctp\",\n+ \"sport\",\n+ \"dport\",\n+ \"tag\",\n+ ],\n+ \"actions\": [\"drop\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"vlan\", \"ipv6\", \"sip\", \"dip\", \"proto\", \"tc\", \"hop\"],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\n+ \"vlan\",\n+ \"ipv6\",\n+ \"sip\",\n+ \"dip\",\n+ \"tc\",\n+ \"hop\",\n+ \"udp\",\n+ \"sport\",\n+ \"dport\",\n+ ],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\n+ \"vlan\",\n+ \"ipv6\",\n+ \"sip\",\n+ \"dip\",\n+ \"tc\",\n+ \"hop\",\n+ \"tcp\",\n+ \"sport\",\n+ \"dport\",\n+ ],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\n+ \"vlan\",\n+ \"ipv6\",\n+ \"sip\",\n+ \"dip\",\n+ \"tc\",\n+ \"hop\",\n+ \"sctp\",\n+ \"sport\",\n+ \"dport\",\n+ \"tag\",\n+ ],\n+ \"actions\": [\"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\n+ \"vlan\",\n+ \"ipv6\",\n+ \"sip\",\n+ \"dip\",\n+ \"tc\",\n+ \"hop\",\n+ \"sctp\",\n+ \"sport\",\n+ \"dport\",\n+ \"tag\",\n+ ],\n+ \"actions\": [\"drop\"],\n+ },\n+ ]\n+ extrapkt_rulenum = self.all_flows_process(basic_flow_actions)\n+ extra_packet = extrapkt_rulenum[\"extrapacket\"]\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/Dot1Q(vlan=%s)/IPv6(src=\"2001::1\", dst=\"2001::2\", tc=2, hlim=20)/UDP(sport=22,dport=23)/Raw(\"x\" * 20)'\n+ % (self.pf_mac, extra_packet[1][\"vlan\"])\n+ )\n+ self.verify_result(\n+ \"pf\", expect_rxpkts=\"1\", expect_queue=\"0\", verify_mac=self.pf_mac\n+ )\n+ rule_num = extrapkt_rulenum[\"rulenum\"]\n+ self.verify_rulenum(rule_num)\n+\n # ixgbe signature\n else:\n self.pmdout.start_testpmd(\n \"%s\" % self.cores,\n- \"--pkt-filter-mode=signature --disable-rss --rxq=%d --txq=%d\"\n- % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n+ \"--disable-rss --rxq=%d --txq=%d\" % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n )\n self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \", 120)\n self.dut.send_expect(\"set verbose 1\", \"testpmd> \", 120)\n@@ -3442,26 +4057,14 @@ class TestGeneric_flow_api(TestCase):\n rule_num = extrapkt_rulenum[\"rulenum\"]\n self.verify_rulenum(rule_num + 1)\n \n- support_nic = [\n- \"I40E_10G-SFP_XL710\",\n- \"I40E_25G-25G_SFP28\",\n- \"I40E_40G-QSFP_A\",\n- \"I40E_10G-10G_BASE_T_BC\",\n- \"I40E_40G-QSFP_B\",\n- \"I40E_10G-SFP_X722\",\n- \"I40E_10G-10G_BASE_T_X722\",\n- ]\n-\n @check_supported_nic(support_nic)\n def test_fdir_wrong_parameters(self):\n \"\"\"\n Test case: Intel® Ethernet 700 Series fdir wrong parameters\n \"\"\"\n-\n self.pmdout.start_testpmd(\n \"%s\" % self.pf_cores,\n- \"--disable-rss --rxq=%d --txq=%d --pkt-filter-mode=perfect\"\n- % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n+ \"--disable-rss --rxq=%d --txq=%d\" % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n \"-a %s --socket-mem 1024,1024 --file-prefix=pf \" % self.pf_pci,\n )\n self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \")\n@@ -3512,29 +4115,6 @@ class TestGeneric_flow_api(TestCase):\n self.dut.send_expect(\"quit\", \"# \")\n time.sleep(2)\n \n- self.dut.generate_sriov_vfs_by_port(self.dut_ports[0], 1, self.kdriver)\n- self.vf_port = self.dut.ports_info[self.dut_ports[0]][\"vfs_port\"][0]\n- self.vf_port.bind_driver(driver=\"vfio-pci\")\n- self.vf_port_pci = self.dut.ports_info[self.dut_ports[0]][\"sriov_vfs_pci\"][0]\n- # start testpmd on vf0\n- self.pmdout.start_testpmd(\n- \"default\",\n- \"--rxq=4 --txq=4 --disable-rss --pkt-filter-mode=perfect\",\n- eal_param=\"-a %s --socket-mem 1024,1024 --file-prefix=vf\"\n- % self.vf_port_pci,\n- )\n- self.dut.send_expect(\"start\", \"testpmd>\")\n- time.sleep(2)\n- # create a rule on vf that has invalid queue ID\n- self.dut.send_expect(\n- \"flow validate 0 ingress transfer pattern eth / ipv4 src is 192.168.0.1 dst is 192.168.0.2 proto is 3 / vf id is 0 / end actions queue index 4 / end\",\n- \"error\",\n- )\n- self.dut.send_expect(\n- \"flow create 0 ingress transfer pattern eth / ipv4 src is 192.168.0.1 dst is 192.168.0.2 proto is 3 / vf id is 0 / end actions queue index 4 / end\",\n- \"error\",\n- )\n-\n def test_fdir_for_flexbytes(self):\n \"\"\"\n The filter structure is different between igb, ixgbe and i40e\n@@ -3761,8 +4341,7 @@ class TestGeneric_flow_api(TestCase):\n else:\n self.pmdout.start_testpmd(\n \"%s\" % self.cores,\n- \"--pkt-filter-mode=perfect --disable-rss --rxq=%d --txq=%d\"\n- % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n+ \"--disable-rss --rxq=%d --txq=%d\" % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n )\n self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \", 120)\n self.dut.send_expect(\"set verbose 1\", \"testpmd> \", 120)\n@@ -3794,8 +4373,7 @@ class TestGeneric_flow_api(TestCase):\n # the second flexbytes rule should be created after the testpmd reset, because the flexbytes rule is global bit masks\n self.pmdout.start_testpmd(\n \"%s\" % self.cores,\n- \"--pkt-filter-mode=perfect --disable-rss --rxq=%d --txq=%d\"\n- % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n+ \"--disable-rss --rxq=%d --txq=%d\" % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n )\n self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \", 120)\n self.dut.send_expect(\"set verbose 1\", \"testpmd> \", 120)\n@@ -3840,8 +4418,7 @@ class TestGeneric_flow_api(TestCase):\n # signature mode\n self.pmdout.start_testpmd(\n \"%s\" % self.cores,\n- \"--pkt-filter-mode=signature --disable-rss --rxq=%d --txq=%d\"\n- % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n+ \"--disable-rss --rxq=%d --txq=%d\" % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n )\n self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \", 120)\n self.dut.send_expect(\"set verbose 1\", \"testpmd> \", 120)\n@@ -3891,8 +4468,7 @@ class TestGeneric_flow_api(TestCase):\n \n self.pmdout.start_testpmd(\n \"%s\" % self.cores,\n- \"--pkt-filter-mode=signature --disable-rss --rxq=%d --txq=%d\"\n- % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n+ \"--disable-rss --rxq=%d --txq=%d\" % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n )\n self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \", 120)\n self.dut.send_expect(\"set verbose 1\", \"testpmd> \", 120)\n@@ -4160,8 +4736,7 @@ class TestGeneric_flow_api(TestCase):\n \n self.pmdout.start_testpmd(\n \"%s\" % self.cores,\n- \"--pkt-filter-mode=perfect-mac-vlan --disable-rss --rxq=%d --txq=%d\"\n- % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n+ \"--disable-rss --rxq=%d --txq=%d\" % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n )\n self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \", 120)\n self.dut.send_expect(\"set verbose 1\", \"testpmd> \", 120)\n@@ -4232,8 +4807,7 @@ class TestGeneric_flow_api(TestCase):\n \n self.pmdout.start_testpmd(\n \"%s\" % self.cores,\n- \"--pkt-filter-mode=perfect-tunnel --disable-rss --rxq=%d --txq=%d\"\n- % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n+ \"--disable-rss --rxq=%d --txq=%d\" % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n )\n self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \", 120)\n self.dut.send_expect(\"set verbose 1\", \"testpmd> \", 120)\n@@ -4284,8 +4858,7 @@ class TestGeneric_flow_api(TestCase):\n \n self.pmdout.start_testpmd(\n \"%s\" % self.cores,\n- \"--pkt-filter-mode=perfect-tunnel --disable-rss --rxq=%d --txq=%d\"\n- % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n+ \"--disable-rss --rxq=%d --txq=%d\" % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n )\n self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \", 120)\n self.dut.send_expect(\"set verbose 1\", \"testpmd> \", 120)\n@@ -4319,7 +4892,102 @@ class TestGeneric_flow_api(TestCase):\n rule_num = extrapkt_rulenum[\"rulenum\"]\n self.verify_rulenum(rule_num)\n \n- def test_tunnel_filter_vxlan(self):\n+ @check_supported_nic(support_nic)\n+ def test_tunnel_filter_vxlan_PF_vfio(self):\n+ \"\"\"\n+ only supported by i40e\n+ \"\"\"\n+ self.pmdout.start_testpmd(\n+ \"%s\" % self.pf_cores,\n+ \"--disable-rss --rxq=%d --txq=%d\" % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n+ \"-a %s --file-prefix=pf --socket-mem 1024,1024 --legacy-mem\" % self.pf_pci,\n+ )\n+ self.dut.send_expect(\"rx_vxlan_port add 4789 0\", \"testpmd> \", 120)\n+ self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \", 120)\n+ self.dut.send_expect(\"set verbose 1\", \"testpmd> \", 120)\n+ self.dut.send_expect(\"start\", \"testpmd> \", 120)\n+ time.sleep(2)\n+\n+ # create the flow rules\n+ basic_flow_actions = [\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"ipv4\", \"udp\", \"vxlan\", \"ineth\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"ipv4\", \"udp\", \"vxlan\", \"vni\", \"ineth\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"ipv4\", \"udp\", \"vxlan\", \"ineth\", \"invlan\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"ipv4\", \"udp\", \"vxlan\", \"vni\", \"ineth\", \"invlan\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"dst_mac\", \"ipv4\", \"udp\", \"vxlan\", \"vni\", \"ineth\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"udp\", \"vxlan\", \"ineth\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"udp\", \"vxlan\", \"vni\", \"ineth\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"udp\", \"vxlan\", \"ineth\", \"invlan\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"udp\", \"vxlan\", \"vni\", \"ineth\", \"invlan\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"dst_mac\", \"ipv4\", \"udp\", \"vxlan\", \"vni\", \"ineth\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ ]\n+ extrapkt_rulenum = self.all_flows_process(basic_flow_actions)\n+ extra_packet = extrapkt_rulenum[\"extrapacket\"]\n+\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/IP()/UDP()/VXLAN()/Ether(dst=\"%s\")/Dot1Q(vlan=11)/IP()/TCP()/Raw(\"x\" * 20)'\n+ % (self.outer_mac, self.inner_mac)\n+ )\n+ self.verify_result(\n+ \"pf\",\n+ expect_rxpkts=\"1\",\n+ expect_queue=extrapkt_rulenum[\"queue\"][0],\n+ verify_mac=self.outer_mac,\n+ )\n+\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/IP()/UDP()/VXLAN(vni=5)/Ether(dst=\"%s\")/IP()/TCP()/Raw(\"x\" * 20)'\n+ % (self.outer_mac, self.wrong_mac)\n+ )\n+ self.verify_result(\n+ \"pf\", expect_rxpkts=\"1\", expect_queue=\"0\", verify_mac=self.outer_mac\n+ )\n+\n+ rule_num = extrapkt_rulenum[\"rulenum\"]\n+ self.verify_rulenum(rule_num)\n+\n+ @skip_unsupported_host_driver([\"vfio-pci\"])\n+ def test_tunnel_filter_vxlan_PF_igb_uio(self):\n \"\"\"\n only supported by i40e\n \"\"\"\n@@ -4491,7 +5159,101 @@ class TestGeneric_flow_api(TestCase):\n rule_num = extrapkt_rulenum[\"rulenum\"]\n self.verify_rulenum(rule_num)\n \n- def test_tunnel_filter_nvgre(self):\n+ @check_supported_nic(support_nic)\n+ def test_tunnel_filter_nvgre_PF_vfio(self):\n+ \"\"\"\n+ only supported by i40e\n+ \"\"\"\n+ self.pmdout.start_testpmd(\n+ \"%s\" % self.pf_cores,\n+ \"--disable-rss --rxq=%d --txq=%d\" % (MAX_QUEUE + 1, MAX_QUEUE + 1),\n+ \"-a %s --file-prefix=pf --socket-mem 1024,1024 --legacy-mem\" % self.pf_pci,\n+ )\n+ self.dut.send_expect(\"set fwd rxonly\", \"testpmd> \", 120)\n+ self.dut.send_expect(\"set verbose 1\", \"testpmd> \", 120)\n+ self.dut.send_expect(\"start\", \"testpmd> \", 120)\n+ time.sleep(2)\n+\n+ # create the flow rules\n+ basic_flow_actions = [\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"ipv4\", \"nvgre\", \"ineth\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"ipv4\", \"nvgre\", \"tni\", \"ineth\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"ipv4\", \"nvgre\", \"ineth\", \"invlan\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"ipv4\", \"nvgre\", \"tni\", \"ineth\", \"invlan\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"create\",\n+ \"flows\": [\"dst_mac\", \"ipv4\", \"nvgre\", \"tni\", \"ineth\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"nvgre\", \"ineth\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"nvgre\", \"tni\", \"ineth\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"nvgre\", \"ineth\", \"invlan\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"ipv4\", \"nvgre\", \"tni\", \"ineth\", \"invlan\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ {\n+ \"create\": \"validate\",\n+ \"flows\": [\"dst_mac\", \"ipv4\", \"nvgre\", \"tni\", \"ineth\"],\n+ \"actions\": [\"pf\", \"queue\"],\n+ },\n+ ]\n+ extrapkt_rulenum = self.all_flows_process(basic_flow_actions)\n+ extra_packet = extrapkt_rulenum[\"extrapacket\"]\n+\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/IP()/NVGRE()/Ether(dst=\"%s\")/Dot1Q(vlan=1)/IP()/TCP()/Raw(\"x\" * 20)'\n+ % (self.outer_mac, self.inner_mac)\n+ )\n+ self.verify_result(\n+ \"pf\",\n+ expect_rxpkts=\"1\",\n+ expect_queue=extrapkt_rulenum[\"queue\"][0],\n+ verify_mac=self.outer_mac,\n+ )\n+\n+ self.sendpkt(\n+ 'Ether(dst=\"%s\")/IP()/NVGRE(TNI=%s)/Ether(dst=\"%s\")/IP()/TCP()/Raw(\"x\" * 20)'\n+ % (self.outer_mac, extra_packet[4][\"tni\"], self.wrong_mac)\n+ )\n+ self.verify_result(\n+ \"pf\", expect_rxpkts=\"1\", expect_queue=\"0\", verify_mac=self.outer_mac\n+ )\n+\n+ rule_num = extrapkt_rulenum[\"rulenum\"]\n+ self.verify_rulenum(rule_num)\n+\n+ @skip_unsupported_host_driver([\"vfio-pci\"])\n+ def test_tunnel_filter_nvgre_PF_igb_uio(self):\n \"\"\"\n only supported by i40e\n \"\"\"\n@@ -5115,169 +5877,6 @@ class TestGeneric_flow_api(TestCase):\n else:\n self.verify(False, \"%s not support this test\" % self.nic)\n \n- @check_supported_nic([\"IXGBE_10G-82599_SFP\"])\n- def test_fdir_for_match_report(self):\n- \"\"\"\n- Test case: IXGBE fdir for Control levels of FDir match reporting\n- only supported by ixgbe\n- \"\"\"\n- fdir_scanner = re.compile(\"FDIR matched hash=(0x\\w+) ID=(0x\\w+)\")\n- pkt0 = 'Ether(dst=\"{}\")/IP(src=\"192.168.0.1\", dst=\"192.168.0.2\")/Raw(\"x\" * 20)'.format(\n- self.pf_mac\n- )\n- pkt1 = 'Ether(dst=\"{}\")/IP(src=\"192.168.1.1\", dst=\"192.168.1.2\")/Raw(\"x\" * 20)'.format(\n- self.pf_mac\n- )\n- rule0 = \"flow create 0 ingress pattern eth / ipv4 src is 192.168.0.1 dst is 192.168.0.2 / end actions queue index 1 / mark id 1 / end\"\n- rule1 = \"flow create 0 ingress pattern eth / ipv4 src is 192.168.1.1 dst is 192.168.1.2 / end actions queue index 2 / mark id 2 / end\"\n-\n- self.logger.info(\"Sub-case1: ``--pkt-filter-report-hash=none`` mode\")\n- pkt_filter_report_hash = \"none\"\n- self.launch_start_testpmd(\n- queue=MAX_QUEUE + 1,\n- pkt_filter_mode=\"perfect\",\n- report_hash=pkt_filter_report_hash,\n- disable_rss=True,\n- fwd=\"rxonly\",\n- verbose=\"1\",\n- )\n-\n- # Send the matched packet with Scapy on the traffic generator and check that no FDir information is printed\n- self.sendpkt(pktstr=pkt0)\n- self.verify_result(\n- \"pf\",\n- expect_rxpkts=\"1\",\n- expect_queue=\"0\",\n- verify_mac=self.pf_mac,\n- check_fdir=\"non-exist\",\n- )\n-\n- # Add flow filter rule, and send the matched packet again.\n- # No FDir information is printed, but it can be seen that the packet went to queue 1\n- self.pmdout.execute_cmd(rule0)\n- self.sendpkt(pktstr=pkt0)\n- self.verify_result(\n- \"pf\",\n- expect_rxpkts=\"1\",\n- expect_queue=\"1\",\n- verify_mac=self.pf_mac,\n- check_fdir=\"non-exist\",\n- )\n- self.pmdout.quit()\n-\n- self.logger.info(\"Sub-case2: ``--pkt-filter-report-hash=match`` mode\")\n- pkt_filter_report_hash = \"match\"\n- self.launch_start_testpmd(\n- queue=MAX_QUEUE + 1,\n- pkt_filter_mode=\"perfect\",\n- report_hash=pkt_filter_report_hash,\n- disable_rss=True,\n- fwd=\"rxonly\",\n- verbose=\"1\",\n- )\n-\n- # Send the matched packet with Scapy on the traffic generator and check that no FDir information is printed\n- self.sendpkt(pktstr=pkt0)\n- self.verify_result(\n- \"pf\",\n- expect_rxpkts=\"1\",\n- expect_queue=\"0\",\n- verify_mac=self.pf_mac,\n- check_fdir=\"non-exist\",\n- )\n-\n- # Add flow filter rule, and send the matched packet again.\n- # the match is indicated (``RTE_MBUF_F_FDIR``), and its details (hash, id) printed\n- self.pmdout.execute_cmd(rule0)\n- self.sendpkt(pktstr=pkt0)\n- self.verify_result(\n- \"pf\",\n- expect_rxpkts=\"1\",\n- expect_queue=\"1\",\n- verify_mac=self.pf_mac,\n- check_fdir=\"exist\",\n- )\n-\n- # Add flow filter rule by using different scr,dst, and send the matched pkt1 packet again.\n- # the match is indicated (``RTE_MBUF_F_FDIR``), and its details (hash, id) printed\n- self.pmdout.execute_cmd(rule1)\n- self.sendpkt(pktstr=pkt1)\n- self.verify_result(\n- \"pf\",\n- expect_rxpkts=\"1\",\n- expect_queue=\"2\",\n- verify_mac=self.pf_mac,\n- check_fdir=\"exist\",\n- )\n-\n- # Remove rule1 and send the matched pkt0 packet again. Check that no FDir information is printed\n- self.pmdout.execute_cmd(\"flow destroy 0 rule 0\")\n- self.sendpkt(pktstr=pkt0)\n- self.verify_result(\n- \"pf\",\n- expect_rxpkts=\"1\",\n- expect_queue=\"0\",\n- verify_mac=self.pf_mac,\n- check_fdir=\"non-exist\",\n- )\n-\n- # Remove rule2, and send the match pkt1 packet again. Check that no FDir information is printed\n- self.pmdout.execute_cmd(\"flow destroy 0 rule 1\")\n- self.sendpkt(pktstr=pkt1)\n- self.verify_result(\n- \"pf\",\n- expect_rxpkts=\"1\",\n- expect_queue=\"0\",\n- verify_mac=self.pf_mac,\n- check_fdir=\"non-exist\",\n- )\n- self.pmdout.quit()\n-\n- self.logger.info(\"Sub-case3: ``--pkt-filter-report-hash=always`` mode\")\n- pkt_filter_report_hash = \"always\"\n- self.launch_start_testpmd(\n- queue=MAX_QUEUE + 1,\n- pkt_filter_mode=\"perfect\",\n- report_hash=pkt_filter_report_hash,\n- disable_rss=True,\n- fwd=\"rxonly\",\n- verbose=\"1\",\n- )\n-\n- # Send matched pkt0 packet with Scapy on the traffic generator and check the output (FDIR id=0x0)\n- self.sendpkt(pktstr=pkt0)\n- out1 = self.verify_result(\n- \"pf\",\n- expect_rxpkts=\"1\",\n- expect_queue=\"0\",\n- verify_mac=self.pf_mac,\n- check_fdir=\"exist\",\n- )\n-\n- # Add flow filter rule, and send the matched pkt0 packet again.\n- # the filter ID is different, and the packet goes to queue 1Add flow filter rule, and send the matched packet again.\n- self.pmdout.execute_cmd(rule0)\n- self.sendpkt(pktstr=pkt0)\n- out2 = self.verify_result(\n- \"pf\",\n- expect_rxpkts=\"1\",\n- expect_queue=\"1\",\n- verify_mac=self.pf_mac,\n- check_fdir=\"exist\",\n- )\n-\n- # check fdir id is different\n- self.logger.info(\n- \"FDIR ID1=\"\n- + fdir_scanner.search(out1).group(0)\n- + \"; FDIR ID2=\"\n- + fdir_scanner.search(out2).group(0)\n- )\n- self.verify(\n- fdir_scanner.search(out1).group(0) != fdir_scanner.search(out2).group(0),\n- \"Sub-case3.3: FDIR ID should be different\",\n- )\n-\n def tear_down(self):\n \"\"\"\n Run after each test case.\n", "prefixes": [ "V2", "2/5" ] }{ "id": 120688, "url": "