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 V1] try to fix sometime dut port rx packets error
Date: Wed,  7 Dec 2016 15:12:02 +0800	[thread overview]
Message-ID: <1481094722-24921-1-git-send-email-huilongx.xu@intel.com> (raw)

some time dut rx packet error, we guess the root case about scapy send packets.
so we try send packets again when check dut not rx packets.

Signed-off-by: xu,huilong <huilongx.xu@intel.com>
---
 tests/TestSuite_pmd.py | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/tests/TestSuite_pmd.py b/tests/TestSuite_pmd.py
index 7b9e6b5..e8a65e5 100644
--- a/tests/TestSuite_pmd.py
+++ b/tests/TestSuite_pmd.py
@@ -342,19 +342,23 @@ class TestPmd(TestCase,IxiaPacketGenerator):
         checksum = ''
         if checksum_test:
             checksum = 'chksum=0x1'
-
-        self.tester.scapy_foreground()
-        self.tester.scapy_append('nutmac="%s"' % mac)
-        self.tester.scapy_append('sendp([Ether(dst=nutmac, src="52:00:00:00:00:00")/IP(len=%s)/UDP(%s)/Raw(load="\x50"*%s)], iface="%s")' % (
-            load_size, checksum, padding, interface))
-
-        out = self.tester.scapy_execute()
-        time.sleep(.5)
-
-        port0_stats = self.get_stats(self.dut_ports[0])
-        p0tx_pkts, p0tx_bytes = [port0_stats['TX-packets'], port0_stats['TX-bytes']]
-        port1_stats = self.get_stats(self.dut_ports[1])
-        p1rx_pkts, p1rx_err, p1rx_bytes = [port1_stats['RX-packets'], port1_stats['RX-errors'], port1_stats['RX-bytes']]
+        for i in range(3):
+            self.tester.scapy_foreground()
+            self.tester.scapy_append('nutmac="%s"' % mac)
+            self.tester.scapy_append('sendp([Ether(dst=nutmac, src="52:00:00:00:00:00")/IP(len=%s)/UDP(%s)/Raw(load="\x50"*%s)], iface="%s")' % (
+                load_size, checksum, padding, interface))
+
+            out = self.tester.scapy_execute()
+            time.sleep((i + 1) * 0.5)
+
+            port0_stats = self.get_stats(self.dut_ports[0])
+            p0tx_pkts, p0tx_bytes = [port0_stats['TX-packets'], port0_stats['TX-bytes']]
+            port1_stats = self.get_stats(self.dut_ports[1])
+            p1rx_pkts, p1rx_err, p1rx_bytes = [port1_stats['RX-packets'], port1_stats['RX-errors'], port1_stats['RX-bytes']]
+            #dut port rx packets already
+            if (p1rx_pkts - gp1rx_pkts):
+                break
+            time.sleep(i)
 
         p0tx_pkts -= gp0tx_pkts
         p0tx_bytes -= gp0tx_bytes
-- 
1.9.3

             reply	other threads:[~2016-12-07  7:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07  7:12 xu,huilong [this message]
2016-12-14  8:12 ` Liu, Yong
2016-12-14  9:11   ` Xu, HuilongX
2016-12-14 15:18     ` 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=1481094722-24921-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).