Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/84991/?format=api
http://patches.dpdk.org/api/patches/84991/?format=api", "web_url": "http://patches.dpdk.org/project/dts/patch/20201211023317.13817-1-box.c.chen@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": "<20201211023317.13817-1-box.c.chen@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dts/20201211023317.13817-1-box.c.chen@intel.com", "date": "2020-12-11T02:33:17", "name": "[V1] tests/cvl_dcf_switch_filter: add drop action test case", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "488760b0fc2c0bccdfa0cdcce569b971d07eab64", "submitter": { "id": 1819, "url": "http://patches.dpdk.org/api/people/1819/?format=api", "name": "Chen, BoX C", "email": "box.c.chen@intel.com" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dts/patch/20201211023317.13817-1-box.c.chen@intel.com/mbox/", "series": [ { "id": 14247, "url": "http://patches.dpdk.org/api/series/14247/?format=api", "web_url": "http://patches.dpdk.org/project/dts/list/?series=14247", "date": "2020-12-11T02:33:17", "name": "[V1] tests/cvl_dcf_switch_filter: add drop action test case", "version": 1, "mbox": "http://patches.dpdk.org/series/14247/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/84991/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/84991/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 576BAA04DB;\n\tFri, 11 Dec 2020 03:34:46 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3FBCDAC9C;\n\tFri, 11 Dec 2020 03:34:45 +0100 (CET)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by dpdk.org (Postfix) with ESMTP id 73E3FAC9B\n for <dts@dpdk.org>; Fri, 11 Dec 2020 03:34:42 +0100 (CET)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Dec 2020 18:34:41 -0800", "from unknown (HELO cb-dts.sh.intel.com) ([10.240.183.58])\n by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Dec 2020 18:34:39 -0800" ], "IronPort-SDR": [ "\n LYzUm7GlQgcRvun/Y8M318qohOIiSRwYErigVvoZlJqXNb+v8FS/Ocx+lfnanotokbpA7Xy6Cf\n 1vP5ZOBK8A+Q==", "\n UnPOnfiUz59eApLh2MPi3PdcTJytc+FLtGby4mS68+1ywWHFZ0urbA7nNET9iU7ibwD7Ujfp4i\n l8AqMQEWCzqA==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9831\"; a=\"259082648\"", "E=Sophos;i=\"5.78,409,1599548400\"; d=\"scan'208\";a=\"259082648\"", "E=Sophos;i=\"5.78,409,1599548400\"; d=\"scan'208\";a=\"544389188\"" ], "From": "ChenBo <box.c.chen@intel.com>", "To": "dts@dpdk.org", "Cc": "ChenBo <box.c.chen@intel.com>", "Date": "Fri, 11 Dec 2020 10:33:17 +0800", "Message-Id": "<20201211023317.13817-1-box.c.chen@intel.com>", "X-Mailer": "git-send-email 2.17.1", "Subject": "[dts] [PATCH V1] tests/cvl_dcf_switch_filter: add drop action test\n\tcase", "X-BeenThere": "dts@dpdk.org", "X-Mailman-Version": "2.1.15", "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": "Add test cases to test the drop action function of DCF.\n\nSigned-off-by: ChenBo <box.c.chen@intel.com>\n---\n tests/TestSuite_cvl_dcf_switch_filter.py | 176 +++++++++++++++++++++++\n 1 file changed, 176 insertions(+)", "diff": "diff --git a/tests/TestSuite_cvl_dcf_switch_filter.py b/tests/TestSuite_cvl_dcf_switch_filter.py\nindex a65b73a3..be2e6cd6 100644\n--- a/tests/TestSuite_cvl_dcf_switch_filter.py\n+++ b/tests/TestSuite_cvl_dcf_switch_filter.py\n@@ -1216,6 +1216,156 @@ tv_mac_vlan_pppoe_ipcp_pay = {\n \"expect_results\":{\"expect_pkts\":0}}\n }\n \n+tv_mac_ipv4_drop = {\n+ \"name\": \"tv_mac_ipv4_drop\",\n+ \"rte_flow_pattern\": \"flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.1 / end actions drop / end\",\n+ \"matched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\")/IP(src=\"192.168.0.1\")/Raw(\"x\"*80)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 0}},\n+ \"mismatched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\")/IP(src=\"192.168.0.2\")/Raw(\"x\"*80)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 1}}\n+}\n+\n+tv_mac_ipv4_mask_drop = {\n+ \"name\": \"tv_mac_ipv4_drop\",\n+ \"rte_flow_pattern\": \"flow create 0 ingress pattern eth / ipv4 dst spec 224.0.0.0 dst mask 240.0.0.0 / end actions drop / end\",\n+ \"matched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\")/IP(dst=\"239.0.0.0\")/TCP()/Raw(\"x\"*80)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 0}},\n+ \"mismatched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\")/IP(dst=\"128.0.0.0\")/TCP()/Raw(\"x\"*80)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 1}}\n+}\n+\n+tv_mac_nvgre_drop = {\n+ \"name\": \"tv_mac_nvgre_drop\",\n+ \"rte_flow_pattern\": \"flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.1 / nvgre tni is 2 / eth / ipv4 src is 192.168.1.2 dst is 192.168.1.3 / end actions drop / end\",\n+ \"matched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\")/IP(dst=\"192.168.0.1\")/NVGRE(TNI=2)/Ether()/IP(src=\"192.168.1.2\", dst=\"192.168.1.3\")/Raw(\"x\"*80)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 0}},\n+ \"mismatched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\")/IP(dst=\"192.168.0.1\")/NVGRE(TNI=1)/Ether()/IP(src=\"192.168.1.2\", dst=\"192.168.1.3\")/Raw(\"x\"*80)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 1}}\n+}\n+\n+tv_mac_ppoes_drop = {\n+ \"name\": \"tv_mac_ppoes_drop\",\n+ \"rte_flow_pattern\": \"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x0021 / end actions drop / end\",\n+ \"matched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\"\\\\x00\\\\x21\")/IP()/Raw(\"x\" * 80)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 0}},\n+ \"mismatched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=2)/PPP(b\"\\\\x00\\\\x21\")/IP()/Raw(\"x\" * 80)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 1}}\n+}\n+\n+tv_mac_pfcp_drop = {\n+ \"name\": \"tv_mac_pfcp_drop\",\n+ \"rte_flow_pattern\": \"flow create 0 ingress pattern eth / ipv4 / udp / pfcp s_field is 0 / end actions drop / end\",\n+ \"matched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\")/IP()/UDP(dport=8805)/PFCP(S=0)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 0}},\n+ \"mismatched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\")/IP()/UDP(dport=8805)/PFCP(S=1)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 1}}\n+}\n+\n+tv_mac_vlan_drop = {\n+ \"name\": \"tv_mac_vlan_drop\",\n+ \"rte_flow_pattern\": \"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / end actions drop / end\",\n+ \"matched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\",type=0x8100)/Dot1Q(vlan=1)/IP(src=\"192.168.0.1\",dst=\"192.168.0.2\",tos=4,ttl=2)/TCP()/Raw(\"X\"*80)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 0}},\n+ \"mismatched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\",type=0x8100)/Dot1Q(vlan=2)/IP(src=\"192.168.0.1\",dst=\"192.168.0.2\",tos=4,ttl=2)/TCP()/Raw(\"X\"*80)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 1}}\n+}\n+\n+tv_mac_l2tp_drop = {\n+ \"name\": \"tv_mac_l2tp_drop\",\n+ \"rte_flow_pattern\": \"flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 / l2tpv3oip session_id is 1 / end actions drop / end\",\n+ \"matched\": {\"scapy_str\": [\"Ether(dst='00:11:22:33:44:55')/IP(src='192.168.0.2', proto=115)/L2TP(b'\\\\x00\\\\x00\\\\x00\\\\x01')/('X'*480)\"],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 0}},\n+ \"mismatched\": {\"scapy_str\": [\"Ether(dst='00:11:22:33:44:55')/IP(src='192.168.0.2', proto=115)/L2TP(b'\\\\x00\\\\x00\\\\x00\\\\x02')/('X'*480)\"],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 1}}\n+}\n+\n+tv_mac_esp_drop = {\n+ \"name\": \"tv_mac_l2tp_drop\",\n+ \"rte_flow_pattern\": \"flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 / esp spi is 1 / end actions drop / end\",\n+ \"matched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\")/IP(src=\"192.168.0.2\", proto=50)/ESP(spi=1)/(\"X\"*480)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 0}},\n+ \"mismatched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\")/IP(src=\"192.168.0.2\", proto=50)/ESP(spi=2)/(\"X\"*480)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 1}}\n+}\n+\n+tv_mac_blend_pkg_drop = {\n+ \"name\": \"tv_mac_blend_pkg_drop\",\n+ \"rte_flow_pattern\": [\"flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.1 / end actions drop / end\",\n+ \"flow create 0 ingress pattern eth / ipv4 dst spec 224.0.0.0 dst mask 240.0.0.0 / end actions drop / end\",\n+ \"flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.3 / nvgre tni is 2 / eth / ipv4 src is 192.168.1.2 dst is 192.168.1.3 / end actions drop / end\",\n+ \"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / pppoes seid is 3 / pppoe_proto_id is 0x0021 / end actions drop / end\",\n+ \"flow create 0 ingress pattern eth / ipv4 / udp / pfcp s_field is 0 / end actions drop / end\",\n+ \"flow create 0 ingress pattern eth dst is 00:11:22:33:44:55 / vlan tci is 1 / end actions drop / end\",\n+ \"flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.4 / l2tpv3oip session_id is 1 / end actions drop / end\",\n+ \"flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.5 / esp spi is 1 / end actions drop / end\"],\n+ \"matched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\")/IP(src=\"192.168.0.1\")/Raw(\"x\"*80)',\n+ 'Ether(dst=\"00:11:22:33:44:55\")/IP(dst=\"239.0.0.0\")/TCP()/Raw(\"x\"*80)',\n+ 'Ether(dst=\"00:11:22:33:44:55\")/IP(dst=\"192.168.0.3\")/NVGRE(TNI=2)/Ether()/IP(src=\"192.168.1.2\", dst=\"192.168.1.3\")/Raw(\"x\"*80)',\n+ 'Ether(dst=\"00:11:22:33:44:55\",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=3)/PPP(b\"\\\\x00\\\\x21\")/IP()/Raw(\"X\" * 80)',\n+ 'Ether(dst=\"00:11:22:33:44:55\")/IP()/UDP(dport=8805)/PFCP(S=0)',\n+ 'Ether(dst=\"00:11:22:33:44:55\",type=0x8100)/Dot1Q(vlan=1)/IP(src=\"192.168.0.1\",dst=\"192.168.0.2\",tos=4,ttl=2)/TCP()/Raw(\"X\"*80)',\n+ 'Ether(dst=\"00:11:22:33:44:55\")/IP(src=\"192.168.0.4\", proto=115)/L2TP(b\"\\\\x00\\\\x00\\\\x00\\\\x01\")/(\"X\"*480)',\n+ 'Ether(dst=\"00:11:22:33:44:55\")/IP(src=\"192.168.0.5\", proto=50)/ESP(spi=1)/(\"X\"*80)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 0}},\n+ \"mismatched\": {\"scapy_str\": ['Ether(dst=\"00:11:22:33:44:55\")/IP(src=\"192.168.0.6\")/Raw(\"x\"*80)',\n+ 'Ether(dst=\"00:11:22:33:44:55\")/IP(dst=\"128.0.0.0\")/TCP()/Raw(\"x\"*80)',\n+ 'Ether(dst=\"00:11:22:33:44:55\")/IP(dst=\"192.168.0.8\")/NVGRE(TNI=1)/Ether()/IP(src=\"192.168.1.2\", dst=\"192.168.1.3\")/Raw(\"x\"*80)',\n+ 'Ether(dst=\"00:11:22:33:44:55\",type=0x8100)/Dot1Q(vlan=1,type=0x8864)/PPPoE(sessionid=2)/PPP(b\"\\\\x00\\\\x21\")/IP()/Raw(\"x\" * 80)',\n+ 'Ether(dst=\"00:11:22:33:44:55\")/IP()/UDP(dport=8805)/PFCP(S=1)',\n+ 'Ether(dst=\"00:11:22:33:44:55\",type=0x8100)/Dot1Q(vlan=2)/IP(src=\"192.168.0.9\",dst=\"192.168.0.2\",tos=4,ttl=2)/TCP()/Raw(\"X\"*80)',\n+ 'Ether(dst=\"00:11:22:33:44:55\")/IP(src=\"192.168.0.10\", proto=115)/L2TP(b\"\\\\x00\\\\x00\\\\x00\\\\x02\")/(\"X\"*480)',\n+ 'Ether(dst=\"00:11:22:33:44:55\")/IP(src=\"192.168.0.11\", proto=50)/ESP(spi=2)/(\"X\"*80)'],\n+ \"check_func\": {\"func\": rfc.check_vf_rx_packets_number,\n+ \"param\": {\"expect_port\": 1, \"expect_queues\": \"null\"}},\n+ \"expect_results\": {\"expect_pkts\": 8}}\n+}\n+\n+sv_mac_test_drop_action = [\n+ tv_mac_ipv4_drop,\n+ tv_mac_ipv4_mask_drop,\n+ tv_mac_nvgre_drop,\n+ tv_mac_ppoes_drop,\n+ tv_mac_pfcp_drop,\n+ tv_mac_vlan_drop,\n+ tv_mac_l2tp_drop,\n+ tv_mac_esp_drop,\n+ tv_mac_blend_pkg_drop\n+]\n+\n class CVLDCFSwitchFilterTest(TestCase):\n \n def bind_nics_driver(self, ports, driver=\"\"):\n@@ -2175,6 +2325,32 @@ class CVLDCFSwitchFilterTest(TestCase):\n self.setup_1pf_vfs_env()\n self._rte_flow_validate_pattern(tv_mac_vlan_pppoe_ipcp_pay)\n \n+ def test_mac_drop_action(self):\n+ self.setup_1pf_vfs_env()\n+ self.dut.send_expect('ip link set %s vf 1 mac \"00:11:22:33:44:55\"' % self.pf0_intf, '# ')\n+ self.launch_testpmd()\n+ for pattern in sv_mac_test_drop_action:\n+ # validate a rule\n+ self.validate_switch_filter_rule(pattern[\"rte_flow_pattern\"])\n+ # create a rule\n+ rule_list = self.create_switch_filter_rule(pattern[\"rte_flow_pattern\"]) # create a rule\n+ self.check_switch_filter_rule_list(0, rule_list)\n+ # send matched packets and check\n+ matched_dic = pattern[\"matched\"]\n+ self.send_and_check_packets(matched_dic)\n+ # send mismatched packets and check\n+ mismatched_dic = pattern[\"mismatched\"]\n+ self.send_and_check_packets(mismatched_dic)\n+ # destroy rule and send matched packets\n+ self.destroy_switch_filter_rule(0, rule_list)\n+ self.check_switch_filter_rule_list(0, [])\n+ # send matched packets and check\n+ destroy_dict = copy.deepcopy(matched_dic)\n+ destroy_dict[\"expect_results\"][\"expect_pkts\"] = len(pattern[\"matched\"][\"scapy_str\"])\n+ self.send_and_check_packets(destroy_dict)\n+ self.dut.send_expect(\"flow flush 0\", \"testpmd> \", 15)\n+ self.dut.send_expect(\"clear port stats all\", \"testpmd> \", 15)\n+\n def tear_down(self):\n \"\"\"\n Run after each test case.\n", "prefixes": [ "V1" ] }{ "id": 84991, "url": "