From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 33A325582 for ; Tue, 15 Mar 2016 04:13:34 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 14 Mar 2016 20:13:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,337,1455004800"; d="scan'208";a="66428230" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga004.fm.intel.com with ESMTP; 14 Mar 2016 20:13:33 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.110.15) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 14 Mar 2016 20:13:32 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.232]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.132]) with mapi id 14.03.0248.002; Tue, 15 Mar 2016 11:13:31 +0800 From: "Pei, Yulong" To: "Tu, LijuanX A" , "dts@dpdk.org" , "Xu, Qian Q" Thread-Topic: [dts][PATCH v2]tests vf_port_start_stop: update test case Thread-Index: AQHRdOs4YrIle0iCgUi4y/OxNT3mvZ9Z5+9w Date: Tue, 15 Mar 2016 03:13:29 +0000 Message-ID: <188971FCDA171749BED5DA74ABF3E6F00353ED35@shsmsx102.ccr.corp.intel.com> References: <1456967910-18349-1-git-send-email-lijuanx.a.tu@intel.com> In-Reply-To: <1456967910-18349-1-git-send-email-lijuanx.a.tu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjllZmNjNzEtMTIyYi00ZjhlLTgwMTMtOWJhZjE2NDg2NmU0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQkVwSmZwakxPQW9Xak9TM2R1cXRGMXFLNVZDM3RmVTE5VDZBWWJYbHhPYz0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH v2]tests vf_port_start_stop: update test case 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: Tue, 15 Mar 2016 03:13:34 -0000 Ack+ -----Original Message----- From: Tu, LijuanX A=20 Sent: Thursday, March 3, 2016 9:19 AM To: dts@dpdk.org; Pei, Yulong ; Xu, Qian Q Cc: Tu, LijuanX A Subject: [dts][PATCH v2]tests vf_port_start_stop: update test case Forwarding checking RX-packets, RX-Bytes, Tx-packets, Tx-bytes, Do not chec= king Rx-errors fortville NIC: when not start, the port is ready to RX but NOT RX packets, if you send 119 packets at 64B, then it will be RXed at the NIC's hardw= are buffer if the buffer is full, it will show in RX-errors so we do not verify Rx-errors. Signed-off-by: Lijuan Tu --- tests/TestSuite_vf_port_start_stop.py | 47 +++++++++++++++++++++----------= ---- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/tests/TestSuite_vf_port_start_stop.py b/tests/TestSuite_vf_por= t_start_stop.py index 0cc7ffd..4aa8de7 100644 --- a/tests/TestSuite_vf_port_start_stop.py +++ b/tests/TestSuite_vf_port_start_stop.py @@ -114,11 +114,19 @@ class TestVfPortStartStop(TestCase): testpmd.execute_cmd('port stop all') testpmd.execute_cmd('clear port stats all') =20 - def check_port_start_stop(self, testpmd, times=3D10): + def check_port_start_stop(self, testpmd, times=3D1000): """ VF port start/stop several times , check if it work well. """ + port_id_0 =3D 0 + port_id_1 =3D 1 + for i in range(times): + vf0_stats =3D self.vm0_testpmd.get_pmd_stats(port_id_0) + b_vf0_rx_pkts, b_vf0_rx_bytes =3D vf0_stats['RX-packets'], vf0= _stats['RX-bytes'] + vf1_stats =3D self.vm0_testpmd.get_pmd_stats(port_id_1) + b_vf1_tx_pkts, b_vf1_tx_bytes =3D vf1_stats['TX-packets'],=20 + vf1_stats['TX-bytes'] + out =3D testpmd.execute_cmd('port start all') self.verify("Checking link statuses" in out, "ERROR: port star= t all") testpmd.execute_cmd('start') @@ -127,22 +135,24 @@ class TestV= fPortStartStop(TestCase): out =3D testpmd.execute_cmd('port stop all') self.verify("Checking link statuses" in out, "ERROR: port stop= all") =20 - port_id_0 =3D 0 - port_id_1 =3D 1 - vf0_stats =3D self.vm0_testpmd.get_pmd_stats(port_id_0) - vf1_stats =3D self.vm0_testpmd.get_pmd_stats(port_id_1) - - vf0_rx_cnt =3D vf0_stats['RX-packets'] - self.verify(vf0_rx_cnt !=3D 0, "no packet was received by vm0_VF0"= ) - - vf0_rx_err =3D vf0_stats['RX-errors'] - self.verify(vf0_rx_err =3D=3D 0, "vm0_VF0 rx-errors") - =20 - vf1_tx_cnt =3D vf1_stats['TX-packets'] - self.verify(vf1_tx_cnt !=3D 0, "no packet was transmitted by vm0_V= F1") - - vf1_tx_err =3D vf1_stats['TX-errors'] - self.verify(vf1_tx_err =3D=3D 0, "vm0_VF0 tx-errors") + vf0_stats =3D self.vm0_testpmd.get_pmd_stats(port_id_0) + c_vf0_rx_pkts, c_vf0_rx_bytes, vf0_rx_errors =3D vf0_stats['RX= -packets'], vf0_stats['RX-bytes'], vf0_stats['RX-errors'] + vf1_stats =3D self.vm0_testpmd.get_pmd_stats(port_id_1) + c_vf1_tx_pkts, c_vf1_tx_bytes, vf1_tx_errors =3D=20 + vf1_stats['TX-packets'], vf1_stats['TX-bytes'], vf1_stats['TX-errors'] + + #Fortville NIC :when not start, the port is ready to RX but NO= T RX packets, + #if you send packets , then it will be RXed at the NIC's hard= ware buffer + #if buffer is full ,it will show RX-errors + #so, we do not check RX-errors + if self.kdriver !=3D "i40e": + self.verify(vf0_rx_errors =3D=3D 0, "vm0_VF0 rx-errors") + self.verify(vf1_tx_errors =3D=3D 0, "vm0_VF1 tx-errors") + + #compare vf0 RX-packets RX-bytes ,vf1 Tx-packets TX-bytes + self.verify(c_vf0_rx_pkts > b_vf0_rx_pkts, "Packets received e= rror") + self.verify(c_vf0_rx_bytes > b_vf0_rx_bytes, "Bytes received e= rror") + self.verify(c_vf1_tx_pkts > b_vf1_tx_pkts, "Packets forwarding= error") + self.verify(c_vf1_tx_bytes > b_vf1_tx_bytes, "Bytes=20 + forvwarding error") =20 def setup_1pf_2vf_1vm_env(self, driver=3D'default'): =20 @@ -219,7 +229,8 @@ class TestVfPortStartStop(TestCase): =20 time.sleep(2) =20 - dst_mac =3D self.vm_dut_0.get_mac_address(self.vm0_dut_ports[0]) + port_id_0 =3D 0 + dst_mac =3D self.vm0_testpmd.get_port_mac(port_id_0) self.send_and_verify(dst_mac, self.vm0_testpmd)=20 =20 def tear_down(self): -- 2.5.0