[V4,8/8] tests/vlan: modify script and test plan to support i40e fimware >= 8.4

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

Checks

Context Check Description
ci/Intel-dts-pylama-test success Testing OK
ci/Intel-dts-doc-test success Testing OK
ci/Intel-dts-suite-test success Testing OK

Commit Message

Weiyuan Li Nov. 22, 2022, 7:09 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.
v4:
-modify comments.
-dual_vlan test plan modify table and add header.

 tests/TestSuite_vlan.py | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
  

Patch

diff --git a/tests/TestSuite_vlan.py b/tests/TestSuite_vlan.py
index 3d8811f9..1bdac137 100644
--- a/tests/TestSuite_vlan.py
+++ b/tests/TestSuite_vlan.py
@@ -48,7 +48,14 @@  class TestVlan(TestCase):
         self.pmdout.start_testpmd(
             "Default", "--portmask=%s --port-topology=loop" % portMask
         )
-
+        # Get the firmware version information
+        try:
+            self.fwversion, _, _ = self.pmdout.get_firmware_version(
+                self.dut_ports[0]
+            ).split()
+        except ValueError:
+            # nic IXGBE, IGC
+            self.fwversion = self.pmdout.get_firmware_version(self.dut_ports[0]).split()
         self.dut.send_expect("set verbose 1", "testpmd> ")
         self.dut.send_expect("set fwd mac", "testpmd> ")
         self.dut.send_expect("set promisc all off", "testpmd> ")
@@ -105,6 +112,10 @@  class TestVlan(TestCase):
         self.dut.send_expect(
             "rx_vlan add %d %s" % (self.vlan, 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("vlan set strip off  %s" % dutRxPortId, "testpmd> ")
         self.dut.send_expect("start", "testpmd> ", 120)
         out = self.dut.send_expect("show port info %s" % dutRxPortId, "testpmd> ", 20)
@@ -127,6 +138,10 @@  class TestVlan(TestCase):
         Disable receipt of VLAN packets
         """
         self.dut.send_expect("rx_vlan rm %d %s" % (self.vlan, 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> ", 120)
         self.vlan_send_packet(self.vlan)
 
@@ -187,7 +202,8 @@  class TestVlan(TestCase):
         """
         Run after each test case.
         """
-        pass
+        if self.kdriver == "i40e" and self.fwversion >= "8.40":
+            self.dut.send_expect("vlan set extend off %s" % dutRxPortId, "testpmd> ")
 
     def tear_down_all(self):
         """