From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id C65B72BC5 for ; Wed, 7 Dec 2016 08:10:55 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 06 Dec 2016 23:10:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,310,1477983600"; d="scan'208";a="1068990224" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.240.176.135]) by orsmga001.jf.intel.com with ESMTP; 06 Dec 2016 23:10:53 -0800 From: "xu,huilong" To: dts@dpdk.org Cc: "xu,huilong" Date: Wed, 7 Dec 2016 15:12:02 +0800 Message-Id: <1481094722-24921-1-git-send-email-huilongx.xu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1] try to fix sometime dut port rx packets error X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 07:10:56 -0000 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 --- 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