[V3,6/8] tests/vlan_ethertype_config: modify script and test plan to support i40e fimware >= 8.4

Message ID 20221121080509.10128-6-weiyuanx.li@intel.com (mailing list archive)
State Superseded
Headers
Series [V3,1/8] test_plans/dual_vlan: modify script and test plan to support i40e fimware >= 8.4 |

Commit Message

Weiyuan Li Nov. 21, 2022, 8:05 a.m. UTC
  Modify script and test plan to i40e support fimware >= 8.4.
When the fimrware >= 8.4, if the filter is to take effect need to enable
extend.

Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
---
Tested-by: Song Jiale <songx.jiale@intel.com>

v2:
-use the firmware version to judge whether to add command `extend on`.
v3:
-modify description.

 tests/TestSuite_vlan_ethertype_config.py | 25 +++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)
  

Patch

diff --git a/tests/TestSuite_vlan_ethertype_config.py b/tests/TestSuite_vlan_ethertype_config.py
index b641d928..7147c490 100644
--- a/tests/TestSuite_vlan_ethertype_config.py
+++ b/tests/TestSuite_vlan_ethertype_config.py
@@ -56,6 +56,17 @@  class TestVlanEthertypeConfig(TestCase):
         """
         self.pmdout = PmdOutput(self.dut)
         self.pmdout.start_testpmd("Default", "--portmask=%s" % self.portmask)
+        # Get the firmware version information
+        try:
+            self.fwversion, _, _ = self.pmdout.get_firmware_version(
+                self.dut.get_ports()[0]
+            ).split()
+        except ValueError:
+            # nic IXGBE, IGC
+            self.fwversion = self.pmdout.get_firmware_version(
+                self.dut.get_ports()[0]
+            ).split()
+
         if self.kdriver == "i40e":
             self.dut.send_expect("set promisc all off", "testpmd> ")
 
@@ -194,6 +205,12 @@  class TestVlanEthertypeConfig(TestCase):
                 self.dut.send_expect(
                     "vlan set filter on  %s" % dutRxPortId, "testpmd> "
                 )
+                # Because the kernel forces enable Qinq and cannot be closed,
+                # the dpdk can only add 'extend on' to make the VLAN filter work normally.
+                if self.kdriver == "i40e" and self.fwversion >= "8.40":
+                    self.dut.send_expect(
+                        "vlan set extend on %s" % dutRxPortId, "testpmd> "
+                    )
                 self.dut.send_expect("start", "testpmd> ")
                 self.check_vlan_packets(rx_vlan, tpid, self.rxItf, False)
                 # test vlan filter off
@@ -209,8 +226,12 @@  class TestVlanEthertypeConfig(TestCase):
         random_vlan = random.randint(1, MAX_VLAN - 1)
         rx_vlans = [1, random_vlan, MAX_VLAN]
         self.dut.send_expect("set fwd mac", "testpmd> ")
-        self.dut.send_expect("vlan set filter on  %s" % dutRxPortId, "testpmd> ")
+        self.dut.send_expect("vlan set filter on %s" % dutRxPortId, "testpmd> ")
         self.dut.send_expect("vlan set strip off %s" % dutRxPortId, "testpmd> ", 20)
+        # Because the kernel forces enable Qinq and cannot be closed,
+        # the dpdk can only add 'extend on' to make the VLAN filter work normally.
+        if self.kdriver == "i40e" and self.fwversion >= "8.40":
+            self.dut.send_expect("vlan set extend on %s" % dutRxPortId, "testpmd> ")
         self.dut.send_expect("start", "testpmd> ")
 
         # caium_a063 card support only default '0x8100' tpid in rx mode
@@ -359,6 +380,8 @@  class TestVlanEthertypeConfig(TestCase):
         """
         Run after each test case.
         """
+        if self.kdriver == "i40e" and self.fwversion >= "8.40":
+            self.dut.send_expect("vlan set extend off %s" % dutRxPortId, "testpmd> ")
         self.dut.send_expect("stop", "testpmd> ", 30)
         self.dut.send_expect("quit", "# ", 30)
         pass