test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Yu.Jiang" <yux.jiang@intel.com>
To: yuan.peng@intel.com, dts@dpdk.org
Cc: Yu Jiang <yux.jiang@intel.com>, Lingli Chen <linglix.chen@intel.com>
Subject: [dts][PATCH V1 2/2] tests/l3fwdacl: merge l3fwd-acl wtih l3fwd and modify it to support different force-max-simd-bitwidth
Date: Fri, 10 Jun 2022 15:06:21 +0800	[thread overview]
Message-ID: <1654844781-6435-3-git-send-email-yux.jiang@intel.com> (raw)
In-Reply-To: <1654844781-6435-1-git-send-email-yux.jiang@intel.com>

From: Yu Jiang <yux.jiang@intel.com>

1, According to dpdk22.07rc1 commit id 6de0ea50e("examples/l3fwd: merge l3fwd-acl example"),
modify l3fwdacl suite.
2, Since DTS commit "7eaf4b60 tests/l3fwdacl: modify pmd param for acl" has incorrect usage,
 modify script to support different force-max-simd-bitwidth para.

Signed-off-by: Lingli Chen <linglix.chen@intel.com>
Signed-off-by: Yu Jiang <yux.jiang@intel.com>
---
 conf/app_name.cfg           |  3 +--
 tests/TestSuite_l3fwdacl.py | 49 ++++++++++++++++++++++---------------
 2 files changed, 30 insertions(+), 22 deletions(-)

diff --git a/conf/app_name.cfg b/conf/app_name.cfg
index 5d3244da..84f65c92 100644
--- a/conf/app_name.cfg
+++ b/conf/app_name.cfg
@@ -37,7 +37,6 @@ l2fwd-event=target/examples/dpdk-l2fwd-event
 l2fwd-jobstats=target/examples/dpdk-l2fwd-jobstats
 l2fwd-keepalive=target/examples/dpdk-l2fwd-keepalive
 l3fwd=target/examples/dpdk-l3fwd
-l3fwd-acl=target/examples/dpdk-l3fwd-acl
 l3fwd-power=target/examples/dpdk-l3fwd-power
 link_status_interrupt=target/examples/dpdk-link_status_interrupt
 ntb=target/examples/dpdk-ntb
@@ -68,4 +67,4 @@ node=target/examples/dpdk-efd_node
 server=target/examples/dpdk-efd_server
 testpmd_vf=target/app/dpdk-testpmd-vf
 vm_power_manager=target/examples/dpdk-vm_power_manager
-guest_cli=target/examples/dpdk-guest_cli
\ No newline at end of file
+guest_cli=target/examples/dpdk-guest_cli
diff --git a/tests/TestSuite_l3fwdacl.py b/tests/TestSuite_l3fwdacl.py
index 0876b978..ebaa80ea 100644
--- a/tests/TestSuite_l3fwdacl.py
+++ b/tests/TestSuite_l3fwdacl.py
@@ -355,7 +355,7 @@ class TestL3fwdacl(TestCase):
             extra_args = '--alg="scalar"'
 
         cmdline = (
-            '%s %s -- -p %s --config="(%d,0,2),(%d,0,3)" --rule_ipv4="%s" --rule_ipv6="%s" %s'
+            '%s %s -- -p %s --lookup acl --config="(%d,0,2),(%d,0,3)" --rule_ipv4="%s" --rule_ipv6="%s" %s --parse-ptype'
             % (
                 self.app_l3fwd_acl_path,
                 self.eal_para,
@@ -447,6 +447,9 @@ class TestL3fwdacl(TestCase):
         """
         tx_interface = self.tester.get_interface(tx_port)
         rx_interface = self.tester.get_interface(rx_port)
+        # wait tester's interface up
+        for intfx in [tx_interface, rx_interface]:
+            self.tester.is_interface_up(intf=intfx)
         if rule["sIpAddr"] != "ALL":
             rule["sIpAddr"] = self.create_ipv4_ip_not_match(rule["sIpAddr"])
         if rule["dIpAddr"] != "ALL":
@@ -478,6 +481,9 @@ class TestL3fwdacl(TestCase):
         """
         tx_interface = self.tester.get_interface(tx_port)
         rx_interface = self.tester.get_interface(rx_port)
+        # wait tester's interface up
+        for intfx in [tx_interface, rx_interface]:
+            self.tester.is_interface_up(intf=intfx)
         if rule["sIpAddr"] != "ALL":
             rule["sIpAddr"] = self.create_ipv6_ip_not_match(rule["sIpAddr"])
         if rule["dIpAddr"] != "ALL":
@@ -499,7 +505,6 @@ class TestL3fwdacl(TestCase):
         pkt = packet.Packet()
         pkt.append_pkt(ethernet_str)
         pkt.send_pkt(crb=self.tester, tx_port=tx_interface, timeout=30)
-
         out = self.remove_dhcp_from_revpackets(inst)
         return len(out)
 
@@ -509,6 +514,9 @@ class TestL3fwdacl(TestCase):
         """
         tx_interface = self.tester.get_interface(tx_port)
         rx_interface = self.tester.get_interface(rx_port)
+        # wait tester's interface up
+        for intfx in [tx_interface, rx_interface]:
+            self.tester.is_interface_up(intf=intfx)
         etherStr = self.create_ipv4_rule_string(rule, "Ether")
 
         dst_filter = {"layer": "ether", "config": {"dst": "not ff:ff:ff:ff:ff:ff"}}
@@ -526,6 +534,9 @@ class TestL3fwdacl(TestCase):
         """
         tx_interface = self.tester.get_interface(tx_port)
         rx_interface = self.tester.get_interface(rx_port)
+        # wait tester's interface up
+        for intfx in [tx_interface, rx_interface]:
+            self.tester.is_interface_up(intf=intfx)
         etherStr = self.create_ipv6_rule_string(rule, "Ether")
 
         fil = [{"layer": "ether", "config": {"dst": "not ff:ff:ff:ff:ff:ff"}}]
@@ -533,7 +544,6 @@ class TestL3fwdacl(TestCase):
         pkt = packet.Packet()
         pkt.append_pkt(etherStr)
         pkt.send_pkt(crb=self.tester, tx_port=tx_interface, timeout=30)
-
         out = self.remove_dhcp_from_revpackets(inst)
         return len(out)
 
@@ -807,7 +817,7 @@ class TestL3fwdacl(TestCase):
         self.create_acl_ipv4_db(rule_list)
 
         cmdline = (
-            '%s %s -- -p %s --config="(%d,0,2),(%d,0,3)" --rule_ipv4="%s" --rule_ipv6="%s"'
+            '%s %s -- -p %s --lookup acl --config="(%d,0,2),(%d,0,3)" --rule_ipv4="%s" --rule_ipv6="%s" --parse-ptype'
             % (
                 self.app_l3fwd_acl_path,
                 self.eal_para,
@@ -834,7 +844,7 @@ class TestL3fwdacl(TestCase):
         self.create_acl_ipv6_db(rule_list)
 
         cmdline = (
-            '%s %s -- -p %s --config="(%d,0,2),(%d,0,3)" --rule_ipv4="%s" --rule_ipv6="%s"'
+            '%s %s -- -p %s --lookup acl --config="(%d,0,2),(%d,0,3)" --rule_ipv4="%s" --rule_ipv6="%s" --parse-ptype'
             % (
                 self.app_l3fwd_acl_path,
                 self.eal_para,
@@ -867,14 +877,17 @@ class TestL3fwdacl(TestCase):
         cores = self.get_core_list()
         self.verify(cores is not None, "Insufficient cores for speed testing")
 
-        self.eal_para = self.dut.create_eal_parameters(
-            cores=self.get_core_list(), other_eal_param="force-max-simd-bitwidth"
-        )
+        self.eal_para = self.dut.create_eal_parameters(cores=self.get_core_list())
         self.core_mask = utils.create_mask(cores)
         print("Core mask: %s" % self.core_mask)
-
-        if self.dut.dpdk_version >= "20.11.0":
-            self.eal_para += " --force-max-simd-bitwidth=0"
+        # When execution.cfg set rx_mode=xxx, it should have priority.
+        if "force-max-simd-bitwidth" in self.eal_para:
+            print("eal_para".format(self.eal_para))
+            pass
+        else:
+            # DTS commit 68bb1b92("tests/l3fwdacl: try to use highest available method") when dpdk > 20.11.0 by konstantin.ananyev@intel.com
+            if self.dut.dpdk_version >= "20.11.0":
+                self.eal_para += " --force-max-simd-bitwidth=0"
 
         valid_ports = [port for port in ports if self.tester.get_local_port(port) != -1]
         self.verify(
@@ -889,11 +902,8 @@ class TestL3fwdacl(TestCase):
 
         TestL3fwdacl.default_rule["Port"] = self.dut_ports[1]
 
-        # compile l3fwd-acl
-        out = self.dut.build_dpdk_apps("examples/l3fwd-acl")
-        self.app_l3fwd_acl_path = self.dut.apps_name["l3fwd-acl"]
-        self.verify("Error" not in out, "compilation error 1")
-        self.verify("No such file" not in out, "compilation error 2")
+        # dpdk22.07-rc1 commit 6de0ea50("examples/l3fwd: merge l3fwd-acl example"), compile l3fwd example.
+        self.app_l3fwd_acl_path = self.dut.build_dpdk_apps("examples/l3fwd")
 
     def test_l3fwdacl_acl_rule(self):
         """
@@ -1025,8 +1035,7 @@ class TestL3fwdacl(TestCase):
             TestL3fwdacl.lpm_rule_list_ipv6[1], tx_port, rx_port
         )
 
-        self.dut.send_expect("^C", "#", 20)
-
+        self.dut.send_expect("^C", "#", 30)
         self.verify(out1 >= 1, "Rx port0 not receive expected packet")
         self.verify(out2 >= 1, "Rx port1 not receive expected packet")
 
@@ -1103,7 +1112,7 @@ class TestL3fwdacl(TestCase):
         self.create_acl_ipv4_db(rule_list_ipv4)
 
         cmdline = (
-            '%s %s -- -p %s --config="(%d,0,2),(%d,0,3)" --rule_ipv4="%s" --rule_ipv6="%s" --alg="scalar"'
+            '%s %s -- -p %s --lookup acl --config="(%d,0,2),(%d,0,3)" --rule_ipv4="%s" --rule_ipv6="%s" --alg="scalar" --parse-ptype'
             % (
                 self.app_l3fwd_acl_path,
                 self.eal_para,
@@ -1123,7 +1132,7 @@ class TestL3fwdacl(TestCase):
         self.create_acl_ipv6_db(rule_list_ipv6)
 
         cmdline = (
-            '%s %s -- -p %s --config="(%d,0,2),(%d,0,3)" --rule_ipv4="%s" --rule_ipv6="%s" --alg="scalar"'
+            '%s %s -- -p %s --lookup acl --config="(%d,0,2),(%d,0,3)" --rule_ipv4="%s" --rule_ipv6="%s" --alg="scalar" --parse-ptype'
             % (
                 self.app_l3fwd_acl_path,
                 self.eal_para,
-- 
2.25.1


      parent reply	other threads:[~2022-06-10  7:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10  7:06 [dts][PATCH V1 0/2] l3fwdacl: merge l3fwd-acl wtih l3fwd Yu.Jiang
2022-06-10  7:06 ` [dts][PATCH V1 1/2] test_plans/l3fwdacl: " Yu.Jiang
2022-06-10  7:06 ` Yu.Jiang [this message]

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=1654844781-6435-3-git-send-email-yux.jiang@intel.com \
    --to=yux.jiang@intel.com \
    --cc=dts@dpdk.org \
    --cc=linglix.chen@intel.com \
    --cc=yuan.peng@intel.com \
    /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).