test suite reviews and discussions
 help / color / mirror / Atom feed
From: Jiale Song <songx.jiale@intel.com>
To: dts@dpdk.org
Cc: Jiale Song <songx.jiale@intel.com>
Subject: [dts] [PATCH V1 1/2] test_plans/ice_switch_filter: add 2 case
Date: Thu, 14 Jul 2022 18:47:42 +0000	[thread overview]
Message-ID: <20220714184743.14720-1-songx.jiale@intel.com> (raw)

add case to test the rule of l2 mask and l3 mask.

Signed-off-by: Jiale Song <songx.jiale@intel.com>
---
 test_plans/ice_switch_filter_test_plan.rst | 237 ++++++++++++++++++++-
 1 file changed, 234 insertions(+), 3 deletions(-)

diff --git a/test_plans/ice_switch_filter_test_plan.rst b/test_plans/ice_switch_filter_test_plan.rst
index 599174ba..001c6be2 100644
--- a/test_plans/ice_switch_filter_test_plan.rst
+++ b/test_plans/ice_switch_filter_test_plan.rst
@@ -96,6 +96,10 @@ Pattern and input set
   +---------------------+-------------------------------+-------------------------------------------+-------------------------------------------+
   |  ethertype filter   | ethertype filter_PPPOED       | [Ether type]                              | [Ether type]                              |
   +---------------------+-------------------------------+-------------------------------------------+-------------------------------------------+
+  |                     | L3 multicast                  | [Dest IPv4], [Source IPv6]                | N/A                                       |
+  |      multicast      +-------------------------------+-------------------------------------------+-------------------------------------------+
+  |                     | L2 multicast                  | [Dest MAC], [Source MAC]                  | N/A                                       |
+  +---------------------+-------------------------------+-------------------------------------------+-------------------------------------------+
 
 .. note::
 
@@ -5596,6 +5600,8 @@ Pattern Any Test Case
 Test case 1: check rule is programmed to switch
 -----------------------------------------------
 
+Test Steps
+..........
 1. launch testpmd with --log-level="ice,7" create a rule::
 
     testpmd> flow create 0 ingress pattern any / end actions drop / end
@@ -5614,6 +5620,9 @@ Test case 1: check rule is programmed to switch
 
 Test case 2: drop any rule
 --------------------------
+
+Test Steps
+..........
 1. create a rule::
 
     testpmd> flow create 0 ingress pattern any / end actions drop / end
@@ -5656,6 +5665,9 @@ Test case 2: drop any rule
 
 Test case 3: any to queue rule
 ------------------------------
+
+Test Steps
+..........
 1. create a rule::
 
     testpmd> flow create 0 ingress pattern any / end actions queue index 4 / end
@@ -5677,8 +5689,10 @@ Test case 4: pattern any priority check
 ---------------------------------------
 
 subcase 1: non-pipeline mode
-............................
+----------------------------
 
+Test Steps
+..........
 1. create drop any rule with priority 0, to queue rule with priority 1::
 
     testpmd> flow create 0 priority 0 ingress pattern any / end actions drop / end
@@ -5703,8 +5717,10 @@ subcase 1: non-pipeline mode
 5. change the rule priority, repeat step 2-4, check the result is same.
 
 subcase 2: non-pipeline mode with other rule
-............................................
+--------------------------------------------
 
+Test Steps
+..........
 1. create 2 rules::
 
     testpmd> flow create 0 priority 1 ingress pattern any / end actions drop / end
@@ -5732,8 +5748,10 @@ subcase 2: non-pipeline mode with other rule
     testpmd> flow destroy 0 rule 1
 
 subcase 3: pipeline mode
-........................
+------------------------
 
+Test Steps
+..........
 1. launch testpmd with pipeline mode, create rule, check the rule can be created::
 
     testpmd> flow create 0 priority 0 ingress pattern any / end actions drop / end
@@ -5761,3 +5779,216 @@ subcase 3: pipeline mode
 7. create rule, check the rule can not be created::
 
     testpmd> flow create 0 priority 1 ingress pattern any / end actions queue index 4 / end
+
+Test case: L3 multicast
+=======================
+
+subcase 1: ipv4 dst + mask + queue action
+-----------------------------------------
+
+Test Steps
+..........
+1. validate a rule::
+
+     testpmd> flow validate 0 ingress pattern eth / ipv4 dst spec 224.0.0.0 dst mask 240.0.0.0 / end actions queue index 12 / 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 / ipv4 dst spec 224.0.0.0 dst mask 240.0.0.0 / end actions queue index 12 / end
+     testpmd> flow list 0
+
+   check the rule exists in the list.
+
+3. send matched packets::
+
+     sendp(Ether()/IP(dst="224.0.0.0")/Raw("x"*80), iface="enp27s0f0", count=1),
+     sendp(Ether()/IP(dst="224.0.0.255")/Raw("x"*80), iface="enp27s0f0", count=1),
+     sendp(Ether()/IP(src="192.168.0.1", dst="224.0.255.0")/Raw("x"*80), iface="enp27s0f0", count=1),
+     sendp(Ether()/IP(src="192.168.0.1", dst="224.255.0.0")/TCP()/Raw("x"*80), iface="enp27s0f0", count=1),
+     sendp(Ether()/IP(src="192.168.0.1", dst="239.0.0.0")/UDP()/Raw("x"*80), iface="enp27s0f0", count=1),
+
+   check all the packets received by queue 12.
+   send mismatched packets::
+
+     sendp(Ether()/IP(src="192.168.0.1", dst="223.0.0.0")/TCP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether()/IP(src="192.168.0.1", dst="240.0.0.0")/UDP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether()/IP(src="192.168.0.1", dst="128.0.0.0")/Raw("x"*80)], iface="enp27s0f0", count=1)
+
+   check all the packets can't received by queue 12.
+
+4. verify rules can be destroyed::
+
+     testpmd> flow destroy 0 rule 0
+     testpmd> flow list 0
+
+   check the rule not exists in the list.
+   send matched packets, check all the packets can't received by queue 12.
+
+subcase 2: ipv6 src + mask + drop action
+----------------------------------------
+
+Test Steps
+..........
+1. validate a rule::
+
+     testpmd> flow validate 0 ingress pattern eth / ipv6 src spec CDCD:910A:2222:5498:8475:1111:3900:2023 src mask fff0:0:0:0:0:0:0:0 / 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 / ipv6 src spec CDCD:910A:2222:5498:8475:1111:3900:2023 src mask fff0:0:0:0:0:0:0:0 / end actions drop / end
+     testpmd> flow list 0
+
+   check the rule exists in the list.
+
+3. send matched packets::
+
+     sendp(Ether()/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:2023")/("X"*480), iface="enp27s0f0", count=1),
+     sendp(Ether()/IPv6(src="CDCf:0:0:0:0:0:0:0")/("X"*480), iface="enp27s0f0", count=1),
+     sendp(Ether()/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:1515", src="CDC0:0:0:0:0:0:0:ffff")/("X"*480), iface="enp27s0f0", count=1),
+     sendp(Ether()/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:1515", src="CDC0:0:0:0:0:0:ffff:0")/("X"*480), iface="enp27s0f0", count=1),
+     sendp(Ether()/IPv6(src="CDC0:0:0:0:0:ffff:0:0")/UDP()/("X"*480), iface="enp27s0f0", count=1),
+     sendp(Ether()/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:1515", src="CDC0:0:0:0:ffff:0:0:0")/UDP()/("X"*480), iface="enp27s0f0", count=1),
+     sendp(Ether()/IPv6(src="CDC0:0:ffff:0:0:0:0:0")/TCP()/("X"*480), iface="enp27s0f0", count=1),
+     sendp(Ether()/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:1515", src="CDC0:ffff:0:0:0:0:0:0")/TCP()/("X"*480), iface="enp27s0f0", count=1),
+
+   check all the packets are dropped.
+   send mismatched packets::
+
+     sendp(Ether()/IPv6(src="CDDD:910A:2222:5498:8475:1111:3900:2023")/("X"*480), iface="enp27s0f0", count=1)
+     sendp(Ether()/IPv6(src="CFCD:910A:2222:5498:8475:1111:3900:2023")/UDP()/("X"*480), iface="enp27s0f0", count=1)
+     sendp(Ether()/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:1515", src="FDCD:0:0:0:0:0:0:ffff")/TCP()/("X"*480), iface="enp27s0f0", count=1)
+
+   check all the packets are not dropped.
+
+4. verify rules can be destroyed::
+
+     testpmd> flow destroy 0 rule 0
+     testpmd> flow list 0
+
+   check the rule not exists in the list.
+   send matched packets, check all the packets are not dropped.
+
+Test case: L2 multicast
+=======================
+
+subcase 1: mac dst + mask + queue action
+----------------------------------------
+
+Test Steps
+..........
+1. validate a rule::
+
+     testpmd> flow validate 0 ingress pattern eth dst spec 01:00:5e:00:00:00 dst mask ff:ff:ff:80:00:00 / end actions queue index 12 / 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 dst spec 01:00:5e:00:00:00 dst mask ff:ff:ff:80:00:00 / end actions queue index 12 / end
+     testpmd> flow list 0
+
+   check the rule exists in the list.
+
+3. send matched packets::
+
+     sendp(Ether(dst="01:00:5e:00:00:00")/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(dst="01:00:5e:7f:00:00")/IP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(dst="01:00:5e:00:ff:00")/IP()/TCP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(src="01:00:5e:00:00:01", dst="01:00:5e:00:00:ff")/IP()/UDP()/Raw("x"*80), iface="enp27s0f0", count=1)
+
+   check all the packets received by queue 12.
+   send mismatched packets::
+
+     sendp(Ether(dst="01:00:5e:80:00:00")/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(dst="01:00:ff:00:00:00")/IP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(dst="01:ff:5e:00:ff:00")/IP()/TCP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(dst="ff:00:5e:00:00:ff")/IP()/UDP()/Raw("x"*80), iface="enp27s0f0", count=1)
+
+   check all the packets can't receive by queue 12.
+
+4. verify rules can be destroyed::
+
+     testpmd> flow destroy 0 rule 0
+     testpmd> flow list 0
+
+   check the rule not exists in the list.
+   send matched packets, check all the packets can't receive by queue 12.
+
+subcase 2: mac src + mask + drop action
+---------------------------------------
+
+Test Steps
+..........
+1. validate a rule::
+
+     testpmd> flow validate 0 ingress pattern eth src spec 01:00:5e:00:00:00 src mask ff:ff:ff:80:00:00 / 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 src spec 01:00:5e:00:00:00 src mask ff:ff:ff:80:00:00 / end actions drop / end
+     testpmd> flow list 0
+
+   check the rule exists in the list.
+
+3. send matched packets::
+
+     sendp(Ether(src="01:00:5e:00:00:00")/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(src="01:00:5e:7f:00:00")/IP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(src="01:00:5e:00:ff:00")/IP()/TCP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(dst="01:00:5e:00:00:01", src="01:00:5e:00:00:ff")/IP()/UDP()/Raw("x"*80), iface="enp27s0f0", count=1)
+
+   check all the packets are dropped.
+   send mismatched packets::
+
+     sendp(Ether(src="01:00:5e:80:00:00")/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(src="01:00:ff:00:00:00")/IP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(src="01:ff:5e:00:ff:00")/IP()/TCP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(src="ff:00:5e:00:00:ff")/IP()/UDP()/Raw("x"*80), iface="enp27s0f0", count=1)
+
+   check all the packets are not dropped.
+
+4. verify rules can be destroyed::
+
+     testpmd> flow destroy 0 rule 0
+     testpmd> flow list 0
+
+   check the rule not exists in the list.
+   send matched packets, check all the packets are not dropped.
\ No newline at end of file
-- 
2.17.1


             reply	other threads:[~2022-07-14 10:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 18:47 Jiale Song [this message]
2022-07-14 18:47 ` [dts] [PATCH V1 2/2] tests/ice_switch_filter: " Jiale Song
2022-07-18  2:56   ` Huang, ZhiminX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220714184743.14720-1-songx.jiale@intel.com \
    --to=songx.jiale@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).