test suite reviews and discussions
 help / color / mirror / Atom feed
From: haifeng <haifengx.tang@intel.com>
To: dts@dpdk.org
Subject: [dts] [DTS][PATCH V2] fix pmd driver tx and rx crc issue
Date: Mon, 30 Nov 2015 13:11:32 +0800	[thread overview]
Message-ID: <1448860292-40296-1-git-send-email-haifengx.tang@intel.com> (raw)

Signed-off-by: haifeng <haifengx.tang@intel.com>
---
 tests/TestSuite_shutdown_api.py | 38 ++++++++++++++++----------------------
 1 file changed, 16 insertions(+), 22 deletions(-)

diff --git a/tests/TestSuite_shutdown_api.py b/tests/TestSuite_shutdown_api.py
index 411e4bf..241e072 100644
--- a/tests/TestSuite_shutdown_api.py
+++ b/tests/TestSuite_shutdown_api.py
@@ -82,19 +82,19 @@ class TestShutdownApi(TestCase):
         stats = output.get_pmd_stats(portid)
         return stats
 
-    def check_forwarding(self, ports=None, pktSize=68, received=True, vlan=False, promisc=False, crcStrip=True):
+    def check_forwarding(self, ports=None, pktSize=68, received=True, vlan=False, promisc=False):
         if ports is None:
             ports = self.ports
         if len(ports) == 1:
-            self.send_packet(ports[0], ports[0], pktSize, received, vlan, promisc, crcStrip)
+            self.send_packet(ports[0], ports[0], pktSize, received, vlan, promisc)
             return
 
         for i in range(len(ports)):
             if i % 2 == 0:
-                self.send_packet(ports[i], ports[i + 1], pktSize, received, vlan, promisc, crcStrip)
-                self.send_packet(ports[i + 1], ports[i], pktSize, received, vlan, promisc, crcStrip)
+                self.send_packet(ports[i], ports[i + 1], pktSize, received, vlan, promisc)
+                self.send_packet(ports[i + 1], ports[i], pktSize, received, vlan, promisc)
 
-    def send_packet(self, txPort, rxPort, pktSize=68, received=True, vlan=False, promisc=False, crcStrip=False):
+    def send_packet(self, txPort, rxPort, pktSize=68, received=True, vlan=False, promisc=False):
         """
         Send packages according to parameters.
         """
@@ -147,13 +147,13 @@ class TestShutdownApi(TestCase):
                 rx_bytes_exp -= 4
                 tx_bytes_exp -= 4
         else:
-             if self.nic not in ['kawela_4']:
-                 tx_bytes_exp -= 4
-                 if crcStrip is True:
-                     rx_bytes_exp -= 4
-             if vlan is True:
-                tx_bytes_exp -= 4   
-        
+            # some NIC will always include tx crc
+            rx_bytes_exp -= 4
+            tx_bytes_exp -= 4
+            if vlan is True:
+                # vlan strip default is on
+                tx_bytes_exp -= 4
+
         if received:
             self.verify(p0tx_pkts == p1rx_pkts, "Wrong TX pkts p0_tx=%d, p1_rx=%d" % (p0tx_pkts, p1rx_pkts))
             self.verify(p1rx_bytes == rx_bytes_exp, "Wrong Rx bytes p1_rx=%d, expect=%d" % (p1rx_bytes, rx_bytes_exp))
@@ -281,7 +281,7 @@ class TestShutdownApi(TestCase):
         self.verify(
             "CRC stripping enabled" in out, "CRC stripping not enabled properly")
         self.dut.send_expect("start", "testpmd> ")
-        self.check_forwarding(crcStrip=True)
+        self.check_forwarding()
 
 
     def test_change_linkspeed(self):
@@ -365,15 +365,9 @@ class TestShutdownApi(TestCase):
         self.dut.send_expect("port config all hw-vlan off", "testpmd> ")
         self.dut.send_expect("port start all", "testpmd> ", 100)
         self.dut.send_expect("start", "testpmd> ")
-        if self.nic in ["bartonhills", "powerville", "springville", "hartwell"]:
-            jumbo_size = jumbo_size + 4
-            self.check_forwarding(pktSize=jumbo_size - 1)
-            self.check_forwarding(pktSize=jumbo_size)
-            self.check_forwarding(pktSize=jumbo_size + 1, received=False)
-        else:
-            self.check_forwarding(pktSize=jumbo_size - 1)
-            self.check_forwarding(pktSize=jumbo_size)
-            self.check_forwarding(pktSize=jumbo_size + 1, received=False)
+        self.check_forwarding(pktSize=jumbo_size - 1)
+        self.check_forwarding(pktSize=jumbo_size)
+        self.check_forwarding(pktSize=jumbo_size + 1, received=False)
 
     def test_enable_disablerss(self):
         """
-- 
1.9.3

                 reply	other threads:[~2015-11-30  5:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1448860292-40296-1-git-send-email-haifengx.tang@intel.com \
    --to=haifengx.tang@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).