From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id D2DF3A00E6 for ; Fri, 17 May 2019 03:24:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 84166326C; Fri, 17 May 2019 03:24:28 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id AC46F2BF2 for ; Fri, 17 May 2019 03:24:26 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 May 2019 18:24:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,477,1549958400"; d="scan'208";a="172600181" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.240.176.135]) by fmsmga002.fm.intel.com with ESMTP; 16 May 2019 18:24:25 -0700 From: Wenjie Li To: dts@dpdk.org Cc: Wenjie Li Date: Fri, 17 May 2019 09:28:47 +0800 Message-Id: <1558056527-52378-1-git-send-email-wenjiex.a.li@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1] tests/tso: should stop ports before set csum 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" 1. should stop ports before set csum and start ports after the settings 2. there is no clear indication of which network card is not supported, will not check the nic type anymore 3. add tear_down and tear_down_all 4. delete unless comment/code Signed-off-by: Wenjie Li --- tests/TestSuite_tso.py | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/tests/TestSuite_tso.py b/tests/TestSuite_tso.py index 6735169..5e0dbd5 100644 --- a/tests/TestSuite_tso.py +++ b/tests/TestSuite_tso.py @@ -51,13 +51,6 @@ class TestTSO(TestCase): """ Run at the start of each test suite. """ - # this feature support Fortville, Niantic - self.verify(self.nic in ["kawela_2", "niantic", "bartonhills", "82545EM", - "82540EM", "springfountain", "fortville_eagle", - "fortville_spirit", "fortville_spirit_single", - "redrockcanyou", "atwood", "boulderrapid", "fortpark_TLV","fortville_25g","hi1822", "cavium_a063"], - "NIC Unsupported: " + str(self.nic)) - # Based on h/w type, choose how many ports to use self.dut_ports = self.dut.get_ports(self.nic) @@ -72,12 +65,6 @@ class TestTSO(TestCase): self.frame_sizes = [128, 1458] self.rxfreet_values = [0, 8, 16, 32, 64, 128] - # self.test_cycles = [{'cores': '1S/1C/1T', 'Mpps': {}, 'pct': {}}, - # {'cores': '1S/1C/2T', 'Mpps': {}, 'pct': {}}, - # {'cores': '1S/2C/1T', 'Mpps': {}, 'pct': {}}, - # {'cores': '1S/2C/2T', 'Mpps': {}, 'pct': {}}, - # {'cores': '1S/4C/2T', 'Mpps': {}, 'pct': {}} - # ] self.test_cycles = [{'cores': '1S/1C/2T', 'Mpps': {}, 'pct': {}}] self.table_header = ['Frame Size'] @@ -87,8 +74,6 @@ class TestTSO(TestCase): self.blacklist = "" - # self.coreMask = utils.create_mask(cores) - self.headers_size = HEADER_SIZE['eth'] + HEADER_SIZE[ 'ip'] + HEADER_SIZE['tcp'] @@ -160,6 +145,7 @@ class TestTSO(TestCase): cmd = "./%s/app/testpmd -c %s -n %d %s -- -i --rxd=512 --txd=512 --burst=32 --rxfreet=64 --mbcache=128 --portmask=%s --txpt=36 --txht=0 --txwt=0 --txfreet=32 --txrst=32 " % (self.target, self.coreMask, self.dut.get_memory_channels(), self.blacklist, self.portMask) self.dut.send_expect(cmd, "testpmd> ", 120) self.dut.send_expect("set verbose 1", "testpmd> ", 120) + self.dut.send_expect("port stop all", "testpmd> ", 120) self.dut.send_expect("csum set ip hw %d" % self.dut_ports[0], "testpmd> ", 120) self.dut.send_expect("csum set udp hw %d" % self.dut_ports[0], "testpmd> ", 120) self.dut.send_expect("csum set tcp hw %d" % self.dut_ports[0], "testpmd> ", 120) @@ -176,6 +162,7 @@ class TestTSO(TestCase): self.dut.send_expect("tso set 800 %d" % self.dut_ports[1], "testpmd> ", 120) self.dut.send_expect("set fwd csum", "testpmd> ", 120) + self.dut.send_expect("port start all", "testpmd> ", 120) self.dut.send_expect("start", "testpmd> ") self.tester.scapy_foreground() @@ -226,6 +213,7 @@ class TestTSO(TestCase): cmd = "./%s/app/testpmd -c %s -n %d %s -- -i --rxd=512 --txd=512 --burst=32 --rxfreet=64 --mbcache=128 --portmask=%s --txpt=36 --txht=0 --txwt=0 --txfreet=32 --txrst=32 " % (self.target, self.coreMask, self.dut.get_memory_channels(), self.blacklist, self.portMask) self.dut.send_expect(cmd, "testpmd> ", 120) self.dut.send_expect("set verbose 1", "testpmd> ", 120) + self.dut.send_expect("port stop all", "testpmd> ", 120) self.dut.send_expect("csum set ip hw %d" % self.dut_ports[0], "testpmd> ", 120) self.dut.send_expect("csum set udp hw %d" % self.dut_ports[0], "testpmd> ", 120) self.dut.send_expect("csum set tcp hw %d" % self.dut_ports[0], "testpmd> ", 120) @@ -242,6 +230,7 @@ class TestTSO(TestCase): self.dut.send_expect("tso set 800 %d" % self.dut_ports[1], "testpmd> ", 120) self.dut.send_expect("set fwd csum", "testpmd> ", 120) + self.dut.send_expect("port start all", "testpmd> ", 120) self.dut.send_expect("start", "testpmd> ") self.tester.scapy_foreground() @@ -295,6 +284,7 @@ class TestTSO(TestCase): self.rst_report(command_line + "\n\n", frame=True, annex=True) self.dut.send_expect(command_line, "testpmd> ", 120) + self.dut.send_expect("port stop all", "testpmd> ", 120) self.dut.send_expect("csum set ip hw %d" % self.dut_ports[0], "testpmd> ", 120) self.dut.send_expect("csum set udp hw %d" % self.dut_ports[0], "testpmd> ", 120) self.dut.send_expect("csum set tcp hw %d" % self.dut_ports[0], "testpmd> ", 120) @@ -309,6 +299,7 @@ class TestTSO(TestCase): self.dut.send_expect("csum parse-tunnel on %d" % self.dut_ports[1], "testpmd> ", 120) self.dut.send_expect("tso set 800 %d" % self.dut_ports[1], "testpmd> ", 120) self.dut.send_expect("set fwd csum", "testpmd> ", 120) + self.dut.send_expect("port start all", "testpmd> ", 120) self.dut.send_expect("start", "testpmd> ") for frame_size in self.frame_sizes: wirespeed = self.wirespeed(self.nic, frame_size, 2) @@ -350,3 +341,15 @@ class TestTSO(TestCase): self.result_table_add(table_row) self.result_table_print() + def tear_down(self): + """ + Run after each test case. + """ + self.dut.kill_all() + time.sleep(2) + + def tear_down_all(self): + """ + Run after each test suite. + """ + pass -- 2.17.2