From patchwork Wed Jul 20 10:02:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 114059 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 49864A0032; Wed, 20 Jul 2022 03:41:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2196640FAE; Wed, 20 Jul 2022 03:41:53 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 1ED2840697 for ; Wed, 20 Jul 2022 03:41:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658281312; x=1689817312; h=from:to:cc:subject:date:message-id; bh=y65a7POXZNUfUFbOsVg2ciqHiVT4JoiK4c2bwGT6lc8=; b=oFw9cOfk8jBinsI6zXH7dalfvJ5KoGPAOOmNnIS41nIP8hCHKt4WarNy 1PHPDqjYRzpObtsO4+BAweThOYHAvpSPz/Cd8JsD0J+zr5dG6yPx6j3z2 TCDrlU0Y/X0qWoDm5h9QWbLFcBigFcslB1nEGVTEtJ4LujlwKTl6ObMWe 1fWp12ulV6haSM2OkpS5HBvGScx18NIjm9xeCFqJVds4ob9ZsWMMDjLK2 SxeHZS/a4KGqdncz6D4QKj3GHHShoCXk2smzaqek8bjwxNFEQj4CtYBOy ysVKzYu8b4VfkkzxdW21je+bcyveG/qfiNRtifyfOQW6xEHC47kyAAppI A==; X-IronPort-AV: E=McAfee;i="6400,9594,10413"; a="285418952" X-IronPort-AV: E=Sophos;i="5.92,285,1650956400"; d="scan'208";a="285418952" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2022 18:41:45 -0700 X-IronPort-AV: E=Sophos;i="5.92,285,1650956400"; d="scan'208";a="625446772" Received: from unknown (HELO localhost.localdomain) ([10.239.252.94]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2022 18:41:44 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Subject: [dts] [PATCH V1 1/2] test_plans/ice_dcf_switch_filter: add case Date: Wed, 20 Jul 2022 10:02:42 +0000 Message-Id: <20220720100243.31535-1-songx.jiale@intel.com> X-Mailer: git-send-email 2.17.1 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 add case to test l4 multicast. Signed-off-by: Jiale Song --- .../ice_dcf_switch_filter_test_plan.rst | 366 +++++++++++++++++- 1 file changed, 365 insertions(+), 1 deletion(-) diff --git a/test_plans/ice_dcf_switch_filter_test_plan.rst b/test_plans/ice_dcf_switch_filter_test_plan.rst index 0d38c218..afc3cc94 100644 --- a/test_plans/ice_dcf_switch_filter_test_plan.rst +++ b/test_plans/ice_dcf_switch_filter_test_plan.rst @@ -94,8 +94,12 @@ Pattern and input set | | MAC_IPV6_PFCP_SESSION | [Dest Port], [S-field] | +---------------------+-------------------------------+-------------------------------------------+ | | IP multicast | [Dest IP] | - | multicast +-------------------------------+-------------------------------------------+ + | +-------------------------------+-------------------------------------------+ | | L2 multicast | [Dest MAC] | + | multicast +-------------------------------+-------------------------------------------+ + | | IPV4/IPV6 + UDP/TCP multicast | [Dest Port] | + | | VXLAN + UDP/TCP multicast | [Dest Port] | + | | NVGRE + UDP/TCP multicast | [Dest Port] | +---------------------+-------------------------------+-------------------------------------------+ | | ethertype filter_PPPOD | [Ether type] | | +-------------------------------+-------------------------------------------+ @@ -3582,3 +3586,363 @@ Subcase 8: DCF DROP blend PACKAGES check the rules not exist in the list. send matched packets, check port can receive the packet. + +Subcase 9: MAC_IPV4_TCP + L4 MASK + drop +----------------------------------------- +1. validate a rule:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 / tcp src is 2345 src mask 0x0f0f / 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 MAC_IPV4_L2TP_PAY rule:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 / tcp src is 2345 src mask 0x0f0f / end actions drop / end + testpmd> flow list 0 + + check the rule exists in the list. + +3. send matched packets:: + + sendp([Ether(dst={vf1_mac})/IP()/TCP(sport=2313,dport=23)/Raw("x"*80)], iface="enp27s0f0", count=1) + sendp([Ether(dst={vf1_mac})/IP()/TCP(sport=2553,dport=23)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 can't receive the packet. + +4. send mismatched packets:: + + sendp([Ether(dst={vf1_mac})/IP(src="192.168.0.2",dst="192.168.0.3",tos=4)/TCP(sport=2344,dport=23)/Raw("x"*80)], iface="enp27s0f0", count=1) + sendp([Ether(dst={vf1_mac})/IP(src="192.168.0.2",dst="192.168.0.3",tos=4)/TCP(sport=2601,dport=23)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 can receive the packet. + +5. verify rules can be destroyed:: + + testpmd> flow flush 0 + testpmd> flow list 0 + + check the rules not exist in the list. + send matched packets, check port 1 can receive the packet. + +Subcase 10: MAC_IPV6_UDP + L4 MASK + drop +------------------------------------------ +1. validate a rule:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv6 / udp dst is 3333 dst mask 0x0ff0 / 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 MAC_IPV4_L2TP_PAY rule:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv6 / udp dst is 3333 dst mask 0x0ff0 / end actions drop / end + testpmd> flow list 0 + + check the rule exists in the list. + +3. send matched packets:: + + sendp([Ether(dst={vf1_mac})/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/UDP(sport=10,dport=3328)/Raw("x"*80)], iface="enp27s0f0", count=1) + sendp([Ether(dst={vf1_mac})/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/UDP(sport=20,dport=3343)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 can't receive the packet. + +4. send mismatched packets:: + + sendp([Ether(dst={vf1_mac})/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/UDP(sport=50,dport=3077)/Raw("x"*80)], iface="enp27s0f0", count=1) + sendp([Ether(dst={vf1_mac})/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/UDP(sport=50,dport=3349)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 can receive the packet. + +5. verify rules can be destroyed:: + + testpmd> flow flush 0 + testpmd> flow list 0 + + check the rules not exist in the list. + send matched packets, check port 1 can receive the packet. + +Subcase 11: MAC_IPV4_UDP_VXLAN_MAC_IPV4_TCP + L4 MASK + drop +------------------------------------------------------------- +1. validate a rule:: + + testpmd> rx_vxlan_port add 4789 0 + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 / udp / vxlan / eth / ipv4 / tcp src is 32 src mask 0x0f / 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 MAC_IPV4_L2TP_PAY rule:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 / udp / vxlan / eth / ipv4 / tcp src is 32 src mask 0x0f / end actions drop / end + testpmd> flow list 0 + + check the rule exists in the list. + +3. send matched packets:: + + sendp([Ether(dst={vf1_mac})/IP()/UDP()/VXLAN()/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/TCP(sport=32,dport=22)/Raw("x"*80)], iface="enp27s0f0", count=1) + sendp([Ether(dst={vf1_mac})/IP()/UDP()/VXLAN()/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/TCP(sport=16,dport=22)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 can't receive the packet. + +4. send mismatched packets:: + + sendp([Ether(dst={vf1_mac})/IP()/UDP()/VXLAN()/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/TCP(sport=33,dport=22)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 can receive the packet. + +5. verify rules can be destroyed:: + + testpmd> flow flush 0 + testpmd> flow list 0 + + check the rules not exist in the list. + send matched packets, check port 1 can receive the packet. + +Subcase 11: MAC_IPV4_NVGRE_MAC_IPV4_TCP + L4 MASK + drop +--------------------------------------------------------- +1. validate a rule:: + + testpmd> flow validate 0 ingress pattern eth / ipv4 dst is 192.168.0.1 / nvgre tni is 0x8 / eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / tcp dst is 1280 dst mask 0x00ff / 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 MAC_IPV4_L2TP_PAY rule:: + + testpmd> flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.1 / nvgre tni is 0x8 / eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / tcp dst is 1280 dst mask 0x00ff / end actions drop / end + testpmd> flow list 0 + + check the rule exists in the list. + +3. send matched packets:: + + sendp([Ether(dst={vf1_mac})/IP(dst="192.168.0.1")/NVGRE(TNI=0x8)/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/TCP(sport=50,dport=1280)/Raw("x"*80)], iface="enp27s0f0", count=1) + sendp([Ether(dst={vf1_mac})/IP(dst="192.168.0.1")/NVGRE(TNI=0x8)/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/TCP(sport=50,dport=1536)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 can't receive the packet. + +4. send mismatched packets:: + + sendp([Ether(dst={vf1_mac})/IP(dst="192.168.0.1")/NVGRE(TNI=0x8)/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/TCP(sport=50,dport=1281)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 can receive the packet. + +5. verify rules can be destroyed:: + + testpmd> flow flush 0 + testpmd> flow list 0 + + check the rules not exist in the list. + send matched packets, check port 1 can receive the packet. + +Test case: IPv4/IPv6 + TCP/UDP + L4 MASK +======================================== +Subcase 1: MAC_IPV4_UDP + L4 MASK + single vf +---------------------------------------------- +1. validate a rule:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 / udp src is 2152 src mask 0xff00 dst is 1281 dst mask 0x00ff / end actions vf id 1 / 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 MAC_IPV4_L2TP_PAY rule:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 / udp src is 2152 src mask 0xff00 dst is 1281 dst mask 0x00ff / end actions vf id 1 / end + testpmd> flow list 0 + + check the rule exists in the list. + +3. send matched packets:: + + sendp([Ether(dst="00:11:22:33:44:66")/IP(src="192.168.0.2",dst="192.168.0.3",tos=4)/UDP(sport=2048,dport=1)/Raw("x"*80)], iface="enp27s0f0", count=1) + sendp([Ether(dst="00:11:22:33:44:66")/IP(src="192.168.0.2",dst="192.168.0.3",tos=4)/UDP(sport=2303,dport=3841)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 receive the packet. + +4. send mismatched packets:: + + sendp([Ether(dst="00:11:22:33:44:66")/IP(src="192.168.0.2",dst="192.168.0.3",tos=4)/UDP(sport=2047,dport=2)/Raw("x"*80)], iface="enp27s0f0", count=1) + sendp([Ether(dst="00:11:22:33:44:66")/IP(src="192.168.0.2",dst="192.168.0.3",tos=4)/UDP(sport=2058,dport=3586)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 can not receive the packet. + +5. verify rules can be destroyed:: + + testpmd> flow flush 0 + testpmd> flow list 0 + + check the rules not exist in the list. + send matched packets, check port 1 can not receive the packet. + +Subcase 2: MAC_IPV6_TCP + L4 MASK + single vf +---------------------------------------------- +1. validate a rule:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv6 / tcp dst is 3333 dst mask 0x0ff0 / end actions vf id 1 / 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 MAC_IPV4_L2TP_PAY rule:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv6 / tcp dst is 3333 dst mask 0x0ff0 / end actions vf id 1 / end + testpmd> flow list 0 + + check the rule exists in the list. + +3. send matched packets:: + + sendp([Ether(dst="00:11:22:33:44:66")/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/TCP(sport=10,dport=3328)/Raw("x"*80)], iface="enp27s0f0", count=1) + sendp([Ether(dst="00:11:22:33:44:66")/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/TCP(sport=20,dport=3343)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 receive the packet. + +4. send mismatched packets:: + + sendp([Ether(dst="00:11:22:33:44:66")/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/TCP(sport=50,dport=3077)/Raw("x"*80)], iface="enp27s0f0", count=1) + sendp([Ether(dst="00:11:22:33:44:66")/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/TCP(sport=50,dport=3349)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 can not receive the packet. + +5. verify rules can be destroyed:: + + testpmd> flow flush 0 + testpmd> flow list 0 + + check the rules not exist in the list. + send matched packets, check port 1 can not receive the packet. + +Subcase 3: MAC_IPV4_UDP_VXLAN_MAC_IPV4_UDP + L4 MASK + single vf +----------------------------------------------------------------- +1. validate a rule:: + + testpmd> rx_vxlan_port add 4789 0 + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 / udp / vxlan / eth / ipv4 / udp src is 32 src mask 0x0f / end actions vf id 1 / 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 MAC_IPV4_L2TP_PAY rule:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 / udp / vxlan / eth / ipv4 / udp src is 32 src mask 0x0f / end actions vf id 1 / end + testpmd> flow list 0 + + check the rule exists in the list. + +3. send matched packets:: + + sendp([Ether(dst="00:11:22:33:44:66")/IP()/UDP()/VXLAN()/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/UDP(sport=32,dport=22)/Raw("x"*80)], iface="enp27s0f0", count=1) + sendp([Ether(dst="00:11:22:33:44:66")/IP()/UDP()/VXLAN()/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/UDP(sport=16,dport=22)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 receive the packet. + +4. send mismatched packets:: + + sendp([Ether(dst="00:11:22:33:44:66")/IP()/UDP()/VXLAN()/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/UDP(sport=33,dport=22)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 can not receive the packet. + +5. verify rules can be destroyed:: + + testpmd> flow flush 0 + testpmd> flow list 0 + + check the rules not exist in the list. + send matched packets, check port 1 can not receive the packet. + +Subcase 4: MAC_IPV4_NVGRE_MAC_IPV4_UDP + L4 MASK + single vf +------------------------------------------------------------- +1. validate a rule:: + + testpmd> flow validate 0 ingress pattern eth / ipv4 dst is 192.168.0.1 / nvgre tni is 0x8 / eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / udp src is 1280 src mask 0x00ff / end actions vf id 1 / 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 MAC_IPV4_L2TP_PAY rule:: + + testpmd> flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.1 / nvgre tni is 0x8 / eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / udp src is 1280 src mask 0x00ff / end actions vf id 1 / end + testpmd> flow list 0 + + check the rule exists in the list. + +3. send matched packets:: + + sendp([Ether(dst="00:11:22:33:44:66")/IP(dst="192.168.0.1")/NVGRE(TNI=0x8)/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/UDP(sport=1280)/Raw("x"*80)], iface="enp27s0f0", count=1) + sendp([Ether(dst="00:11:22:33:44:66")/IP(dst="192.168.0.1")/NVGRE(TNI=0x8)/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/UDP(sport=1536)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 receive the packet. + +4. send mismatched packets:: + + sendp([Ether(dst="00:11:22:33:44:66")/IP(dst="192.168.0.1")/NVGRE(TNI=0x8)/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/UDP(sport=1281)/Raw("x"*80)], iface="enp27s0f0", count=1) + + check port 1 can not receive the packet. + +5. verify rules can be destroyed:: + + testpmd> flow flush 0 + testpmd> flow list 0 + + check the rules not exist in the list. + send matched packets, check port 1 can not receive the packet. \ No newline at end of file From patchwork Wed Jul 20 10:02:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 114060 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 5D0E4A00C2; Wed, 20 Jul 2022 03:41:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4E5E540A7A; Wed, 20 Jul 2022 03:41:54 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 0ACE440697 for ; Wed, 20 Jul 2022 03:41:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658281313; x=1689817313; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=e7y5G2F8rwOPUX320VZNaHrJwmEx2uRbBhjJf731phA=; b=lIcLjBcy3zN4MHcBti/XOntXWbaB7ijQ2SbHhWpl2cPM1+zzx03i/MlY HLc5EEBMx9yoXXSvJfGRVOzs7cOOPX1yvnz1XpgRk7MJa5ZZlmtHIuP6H WeePnchd64zKDeNH+jgi/nyfTaRhfuGr0PBnZq/so+UjaqT5xJpLL+sYE Y8tH91EKTD9yD6ZuhRCX8Ldy6yiBb9C1/Cep7F3Lo31xcWqouVWXnHo+F /2VHHx2TedCeG9hJoIdY/sIhyWQNFoD+u68mjF1ohHt1JOPPpxI3ygNu9 ecFS2Kt7mVwIMgJsgKyAwp9ZRwzWp+nnTrMtD0/nSJ0fedrK4CBWGYY3x Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10413"; a="285418961" X-IronPort-AV: E=Sophos;i="5.92,285,1650956400"; d="scan'208";a="285418961" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2022 18:41:47 -0700 X-IronPort-AV: E=Sophos;i="5.92,285,1650956400"; d="scan'208";a="625446778" Received: from unknown (HELO localhost.localdomain) ([10.239.252.94]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2022 18:41:45 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Subject: [dts] [PATCH V1 2/2] tests/ice_dcf_switch_filter: add case Date: Wed, 20 Jul 2022 10:02:43 +0000 Message-Id: <20220720100243.31535-2-songx.jiale@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220720100243.31535-1-songx.jiale@intel.com> References: <20220720100243.31535-1-songx.jiale@intel.com> 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 add case to test l4 multicast. Signed-off-by: Jiale Song --- tests/TestSuite_ice_dcf_switch_filter.py | 287 +++++++++++++++++++++++ 1 file changed, 287 insertions(+) diff --git a/tests/TestSuite_ice_dcf_switch_filter.py b/tests/TestSuite_ice_dcf_switch_filter.py index 3c647be6..c3ca48d1 100644 --- a/tests/TestSuite_ice_dcf_switch_filter.py +++ b/tests/TestSuite_ice_dcf_switch_filter.py @@ -1388,6 +1388,139 @@ tv_add_two_rules_with_different_input_set_different_vf_id = { }, } +# l4 mask +# ipv4/ipv6 + udp/tcp +mac_ipv4_udp_l4_mask_scapy_str = { + "matched": [ + 'Ether(dst="00:11:22:33:44:66")/IP(src="192.168.0.2",dst="192.168.0.3",tos=4)/UDP(sport=2048,dport=1)/Raw("x"*80)', + 'Ether(dst="00:11:22:33:44:66")/IP(src="192.168.0.2",dst="192.168.0.3",tos=4)/UDP(sport=2303,dport=3841)/Raw("x"*80)', + ], + "mismatched": [ + 'Ether(dst="00:11:22:33:44:66")/IP(src="192.168.0.2",dst="192.168.0.3",tos=4)/UDP(sport=2047,dport=2)/Raw("x"*80)', + 'Ether(dst="00:11:22:33:44:66")/IP(src="192.168.0.2",dst="192.168.0.3",tos=4)/UDP(sport=2058,dport=3586)/Raw("x"*80)', + ], +} +tv_mac_ipv4_udp_l4_mask_in_single_vf_01 = { + "name": "tv_mac_ipv4_udp_l4_mask_in_single_vf_01", + "rte_flow_pattern": "flow create 0 priority 0 ingress pattern eth / ipv4 / udp src is 2152 src mask 0xff00 dst is 1281 dst mask 0x00ff / end actions vf id 1 / end", + "matched": { + "scapy_str": mac_ipv4_udp_l4_mask_scapy_str["matched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 2}, + }, + "mismatched": { + "scapy_str": mac_ipv4_udp_l4_mask_scapy_str["mismatched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 0}, + }, +} + +mac_ipv6_udp_l4_mask_scapy_str = { + "matched": [ + 'Ether(dst="00:11:22:33:44:66")/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/TCP(sport=10,dport=3328)/Raw("x"*80)', + 'Ether(dst="00:11:22:33:44:66")/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/TCP(sport=20,dport=3343)/Raw("x"*80)', + ], + "mismatched": [ + 'Ether(dst="00:11:22:33:44:66")/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/TCP(sport=50,dport=3077)/Raw("x"*80)', + 'Ether(dst="00:11:22:33:44:66")/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/TCP(sport=50,dport=3349)/Raw("x"*80)', + ], +} +tv_mac_ipv6_tcp_l4_mask_in_single_vf_02 = { + "name": "tv_mac_ipv6_tcp_l4_mask_in_single_vf_02", + "rte_flow_pattern": "flow create 0 priority 0 ingress pattern eth / ipv6 / tcp dst is 3333 dst mask 0x0ff0 / end actions vf id 1 / end", + "matched": { + "scapy_str": mac_ipv6_udp_l4_mask_scapy_str["matched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 2}, + }, + "mismatched": { + "scapy_str": mac_ipv6_udp_l4_mask_scapy_str["mismatched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 0}, + }, +} + +# test vxlan l4 mask +mac_ipv4_udp_vxlan_eth_ipv4_udp_l4_mask_scapy_str = { + "matched": [ + 'Ether(dst="00:11:22:33:44:66")/IP()/UDP()/VXLAN()/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/UDP(sport=32,dport=22)/Raw("x"*80)', + 'Ether(dst="00:11:22:33:44:66")/IP()/UDP()/VXLAN()/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/UDP(sport=16,dport=22)/Raw("x"*80)', + ], + "mismatched": [ + 'Ether(dst="00:11:22:33:44:66")/IP()/UDP()/VXLAN()/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/UDP(sport=33,dport=22)/Raw("x"*80)' + ], +} +tv_mac_ipv4_udp_vxlan_eth_ipv4_udp_l4_mask_in_single_vf_03 = { + "name": "tv_mac_ipv4_udp_vxlan_eth_ipv4_udp_l4_mask_in_single_vf_03", + "rte_flow_pattern": "flow create 0 priority 0 ingress pattern eth / ipv4 / udp / vxlan / eth / ipv4 / udp src is 32 src mask 0x0f / end actions vf id 1 / end", + "matched": { + "scapy_str": mac_ipv4_udp_vxlan_eth_ipv4_udp_l4_mask_scapy_str["matched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 2}, + }, + "mismatched": { + "scapy_str": mac_ipv4_udp_vxlan_eth_ipv4_udp_l4_mask_scapy_str["mismatched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 0}, + }, +} + +# test nvgre l4 mask +mac_ipv4_nvgre_eth_ipv4_udp_l4_mask_scapy_str = { + "matched": [ + 'Ether(dst="00:11:22:33:44:66")/IP(dst="192.168.0.1")/NVGRE(TNI=0x8)/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/UDP(sport=1280)/Raw("x"*80)', + 'Ether(dst="00:11:22:33:44:66")/IP(dst="192.168.0.1")/NVGRE(TNI=0x8)/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/UDP(sport=1536)/Raw("x"*80)', + ], + "mismatched": [ + 'Ether(dst="00:11:22:33:44:66")/IP(dst="192.168.0.1")/NVGRE(TNI=0x8)/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/UDP(sport=1281)/Raw("x"*80)', + ], +} +tv_mac_ipv4_nvgre_eth_ipv4_udp_l4_mask_in_single_vf_04 = { + "name": "tv_mac_ipv4_nvgre_eth_ipv4_udp_l4_mask_in_single_vf_04", + "rte_flow_pattern": "flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.1 / nvgre tni is 0x8 / eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / udp src is 1280 src mask 0x00ff / end actions vf id 1 / end", + "matched": { + "scapy_str": mac_ipv4_nvgre_eth_ipv4_udp_l4_mask_scapy_str["matched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 2}, + }, + "mismatched": { + "scapy_str": mac_ipv4_nvgre_eth_ipv4_udp_l4_mask_scapy_str["mismatched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 0}, + }, +} + +tvs_l4_multicast = [ + tv_mac_ipv4_udp_l4_mask_in_single_vf_01, + tv_mac_ipv6_tcp_l4_mask_in_single_vf_02, + tv_mac_ipv4_udp_vxlan_eth_ipv4_udp_l4_mask_in_single_vf_03, + tv_mac_ipv4_nvgre_eth_ipv4_udp_l4_mask_in_single_vf_04, +] + tv_mac_ipv4_drop = { "name": "tv_mac_ipv4_drop", "rte_flow_pattern": "flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.1 / end actions drop / end", @@ -1632,6 +1765,141 @@ tv_mac_blend_pkg_drop = { }, } +vf1_mac = "00:11:22:33:44:55" +mac_ipv4_tcp_l4_mask_scapy_str = { + "matched": [ + 'Ether(dst="%s")/IP()/TCP(sport=2313,dport=23)/Raw("x"*80)' % vf1_mac, + 'Ether(dst="%s")/IP()/TCP(sport=2553,dport=23)/Raw("x"*80)' % vf1_mac, + ], + "mismatched": [ + 'Ether(dst="%s")/IP(src="192.168.0.2",dst="192.168.0.3",tos=4)/TCP(sport=2344,dport=23)/Raw("x"*80)' + % vf1_mac, + 'Ether(dst="%s")/IP(src="192.168.0.2",dst="192.168.0.3",tos=4)/TCP(sport=2601,dport=23)/Raw("x"*80)' + % vf1_mac, + ], +} +tv_mac_ipv4_tcp_l4_mask_drop = { + "name": "tv_mac_ipv4_tcp_l4_mask_drop", + "rte_flow_pattern": "flow create 0 priority 0 ingress pattern eth / ipv4 / tcp src is 2345 src mask 0x0f0f / end actions drop / end", + "matched": { + "scapy_str": mac_ipv4_tcp_l4_mask_scapy_str["matched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 0}, + }, + "mismatched": { + "scapy_str": mac_ipv4_tcp_l4_mask_scapy_str["mismatched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 2}, + }, +} + +mac_ipv6_tcp_l4_mask_scapy_str = { + "matched": [ + 'Ether(dst="%s")/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/UDP(sport=10,dport=3328)/Raw("x"*80)' + % vf1_mac, + 'Ether(dst="%s")/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/UDP(sport=20,dport=3343)/Raw("x"*80)' + % vf1_mac, + ], + "mismatched": [ + 'Ether(dst="%s")/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/UDP(sport=50,dport=3077)/Raw("x"*80)' + % vf1_mac, + 'Ether(dst="%s")/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:1515",dst="CDCD:910A:2222:5498:8475:1111:3900:2020",tc=3)/UDP(sport=50,dport=3349)/Raw("x"*80)' + % vf1_mac, + ], +} +tv_mac_ipv6_udp_l4_mask_drop = { + "name": "tv_mac_ipv6_udp_l4_mask_drop", + "rte_flow_pattern": "flow create 0 priority 0 ingress pattern eth / ipv6 / udp dst is 3333 dst mask 0x0ff0 / end actions drop / end", + "matched": { + "scapy_str": mac_ipv6_tcp_l4_mask_scapy_str["matched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 0}, + }, + "mismatched": { + "scapy_str": mac_ipv6_tcp_l4_mask_scapy_str["mismatched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 2}, + }, +} + +mac_ipv4_udp_vxlan_eth_ipv4_tcp_l4_mask_scapy_str = { + "matched": [ + 'Ether(dst="%s")/IP()/UDP()/VXLAN()/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/TCP(sport=32,dport=22)/Raw("x"*80)' + % vf1_mac, + 'Ether(dst="%s")/IP()/UDP()/VXLAN()/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/TCP(sport=16,dport=22)/Raw("x"*80)' + % vf1_mac, + ], + "mismatched": [ + 'Ether(dst="%s")/IP()/UDP()/VXLAN()/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/TCP(sport=33,dport=22)/Raw("x"*80)' + % vf1_mac, + ], +} +tv_mac_ipv4_udp_vxlan_eth_ipv4_tcp_l4_mask_drop = { + "name": "tv_mac_ipv4_udp_vxlan_eth_ipv4_tcp_l4_mask_drop", + "rte_flow_pattern": "flow create 0 priority 0 ingress pattern eth / ipv4 / udp / vxlan / eth / ipv4 / tcp src is 32 src mask 0x0f / end actions drop / end", + "matched": { + "scapy_str": mac_ipv4_udp_vxlan_eth_ipv4_tcp_l4_mask_scapy_str["matched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 0}, + }, + "mismatched": { + "scapy_str": mac_ipv4_udp_vxlan_eth_ipv4_tcp_l4_mask_scapy_str["mismatched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 1}, + }, +} + +mac_ipv4_nvgre_eth_ipv4_tcp_l4_mask_scapy_str = { + "matched": [ + 'Ether(dst="%s")/IP(dst="192.168.0.1")/NVGRE(TNI=0x8)/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/TCP(sport=50,dport=1280)/Raw("x"*80)' + % vf1_mac, + 'Ether(dst="%s")/IP(dst="192.168.0.1")/NVGRE(TNI=0x8)/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/TCP(sport=50,dport=1536)/Raw("x"*80)' + % vf1_mac, + ], + "mismatched": [ + 'Ether(dst="%s")/IP(dst="192.168.0.1")/NVGRE(TNI=0x8)/Ether()/IP(src="192.168.0.2", dst="192.168.0.3")/TCP(sport=50,dport=1281)/Raw("x"*80)' + % vf1_mac, + ], +} +tv_mac_ipv4_nvgre_eth_ipv4_tcp_l4_mask_drop = { + "name": "tv_mac_ipv4_nvgre_eth_ipv4_tcp_l4_mask_drop", + "rte_flow_pattern": "flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.1 / nvgre tni is 0x8 / eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / tcp dst is 1280 dst mask 0x00ff / end actions drop / end", + "matched": { + "scapy_str": mac_ipv4_nvgre_eth_ipv4_tcp_l4_mask_scapy_str["matched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 0}, + }, + "mismatched": { + "scapy_str": mac_ipv4_nvgre_eth_ipv4_tcp_l4_mask_scapy_str["mismatched"], + "check_func": { + "func": rfc.check_vf_rx_packets_number, + "param": {"expect_port": 1, "expect_queues": "null"}, + }, + "expect_results": {"expect_pkts": 1}, + }, +} + sv_mac_test_drop_action = [ tv_mac_ipv4_drop, tv_mac_ipv4_mask_drop, @@ -1642,6 +1910,10 @@ sv_mac_test_drop_action = [ tv_mac_l2tp_drop, tv_mac_esp_drop, tv_mac_blend_pkg_drop, + tv_mac_ipv4_tcp_l4_mask_drop, + tv_mac_ipv6_udp_l4_mask_drop, + tv_mac_ipv4_udp_vxlan_eth_ipv4_tcp_l4_mask_drop, + tv_mac_ipv4_nvgre_eth_ipv4_tcp_l4_mask_drop, ] @@ -2640,6 +2912,7 @@ class ICEDCFSwitchFilterTest(TestCase): 'ip link set %s vf 1 mac "00:11:22:33:44:55"' % self.pf0_intf, "# " ) self.launch_testpmd() + self.dut.send_expect("rx_vxlan_port add 4789 0", "testpmd> ") for pattern in sv_mac_test_drop_action: # validate a rule self.validate_switch_filter_rule(pattern["rte_flow_pattern"]) @@ -2666,6 +2939,20 @@ class ICEDCFSwitchFilterTest(TestCase): self.dut.send_expect("flow flush 0", "testpmd> ", 15) self.dut.send_expect("clear port stats all", "testpmd> ", 15) + # l4 mask + def test_l4_multicast(self): + self.setup_1pf_vfs_env() + self.dut.send_expect( + "ip link set %s vf 1 mac 00:11:22:33:44:55" % self.pf0_intf, "# " + ) + self.launch_testpmd() + self.dut.send_expect("rx_vxlan_port add 4789 0", "testpmd> ") + try: + for sub_case in tvs_l4_multicast: + self._rte_flow_validate_pattern(sub_case, launch_testpmd=False) + except Exception as ex: + raise ex + def tear_down(self): """ Run after each test case.