test suite reviews and discussions
 help / color / mirror / Atom feed
From: Weiyuan Li <weiyuanx.li@intel.com>
To: dts@dpdk.org, yuan.peng@intel.com
Cc: Weiyuan Li <weiyuanx.li@intel.com>
Subject: [dts][PATCH V2 1/4] tests/kernelpf_iavf: update dts code for driver change
Date: Wed,  6 Jul 2022 10:38:03 +0800	[thread overview]
Message-ID: <20220706023806.27825-1-weiyuanx.li@intel.com> (raw)

The out-tree driver has vf-vlan-pruning option,but in-tree driver has
not. So we need different action to enable vlan filter when we validate
the vlan filter function with in-tree and out-tree kernel drvier.

Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
---

v2:
-fix format issue

 tests/TestSuite_kernelpf_iavf.py | 33 ++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/tests/TestSuite_kernelpf_iavf.py b/tests/TestSuite_kernelpf_iavf.py
index d7d17ac4..67a26245 100644
--- a/tests/TestSuite_kernelpf_iavf.py
+++ b/tests/TestSuite_kernelpf_iavf.py
@@ -96,7 +96,25 @@ class TestKernelpfIavf(TestCase):
         # bind to default driver
         self.bind_nic_driver(self.dut_ports, driver="")
         self.used_dut_port = self.dut_ports[0]
-        if self.is_eth_series_nic(800) and self.default_stats:
+        # check out tree driver whether there is flag vf-vlan-pruning.
+        # out tree path: /lib/modules/4.18.0-305.19.1.el8_4.x86_64/updates/drivers/net/ethernet/intel/i40e/i40e.ko
+        # in tree path:/lib/modules/5.15.0-27-generic/kernel/drivers/net/ethernet/intel/ice/ice.ko
+        out = self.dut.send_expect(f"modinfo {self.kdriver}", "# ")
+        pattern = "/lib/modules/(.*?)/updates/drivers"
+        regex = re.compile(pattern)
+        mo = regex.search(out)
+        if mo:
+            search_results = mo.group(0)
+        else:
+            search_results = ""
+        if "updates" in search_results and not self.default_stats:
+            self.logger.warning(
+                f"{self.kdriver} driver out tree does not have vf-vlan-pruning flag. Please confirm whether the driver is correct."
+            )
+        if (
+            any([self.is_eth_series_nic(800), self.kdriver == "i40e"])
+            and self.default_stats
+        ):
             self.dut.send_expect(
                 "ethtool --set-priv-flags %s %s on" % (self.host_intf, self.flag), "# "
             )
@@ -119,7 +137,6 @@ class TestKernelpfIavf(TestCase):
             self.dut.send_expect(
                 "ip link set %s vf 0 mac %s" % (self.host_intf, self.vf_mac), "# "
             )
-
         try:
 
             for port in self.sriov_vfs_port:
@@ -453,7 +470,11 @@ class TestKernelpfIavf(TestCase):
         time.sleep(1)
         tcpdump_out = self.get_tcpdump_package()
         receive_pkt = re.findall("vlan %s" % random_vlan, tcpdump_out)
-        if self.kdriver == "i40e" and self.driver_version < "2.13.10":
+        if (
+            (self.kdriver == "i40e" and self.driver_version < "2.13.10")
+            or (self.kdriver == "i40e" and not self.default_stats)
+            or (self.kdriver == "ice" and not self.default_stats)
+        ):
             self.verify(len(receive_pkt) == 2, "Failed to received vlan packet!!!")
         else:
             self.verify(len(receive_pkt) == 1, "Failed to received vlan packet!!!")
@@ -853,7 +874,11 @@ class TestKernelpfIavf(TestCase):
         self.scapy_send_packet(self.vf_mac, self.tester_intf, vlan_flags=True, count=10)
         out = self.vm_dut.get_session_output()
         packets = len(re.findall("received 1 packets", out))
-        if self.kdriver == "i40e" and self.driver_version < "2.13.10":
+        if (
+            (self.kdriver == "i40e" and self.driver_version < "2.13.10")
+            or (self.kdriver == "i40e" and not self.default_stats)
+            or (self.kdriver == "ice" and not self.default_stats)
+        ):
             self.verify(packets == 10, "Not receive expected packet")
         else:
             self.verify(packets == 0, "Receive expected packet")
-- 
2.27.0


             reply	other threads:[~2022-07-06  2:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06  2:38 Weiyuan Li [this message]
2022-07-06  2:38 ` [dts][PATCH V2 2/4] tests/vf_vlan: " Weiyuan Li
2022-07-06  6:46   ` Tu, Lijuan
2022-07-06  2:38 ` [dts][PATCH V2 3/4] test_plans/kernelpf_iavf: " Weiyuan Li
2022-07-06  2:38 ` [dts][PATCH V2 4/4] test_plans/vf_vlan: " Weiyuan Li

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=20220706023806.27825-1-weiyuanx.li@intel.com \
    --to=weiyuanx.li@intel.com \
    --cc=dts@dpdk.org \
    --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).