From patchwork Fri Aug 26 10:27:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, HongboX" X-Patchwork-Id: 115462 Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id E6EEBA0554; Fri, 26 Aug 2022 12:32:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E2D2D40696; Fri, 26 Aug 2022 12:32:21 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 669C3410D0 for ; Fri, 26 Aug 2022 12:32:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661509940; x=1693045940; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Da7JXSCBJIyvNC18lv4zNsoMWQ/QRYoZ85McHButwLY=; b=J1fwXwAgAz4bch6/PMkrbz4tKWWToLNZw7UYteEJ5uLRRW72NNRnk3uT mJTTa4iBxJ7KMlkl8D/1HiOf4ePuU0Q45brQ/A5RKPa9z27cpvsaaqVbi OWge2xAkMPKo4oKP3X8lNCrQKVeNLa0RhCTUOZH9CZCq0DBhAzROATW6X SmPEOe//UcuNS9XF7EOLeEw4UYEIuIl1of4kgpzi2KTnTvYex6XMy0mPI VSqms8spVi306qUC9XJ9P8Y7mTwuyVGDa/xY2tRYQJLofYNpucin0mzXk 7i6zVZVulaQYzkCb8O/8gwil81D0SrT2imtjh3rNFfDvpH4tN3A8MbCfH w==; X-IronPort-AV: E=McAfee;i="6500,9779,10450"; a="274230098" X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208";a="274230098" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 03:32:11 -0700 X-IronPort-AV: E=Sophos;i="5.93,265,1654585200"; d="scan'208";a="671413375" Received: from unknown (HELO localhost.localdomain) ([10.239.252.212]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 03:32:08 -0700 From: Hongbo Li To: dts@dpdk.org Cc: Hongbo Li Subject: [dts][PATCH V1] tests/ice_switch_filter_pppoe:move the case of ethertype_filter_pppoed to ice_switch_filter_pppoe Date: Fri, 26 Aug 2022 06:27:59 -0400 Message-Id: <20220826102759.90507-1-hongbox.li@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org move the case from ice_switch_filter to ice_switch_filter_pppoe Signed-off-by: Hongbo Li Acked-by: Lijuan Tu --- .../ice_switch_filter_pppoe_test_plan.rst | 127 +++++++++++++++++ test_plans/ice_switch_filter_test_plan.rst | 129 ------------------ tests/TestSuite_ice_switch_filter.py | 78 ----------- tests/TestSuite_ice_switch_filter_pppoe.py | 79 +++++++++++ 4 files changed, 206 insertions(+), 207 deletions(-) diff --git a/test_plans/ice_switch_filter_pppoe_test_plan.rst b/test_plans/ice_switch_filter_pppoe_test_plan.rst index 8cffb554..157d2e01 100644 --- a/test_plans/ice_switch_filter_pppoe_test_plan.rst +++ b/test_plans/ice_switch_filter_pppoe_test_plan.rst @@ -36,6 +36,8 @@ Pattern and input set | | | non-pipeline mode | pipeline mode | +=====================+===============================+===========================================+===========================================+ | ethertype filter | ethertype filter_PPPOES | [Ether type] | [Ether type] | + | +-------------------------------+-------------------------------------------+-------------------------------------------+ + | | ethertype filter_PPPOED | [Ether type] | [Ether type] | +---------------------+-------------------------------+-------------------------------------------+-------------------------------------------+ | | MAC_VLAN_PPPOE_IPV4_PAY | [Dest MAC], [VLAN], [seid], | [Dest MAC], [VLAN], [seid], | | | _session_id_proto_id | [pppoe_proto_id] | [pppoe_proto_id] | @@ -371,6 +373,131 @@ drop action repeat step 1-4 to check the pattern in pipeline mode. + +Ethertype filter_PPPOED +----------------------- + +matched packets:: + + sendp([Ether(dst="00:11:22:33:44:55", type=0x8863)/Raw("x" *80)],iface="ens786f0",count=1) + sendp([Ether(dst="00:11:22:33:44:55")/PPPoED()/Raw("x" *80)],iface="ens786f0",count=1) + +mismatched packets:: + + sendp([Ether(dst="00:11:22:33:44:55", type=0x8864)/Raw("x" *80)],iface="ens786f0",count=1) + sendp([Ether(dst="00:11:22:33:44:55")/PPPoE()/Raw("x" *80)],iface="ens786f0",count=1) + +to queue action +................ + +1. validate a rule:: + + testpmd> flow validate 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end + + get the message:: + + Flow rule validated + + check the flow list:: + + testpmd> flow list 0 + + check the rule not exists in the list. + +2. create a rule:: + + testpmd> flow create 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end + + get the message:: + + Succeeded to create (2) flow + + check the flow list:: + + testpmd> flow list 0 + + check the rule exists in the list. + +3. send matched packets, check the packets are to queue 2. + send mismatched packets, check the packets are not to queue 2. + +4. verify rules can be destroyed:: + + testpmd> flow destroy 0 rule 15360 + testpmd> flow list 0 + + check the rule not exists in the list. + send matched packets, check the packets are not to queue 2. + +5. check the pattern in pipeline mode + + The rules in pipeline mode are similar to rules in non-pipeline mode, + just need to add priority 0 to show it is created as a switch filter rule. + + validate a rule:: + + testpmd> flow validate 0 priority 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end + + create a rule:: + + testpmd> flow create 0 priority 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end + + repeat step 1-4 to check the pattern in pipeline mode. + +drop action +............ + +1. validate a rule:: + + testpmd> flow validate 0 ingress pattern eth type is 0x8863 / end actions drop / end + + get the message:: + + Flow rule validated + + check the flow list:: + + testpmd> flow list 0 + + check the rule not exists in the list. + +2. create a rule:: + + testpmd> flow create 0 ingress pattern eth type is 0x8863 / end actions drop / end + + get the message:: + + Succeeded to create (2) flow + + check the flow list:: + + testpmd> flow list 0 + + check the rule exists in the list. + +3. send matched packets, check the packets are dropped. + send mismatched packets, check the packets are not dropped. + +4. verify rules can be destroyed:: + + testpmd> flow destroy 0 rule 15360 + testpmd> flow list 0 + + check the rule not exists in the list. + send matched packets, check the packets are not to dropped. + +5. check the pattern in pipeline mode + + validate a rule:: + + testpmd> flow validate 0 priority 0 ingress pattern eth type is 0x8863 / end actions drop / end + + create a rule:: + + testpmd> flow create 0 priority 0 ingress pattern eth type is 0x8863 / end actions drop / end + + repeat step 1-4 to check the pattern in pipeline mode. + Test case: MAC_VLAN_PPPOE_IPV4_PAY_session_id_proto_id ====================================================== diff --git a/test_plans/ice_switch_filter_test_plan.rst b/test_plans/ice_switch_filter_test_plan.rst index 599174ba..6ea6843c 100644 --- a/test_plans/ice_switch_filter_test_plan.rst +++ b/test_plans/ice_switch_filter_test_plan.rst @@ -94,8 +94,6 @@ Pattern and input set | | | [Inner Source IP], [Inner Dest IP], | | | | | [Inner Source Port], [Inner Dest Port] | | +---------------------+-------------------------------+-------------------------------------------+-------------------------------------------+ - | ethertype filter | ethertype filter_PPPOED | [Ether type] | [Ether type] | - +---------------------+-------------------------------+-------------------------------------------+-------------------------------------------+ .. note:: @@ -4603,133 +4601,6 @@ drop action check the rule not exists in the list. send matched packets, check the packets are not dropped. -Test case: Ethertype filter -=========================== - -Ethertype filter_PPPOED ------------------------ - -matched packets:: - - sendp([Ether(dst="00:11:22:33:44:55", type=0x8863)/Raw("x" *80)],iface="ens786f0",count=1) - sendp([Ether(dst="00:11:22:33:44:55")/PPPoED()/Raw("x" *80)],iface="ens786f0",count=1) - -mismatched packets:: - - sendp([Ether(dst="00:11:22:33:44:55", type=0x8864)/Raw("x" *80)],iface="ens786f0",count=1) - sendp([Ether(dst="00:11:22:33:44:55")/PPPoE()/Raw("x" *80)],iface="ens786f0",count=1) - -to queue action -................ - -1. validate a rule:: - - testpmd> flow validate 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end - - get the message:: - - Flow rule validated - - check the flow list:: - - testpmd> flow list 0 - - check the rule not exists in the list. - -2. create a rule:: - - testpmd> flow create 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end - - get the message:: - - Succeeded to create (2) flow - - check the flow list:: - - testpmd> flow list 0 - - check the rule exists in the list. - -3. send matched packets, check the packets are to queue 2. - send mismatched packets, check the packets are not to queue 2. - -4. verify rules can be destroyed:: - - testpmd> flow destroy 0 rule 15360 - testpmd> flow list 0 - - check the rule not exists in the list. - send matched packets, check the packets are not to queue 2. - -5. check the pattern in pipeline mode - - The rules in pipeline mode are similar to rules in non-pipeline mode, - just need to add priority 0 to show it is created as a switch filter rule. - - validate a rule:: - - testpmd> flow validate 0 priority 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end - - create a rule:: - - testpmd> flow create 0 priority 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end - - repeat step 1-4 to check the pattern in pipeline mode. - -drop action -............ - -1. validate a rule:: - - testpmd> flow validate 0 ingress pattern eth type is 0x8863 / end actions drop / end - - get the message:: - - Flow rule validated - - check the flow list:: - - testpmd> flow list 0 - - check the rule not exists in the list. - -2. create a rule:: - - testpmd> flow create 0 ingress pattern eth type is 0x8863 / end actions drop / end - - get the message:: - - Succeeded to create (2) flow - - check the flow list:: - - testpmd> flow list 0 - - check the rule exists in the list. - -3. send matched packets, check the packets are dropped. - send mismatched packets, check the packets are not dropped. - -4. verify rules can be destroyed:: - - testpmd> flow destroy 0 rule 15360 - testpmd> flow list 0 - - check the rule not exists in the list. - send matched packets, check the packets are not to dropped. - -5. check the pattern in pipeline mode - - validate a rule:: - - testpmd> flow validate 0 priority 0 ingress pattern eth type is 0x8863 / end actions drop / end - - create a rule:: - - testpmd> flow create 0 priority 0 ingress pattern eth type is 0x8863 / end actions drop / end - - repeat step 1-4 to check the pattern in pipeline mode. - Test case: unsupported patterns in os default package ===================================================== diff --git a/tests/TestSuite_ice_switch_filter.py b/tests/TestSuite_ice_switch_filter.py index 76bd630f..c9c5b17f 100644 --- a/tests/TestSuite_ice_switch_filter.py +++ b/tests/TestSuite_ice_switch_filter.py @@ -2983,67 +2983,6 @@ tvs_mac_ipv4_nvgre_ipv4_tcp_pipeline_mode = [ tv_mac_ipv4_nvgre_ipv4_tcp_pipeline_mode_drop_03, ] -# test vector ethertype_filter_pppoed -ethertype_filter_pppoed_scapy_str = { - "matched": [ - 'Ether(dst="00:11:22:33:44:55", type=0x8863)/Raw("x" *80)', - 'Ether(dst="00:11:22:33:44:55")/PPPoED()/Raw("x" *80)', - ], - "mismatched": [ - 'Ether(dst="00:11:22:33:44:55", type=0x8864)/Raw("x" *80)', - 'Ether(dst="00:11:22:33:44:55")/PPPoE()/Raw("x" *80)', - ], -} - -tv_ethertype_filter_pppoed_in_queue_01 = { - "name": "tv_ethertype_filter_pppoed_in_queue_01", - "rte_flow_pattern": "flow create 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end", - "configuration": {"is_non_pipeline": True, "is_need_rss_rule": False}, - "matched": { - "scapy_str": ethertype_filter_pppoed_scapy_str["matched"], - "check_func": { - "func": rfc.check_output_log_in_queue, - "param": {"expect_port": 0, "expect_queues": 2}, - }, - "expect_results": {"expect_pkts": 2}, - }, - "mismatched": { - "scapy_str": ethertype_filter_pppoed_scapy_str["mismatched"], - "check_func": { - "func": rfc.check_output_log_in_queue_mismatched, - "param": {"expect_port": 0, "expect_queues": 2}, - }, - "expect_results": {"expect_pkts": 2}, - }, -} - -tv_ethertype_filter_pppoed_drop_02 = { - "name": "tv_ethertype_filter_pppoed_drop_02", - "rte_flow_pattern": "flow create 0 ingress pattern eth type is 0x8863 / end actions drop / end", - "configuration": {"is_non_pipeline": True, "is_need_rss_rule": False}, - "matched": { - "scapy_str": ethertype_filter_pppoed_scapy_str["matched"], - "check_func": { - "func": rfc.check_output_log_drop, - "param": {"expect_port": 0, "expect_queues": "null"}, - }, - "expect_results": {"expect_pkts": 2}, - }, - "mismatched": { - "scapy_str": ethertype_filter_pppoed_scapy_str["mismatched"], - "check_func": { - "func": rfc.check_output_log_drop_mismatched, - "param": {"expect_port": 0, "expect_queues": "null"}, - }, - "expect_results": {"expect_pkts": 2}, - }, -} - -tvs_ethertype_filter_pppoed = [ - tv_ethertype_filter_pppoed_in_queue_01, - tv_ethertype_filter_pppoed_drop_02, -] - # non-tunnel pipeline mode # test vector mac_ipv4_frag_pipeline_mode mac_ipv4_frag_pipeline_mode_scapy_str = { @@ -4920,23 +4859,6 @@ class ICESwitchFilterTest(TestCase): def test_mac_ipv4_nvgre_ipv4_tcp_pipeline_mode(self): self._rte_flow_validate_pattern(tvs_mac_ipv4_nvgre_ipv4_tcp_pipeline_mode) - # ether filter non-pipeline mode - def test_ethertype_filter_pppoed(self): - self._rte_flow_validate_pattern(tvs_ethertype_filter_pppoed) - - # ether filter pipeline mode - def test_ethertype_filter_pppoed_pipeline_mode(self): - tvs_ethertype_filter_pppoed_pipeline_mode = copy.deepcopy( - tvs_ethertype_filter_pppoed - ) - for tv in tvs_ethertype_filter_pppoed_pipeline_mode: - create_rule = tv["rte_flow_pattern"].replace( - "flow create 0", "flow create 0 priority 0" - ) - tv["rte_flow_pattern"] = create_rule - tv["configuration"]["is_non_pipeline"] = False - self._rte_flow_validate_pattern(tvs_ethertype_filter_pppoed_pipeline_mode) - # non-tunnel pipeline mode def test_mac_ipv4_frag_pipeline_mode(self): self._rte_flow_validate_pattern(tvs_mac_ipv4_frag_pipeline_mode) diff --git a/tests/TestSuite_ice_switch_filter_pppoe.py b/tests/TestSuite_ice_switch_filter_pppoe.py index c83195b3..3c840655 100644 --- a/tests/TestSuite_ice_switch_filter_pppoe.py +++ b/tests/TestSuite_ice_switch_filter_pppoe.py @@ -97,6 +97,67 @@ tvs_ethertype_filter_pppoes = [ tv_ethertype_filter_pppoes_drop_03, ] +# test vector ethertype_filter_pppoed +ethertype_filter_pppoed_scapy_str = { + "matched": [ + 'Ether(dst="00:11:22:33:44:55", type=0x8863)/Raw("x" *80)', + 'Ether(dst="00:11:22:33:44:55")/PPPoED()/Raw("x" *80)', + ], + "mismatched": [ + 'Ether(dst="00:11:22:33:44:55", type=0x8864)/Raw("x" *80)', + 'Ether(dst="00:11:22:33:44:55")/PPPoE()/Raw("x" *80)', + ], +} + +tv_ethertype_filter_pppoed_in_queue_01 = { + "name": "tv_ethertype_filter_pppoed_in_queue_01", + "rte_flow_pattern": "flow create 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end", + "configuration": {"is_non_pipeline": True, "is_need_rss_rule": False}, + "matched": { + "scapy_str": ethertype_filter_pppoed_scapy_str["matched"], + "check_func": { + "func": rfc.check_output_log_in_queue, + "param": {"expect_port": 0, "expect_queues": 2}, + }, + "expect_results": {"expect_pkts": 2}, + }, + "mismatched": { + "scapy_str": ethertype_filter_pppoed_scapy_str["mismatched"], + "check_func": { + "func": rfc.check_output_log_in_queue_mismatched, + "param": {"expect_port": 0, "expect_queues": 2}, + }, + "expect_results": {"expect_pkts": 2}, + }, +} + +tv_ethertype_filter_pppoed_drop_02 = { + "name": "tv_ethertype_filter_pppoed_drop_02", + "rte_flow_pattern": "flow create 0 ingress pattern eth type is 0x8863 / end actions drop / end", + "configuration": {"is_non_pipeline": True, "is_need_rss_rule": False}, + "matched": { + "scapy_str": ethertype_filter_pppoed_scapy_str["matched"], + "check_func": { + "func": rfc.check_output_log_drop, + "param": {"expect_port": 0, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 2}, + }, + "mismatched": { + "scapy_str": ethertype_filter_pppoed_scapy_str["mismatched"], + "check_func": { + "func": rfc.check_output_log_drop_mismatched, + "param": {"expect_port": 0, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 2}, + }, +} + +tvs_ethertype_filter_pppoed = [ + tv_ethertype_filter_pppoed_in_queue_01, + tv_ethertype_filter_pppoed_drop_02, +] + # l4 mask # ipv4/ipv6 + udp/tcp pipeline mode mac_pppoes_ipv4_udp_l4_mask_scapy_str = { @@ -2814,6 +2875,7 @@ tv_mac_vlan_pppoe_ipcp_pay_drop_03 = { }, } + tvs_mac_vlan_pppoe_ipcp_pay = [ tv_mac_vlan_pppoe_ipcp_pay_in_queue_01, tv_mac_vlan_pppoe_ipcp_pay_queue_region_02, @@ -3432,6 +3494,23 @@ class ICESwitchFilterPPPOETest(TestCase): def test_mac_vlan_pppoes_l4_mask(self): self._rte_flow_validate_pattern(tvs_mac_vlan_pppoes_l4_mask) + # ether filter non-pipeline mode + def test_ethertype_filter_pppoed(self): + self._rte_flow_validate_pattern(tvs_ethertype_filter_pppoed) + + # ether filter pipeline mode + def test_ethertype_filter_pppoed_pipeline_mode(self): + tvs_ethertype_filter_pppoed_pipeline_mode = copy.deepcopy( + tvs_ethertype_filter_pppoed + ) + for tv in tvs_ethertype_filter_pppoed_pipeline_mode: + create_rule = tv["rte_flow_pattern"].replace( + "flow create 0", "flow create 0 priority 0" + ) + tv["rte_flow_pattern"] = create_rule + tv["configuration"]["is_non_pipeline"] = False + self._rte_flow_validate_pattern(tvs_ethertype_filter_pppoed_pipeline_mode) + # 20.08 def test_mac_vlan_pppoe_ipv4_pay_non_pipeline_mode(self): self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv4_pay_session_id_proto_id)