test suite reviews and discussions
 help / color / mirror / Atom feed
From: "xu,huilong" <huilongx.xu@intel.com>
To: dts@dpdk.org
Cc: "xu,huilong" <huilongx.xu@intel.com>
Subject: [dts] [patch V2 1/2] add check_tx_bytes function for check testpmd tx_bytes
Date: Thu, 12 Jan 2017 16:46:56 +0800	[thread overview]
Message-ID: <1484210817-42185-1-git-send-email-huilongx.xu@intel.com> (raw)

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@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

             reply	other threads:[~2017-01-12  8:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12  8:46 xu,huilong [this message]
2017-01-12  8:46 ` [dts] [patch V2 2/2] used check_tx_bytes for check tx_bytes in test case xu,huilong
2017-01-16  2:28 ` [dts] [patch V2 1/2] add check_tx_bytes function for check testpmd tx_bytes Liu, Yong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1484210817-42185-1-git-send-email-huilongx.xu@intel.com \
    --to=huilongx.xu@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).