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 85A16A00C5; Thu, 11 Jun 2020 14:04:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 43145FFA; Thu, 11 Jun 2020 14:04:57 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 1A1342AB for ; Thu, 11 Jun 2020 14:04:55 +0200 (CEST) IronPort-SDR: gQAMaybJl32BPjIFwRLkU7b0h+MluL8R3C52nVCiMl7DI8e1ZNszDJASViia6Oqlzir3GPELHt +98gmngmWg4A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2020 05:04:49 -0700 IronPort-SDR: 0WsAQ/pjg7eB/gYEaJI1FZuozE4cX93bPPAXIXm2IV1NUbNJ5aJaPIvC38pf1rLl206OGq3sSP giaH/kUAW2GA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,499,1583222400"; d="scan'208";a="275311663" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga006.jf.intel.com with ESMTP; 11 Jun 2020 05:04:49 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 11 Jun 2020 05:04:48 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 11 Jun 2020 05:04:48 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.85]) by shsmsx102.ccr.corp.intel.com ([169.254.2.36]) with mapi id 14.03.0439.000; Thu, 11 Jun 2020 20:04:45 +0800 From: "Tu, Lijuan" To: "Fu, Qi" , "dts@dpdk.org" CC: "Fu, Qi" Thread-Topic: [dts] [PATCH V1]tests/TestSuite_cvl_dcf_switch_filter: add l2tp and esp test cases to dcf switch filter Thread-Index: AQHWOXFlT5J5MCJLCUGmFym2yfi3O6jTXgzQ Date: Thu, 11 Jun 2020 12:04:43 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC5BB2B@SHSMSX101.ccr.corp.intel.com> References: <20200603152836.4610-1-qi.fu@intel.com> In-Reply-To: <20200603152836.4610-1-qi.fu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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" Applied, thanks -----Original Message----- From: dts On Behalf Of Fu Qi Sent: 2020=1B$BG/=1B(B6=1B$B7n=1B(B3=1B$BF|=1B(B 23:29 To: dts@dpdk.org Cc: Fu, Qi Subject: [dts] [PATCH V1]tests/TestSuite_cvl_dcf_switch_filter: add l2tp an= d esp test cases to dcf switch filter 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 =3D { "expect_results":{"expect_pkts":0}} } =20 +tv_mac_ipv4_l2tpv3 =3D { + "name":"tv_mac_ipv4_l2tpv3", + "rte_flow_pattern":"flow create 0 priority 0 ingress pattern eth / ipv= 4 src is 192.168.0.2 / l2tpv3oip session_id is 1 / end actions vf id 1 / en= d", + "matched":{"scapy_str":["Ether(dst=3D'00:11:22:33:44:12')/IP(src=3D'19= 2.168.0.2', proto=3D115)/L2TP('\\x00\\x00\\x00\\x01')/('X'*480)"], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"nu= ll"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":["Ether(dst=3D'00:11:22:33:44:12')/IP(src=3D= '192.168.0.2', proto=3D115)/L2TP('\\x00\\x00\\x00\\x02')/('X'*480)", + "Ether(dst=3D'00:11:22:33:44:12')/IP(src=3D= '192.168.1.2', proto=3D115)/L2TP('\\x00\\x00\\x00\\x01')/('X'*480)", + "Ether(dst=3D'00:11:22:33:44:12')/IP(dst=3D= '192.168.0.2', proto=3D115)/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 =3D { + "name":"tv_mac_ipv6_l2tpv3", + "rte_flow_pattern":"flow create 0 priority 0 ingress pattern eth / ipv= 6 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=3D'00:11:22:33:44:13')/IPv6(dst=3D'= 1111:2222:3333:4444:5555:6666:7777:8888', nh=3D115)/L2TP('\\x00\\x00\\x00\\= x01')/('X'*480)"], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"nu= ll"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":["Ether(dst=3D'00:11:22:33:44:13')/IPv6(dst= =3D'1111:2222:3333:4444:5555:6666:7777:8888', nh=3D115)/L2TP('\\x00\\x00\\x= 00\\x02')/('X'*480)", + "Ether(dst=3D'00:11:22:33:44:13')/IPv6(dst= =3D'1111:2222:3333:4444:5555:6666:7777:9999', nh=3D115)/L2TP('\\x00\\x00\\x= 00\\x01')/('X'*480)", + "Ether(dst=3D'00:11:22:33:44:13')/IPv6(src= =3D'1111:2222:3333:4444:5555:6666:7777:8888', nh=3D115)/L2TP('\\x00\\x00\\x= 00\\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 =3D { + "name":"tv_mac_ipv4_esp", + "rte_flow_pattern":"flow create 0 priority 0 ingress pattern eth / ipv= 4 src is 192.168.0.2 / esp spi is 1 / end actions vf id 1 / end", + "matched":{"scapy_str":['Ether(dst=3D"00:11:22:33:44:13")/IP(src=3D"19= 2.168.0.2", proto=3D50)/ESP(spi=3D1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"nu= ll"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":['Ether(dst=3D"00:11:22:33:44:22")/IP(src=3D= "192.168.0.2", proto=3D50)/ESP(spi=3D2)/("X"*480)', + 'Ether(dst=3D"00:11:22:33:44:22")/IP(src=3D= "192.168.1.2", proto=3D50)/ESP(spi=3D1)/("X"*480)', + 'Ether(dst=3D"00:11:22:33:44:13")/IP(dst=3D= "192.168.0.2", proto=3D50)/ESP(spi=3D1)/("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 =3D { + "name":"tv_mac_ipv6_esp", + "rte_flow_pattern":"flow create 0 priority 0 ingress pattern eth / ipv= 6 dst is 1111:2222:3333:4444:5555:6666:7777:8888 / esp spi is 1 / end actio= ns vf id 1 / end", + "matched":{"scapy_str":['Ether(dst=3D"00:11:22:33:44:13")/IPv6(dst=3D"= 1111:2222:3333:4444:5555:6666:7777:8888", nh=3D50)/ESP(spi=3D1)/("X"*480)']= , + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"nu= ll"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":['Ether(dst=3D"00:11:22:33:44:13")/IPv6(dst= =3D"1111:2222:3333:4444:5555:6666:7777:8888", nh=3D50)/ESP(spi=3D2)/("X"*48= 0)', + 'Ether(dst=3D"00:11:22:33:44:13")/IPv6(dst= =3D"1111:2222:3333:4444:5555:6666:7777:9999", nh=3D50)/ESP(spi=3D1)/("X"*48= 0)', + 'Ether(dst=3D"00:11:22:33:44:13")/IPv6(src= =3D"1111:2222:3333:4444:5555:6666:7777:8888", nh=3D50)/ESP(spi=3D1)/("X"*48= 0)'], + "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 =3D { + "name":"tv_mac_ipv4_ah", + "rte_flow_pattern":"flow create 0 priority 0 ingress pattern eth / ipv= 4 src is 192.168.0.2 / ah spi is 1 / end actions vf id 1 / end", + "matched":{"scapy_str":['Ether(dst=3D"00:11:22:33:44:13")/IP(src=3D"19= 2.168.0.2", proto=3D51)/AH(spi=3D1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"nu= ll"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":['Ether(dst=3D"00:11:22:33:44:13")/IP(src=3D= "192.168.0.2", proto=3D51)/AH(spi=3D2)/("X"*480)', + 'Ether(dst=3D"00:11:22:33:44:13")/IP(src=3D= "192.168.10.2", proto=3D51)/AH(spi=3D1)/("X"*480)', + 'Ether(dst=3D"00:11:22:33:44:13")/IP(dst=3D= "192.168.0.2", proto=3D51)/AH(spi=3D1)/("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 =3D { + "name":"tv_mac_ipv6_ah", + "rte_flow_pattern":"flow create 0 priority 0 ingress pattern eth / ipv= 6 dst is 1111:2222:3333:4444:5555:6666:7777:8888 / ah spi is 1 / end action= s vf id 1 / end", + "matched":{"scapy_str":['Ether(dst=3D"00:11:22:33:44:13")/IPv6(dst=3D"= 1111:2222:3333:4444:5555:6666:7777:8888", nh=3D51)/AH(spi=3D1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"nu= ll"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":['Ether(dst=3D"00:11:22:33:44:13")/IPv6(dst= =3D"1111:2222:3333:4444:5555:6666:7777:8888", nh=3D51)/AH(spi=3D2)/("X"*480= )', + 'Ether(dst=3D"00:11:22:33:44:13")/IPv6(dst= =3D"1111:2222:3333:4444:5555:6666:7777:9999", nh=3D51)/AH(spi=3D1)/("X"*480= )', + 'Ether(dst=3D"00:11:22:33:44:13")/IPv6(src= =3D"1111:2222:3333:4444:5555:6666:7777:8888", nh=3D51)/AH(spi=3D1)/("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 =3D { + "name":"tv_mac_ipv4_nat_t_esp", + "rte_flow_pattern":"flow create 0 priority 0 ingress pattern eth / ipv= 4 src is 192.168.0.2 / udp / esp spi is 1 / end actions vf id 1 / end", + "matched":{"scapy_str":['Ether(dst=3D"00:11:22:33:44:13")/IP(src=3D"19= 2.168.0.2")/UDP(dport=3D4500)/ESP(spi=3D1)/("X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"nu= ll"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":['Ether(dst=3D"00:11:22:33:44:13")/IP(src=3D= "192.168.0.2")/UDP(dport=3D4500)/ESP(spi=3D2)/("X"*480)', + 'Ether(dst=3D"00:11:22:33:44:13")/IP(src=3D= "192.168.1.2")/UDP(dport=3D4500)/ESP(spi=3D1)/("X"*480)', + 'Ether(dst=3D"00:11:22:33:44:13")/IP(dst=3D= "192.168.0.2")/UDP(dport=3D4500)/ESP(spi=3D1)/("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 =3D { + "name":"tv_mac_ipv6_nat_t_esp", + "rte_flow_pattern":"flow create 0 priority 0 ingress pattern eth / ipv= 6 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=3D"00:11:22:33:44:13")/IPv6(dst=3D"= 1111:2222:3333:4444:5555:6666:7777:8888")/UDP(dport=3D4500)/ESP(spi=3D1)/("= X"*480)'], + "check_func":{"func":rfc.check_vf_rx_packets_number, + "param":{"expect_port":1, "expect_queues":"nu= ll"}}, + "expect_results":{"expect_pkts":1}}, + "mismatched":{"scapy_str":['Ether(dst=3D"00:11:22:33:44:13")/IPv6(dst= =3D"1111:2222:3333:4444:5555:6666:7777:8888")/UDP(dport=3D4500)/ESP(spi=3D2= )/("X"*480)', + 'Ether(dst=3D"00:11:22:33:44:13")/IPv6(dst= =3D"1111:2222:3333:4444:5555:6666:7777:9999")/UDP(dport=3D4500)/ESP(spi=3D1= )/("X"*480)', + 'Ether(dst=3D"00:11:22:33:44:13")/IPv6(src= =3D"1111:2222:3333:4444:5555:6666:7777:8888")/UDP(dport=3D4500)/ESP(spi=3D1= )/("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 =3D { "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 / t= cp 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) =20 + 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 patt= ern" in out, "Log not provide a friendly output to indicate that the mac_ip= v4_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 =3D "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 =3D self.dut.send_expect(rule, "testpmd> ", timeout=3D2) #cre= ate a rule + self.verify("Failed to create flow" in out and "Invalid input patt= ern" 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 =3D "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 =3D self.dut.send_expect(rule, "testpmd> ", timeout=3D2) #cre= ate a rule + self.verify("Failed to create flow" in out and "Invalid input patt= ern" in out, "Log not provide a friendly output to indicate that the esp ru= le failed to create.") + #check the rule list + self.check_switch_filter_rule_list(0, []) =20 def test_unsupported_input_set(self): #set up 4 vfs on 1 pf environment -- 2.17.1