From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 959BDA04EF; Wed, 3 Jun 2020 08:36:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5A7401C1B9; Wed, 3 Jun 2020 08:36:47 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 43A251C1B7 for ; Wed, 3 Jun 2020 08:36:45 +0200 (CEST) IronPort-SDR: cbSK/JhTMaCQ9cunP1WWoLyrjoxV0cxQVBvJXCVJU7jHlVkYs0w4NgZQa+7VzUJ65k6JsglDYa yqb143lLFpfg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2020 23:36:44 -0700 IronPort-SDR: mk3skNrqJh8uOcdACLGaLrHqXfaKyaAIVM8bUO6M1Fv17W6ec3a5BKvbf4+PCR1PrVWVqqvBAc V6mjS/mzGP7g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,467,1583222400"; d="scan'208";a="444985162" Received: from dpdk-qifu-cxl.sh.intel.com ([10.67.119.67]) by orsmga005.jf.intel.com with ESMTP; 02 Jun 2020 23:36:42 -0700 From: Fu Qi To: dts@dpdk.org Cc: Fu Qi Date: Wed, 3 Jun 2020 11:28:36 -0400 Message-Id: <20200603152836.4610-1-qi.fu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH V1]tests/TestSuite_cvl_dcf_switch_filter: add l2tp and esp test cases to dcf switch filter X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "dts" Add test cases for l2tpv3 and esp supported in cvl dcf switch filter. Signed-off-by: Fu Qi --- tests/TestSuite_cvl_dcf_switch_filter.py | 164 +++++++++++++++++++++++ 1 file changed, 164 insertions(+) diff --git a/tests/TestSuite_cvl_dcf_switch_filter.py b/tests/TestSuite_cvl_dcf_switch_filter.py index e8136d2..5c39eaa 100644 --- a/tests/TestSuite_cvl_dcf_switch_filter.py +++ b/tests/TestSuite_cvl_dcf_switch_filter.py @@ -556,6 +556,126 @@ tv_vlan_filter = { "expect_results":{"expect_pkts":0}} } +tv_mac_ipv4_l2tpv3 = { + "name":"tv_mac_ipv4_l2tpv3", + "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 vf id 1 / end", + "matched":{"scapy_str":["Ether(dst='00:11:22:33:44:12')/IP(src='192.168.0.2', proto=115)/L2TP('\\x00\\x00\\x00\\x01')/('X'*480)"], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":["Ether(dst='00:11:22:33:44:12')/IP(src='192.168.0.2', proto=115)/L2TP('\\x00\\x00\\x00\\x02')/('X'*480)", + "Ether(dst='00:11:22:33:44:12')/IP(src='192.168.1.2', proto=115)/L2TP('\\x00\\x00\\x00\\x01')/('X'*480)", + "Ether(dst='00:11:22:33:44:12')/IP(dst='192.168.0.2', proto=115)/L2TP('\\x00\\x00\\x00\\x01')/('X'*480)"], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":0}} +} + +tv_mac_ipv6_l2tpv3 = { + "name":"tv_mac_ipv6_l2tpv3", + "rte_flow_pattern":"flow create 0 priority 0 ingress pattern eth / ipv6 dst is 1111:2222:3333:4444:5555:6666:7777:8888 / l2tpv3oip session_id is 1 / end actions vf id 1 / end", + "matched":{"scapy_str":["Ether(dst='00:11:22:33:44:13')/IPv6(dst='1111:2222:3333:4444:5555:6666:7777:8888', nh=115)/L2TP('\\x00\\x00\\x00\\x01')/('X'*480)"], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":["Ether(dst='00:11:22:33:44:13')/IPv6(dst='1111:2222:3333:4444:5555:6666:7777:8888', nh=115)/L2TP('\\x00\\x00\\x00\\x02')/('X'*480)", + "Ether(dst='00:11:22:33:44:13')/IPv6(dst='1111:2222:3333:4444:5555:6666:7777:9999', nh=115)/L2TP('\\x00\\x00\\x00\\x01')/('X'*480)", + "Ether(dst='00:11:22:33:44:13')/IPv6(src='1111:2222:3333:4444:5555:6666:7777:8888', nh=115)/L2TP('\\x00\\x00\\x00\\x01')/('X'*480)"], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":0}} +} + +tv_mac_ipv4_esp = { + "name":"tv_mac_ipv4_esp", + "rte_flow_pattern":"flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 / esp spi is 1 / end actions vf id 1 / end", + "matched":{"scapy_str":['Ether(dst="00:11:22:33:44:13")/IP(src="192.168.0.2", proto=50)/ESP(spi=1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":['Ether(dst="00:11:22:33:44:22")/IP(src="192.168.0.2", proto=50)/ESP(spi=2)/("X"*480)', + 'Ether(dst="00:11:22:33:44:22")/IP(src="192.168.1.2", proto=50)/ESP(spi=1)/("X"*480)', + 'Ether(dst="00:11:22:33:44:13")/IP(dst="192.168.0.2", proto=50)/ESP(spi=1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":0}} +} + +tv_mac_ipv6_esp = { + "name":"tv_mac_ipv6_esp", + "rte_flow_pattern":"flow create 0 priority 0 ingress pattern eth / ipv6 dst is 1111:2222:3333:4444:5555:6666:7777:8888 / esp spi is 1 / end actions vf id 1 / end", + "matched":{"scapy_str":['Ether(dst="00:11:22:33:44:13")/IPv6(dst="1111:2222:3333:4444:5555:6666:7777:8888", nh=50)/ESP(spi=1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":['Ether(dst="00:11:22:33:44:13")/IPv6(dst="1111:2222:3333:4444:5555:6666:7777:8888", nh=50)/ESP(spi=2)/("X"*480)', + 'Ether(dst="00:11:22:33:44:13")/IPv6(dst="1111:2222:3333:4444:5555:6666:7777:9999", nh=50)/ESP(spi=1)/("X"*480)', + 'Ether(dst="00:11:22:33:44:13")/IPv6(src="1111:2222:3333:4444:5555:6666:7777:8888", nh=50)/ESP(spi=1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":0}} +} + +tv_mac_ipv4_ah = { + "name":"tv_mac_ipv4_ah", + "rte_flow_pattern":"flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 / ah spi is 1 / end actions vf id 1 / end", + "matched":{"scapy_str":['Ether(dst="00:11:22:33:44:13")/IP(src="192.168.0.2", proto=51)/AH(spi=1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":['Ether(dst="00:11:22:33:44:13")/IP(src="192.168.0.2", proto=51)/AH(spi=2)/("X"*480)', + 'Ether(dst="00:11:22:33:44:13")/IP(src="192.168.10.2", proto=51)/AH(spi=1)/("X"*480)', + 'Ether(dst="00:11:22:33:44:13")/IP(dst="192.168.0.2", proto=51)/AH(spi=1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":0}} +} + +tv_mac_ipv6_ah = { + "name":"tv_mac_ipv6_ah", + "rte_flow_pattern":"flow create 0 priority 0 ingress pattern eth / ipv6 dst is 1111:2222:3333:4444:5555:6666:7777:8888 / ah spi is 1 / end actions vf id 1 / end", + "matched":{"scapy_str":['Ether(dst="00:11:22:33:44:13")/IPv6(dst="1111:2222:3333:4444:5555:6666:7777:8888", nh=51)/AH(spi=1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":['Ether(dst="00:11:22:33:44:13")/IPv6(dst="1111:2222:3333:4444:5555:6666:7777:8888", nh=51)/AH(spi=2)/("X"*480)', + 'Ether(dst="00:11:22:33:44:13")/IPv6(dst="1111:2222:3333:4444:5555:6666:7777:9999", nh=51)/AH(spi=1)/("X"*480)', + 'Ether(dst="00:11:22:33:44:13")/IPv6(src="1111:2222:3333:4444:5555:6666:7777:8888", nh=51)/AH(spi=1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":0}} +} + +tv_mac_ipv4_nat_t_esp = { + "name":"tv_mac_ipv4_nat_t_esp", + "rte_flow_pattern":"flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 / udp / esp spi is 1 / end actions vf id 1 / end", + "matched":{"scapy_str":['Ether(dst="00:11:22:33:44:13")/IP(src="192.168.0.2")/UDP(dport=4500)/ESP(spi=1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":['Ether(dst="00:11:22:33:44:13")/IP(src="192.168.0.2")/UDP(dport=4500)/ESP(spi=2)/("X"*480)', + 'Ether(dst="00:11:22:33:44:13")/IP(src="192.168.1.2")/UDP(dport=4500)/ESP(spi=1)/("X"*480)', + 'Ether(dst="00:11:22:33:44:13")/IP(dst="192.168.0.2")/UDP(dport=4500)/ESP(spi=1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":0}} +} + +tv_mac_ipv6_nat_t_esp = { + "name":"tv_mac_ipv6_nat_t_esp", + "rte_flow_pattern":"flow create 0 priority 0 ingress pattern eth / ipv6 dst is 1111:2222:3333:4444:5555:6666:7777:8888 / udp / esp spi is 1 / end actions vf id 1 / end", + "matched":{"scapy_str":['Ether(dst="00:11:22:33:44:13")/IPv6(dst="1111:2222:3333:4444:5555:6666:7777:8888")/UDP(dport=4500)/ESP(spi=1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":['Ether(dst="00:11:22:33:44:13")/IPv6(dst="1111:2222:3333:4444:5555:6666:7777:8888")/UDP(dport=4500)/ESP(spi=2)/("X"*480)', + 'Ether(dst="00:11:22:33:44:13")/IPv6(dst="1111:2222:3333:4444:5555:6666:7777:9999")/UDP(dport=4500)/ESP(spi=1)/("X"*480)', + 'Ether(dst="00:11:22:33:44:13")/IPv6(src="1111:2222:3333:4444:5555:6666:7777:8888")/UDP(dport=4500)/ESP(spi=1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"null"}}, + "expect_results":{"expect_pkts":0}} +} + tv_actions_vf_id_0 = { "name":"tv_actions_vf_id_0", "rte_flow_pattern":"flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / tcp src is 25 dst is 23 / end actions vf id 0 / end", @@ -1157,6 +1277,38 @@ class SwitchFilterTest(TestCase): self.setup_1pf_vfs_env() self._rte_flow_validate_pattern(tv_vlan_filter) + def test_mac_ipv4_l2tpv3(self): + self.setup_1pf_vfs_env() + self._rte_flow_validate_pattern(tv_mac_ipv4_l2tpv3) + + def test_mac_ipv6_l2tpv3(self): + self.setup_1pf_vfs_env() + self._rte_flow_validate_pattern(tv_mac_ipv6_l2tpv3) + + def test_mac_ipv4_esp(self): + self.setup_1pf_vfs_env() + self._rte_flow_validate_pattern(tv_mac_ipv4_esp) + + def test_mac_ipv6_esp(self): + self.setup_1pf_vfs_env() + self._rte_flow_validate_pattern(tv_mac_ipv6_esp) + + def test_mac_ipv4_ah(self): + self.setup_1pf_vfs_env() + self._rte_flow_validate_pattern(tv_mac_ipv4_ah) + + def test_mac_ipv6_ah(self): + self.setup_1pf_vfs_env() + self._rte_flow_validate_pattern(tv_mac_ipv6_ah) + + def test_mac_ipv4_nat_t_esp(self): + self.setup_1pf_vfs_env() + self._rte_flow_validate_pattern(tv_mac_ipv4_nat_t_esp) + + def test_mac_ipv6_nat_t_esp(self): + self.setup_1pf_vfs_env() + self._rte_flow_validate_pattern(tv_mac_ipv6_nat_t_esp) + def test_actions_vf_id_0(self): #set up 4 vfs on 1 pf environment self.setup_1pf_vfs_env() @@ -1217,6 +1369,18 @@ class SwitchFilterTest(TestCase): self.verify("Failed to create flow" in out and "Invalid input pattern" in out, "Log not provide a friendly output to indicate that the mac_ipv4_pfcp_node rule failed to create.") #check the rule list self.check_switch_filter_rule_list(0, []) + #create a l2tpv3 rule which is not supported in os default + rule = "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 / l2tpv3oip session_id is 1 / end actions vf id 1 / end" + out = self.dut.send_expect(rule, "testpmd> ", timeout=2) #create a rule + self.verify("Failed to create flow" in out and "Invalid input pattern" in out, "Log not provide a friendly output to indicate that the l2tpv3 rule failed to create.") + #check the rule list + self.check_switch_filter_rule_list(0, []) + #create a esp rule which is not supported in os default + rule = "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 / esp spi is 1 / end actions vf id 1 / end" + out = self.dut.send_expect(rule, "testpmd> ", timeout=2) #create a rule + self.verify("Failed to create flow" in out and "Invalid input pattern" in out, "Log not provide a friendly output to indicate that the esp rule failed to create.") + #check the rule list + self.check_switch_filter_rule_list(0, []) def test_unsupported_input_set(self): #set up 4 vfs on 1 pf environment -- 2.17.1