test suite reviews and discussions
 help / color / mirror / Atom feed
From: Peng Yuan <yuan.peng@intel.com>
To: dts@dpdk.org
Cc: Peng Yuan <yuan.peng@intel.com>
Subject: [dts] [PATCH V1] tests/cvl_dcf_acl_filter: modified max entries cases
Date: Fri, 30 Jul 2021 03:26:44 +0000	[thread overview]
Message-ID: <20210730032644.29349-1-yuan.peng@intel.com> (raw)

Max entry is changed from 512 to 256, so modify the related cases:
test_max_entry_num
test_max_entry_num_ipv4_other
test_max_entry_num_combined_pattern

Signed-off-by: Peng Yuan <yuan.peng@intel.com>

diff --git a/tests/TestSuite_cvl_dcf_acl_filter.py b/tests/TestSuite_cvl_dcf_acl_filter.py
index 1d516fcf..70d57e14 100644
--- a/tests/TestSuite_cvl_dcf_acl_filter.py
+++ b/tests/TestSuite_cvl_dcf_acl_filter.py
@@ -1062,14 +1062,14 @@ class CVLDCFACLFilterTest(TestCase):
         src_file = 'max_entry_num'
         flows=open(self.src_file_dir + src_file,mode='w')
         count=0
-        for i in range(64):
-            flows.write('flow create 0 ingress pattern eth / ipv4 src spec 192.168.0.%d src mask 255.255.255.0 / end actions drop / end \n' % i)
+        for i in range(32):
+            flows.write('flow create 0 ingress pattern eth / ipv4 src spec 192.168.0.%d src mask 255.255.0.255 / end actions drop / end \n' % i)
             count=count+1
-        for i in range(256):
-            flows.write('flow create 0 ingress pattern eth / ipv4 src spec 192.168.0.%d src mask 255.255.255.254 / tcp / end actions drop / end \n' % i)
+        for i in range(128):
+            flows.write('flow create 0 ingress pattern eth / ipv4 src spec 192.168.0.%d src mask 255.255.254.255 / tcp / end actions drop / end \n' % i)
             count=count+1
         flows.close()
-        self.verify(count == 320, "failed to config 320 acl rules.")
+        self.verify(count == 160, "failed to config 160 acl rules.")
         self.dut.session.copy_file_to(self.src_file_dir + src_file, self.dut_file_dir)
 
         # start testpmd with creating 512 ACL rules
@@ -1077,19 +1077,19 @@ class CVLDCFACLFilterTest(TestCase):
         out_testpmd = self.launch_testpmd(param)
         self.check_dcf_status(out_testpmd, stats=True)
         rule_list = self.dut.send_expect("flow list 0", "testpmd> ", 15)
-        self.verify("319" in rule_list, "320 rules failed to be created")
+        self.verify("159" in rule_list, "160 rules failed to be created")
 
         # create one more ACl rule failed, it is created as a switch rule.
-        rule = "flow create 0 ingress pattern eth / ipv4 src spec 192.168.2.255 src mask 255.255.255.254 / tcp / end actions drop / end"
+        rule = "flow create 0 ingress pattern eth / ipv4 src spec 192.168.2.255 src mask 255.255.254.255 / tcp / end actions drop / end"
         self.create_acl_filter_rule(rule, check_stats=False)
 
         # delete one ACL rule, create the rule again, it is created as an ACL rule successfully.
-        self.dut.send_expect("flow destroy 0 rule 319", "testpmd> ", 15)
+        self.dut.send_expect("flow destroy 0 rule 159", "testpmd> ", 15)
         rule_list = self.dut.send_expect("flow list 0", "testpmd> ", 15)
-        self.verify("319" not in rule_list, "rule 319 is not deleted")
+        self.verify("159" not in rule_list, "rule 159 is not deleted")
         self.create_acl_filter_rule(rule, check_stats=True)
         # delete the switch rule
-        self.dut.send_expect("flow destroy 0 rule 320", "testpmd> ", 15)
+        self.dut.send_expect("flow destroy 0 rule 160", "testpmd> ", 15)
         # send and check match packets
         packet = 'Ether(src="00:11:22:33:44:55", dst="%s")/IP(src="192.168.2.255", dst="192.168.0.2")/TCP(sport=22, dport=23)/Raw(load="x"*30)' % vf1_mac
         out1 = self.send_pkts_getouput(pkts=packet)
@@ -1102,37 +1102,34 @@ class CVLDCFACLFilterTest(TestCase):
 
     def test_max_entry_num(self):
         """
-        the default entry number is 512
+        the default entry number is 256
         """
         src_file = 'max_entry_num'
         flows=open(self.src_file_dir + src_file,mode='w')
         count=0
-        for i in range(256):
-            flows.write('flow create 0 ingress pattern eth / ipv4 src spec 192.168.0.%d src mask 255.255.255.254 / tcp / end actions drop / end \n' % i)
-            count=count+1
-        for j in range(255):
-            flows.write('flow create 0 ingress pattern eth / ipv4 src spec 192.168.1.%d src mask 255.255.255.254 / tcp / end actions drop / end \n' % j)
+        for i in range(255):
+            flows.write('flow create 0 ingress pattern eth / ipv4 src spec 192.168.0.%d src mask 255.255.254.255 / tcp / end actions drop / end \n' % i)
             count=count+1
         flows.close()
-        self.verify(count == 511, "failed to config 511 acl rules.")
+        self.verify(count == 255, "failed to config 255 acl rules.")
         self.dut.session.copy_file_to(self.src_file_dir + src_file, self.dut_file_dir)
 
-        # start testpmd with creating 512 ACL rules
+        # start testpmd with creating 255 ACL rules
         param = " --cmdline-file=%s" % (self.dut_file_dir + src_file)
         out_testpmd = self.launch_testpmd(param)
         self.check_dcf_status(out_testpmd, stats=True)
         rule_list = self.dut.send_expect("flow list 0", "testpmd> ", 15)
-        self.verify("510" in rule_list, "511 rules failed to be created")
+        self.verify("254" in rule_list, "255 rules failed to be created")
 
         # create a switch rule
         rule = "flow create 0 ingress pattern eth / ipv4 src spec 192.168.1.255 src mask 255.255.255.255 / tcp / end actions drop / end"
         self.create_other_filter_rule(rule, check_stats=True)
 
-        # create the 512 ACl rule
-        rule1 = "flow create 0 ingress pattern eth / ipv4 src spec 192.168.2.255 src mask 255.255.255.254 / tcp / end actions drop / end"
+        # create the 256 ACl rule
+        rule1 = "flow create 0 ingress pattern eth / ipv4 src spec 192.168.2.255 src mask 255.0.255.255 / tcp / end actions drop / end"
         self.create_acl_filter_rule(rule1, check_stats=True)
         rule_list = self.dut.send_expect("flow list 0", "testpmd> ", 15)
-        self.verify("512" in rule_list, "the last ACL rule failed to be created")
+        self.verify("256" in rule_list, "the last ACL rule failed to be created")
 
         # send and check match packets
         packet1 = 'Ether(src="00:11:22:33:44:55", dst="%s")/IP(src="192.168.2.255", dst="192.168.0.2")/TCP(sport=22, dport=23)/Raw(load="x"*30)' % vf1_mac
@@ -1145,12 +1142,14 @@ class CVLDCFACLFilterTest(TestCase):
         # send and check match packets
         packet2 = 'Ether(src="00:11:22:33:44:55", dst="%s")/IP(src="192.168.3.255", dst="192.168.0.2")/TCP(sport=22, dport=23)/Raw(load="x"*30)' % vf1_mac
         out2 = self.send_pkts_getouput(pkts=packet2)
-        rfc.check_drop(out2, pkt_num=1, check_param={"port_id": 1, "drop": 1}, stats=False)
+        rfc.check_drop(out2, pkt_num=0, check_param={"port_id": 1, "drop": 1}, stats=False)
 
         # delete one rule, create the rule again, successfully.
-        self.dut.send_expect("flow destroy 0 rule 512", "testpmd> ", 15)
+        self.dut.send_expect("flow destroy 0 rule 256", "testpmd> ", 15)
+        self.dut.send_expect("flow destroy 0 rule 257", "testpmd> ", 15)
         rule_list = self.dut.send_expect("flow list 0", "testpmd> ", 15)
-        self.verify("512" not in rule_list, "rule 512 is not deleted")
+        self.verify("256" not in rule_list, "rule 256 is not deleted")
+        self.verify("257" not in rule_list, "rule 257 is not deleted")
         self.create_acl_filter_rule(rule2, check_stats=True)
         # send and check match packets
         out3 = self.send_pkts_getouput(pkts=packet2)
@@ -1163,46 +1162,46 @@ class CVLDCFACLFilterTest(TestCase):
 
     def test_max_entry_num_ipv4_other(self):
         """
-        create ipv4-other rules, 128 rules can be created at most.
+        create ipv4-other rules, 64 rules can be created at most.
         """
         src_file = 'max_entry_num_ipv4_other'
         flows=open(self.src_file_dir + src_file,mode='w')
         count=0
-        for i in range(127):
-            flows.write('flow create 0 ingress pattern eth / ipv4 src spec 192.168.1.1 src mask 255.255.255.254 dst spec 192.168.0.%d dst mask 255.255.255.254 / end actions drop / end \n' % i)
+        for i in range(63):
+            flows.write('flow create 0 ingress pattern eth / ipv4 src spec 192.168.1.1 src mask 255.255.254.255 dst spec 192.168.0.%d dst mask 255.255.254.255 / end actions drop / end \n' % i)
             count=count+1
         flows.close()
-        self.verify(count == 127, "failed to config 127 acl rules.")
+        self.verify(count == 63, "failed to config 63 acl rules.")
         self.dut.session.copy_file_to(self.src_file_dir + src_file, self.dut_file_dir)
 
-        # start testpmd with creating 128 ACL rules
+        # start testpmd with creating 64 ACL rules
         param = " --cmdline-file=%s" % (self.dut_file_dir + src_file)
         out_testpmd = self.launch_testpmd(param)
         self.check_dcf_status(out_testpmd, stats=True)
         rule_list = self.dut.send_expect("flow list 0", "testpmd> ", 15)
-        self.verify("126" in rule_list, "127 rules failed to be created")
+        self.verify("62" in rule_list, "63 rules failed to be created")
 
         # create one switch rule
         rule = "flow create 0 ingress pattern eth / ipv4 src spec 192.168.1.1 src mask 255.255.255.254 dst spec 192.168.2.100 dst mask 255.255.255.255 / end actions drop / end"
         self.create_other_filter_rule(rule, check_stats=True)
 
-        # create the 128th ACl rule
-        rule1 = "flow create 0 ingress pattern eth / ipv4 src spec 192.168.1.1 src mask 255.255.255.254 dst spec 192.168.0.127 dst mask 255.255.255.254 / end actions drop / end"
+        # create the 64th ACl rule
+        rule1 = "flow create 0 ingress pattern eth / ipv4 src spec 192.168.1.1 src mask 255.255.255.254 dst spec 192.168.0.127 dst mask 255.255.254.255 / end actions drop / end"
         self.create_acl_filter_rule(rule1, check_stats=True)
 
         # create one more ACl rule
-        rule2 = "flow create 0 ingress pattern eth / ipv4 src spec 192.168.1.1 src mask 255.255.255.254 dst spec 192.168.1.128 dst mask 255.255.255.254 / end actions drop / end"
+        rule2 = "flow create 0 ingress pattern eth / ipv4 src spec 192.168.1.1 src mask 255.255.255.254 dst spec 192.168.1.128 dst mask 255.255.254.255 / end actions drop / end"
         self.create_acl_filter_rule(rule2, check_stats=False)
 
         # delete one rule, create the rule again, successfully.
-        self.dut.send_expect("flow destroy 0 rule 128", "testpmd> ", 15)
+        self.dut.send_expect("flow destroy 0 rule 64", "testpmd> ", 15)
         rule_list = self.dut.send_expect("flow list 0", "testpmd> ", 15)
-        self.verify("128" not in rule_list, "rule 128 is not deleted")
+        self.verify("64" not in rule_list, "rule 64 is not deleted")
         self.create_acl_filter_rule(rule2, check_stats=True)
         # delete switch rule
-        self.dut.send_expect("flow destroy 0 rule 129", "testpmd> ", 15)
+        self.dut.send_expect("flow destroy 0 rule 65", "testpmd> ", 15)
         rule_list = self.dut.send_expect("flow list 0", "testpmd> ", 15)
-        self.verify("129" not in rule_list, "rule 129 is not deleted")
+        self.verify("65" not in rule_list, "rule 65 is not deleted")
 
         # send and check match packets
         packet = 'Ether(src="00:11:22:33:44:55", dst="%s")/IP(src="192.168.1.1", dst="192.168.1.128")/Raw(load="x"*30)' % vf1_mac
-- 
2.17.1


             reply	other threads:[~2021-07-30 10:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30  3:26 Peng Yuan [this message]
2021-09-14  9:47 ` Tu, Lijuan

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=20210730032644.29349-1-yuan.peng@intel.com \
    --to=yuan.peng@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).