[dts] [PATCH V1 13/17]vhost_dequeue_zero_copy: change verified mpps value according to linerate

Xiao Qimai qimaix.xiao at intel.com
Fri May 22 10:32:04 CEST 2020


Signed-off-by: Xiao Qimai <qimaix.xiao at intel.com>
---
 tests/TestSuite_vhost_dequeue_zero_copy.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/tests/TestSuite_vhost_dequeue_zero_copy.py b/tests/TestSuite_vhost_dequeue_zero_copy.py
index 8fca47a..8332b8a 100644
--- a/tests/TestSuite_vhost_dequeue_zero_copy.py
+++ b/tests/TestSuite_vhost_dequeue_zero_copy.py
@@ -303,7 +303,9 @@ class TestVhostDequeueZeroCopy(TestCase):
             Mpps = stats[1] / 1000000.0
         # when the fwd mode is rxonly, we can not receive data, so should not verify it
         if fwd_mode != "rxonly":
-            self.verify(Mpps > 0, "can not receive packets of frame size %d" % (frame_size))
+            self.verify(Mpps > self.check_value[frame_size],
+                        "%s of frame size %d speed verify failed, expect %s, result %s" % (
+                            self.running_case, frame_size, self.check_value[frame_size], Mpps))
         throughput = Mpps * 100 / \
                     float(self.wirespeed(self.nic, frame_size, 1))
         return Mpps, throughput
@@ -335,6 +337,15 @@ class TestVhostDequeueZeroCopy(TestCase):
 
         self.vhost_user.send_expect("start", "testpmd> ", 60)
 
+    @property
+    def check_value(self):
+        check_dict = dict.fromkeys(self.frame_sizes)
+        linerate = {64: 0.085, 128: 0.12, 256: 0.20, 512: 0.35, 1024: 0.50, 1280: 0.55, 1518: 0.60}
+        for size in self.frame_sizes:
+            speed = self.wirespeed(self.nic, size, self.number_of_ports)
+            check_dict[size] = round(speed * linerate[size], 2)
+        return check_dict
+
     def send_and_verify_throughput(self, cycle="", fwd_mode=""):
         """
         start to send packets and verify it
-- 
1.8.3.1



More information about the dts mailing list