[dts] [patch V2 1/2] add check_tx_bytes function for check testpmd tx_bytes

xu,huilong huilongx.xu at intel.com
Thu Jan 12 09:46:56 CET 2017


changlist:
1. add PROTOCOL_PACKET_SIZE value in setting mode
2. add check_tx_bytes function in testpmd output mode

Signed-off-by: xu,huilong <huilongx.xu at intel.com>
---
 framework/pmd_output.py | 10 ++++++++--
 framework/settings.py   |  7 ++++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/framework/pmd_output.py b/framework/pmd_output.py
index d982c89..13dcaef 100644
--- a/framework/pmd_output.py
+++ b/framework/pmd_output.py
@@ -31,7 +31,7 @@
 
 import os
 import re
-from settings import TIMEOUT
+from settings import TIMEOUT,PROTOCOL_PACKET_SIZE
 from utils import create_mask
 
 
@@ -192,7 +192,13 @@ class PmdOutput():
         Get the allmulticast mode of port.
         """
         return self.get_detail_from_port_info("Allmulticast mode: ", "\S+", port_id)
-
+    def check_tx_bytes(self, tx_bytes, exp_bytes = 0):
+        """
+        fortville nic will send lldp packet when nic setup with testpmd.
+        so should used (tx_bytes - exp_bytes) % PROTOCOL_PACKET_SIZE['lldp']
+        for check tx_bytes count right
+        """
+        return not (tx_bytes - exp_bytes) % PROTOCOL_PACKET_SIZE['lldp']
     def get_port_vlan_offload(self, port_id):
         """
         Function: get the port vlan settting info.
diff --git a/framework/settings.py b/framework/settings.py
index df2a491..acffa34 100644
--- a/framework/settings.py
+++ b/framework/settings.py
@@ -161,7 +161,12 @@ HEADER_SIZE = {
     'tcp': 20,
     'vxlan': 8,
 }
-
+"""
+dpdk send protocol packet size.
+"""
+PROTOCOL_PACKET_SIZE = {
+    'lldp': 110,
+}
 
 """
 Default session timeout.
-- 
1.9.3



More information about the dts mailing list