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 9C76CA00E6 for ; Thu, 13 Jun 2019 11:11:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9412E1D37C; Thu, 13 Jun 2019 11:11:37 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 1A3F41D37B for ; Thu, 13 Jun 2019 11:11:35 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2019 02:11:35 -0700 X-ExtLoop1: 1 Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga007.jf.intel.com with ESMTP; 13 Jun 2019 02:11:34 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 13 Jun 2019 02:11:34 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 13 Jun 2019 02:11:33 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.104]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.89]) with mapi id 14.03.0439.000; Thu, 13 Jun 2019 17:11:32 +0800 From: "Tu, Lijuan" To: "Li, WenjieX A" , "dts@dpdk.org" CC: "Li, WenjieX A" Thread-Topic: [dts] [PATCH V1] tests: remove runtime_queue_number Thread-Index: AQHVIZcuy/9P6gK2fEmORrJ8RMP1/qaZTMig Date: Thu, 13 Jun 2019 09:11:31 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BABD09B@SHSMSX101.ccr.corp.intel.com> References: <1560396368-4340-1-git-send-email-wenjiex.a.li@intel.com> In-Reply-To: <1560396368-4340-1-git-send-email-wenjiex.a.li@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTVlOWZhN2QtMDE3NS00NTk5LWFjZTktYjZjMjE1M2EyMDE1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiaUNUWDZhVzV5RUlURytJS1RVK21xbFMwNWtSTlgxS0hPOW1oTko2U0ZnZEdaeHA5N1ZGWnZNMlZKMlVUTnFrbCJ9 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 V1] tests: remove runtime_queue_number 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" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Wenjie Li > Sent: Thursday, June 13, 2019 11:26 AM > To: dts@dpdk.org > Cc: Li, WenjieX A > Subject: [dts] [PATCH V1] tests: remove runtime_queue_number >=20 > Remove TestSuite_runtime_queue_number.py since it was replaced by > runtime_vf_queue_number and runtiem_vf_queue_number_kernel. >=20 > Signed-off-by: Wenjie Li > --- > tests/TestSuite_runtime_queue_number.py | 338 ------------------------ > 1 file changed, 338 deletions(-) > delete mode 100644 tests/TestSuite_runtime_queue_number.py >=20 > diff --git a/tests/TestSuite_runtime_queue_number.py > b/tests/TestSuite_runtime_queue_number.py > deleted file mode 100644 > index 644d2fe..0000000 > --- a/tests/TestSuite_runtime_queue_number.py > +++ /dev/null > @@ -1,338 +0,0 @@ > -# BSD LICENSE > -# > -# Copyright(c) 2010-2018 Intel Corporation. All rights reserved. > -# All rights reserved. > -# > -# Redistribution and use in source and binary forms, with or without -# > modification, are permitted provided that the following conditions -# are > met: > -# > -# * Redistributions of source code must retain the above copyright > -# notice, this list of conditions and the following disclaimer. > -# * Redistributions in binary form must reproduce the above copyright > -# notice, this list of conditions and the following disclaimer in > -# the documentation and/or other materials provided with the > -# distribution. > -# * Neither the name of Intel Corporation nor the names of its > -# contributors may be used to endorse or promote products derived > -# from this software without specific prior written permission. > -# > -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND > CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, > INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF > MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE > DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR > CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# > SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - > # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF > USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED > AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN > ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE > POSSIBILITY OF SUCH DAMAGE. > - > -""" > -DPDK Test suite. > - > -Set the VF max queue number when running the DPDK APP instead of > compiling. > - > -""" > - > -import utils > -import time > -import re > - > -from test_case import TestCase > -from settings import HEADER_SIZE > -from pmd_output import PmdOutput > -from settings import DRIVERS > - > -from packet import Packet > - > - > -class TestRuntime_Queue_Number(TestCase): > - > - supported_vf_driver =3D ['pci-stub', 'vfio-pci'] > - > - def set_up_all(self): > - """ > - Run at the start of each test suite. > - Run time Queue Number Prerequisites > - """ > - self.verify(self.nic in ["fortville_eagle", "fortville_spirit", > - "fortville_spirit_single", "fortpark_TL= V"], "NIC > Unsupported: " + str(self.nic)) > - > - # Based on h/w type, choose how many ports to use > - self.dut_ports =3D self.dut.get_ports(self.nic) > - # Verify that enough ports are available > - self.verify(len(self.dut_ports) >=3D 1, "Insufficient ports") > - > - localPort =3D self.tester.get_local_port(self.dut_ports[0]) > - self.tester_intf =3D self.tester.get_interface(localPort) > - self.tester_mac =3D self.tester.get_mac(localPort) > - self.pf_interface =3D self.dut.ports_info[self.dut_ports[0]]['in= tf'] > - self.pf_mac =3D self.dut.get_mac_address(0) > - self.pf_pci =3D self.dut.ports_info[self.dut_ports[0]]['pci'] > - self.pmdout =3D PmdOutput(self.dut) > - self.cores =3D "1S/4C/1T" > - > - self.session_secondary =3D self.dut.new_session() > - self.session_third =3D self.dut.new_session() > - self.vf_mac =3D "00:11:22:33:44:55" > - > - # set vf assign method and vf driver > - self.vf_driver =3D self.get_suite_cfg()['vf_driver'] > - if self.vf_driver is None: > - self.vf_driver =3D 'pci-stub' > - self.verify(self.vf_driver in self.supported_vf_driver, "Unsppor= ted vf > driver") > - if self.vf_driver =3D=3D 'pci-stub': > - self.vf_assign_method =3D 'pci-assign' > - else: > - self.vf_assign_method =3D 'vfio-pci' > - self.dut.send_expect('modprobe vfio-pci', '#') > - > - def set_up(self): > - """ > - Run before each test case. > - """ > - pass > - > - def setup_env(self, vfs_num): > - """ > - This is to set up vf environment. > - The pf is bound to dpdk driver. > - """ > - # assigned number of VFs > - self.dut.generate_sriov_vfs_by_port(self.dut_ports[0], vfs_num, > self.drivername) > - self.sriov_vfs_port =3D self.dut.ports_info[self.dut_ports[0]]['= vfs_port'] > - > - try: > - for port in self.sriov_vfs_port: > - port.bind_driver(self.vf_driver) > - except Exception as e: > - self.destroy_env() > - raise Exception(e) > - > - def destroy_env(self): > - """ > - This is to stop testpmd and destroy vf environment. > - """ > - self.session_third.send_expect("quit", "# ") > - time.sleep(5) > - self.session_secondary.send_expect("quit", "# ") > - time.sleep(5) > - self.dut.send_expect("quit", "# ") > - time.sleep(5) > - self.dut.destroy_sriov_vfs_by_port(self.dut_ports[0]) > - > - def verify_result(self, outstring, max_rxqn, max_txqn, cur_rxqn, cur= _txqn): > - """ > - verify the packet to the expected queue or be dropped > - """ > - self.verify("Max possible RX queues: %d" % max_rxqn in outstring= , "the > vf RX max queue number is not set successfully") > - self.verify("Max possible TX queues: %d" % max_txqn in outstring= , "the > vf TX max queue number is not set successfully") > - self.verify("Current number of RX queues: %d" % cur_rxqn in outs= tring, > "the vf RX queue number is not set successfully") > - self.verify("Current number of TX queues: %d" % cur_txqn in outs= tring, > "the vf TX queue number is not set successfully") > - > - def send_packet(self, itf): > - """ > - Sends packets. > - """ > - self.tester.scapy_foreground() > - time.sleep(2) > - for i in range(254): > - packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IP(src=3D"192.168.0.%d", dst=3D"192.168.0.%d")= ], > iface=3D"%s")' % ( > - self.vf_mac, itf, i + 1, i + 2, itf) > - self.tester.scapy_append(packet) > - self.tester.scapy_execute() > - time.sleep(2) > - > - def check_packet_queue(self, out): > - """ > - get the queue which packet enter. > - """ > - self.verify("Queue=3D 0" in out and "Queue=3D 1" in out and "Que= ue=3D 2" in > out and "Queue=3D 3" in out > - and "Queue=3D 4" in out and "Queue=3D 5" in out and = "Queue=3D 6" in > out and "Queue=3D 7" in out, "there is some queues doesn't work") > - lines =3D out.split("\r\n") > - reta_line =3D {} > - queue_flag =3D 0 > - packet_sumnum =3D 0 > - # collect the hash result and the queue id > - for line in lines: > - line =3D line.strip() > - if queue_flag =3D=3D 1: > - result_scanner =3D r"RX-packets:\s?([0-9]+)" > - scanner =3D re.compile(result_scanner, re.DOTALL) > - m =3D scanner.search(line) > - packet_num =3D m.group(1) > - packet_sumnum =3D packet_sumnum + int(packet_num) > - queue_flag =3D 0 > - elif line.strip().startswith("------- Forward"): > - queue_flag =3D 1 > - elif line.strip().startswith("RX-packets"): > - result_scanner =3D r"RX-packets:\s?([0-9]+)" > - scanner =3D re.compile(result_scanner, re.DOTALL) > - m =3D scanner.search(line) > - packet_rec =3D m.group(1) > - > - self.verify(packet_sumnum =3D=3D int(packet_rec) =3D=3D 254, "Th= ere are some > packets lost.") > - > - def test_set_valid_vf_max_qn(self): > - """ > - try to set all the valid queue number of VF > - """ > - self.setup_env(2) > - max_qn =3D (1, 2, 4, 8, 16) > - # set all the valid queue number per VF > - for i in max_qn: > - # start testpmd on pf > - self.pmdout.start_testpmd("%s" % self.cores, eal_param=3D"- > w %s,queue-num-per-vf=3D%d --file-prefix=3Dtest1 --socket-mem 1024,1024" = % > (self.pf_pci, i)) > - # start testpmd on vf0 > - self.session_secondary.send_expect("./%s/app/testpmd -c 0xf0= -n 4 - > w %s --file-prefix=3Dtest2 --socket-mem 1024,1024 -- -i --rxq=3D%d --txq= =3D%d" % > (self.target, self.sriov_vfs_port[0].pci, i, i), "testpmd>", 120) > - outstring =3D self.session_secondary.send_expect("show port = info all", > "testpmd> ", 120) > - self.verify_result(outstring, max_rxqn=3Di, max_txqn=3Di, cu= r_rxqn=3Di, > cur_txqn=3Di) > - self.session_secondary.send_expect("quit", "# ") > - time.sleep(5) > - self.dut.send_expect("quit", "# ") > - time.sleep(5) > - > - def test_set_invalid_vf_max_qn(self): > - """ > - try to set several invalid queue number of VF > - """ > - self.setup_env(2) > - max_qn =3D (0, 6, 17, 32) > - # set several invalid queue number per vf > - for i in max_qn: > - # start testpmd on pf > - out =3D self.pmdout.start_testpmd("%s" % self.cores, eal_par= am=3D"- > w %s,queue-num-per-vf=3D%d --file-prefix=3Dtest1 --socket-mem 1024,1024" = % > (self.pf_pci, i)) > - self.verify("Wrong VF queue number =3D %d" % i in out, "the = setting of > invalid vf max queue number failed.") > - # start testpmd on vf0 > - self.session_secondary.send_expect("./%s/app/testpmd -c 0xf0= -n 4 - > w %s --file-prefix=3Dtest2 --socket-mem 1024,1024 -- -i" % (self.target, > self.sriov_vfs_port[0].pci), "testpmd>", 120) > - outstring =3D self.session_secondary.send_expect("show port = info all", > "testpmd> ", 120) > - self.verify_result(outstring, max_rxqn=3D4, max_txqn=3D4, cu= r_rxqn=3D1, > cur_txqn=3D1) > - self.session_secondary.send_expect("quit", "# ") > - time.sleep(5) > - self.dut.send_expect("quit", "# ") > - time.sleep(5) > - > - def test_set_vf_qn(self): > - """ > - set vf queue number with testpmd eal parameters. > - """ > - self.setup_env(2) > - self.pmdout.start_testpmd("%s" % self.cores, eal_param=3D"-w %s,= queue- > num-per-vf=3D8 --file-prefix=3Dtest1 --socket-mem 1024,1024" % self.pf_pc= i) > - self.session_secondary.send_expect("./%s/app/testpmd -c 0xf0 -n = 4 - > w %s --file-prefix=3Dtest2 --socket-mem 1024,1024 -- -i --rxq=3D9 --txq= =3D9" % > (self.target, self.sriov_vfs_port[0].pci), "# ", 120) > - self.session_secondary.send_expect("./%s/app/testpmd -c 0xf0 -n = 4 - > w %s --file-prefix=3Dtest2 --socket-mem 1024,1024 -- -i --rxq=3D3 --txq= =3D3" % > (self.target, self.sriov_vfs_port[0].pci), "testpmd>", 120) > - outstring =3D self.session_secondary.send_expect("show port info= all", > "testpmd> ", 120) > - self.verify_result(outstring, max_rxqn=3D8, max_txqn=3D8, cur_rx= qn=3D3, > cur_txqn=3D3) > - > - def test_set_vf_qn_in_testpmd(self): > - """ > - set vf queue number with testpmd command. > - """ > - self.setup_env(2) > - self.pmdout.start_testpmd("%s" % self.cores, eal_param=3D"-w %s,= queue- > num-per-vf=3D8 --file-prefix=3Dtest1 --socket-mem 1024,1024" % self.pf_pc= i) > - self.session_secondary.send_expect("./%s/app/testpmd -c 0xf0 -n = 4 - > w %s --file-prefix=3Dtest2 --socket-mem 1024,1024 -- -i" % (self.target, > self.sriov_vfs_port[0].pci), "testpmd>", 120) > - outstring =3D self.session_secondary.send_expect("show port info= all", > "testpmd> ", 120) > - self.verify_result(outstring, max_rxqn=3D8, max_txqn=3D8, cur_rx= qn=3D1, > cur_txqn=3D1) > - self.session_secondary.send_expect("port stop all", "testpmd> ") > - self.session_secondary.send_expect("port config all rxq 8", "tes= tpmd> ") > - self.session_secondary.send_expect("port config all txq 8", "tes= tpmd> ") > - self.session_secondary.send_expect("port start all", "testpmd> "= ) > - outstring =3D self.session_secondary.send_expect("show port info= all", > "testpmd> ", 120) > - self.verify_result(outstring, max_rxqn=3D8, max_txqn=3D8, cur_rx= qn=3D8, > cur_txqn=3D8) > - self.session_secondary.send_expect("port stop all", "testpmd> ") > - self.session_secondary.send_expect("port config all rxq 9", "Fai= l") > - self.session_secondary.send_expect("port config all txq 9", "Fai= l") > - self.session_secondary.send_expect("port start all", "testpmd> "= ) > - outstring =3D self.session_secondary.send_expect("show port info= all", > "testpmd> ", 120) > - self.verify_result(outstring, max_rxqn=3D8, max_txqn=3D8, cur_rx= qn=3D8, > cur_txqn=3D8) > - > - def test_set_maxvfs_1pf(self): > - """ > - set max queue number when setting max VFs on 1 PF port. > - """ > - if (self.nic in ["fortville_eagle", "fortpark_TLV"]): > - self.setup_env(32) > - # failed to set VF max queue num to 16. > - out =3D self.pmdout.start_testpmd("%s" % self.cores, eal_par= am=3D"- > w %s,queue-num-per-vf=3D16 --file-prefix=3Dtest1 --socket-mem 1024,1024" = % > self.pf_pci) > - self.verify("exceeds the hardware maximum 384" in out, "the = queue > num exceeds the hardware maximum 384") > - elif (self.nic in ["fortville_spirit", "fortville_spirit_single"= ]): > - self.setup_env(64) > - # failed to set VF max queue num to 16. > - out =3D self.pmdout.start_testpmd("%s" % self.cores, eal_par= am=3D"- > w %s,queue-num-per-vf=3D16 --file-prefix=3Dtest1 --socket-mem 1024,1024" = % > self.pf_pci) > - self.verify("exceeds the hardware maximum 768" in out, "the = queue > num exceeds the hardware maximum 768") > - self.dut.send_expect("quit", "# ") > - time.sleep(5) > - # succeed in setting VF max queue num to 8 > - self.pmdout.start_testpmd("%s" % self.cores, eal_param=3D"-w %s,= queue- > num-per-vf=3D8 --file-prefix=3Dtest1 --socket-mem 1024,1024" % self.pf_pc= i) > - # start testpmd on vf0 > - self.session_secondary.send_expect("./%s/app/testpmd -c 0x1e0 -n= 4 - > w %s --file-prefix=3Dtest2 --socket-mem 1024,1024 -- -i --rxq=3D%d --txq= =3D%d" % > (self.target, self.sriov_vfs_port[0].pci, 8, 8), "testpmd>", 120) > - # start testpmd on vf31 with different rxq/txq number > - self.session_third.send_expect("./%s/app/testpmd -c 0x1e00 -n 4 = -w %s > --file-prefix=3Dtest3 --socket-mem 1024,1024 -- -i" % (self.target, > self.sriov_vfs_port[31].pci), "testpmd>", 120) > - # check the max queue number and current queue number > - outstring =3D self.session_secondary.send_expect("show port info= all", > "testpmd> ", 120) > - self.verify_result(outstring, max_rxqn=3D8, max_txqn=3D8, cur_rx= qn=3D8, > cur_txqn=3D8) > - outstring =3D self.session_third.send_expect("show port info all= ", > "testpmd> ", 120) > - self.verify_result(outstring, max_rxqn=3D8, max_txqn=3D8, cur_rx= qn=3D1, > cur_txqn=3D1) > - # modify the queue number of VF1 to max queue number > - self.session_third.send_expect("stop", "testpmd> ", 120) > - self.session_third.send_expect("port stop all", "testpmd> ", 120= ) > - self.session_third.send_expect("port config all rxq 8", "testpmd= > ", 120) > - self.session_third.send_expect("port config all txq 8", "testpmd= > ", 120) > - self.session_third.send_expect("port start all", "testpmd> ", 12= 0) > - > - # check all the queues can be used to distributed packets. > - self.session_secondary.send_expect("set fwd rxonly", "testpmd> "= , 120) > - self.session_secondary.send_expect("set verbose 1", "testpmd> ",= 120) > - self.session_secondary.send_expect("start", "testpmd> ", 120) > - time.sleep(2) > - self.send_packet(self.tester_intf) > - out =3D self.session_secondary.send_expect("stop", "testpmd> ", = 120) > - time.sleep(2) > - self.check_packet_queue(out) > - > - # check all the queues can be used to distributed packets. > - self.session_third.send_expect("set fwd rxonly", "testpmd> ", 12= 0) > - self.session_third.send_expect("set verbose 1", "testpmd> ", 120= ) > - self.session_third.send_expect("start", "testpmd> ", 120) > - time.sleep(2) > - self.send_packet(self.tester_intf) > - out =3D self.session_third.send_expect("stop", "testpmd> ", 120) > - time.sleep(2) > - self.check_packet_queue(out) > - > - def test_vf_bound_to_kerneldriver(self): > - """ > - set vf queue number when vf bound to kernel driver. > - """ > - self.setup_env(2) > - # bind vf to kernel driver > - for port in self.sriov_vfs_port: > - port.bind_driver(driver=3D"i40evf") > - # set vf max queue number to 8 > - self.pmdout.start_testpmd("%s" % self.cores, eal_param=3D"-w %s,= queue- > num-per-vf=3D8 --file-prefix=3Dtest1 --socket-mem 1024,1024" % self.pf_pc= i) > - # get the vf interface > - for port in self.sriov_vfs_port: > - vf_intf =3D port.get_interface_name() > - # list all the vf rx/tx queues of one of the vfs > - outstring =3D self.session_secondary.send_expect("ethtool -S %s"= % > vf_intf, "# ", 120) > - self.verify("rx-7.packets" in outstring, "the vf RX max queue nu= mber is > not set successfully") > - self.verify("tx-7.packets" in outstring, "the vf TX max queue nu= mber is > not set successfully") > - self.dut.send_expect("quit", "# ") > - for port in self.sriov_vfs_port: > - port.bind_driver(driver=3D"vfio-pci") > - > - def tear_down(self): > - """ > - Run after each test case. > - """ > - self.destroy_env() > - self.dut.kill_all() > - > - def tear_down_all(self): > - """ > - Run after each test suite. > - """ > - self.dut.kill_all() > - self.dut.close_session(self.session_secondary) > - self.dut.close_session(self.session_third) > -- > 2.17.2