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 V3 2/4] tests/vf_vlan: update dts code for driver change
Date: Mon, 11 Jul 2022 15:22:32 +0800	[thread overview]
Message-ID: <20220711072234.852-2-weiyuanx.li@intel.com> (raw)
In-Reply-To: <20220711072234.852-1-weiyuanx.li@intel.com>

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
v3:
-modify the code to check whether vf-vlan-pruning option exists.
-modify the description of the test plan about vf-vlan-pruning.

 tests/TestSuite_vf_vlan.py | 30 ++++++++++++++++++++++++++----
 1 file changed, 26 insertions(+), 4 deletions(-)

diff --git a/tests/TestSuite_vf_vlan.py b/tests/TestSuite_vf_vlan.py
index e73ad479..c4904c55 100644
--- a/tests/TestSuite_vf_vlan.py
+++ b/tests/TestSuite_vf_vlan.py
@@ -6,6 +6,7 @@ import random
 import re
 import time
 
+import framework.utils as utils
 from framework.packet import Packet
 from framework.pmd_output import PmdOutput
 from framework.settings import get_nic_name
@@ -62,7 +63,17 @@ class TestVfVlan(TestCase):
         self.host_intf0 = self.dut.ports_info[self.used_dut_port_0]["intf"]
         tester_port = self.tester.get_local_port(self.used_dut_port_0)
         self.tester_intf0 = self.tester.get_interface(tester_port)
-        if self.is_eth_series_nic(800) and self.default_stats:
+        # check driver whether there is flag vf-vlan-pruning.
+        if not self.default_stats:
+            self.logger.warning(
+                utils.RED(
+                    f"{self.kdriver + '_' + self.driver_version} driver does not have vf-vlan-pruning flag."
+                )
+            )
+        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_intf0, self.flag), "# "
             )
@@ -233,7 +244,11 @@ class TestVfVlan(TestCase):
         self.vm0_testpmd.execute_cmd("start")
 
         out = self.send_and_getout(vlan=random_vlan, pkt_type="VLAN_UDP")
-        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("received" in out, "Failed to received vlan packet!!!")
         else:
             self.verify("received" not in out, "Received vlan packet without pvid!!!")
@@ -354,7 +369,11 @@ class TestVfVlan(TestCase):
 
         # send packet with vlan
         out = self.send_and_getout(vlan=random_vlan, pkt_type="VLAN_UDP")
-        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(
                 "received 1 packets" in out,
                 "Received mismatched vlan packet while vlan filter on",
@@ -415,7 +434,10 @@ class TestVfVlan(TestCase):
 
     def tear_down_all(self):
         self.destroy_vm_env()
-        if self.is_eth_series_nic(800) and self.default_stats:
+        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 %s"
                 % (self.host_intf0, self.flag, self.default_stats),
-- 
2.27.0


  reply	other threads:[~2022-07-11  7:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-11  7:22 [dts][PATCH V3 1/4] tests/kernelpf_iavf: " Weiyuan Li
2022-07-11  7:22 ` Weiyuan Li [this message]
2022-07-11  7:22 ` [dts][PATCH V3 3/4] test_plans/kernelpf_iavf: " Weiyuan Li
2022-07-11  7:22 ` [dts][PATCH V3 4/4] test_plans/vf_vlan: " Weiyuan Li
2022-07-18  9:36   ` Chen, LingliX
2022-08-24  8:26   ` lijuan.tu

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=20220711072234.852-2-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).