diff mbox series

[V2,2/2] tests/TestSuite_veb_switch:vf1 RX-bytes need add 4 bytes

Message ID 20210111102630.28937-3-weix.xie@intel.com (mailing list archive)
State Accepted
Headers show
Series switch i40evf to iavf | expand

Commit Message

Xie, WeiX Jan. 11, 2021, 10:26 a.m. UTC
DTS framework has switched i40evf to iavf, so align with it.
After testing, found that:
when send a packet which length is 60 bytes.
for net_iavf driver; the statistic from "show port stats 0" is: RX-bytes:56,
but set verbose 1, we can see the packet length is 60.
for net_i40e_vf driver; the statistic from "show port stats 0" is: RX-bytes: 60

Signed-off-by: Xie wei <weix.xie@intel.com>
---
 tests/TestSuite_veb_switch.py | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/tests/TestSuite_veb_switch.py b/tests/TestSuite_veb_switch.py
index 00dd76e7..cdd2b3c4 100644
--- a/tests/TestSuite_veb_switch.py
+++ b/tests/TestSuite_veb_switch.py
@@ -283,11 +283,18 @@  class TestVEBSwitching(TestCase):
 
         self.dut.send_expect("stop", "testpmd>", 2)
         self.session_secondary.send_expect("stop", "testpmd>", 2)
+        out = self.session_secondary.send_expect("show port info 0", "testpmd>")
+        vf1_driver = re.findall("Driver\s*name:\s*(\w+)", out)[0]
 
         vf0_tx_stats = self.veb_get_pmd_stats("first", 0, "tx")
         vf1_rx_stats = self.veb_get_pmd_stats("second", 0, "rx")
         if self.kdriver == 'ice':
             vf1_rx_stats[-1] = vf1_rx_stats[-1] + 4
+        if self.kdriver == 'i40e':
+            if vf1_driver == 'net_iavf':
+                vf1_rx_stats[-1] = vf1_rx_stats[-1] + 4
+            else:
+                vf1_rx_stats[-1] = vf1_rx_stats[-1]
         self.verify(vf0_tx_stats[0] != 0, "no packet was sent by VF0")
         self.verify(vf0_tx_stats == vf1_rx_stats, "VF1 failed to receive packets from VF0")