From patchwork Mon Aug 17 08:34:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 75572 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0C4DCA034D; Mon, 17 Aug 2020 10:41:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CDA3B1C0D9; Mon, 17 Aug 2020 10:41:53 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id DA96E1C0D9 for ; Mon, 17 Aug 2020 10:41:51 +0200 (CEST) IronPort-SDR: AMeQODv4VxkKi5VNT1yC9ZFw9wbhyL/CxBZ3ADb4Zi9JQbDH6DITj6tY/JWbyHrBmgJbwFBpte FJ4L44fSpJVA== X-IronPort-AV: E=McAfee;i="6000,8403,9715"; a="152304109" X-IronPort-AV: E=Sophos;i="5.76,322,1592895600"; d="scan'208";a="152304109" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2020 01:41:49 -0700 IronPort-SDR: p6S1FebgLil3pK9H8YSAo0mk60C9pQf2SraaPPB4b+QkXowgjE3nDmOKRebggtkoOl2D68J7aB U3UWQPwk/pxg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,322,1592895600"; d="scan'208";a="310034235" Received: from intel.sh.intel.com ([10.239.255.18]) by orsmga002.jf.intel.com with ESMTP; 17 Aug 2020 01:41:48 -0700 From: Guinan Sun To: dts@dpdk.org Cc: Guinan Sun Date: Mon, 17 Aug 2020 08:34:10 +0000 Message-Id: <20200817083411.71430-1-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817055452.68792-1-guinanx.sun@intel.com> References: <20200817055452.68792-1-guinanx.sun@intel.com> Subject: [dts] [PATCH v2 1/2] test_plans: add cloud_filter_with_l4_port_test_plan.rst 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" Enables the cloud filter for IPv4_UDP/IPv4_TCP/IPv4_SCTP with SRC port only or DST port only. This supports different filter types for the same packet type. E.g. one IPv4_UDP rules with SRC port only and another IPv4_UDP rule with DST port only. Signed-off-by: Guinan Sun --- .../cloud_filter_with_l4_port_test_plan.rst | 520 ++++++++++++++++++ 1 file changed, 520 insertions(+) create mode 100644 test_plans/cloud_filter_with_l4_port_test_plan.rst diff --git a/test_plans/cloud_filter_with_l4_port_test_plan.rst b/test_plans/cloud_filter_with_l4_port_test_plan.rst new file mode 100644 index 0000000..beef55c --- /dev/null +++ b/test_plans/cloud_filter_with_l4_port_test_plan.rst @@ -0,0 +1,520 @@ +.. Copyright (c) <2020>, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + - Neither the name of Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + +=================================== +Cloud filter with l4 port test plan +=================================== + +Prerequisites +============= + +1. Hardware: + Fortville + +2. software: + dpdk: http://dpdk.org/git/dpdk + scapy: http://www.secdev.org/projects/scapy/ + +3. bind the pf to dpdk driver:: + + ./usertools/dpdk-devbind.py --force --bind=vfio-pci 0000:81:00.0 + +4.Launch the testpmd:: + ./testpmd -l 0-3 -n 4 -w 81:00.0 --file-prefix=test -- -i --rxq=16 --txq=16 --disable-rss + testpmd> set fwd rxonly + testpmd> set promisc all off + testpmd> set verbose 1 + testpmd> start + +Test Case 1: ipv4-udp_sport only +================================ + + 1. validate a source port rule:: + testpmd> flow validate 0 ingress pattern eth / ipv4 / udp src is 156 / end actions pf / queue index 1 / end + + Verify the command can validate:: + Flow rule validated + + 2. create a source port rule:: + testpmd> flow create 0 ingress pattern eth / ipv4 / udp src is 156 / end actions pf / queue index 1 / end + + testpmd> flow list 0 + + Verify there are one rule. + + send matched packets:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/UDP(sport=156)/Raw('x' * 80) + + Verify packets will be received in queue 1. + + send no matched packet:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/UDP(sport=111)/Raw('x' * 80) + + Verify packets will not be received in queue 1. + + 3. flush the rule:: + testpmd> flow flush 0 + + send packets match rule 0:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/UDP(sport=156)/Raw('x' * 80) + + packets should be in queue 0. + +Test Case 2: ipv4-udp_dport only +================================ + + 1. validate a destination port rule:: + testpmd> flow validate 0 ingress pattern eth / ipv4 / udp dst is 156 / end actions pf / queue index 1 / end + + Verify the command can validate:: + Flow rule validated + + 2. create a destination port rule:: + testpmd> flow create 0 ingress pattern eth / ipv4 / udp dst is 156 / end actions pf / queue index 1 / end + + testpmd> flow list 0 + + Verify there are one rule. + + send matched packets:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/UDP(dport=156)/Raw('x' * 80) + + Verify packets will be received in queue 1. + + send no matched packet:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/UDP(dport=111)/Raw('x' * 80) + + Verify packets will not be received in queue 1. + + 3. flush the rule:: + testpmd> flow flush 0 + + send packets match rule 0:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/UDP(dport=156)/Raw('x' * 80) + + packets should be in queue 0. + +Test Case 3: ipv4-tcp_sport only +================================ + + 1. validate a source port rule:: + testpmd> flow validate 0 ingress pattern eth / ipv4 / tcp src is 156 / end actions pf / queue index 1 / end + + Verify the command can validate:: + Flow rule validated + + 2. testpmd> flow create 0 ingress pattern eth / ipv4 / tcp src is 156 / end actions pf / queue index 1 / end + + testpmd> flow list 0 + + Verify there are one rule. + + send matched packets:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/TCP(sport=156)/Raw('x' * 80) + + Verify packets will be received in queue 1. + + send no matched packet:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/TCP(sport=111)/Raw('x' * 80) + + Verify packets will not be received in queue 1. + + 3. flush the rule:: + testpmd> flow flush 0 + + send packets match rule 0:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/TCP(sport=156)/Raw('x' * 80) + + packets should be in queue 0. + +Test Case 4: ipv4-tcp_dport only +================================ + + 1. validate a destination port rule:: + testpmd> flow validate 0 ingress pattern eth / ipv4 / tcp dst is 156 / end actions pf / queue index 1 / end + + Verify the command can validate:: + Flow rule validated + + 2. create a destination port rule:: + testpmd> flow create 0 ingress pattern eth / ipv4 / tcp dst is 156 / end actions pf / queue index 1 / end + + testpmd> flow list 0 + + Verify there are one rule. + + send matched packets:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/TCP(dport=156)/Raw('x' * 80) + + Verify packets will be received in queue 1. + + send no matched packet:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/TCP(dport=111)/Raw('x' * 80) + + Verify packets will not be received in queue 1. + + 3. flush the rule:: + testpmd> flow flush 0 + + send packets match rule 0:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/TCP(dport=156)/Raw('x' * 80) + + packets should be in queue 0. + +Test Case 5: ipv4-sctp_sport only +================================ + + 1. validate a source port rule:: + testpmd> flow validate 0 ingress pattern eth / ipv4 / sctp src is 156 / end actions pf / queue index 1 / end + + Verify the command can validate:: + Flow rule validated + + 2. create a source port rule:: + testpmd> flow create 0 ingress pattern eth / ipv4 / sctp src is 156 / end actions pf / queue index 1 / end + + testpmd> flow list 0 + + Verify there are one rule. + + send matched packets:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/SCTP(sport=156)/Raw('x' * 80) + + Verify packets will be received in queue 1. + + send no matched packet:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/SCTP(sport=111)/Raw('x' * 80) + + Verify packets will not be received in queue 1. + + 3. flush the rule:: + testpmd> flow flush 0 + + send packets match rule 0:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/SCTP(sport=156)/Raw('x' * 80) + + packets should be in queue 0. + +Test Case 6: ipv4-sctp_dport only +================================ + + 1. validate a destination port rule:: + testpmd> flow validate 0 ingress pattern eth / ipv4 / sctp dst is 156 / end actions pf / queue index 1 / end + + Verify the command can validate:: + Flow rule validated + + 2. create a destination port rule:: + testpmd> flow create 0 ingress pattern eth / ipv4 / sctp dst is 156 / end actions pf / queue index 1 / end + + testpmd> flow list 0 + + Verify there are one rule. + + send matched packets:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/SCTP(dport=156)/Raw('x' * 80) + + Verify packets will be received in queue 1. + + send no matched packet:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/SCTP(dport=111)/Raw('x' * 80) + + Verify packets will not be received in queue 1. + + 3. flush the rule:: + testpmd> flow flush 0 + + send packets match rule 0:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/SCTP(dport=156)/Raw('x' * 80) + + packets should be in queue 0. + +Test Case 7: ipv6-udp_sport only +================================ + + 1. validate a source port rule:: + testpmd> flow validate 0 ingress pattern eth / ipv6 / udp src is 156 / end actions pf / queue index 1 / end + + Verify the command can validate:: + Flow rule validated + + 2. create a source port rule:: + testpmd> flow create 0 ingress pattern eth / ipv6 / udp src is 156 / end actions pf / queue index 1 / end + + testpmd> flow list 0 + + Verify there are one rule. + + send matched packets:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/UDP(sport=156)/Raw('x' * 80) + + Verify packets will be received in queue 1. + + send no matched packet:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/UDP(sport=111)/Raw('x' * 80) + + Verify packets will not be received in queue 1. + + 3. flush the rule:: + testpmd> flow flush 0 + + send packets match rule 0:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/UDP(sport=156)/Raw('x' * 80) + + packets should be in queue 0. + +Test Case 8: ipv6-udp_dport only +================================ + + 1. validate a destination port rule:: + testpmd> flow validate 0 ingress pattern eth / ipv6 / udp dst is 156 / end actions pf / queue index 1 / end + + Verify the command can validate:: + Flow rule validated + + 2. create a destination port rule:: + testpmd> flow create 0 ingress pattern eth / ipv6 / udp dst is 156 / end actions pf / queue index 1 / end + + testpmd> flow list 0 + + Verify there are one rule. + + send matched packets:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/UDP(dport=156)/Raw('x' * 80) + + Verify packets will be received in queue 1. + + send no matched packet:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/UDP(dport=111)/Raw('x' * 80) + + Verify packets will not be received in queue 1. + + 3. flush the rule:: + testpmd> flow flush 0 + + send packets match rule 0:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/UDP(dport=156)/Raw('x' * 80) + + packets should be in queue 0. + +Test Case 9: ipv6-tcp_sport only +================================ + + 1. validate a source port rule:: + testpmd> flow validate 0 ingress pattern eth / ipv6 / tcp src is 156 / end actions pf / queue index 1 / end + + Verify the command can validate:: + Flow rule validated + + 2. testpmd> flow create 0 ingress pattern eth / ipv6 / tcp src is 156 / end actions pf / queue index 1 / end + + testpmd> flow list 0 + + Verify there are one rule. + + send matched packets:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/TCP(sport=156)/Raw('x' * 80) + + Verify packets will be received in queue 1. + + send no matched packet:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/TCP(sport=111)/Raw('x' * 80) + + Verify packets will not be received in queue 1. + + 3. flush the rule:: + testpmd> flow flush 0 + + send packets match rule 0:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/TCP(sport=156)/Raw('x' * 80) + + packets should be in queue 0. + +Test Case 10: ipv6-tcp_dport only +================================ + + 1. validate a destination port rule:: + testpmd> flow validate 0 ingress pattern eth / ipv6 / tcp dst is 156 / end actions pf / queue index 1 / end + + Verify the command can validate:: + Flow rule validated + + 2. create a destination port rule:: + testpmd> flow create 0 ingress pattern eth / ipv6 / tcp dst is 156 / end actions pf / queue index 1 / end + + testpmd> flow list 0 + + Verify there are one rule. + + send matched packets:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/TCP(dport=156)/Raw('x' * 80) + + Verify packets will be received in queue 1. + + send no matched packet:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/TCP(dport=111)/Raw('x' * 80) + + Verify packets will not be received in queue 1. + + 3. flush the rule:: + testpmd> flow flush 0 + + send packets match rule 0:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/TCP(dport=156)/Raw('x' * 80) + + packets should be in queue 0. + +Test Case 11: ipv6-sctp_sport only +================================ + + 1. validate a source port rule:: + testpmd> flow validate 0 ingress pattern eth / ipv6 / sctp src is 156 / end actions pf / queue index 1 / end + + Verify the command can validate:: + Flow rule validated + + 2. create a source port rule:: + testpmd> flow create 0 ingress pattern eth / ipv6 / sctp src is 156 / end actions pf / queue index 1 / end + + testpmd> flow list 0 + + Verify there are one rule. + + send matched packets:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/SCTP(sport=156)/Raw('x' * 80) + + Verify packets will be received in queue 1. + + send no matched packet:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/SCTP(sport=111)/Raw('x' * 80) + + Verify packets will not be received in queue 1. + + 3. flush the rule:: + testpmd> flow flush 0 + + send packets match rule 0:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/SCTP(sport=156)/Raw('x' * 80) + + packets should be in queue 0. + +Test Case 12: ipv6-sctp_dport only +================================ + + 1. validate a destination port rule:: + testpmd> flow validate 0 ingress pattern eth / ipv6 / sctp dst is 156 / end actions pf / queue index 1 / end + + Verify the command can validate:: + Flow rule validated + + 2. create a destination port rule:: + testpmd> flow create 0 ingress pattern eth / ipv6 / sctp dst is 156 / end actions pf / queue index 1 / end + + testpmd> flow list 0 + + Verify there are one rule. + + send matched packets:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/SCTP(dport=156)/Raw('x' * 80) + + Verify packets will be received in queue 1. + + send no matched packet:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/SCTP(dport=111)/Raw('x' * 80) + + Verify packets will not be received in queue 1. + + 3. flush the rule:: + testpmd> flow flush 0 + + send packets match rule 0:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IPv6()/SCTP(dport=156)/Raw('x' * 80) + + packets should be in queue 0. + +Test Case 13: multi-rule +============================================================ + + 1. create multi-rule with different input set rules:: + creat rules:: + testpmd> flow create 0 ingress pattern eth / ipv4 / udp src is 11 / end actions pf / queue index 1 / end + testpmd> flow create 0 ingress pattern eth / ipv4 / tcp src is 22 / end actions pf / queue index 2 / end + testpmd> flow create 0 ingress pattern eth / ipv4 / sctp src is 33 / end actions pf / queue index 3 / end + testpmd> flow create 0 ingress pattern eth / ipv4 / udp dst is 44 / end actions pf / queue index 4 / end + testpmd> flow create 0 ingress pattern eth / ipv4 / tcp dst is 55 / end actions pf / queue index 5 / end + testpmd> flow create 0 ingress pattern eth / ipv4 / sctp dst is 66 / end actions pf / queue index 6 / end + + send packets:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/UDP(sport=11)/Raw('x' * 80) + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/TCP(sport=22)/Raw('x' * 80) + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/SCTP(sport=33)/Raw('x' * 80) + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/UDP(dport=44)/Raw('x' * 80) + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/TCP(dport=55)/Raw('x' * 80) + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/SCTP(dport=66)/Raw('x' * 80) + + Verify each packet can match the right queue. + + 2. destroy the rule:: + testpmd> flow destroy 0 rule 0 + + send packets match rule 0:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/UDP(sport=11)/Raw('x' * 80) + + packets should be in queue 0. + + 3. flush the rule:: + testpmd> flow flush 0 + + send packets match rule 0:: + p = Ether(dst="3C:FD:FE:CF:31:D8")/IP()/TCP(sport=22)/Raw('x' * 80) + + packets should be in queue 0. + +Test Case 3: NEGATIVE_TEST +==================================== + +1. rules can not create + + 1) unsupported rules:: + create rules:: + testpmd> flow create 0 ingress pattern eth / ipv4 / udp src is 156 dst is 156 / end actions pf / queue index 1 / end + + Verify rules can not create. + + 2) conflicted rules:: + create one rule:: + testpmd> flow create 0 ingress pattern eth / ipv4 / udp src is 156 / end actions pf / queue index 1 / end + + create conflicted rules:: + testpmd> flow create 0 ingress pattern eth / ipv4 / udp src is 156 / end actions pf / queue index 2 / end + + Verify rules can not create. \ No newline at end of file