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 8D578A00E6 for ; Wed, 12 Jun 2019 08:21:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 511641D12E; Wed, 12 Jun 2019 08:21:39 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 2BADC1D124 for ; Wed, 12 Jun 2019 08:21:37 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jun 2019 23:21:35 -0700 X-ExtLoop1: 1 Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga008.jf.intel.com with ESMTP; 11 Jun 2019 23:21:35 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 11 Jun 2019 23:21:34 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.104]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.76]) with mapi id 14.03.0439.000; Wed, 12 Jun 2019 14:21:33 +0800 From: "Tu, Lijuan" To: "Mei, JianweiX" , "dts@dpdk.org" CC: "Mei, JianweiX" Thread-Topic: [dts] [PATCH V4] tests/TestSuite_runtime_vf_queue_number:add testsuite Thread-Index: AQHVID4P+G0Lrg5jN0y02pFYdUL6N6aXjaHA Date: Wed, 12 Jun 2019 06:21:32 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BABA652@SHSMSX101.ccr.corp.intel.com> References: <1560279725-172904-1-git-send-email-jianweix.mei@intel.com> In-Reply-To: <1560279725-172904-1-git-send-email-jianweix.mei@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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmUzYjZiMTktMGI5MS00YmQyLTllOTQtNzViOTc5MjBhNDIyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZFJQXC9vUTVkOUNERE1cLzVzNUt6bE9RcW8yYjRUbDFWZHZFQmIzTStyc1dcL2FieVk3c3dTYVA4SFNmTmxWZUZEZiJ9 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 V4] tests/TestSuite_runtime_vf_queue_number:add testsuite 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 Jianwei Mei > Sent: Wednesday, June 12, 2019 3:02 AM > To: dts@dpdk.org > Cc: Mei, JianweiX > Subject: [dts] [PATCH V4] tests/TestSuite_runtime_vf_queue_number:add > testsuite >=20 > add testsuite for runtime vf queue number. >=20 > Signed-off-by: Jianwei Mei > --- > tests/TestSuite_runtime_vf_queue_number.py | 375 > +++++++++++++++++++++ > 1 file changed, 375 insertions(+) > create mode 100644 tests/TestSuite_runtime_vf_queue_number.py >=20 > diff --git a/tests/TestSuite_runtime_vf_queue_number.py > b/tests/TestSuite_runtime_vf_queue_number.py > new file mode 100644 > index 0000000..e825556 > --- /dev/null > +++ b/tests/TestSuite_runtime_vf_queue_number.py > @@ -0,0 +1,375 @@ > +# BSD LICENSE > +# > +# Copyright(c) <2019> 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. > + > +''' > + > +import time > +import re > +from qemu_kvm import QEMUKvm > +from test_case import TestCase > +from pmd_output import PmdOutput > + > +VM_CORES_MASK =3D 'all' > + > +class TestRuntimeVfQn(TestCase): > + supported_vf_driver =3D ['pci-stub', 'vfio-pci'] > + def set_up_all(self): > + self.dut_ports =3D self.dut.get_ports(self.nic) > + self.verify(len(self.dut_ports) >=3D 1, 'Insufficient ports') > + self.src_intf =3D self.tester.get_interface(self.tester.get_loca= l_port(0)) > + self.src_mac =3D self.tester.get_mac(self.tester.get_local_port= (0)) > + self.dst_mac =3D self.dut.get_mac_address(0) > + self.vm0 =3D None > + self.pf_pci =3D self.dut.ports_info[self.dut_ports[0]]['pci'] > + self.used_dut_port =3D self.dut_ports[0] > + self.vf_mac =3D "00:11:22:33:44:55" > + > + def set_up(self): > + self.dut.kill_all() > + self.host_testpmd =3D PmdOutput(self.dut) > + self.setup_vm_env(driver=3D'igb_uio') > + > + def setup_vm_env(self, driver=3D'default'): > + ''' > + setup qemu virtual environment,this is to set up 1pf and 2vfs > environment, the pf can be bond to > + kernel driver or dpdk driver. > + ''' > + self.dut.generate_sriov_vfs_by_port(self.used_dut_port, 2, > driver=3Ddriver) > + self.sriov_vfs_port_0 =3D > + self.dut.ports_info[self.used_dut_port]['vfs_port'] > + > + # 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', '#') > + > + try: > + for port in self.sriov_vfs_port_0: > + port.bind_driver(self.vf_driver) > + > + time.sleep(1) > + vf0_prop =3D {'opt_host': self.sriov_vfs_port_0[0].pci} > + vf1_prop =3D {'opt_host': self.sriov_vfs_port_0[1].pci} > + > + # set up VM0 ENV > + self.vm0 =3D QEMUKvm(self.dut, 'vm0', 'vf_queue_number') > + self.vm0.set_vm_device(driver=3Dself.vf_assign_method, **vf0= _prop) > + self.vm_dut_0 =3D self.vm0.start() > + if self.vm_dut_0 is None: > + raise Exception('Set up VM0 ENV failed!') > + except Exception as e: > + self.logger.info(e) > + self.destroy_vm_env() > + raise Exception(e) > + > + def destroy_vm_env(self): > + #destroy vm0 > + if getattr(self, 'vm0', None) and self.vm0: > + self.vm0_dut_ports =3D None > + self.vm0.stop() > + self.vm0 =3D None > + > + #destroy host testpmd > + if getattr(self, 'host_testpmd', None): > + self.host_testpmd.execute_cmd('quit', '# ') > + self.host_testpmd =3D None > + > + # reset used port's sriov > + if getattr(self, 'used_dut_port', None): > + self.dut.destroy_sriov_vfs_by_port(self.used_dut_port) > + port =3D self.dut.ports_info[self.used_dut_port]['port'] > + port.bind_driver() > + self.used_dut_port =3D None > + > + # bind used ports with default driver > + for port_id in self.dut_ports: > + port =3D self.dut.ports_info[port_id]['port'] > + port.bind_driver() > + > + def send_packet(self, vf_mac, itf, integer): > + """ > + Sends packets. > + """ > + self.tester.scapy_foreground() > + time.sleep(2) > + for i in range(integer): > + quotient =3D i // 254 > + remainder =3D i % 254 > + packet =3D r'sendp([Ether(dst=3D"%s", > src=3Dget_if_hwaddr("%s"))/IP(src=3D"10.0.0.1", dst=3D"192.168.%d.%d")], > iface=3D"%s")' % (vf_mac, itf, quotient, remainder + 1, itf) > + self.tester.scapy_append(packet) > + self.tester.scapy_execute() > + time.sleep(2) > + > + def verify_queue_number(self, outstring, qn, pkt_count): > + total_rx =3D [] > + total_tx =3D [] > + total_rx_pkt =3D [] > + total_tx_pkt =3D [] > + lines =3D outstring.split("\r\n") > + re_rx_q =3D r"RX Port=3D 0/Queue=3D\s?([0-9]+)" > + re_tx_q =3D r"TX Port=3D 0/Queue=3D\s?([0-9]+)" > + re_rx_pkt =3D r"RX-packets:\s?([0-9]+)" > + re_tx_pkt =3D r"TX-packets:\s?([0-9]+)" > + rx_s =3D re.compile(re_rx_q, re.DOTALL) > + tx_s =3D re.compile(re_tx_q, re.DOTALL) > + rx_pkt_s =3D re.compile(re_rx_pkt, re.DOTALL) > + tx_pkt_s =3D re.compile(re_tx_pkt, re.DOTALL) > + for line in lines: > + line =3D line.strip() > + if line.strip().startswith("------- Forward"): > + rx_pkt =3D rx_s.search(line) > + tx_pkt =3D tx_s.search(line) > + total_rx.append(int(rx_pkt.group(1))) > + total_tx.append(int(tx_pkt.group(1))) > + elif "RX-packets" in line and "TX-packets" in line and "TX-d= ropped" in > line: > + self.logger.info(line) > + q_rx_pkt =3D rx_pkt_s.search(line) > + q_tx_pkt =3D tx_pkt_s.search(line) > + total_rx_pkt.append(int(q_rx_pkt.group(1))) > + total_tx_pkt.append(int(q_tx_pkt.group(1))) > + else: > + continue > + self.verify(len(total_rx) =3D=3D len(total_tx) =3D=3D qn, "RX qu= eue number is not > equal to Tx queue number.") > + self.verify(sum(total_rx_pkt) =3D=3D sum(total_tx_pkt) =3D=3D > + pkt_count, "some packets lost.") > + > + def stop_vm0(self): > + if getattr(self, 'vm0', None) and self.vm0: > + self.vm0_dut_ports =3D None > + self.vm0.stop() > + self.vm0 =3D None > + > + def execute_testpmd_cmd(self, cmds): > + if len(cmds) =3D=3D 0: > + return > + for item in cmds: > + if len(item) =3D=3D 2: > + self.vm0_testpmd.execute_cmd(item[0], int(item[1])) > + else: > + self.vm0_testpmd.execute_cmd(item[0]) > + > + def testpmd_config_cmd_list(self, qn): > + cmd_list =3D [['stop'], > + ['port stop all'], > + ['port config all txq %d' % qn], > + ['port config all rxq %d' % qn], > + ['port start all']] > + return cmd_list > + > + def verify_result(self, queue_num, pkt_num): > + if queue_num =3D=3D 1: > + outstring =3D self.vm0_testpmd.execute_cmd("start", "testpmd= > ") > + self.verify("port 0: RX queue number: 1 Tx queue number: 1" = in > outstring, > + "The RX/TX queue number error.") > + self.vm0_dut_ports =3D self.vm_dut_0.get_ports('any') > + self.vf_mac =3D self.vm0_testpmd.get_port_mac(self.vm0_dut_p= orts[0]) > + self.send_packet(self.vf_mac, self.src_intf, 3) > + out =3D self.vm0_testpmd.get_output() > + self.verify('port 0/queue 0: received 1 packets' in out, "qu= eue 0 can > not receive pkt") > + else: > + outstring =3D self.vm0_testpmd.execute_cmd("start", "testpmd= > ", 120) > + self.logger.info(outstring) > + time.sleep(2) > + self.verify("port 0: RX queue number: %d Tx queue number: %d= " % > (queue_num, queue_num) in outstring, > + "The RX/TX queue number error.") > + self.vm0_dut_ports =3D self.vm_dut_0.get_ports('any') > + self.vf_mac =3D self.vm0_testpmd.get_port_mac(self.vm0_dut_p= orts[0]) > + self.send_packet(self.vf_mac, self.src_intf, pkt_num) > + outstring1 =3D self.vm0_testpmd.execute_cmd("stop", "testpmd= > ", > 120) > + time.sleep(2) > + self.verify_queue_number(outstring1, queue_num, pkt_num) > + > + def test_reserve_valid_vf_qn(self): > + """ > + Test case 1: reserve valid vf queue number > + :return: > + """ > + valid_qn =3D (2, 4, 8,) > + for qn in valid_qn: > + host_eal_param =3D '-w %s,queue-num-per-vf=3D%d --file-prefi= x=3Dtest1 -- > socket-mem 1024,1024' % (self.pf_pci, qn) > + self.host_testpmd.start_testpmd(VM_CORES_MASK, param=3D'', > + eal_param=3Dhost_eal_param) > + > + gest_eal_param =3D '-w %s --file-prefix=3Dtest2' % > self.vm_dut_0.ports_info[0]['pci'] > + self.vm0_testpmd =3D PmdOutput(self.vm_dut_0) > + self.vm0_testpmd.start_testpmd(VM_CORES_MASK, > eal_param=3Dgest_eal_param, param=3D'') > + guest_cmds =3D self.testpmd_config_cmd_list(qn) > + self.execute_testpmd_cmd(guest_cmds) > + outstring =3D self.vm0_testpmd.execute_cmd("start", "testpmd= > ") > + self.verify("port 0: RX queue number: %d Tx queue number: %d= " % > (qn, qn) in outstring, "The RX/TX queue number error.") > + self.vm0_dut_ports =3D self.vm_dut_0.get_ports('any') > + self.vf_mac =3D self.vm0_testpmd.get_port_mac(self.vm0_dut_p= orts[0]) > + self.send_packet(self.vf_mac, self.src_intf, 100) > + outstring1 =3D self.vm0_testpmd.execute_cmd("stop", "testpmd= > ") > + self.verify_queue_number(outstring1, qn, 100) > + guest_cmds1 =3D self.testpmd_config_cmd_list(qn + 1) > + self.execute_testpmd_cmd(guest_cmds1) > + outstring2 =3D self.vm0_testpmd.execute_cmd("start", "testpm= d> ") > + time.sleep(2) > + self.verify("port 0: RX queue number: %d Tx queue number: %d= " % > ((qn + 1), (qn + 1)) in outstring2, "The RX/TX queue number error.") > + self.send_packet(self.vf_mac, self.src_intf, 254) > + outstring3 =3D self.vm0_testpmd.execute_cmd("stop", "testpmd= > ") > + time.sleep(2) > + self.verify_queue_number(outstring3, qn + 1, 254) > + self.vm0_testpmd.execute_cmd('quit', '# ') > + > + def test_reserve_invalid_vf_qn(self): > + """ > + Test case 2: reserve invalid VF queue number > + :return: > + """ > + for invalid_qn in (0, 3, 5, 6, 7, 9, 11, 15, 17, 25,): > + eal_param =3D '-w %s,queue-num-per-vf=3D%d --file-prefix=3Dt= est1 -- > socket-mem 1024,1024' % (self.pf_pci, invalid_qn) > + testpmd_out =3D self.host_testpmd.start_testpmd(VM_CORES_MAS= K, > param=3D'', eal_param=3Deal_param) > + self.verify("it must be power of 2 and equal or less than 16= " in > testpmd_out, "there is no 'Wrong VF queue number =3D 0' logs.") > + self.dut.send_expect("quit", "# ") > + > + def test_set_valid_vf_qn_in_testpmd(self): > + """ > + Test case 3: set valid VF queue number in testpmd command-line > options > + :return: > + """ > + host_eal_param =3D '-w %s --file-prefix=3Dtest1 --socket-mem 102= 4,1024' % > self.pf_pci > + self.host_testpmd.start_testpmd(VM_CORES_MASK, param=3D'', > + eal_param=3Dhost_eal_param) > + > + gest_eal_param =3D '-w %s --file-prefix=3Dtest2' % > self.vm_dut_0.ports_info[0]['pci'] > + self.vm0_testpmd =3D PmdOutput(self.vm_dut_0) > + for valid_qn in range(1, 17): > + if valid_qn =3D=3D 1: > + self.vm0_testpmd.start_testpmd(VM_CORES_MASK, > eal_param=3Dgest_eal_param, param=3D' --rxq=3D1 --txq=3D1') > + self.vm0_testpmd.execute_cmd('set verbose 1') > + self.vm0_testpmd.execute_cmd("set promisc all off", "tes= tpmd> ") > + self.vm0_testpmd.execute_cmd("set fwd mac", "testpmd> ") > + self.verify_result(valid_qn, 500) > + self.vm0_testpmd.execute_cmd('quit', '# ') > + else: > + self.vm0_testpmd.start_testpmd(VM_CORES_MASK, > eal_param=3Dgest_eal_param, > + param=3D' --rxq=3D%d --tx= q=3D%d' % (valid_qn, > valid_qn)) > + self.vm0_testpmd.execute_cmd("set promisc all off", "tes= tpmd> ") > + self.vm0_testpmd.execute_cmd("set fwd mac", "testpmd> ") > + self.verify_result(valid_qn, 500) > + self.vm0_testpmd.execute_cmd('quit', '# ') > + > + def test_set_invalid_vf_qn_in_testpmd(self): > + """ > + Test case 4: set invalid VF queue number in testpmd command-line > options > + :return: > + """ > + host_eal_param =3D '-w %s --file-prefix=3Dtest1 --socket-mem 102= 4,1024' % > self.pf_pci > + self.host_testpmd.start_testpmd(VM_CORES_MASK, param=3D'', > eal_param=3Dhost_eal_param) > + gest_eal_param =3D '-w %s --file-prefix=3Dtest2' % > self.vm_dut_0.ports_info[0]['pci'] > + self.vm0_testpmd =3D PmdOutput(self.vm_dut_0) > + > + command_0 =3D "./%s/app/testpmd -c %s -n %d %s -- -i %s" \ > + % (self.dut.target, '0xf', self.dut.get_memory_channel= s(), > gest_eal_param, ' --rxq=3D0 --txq=3D0') > + outstring =3D self.vm0_testpmd.execute_cmd(command_0, expected= =3D'# ') > + self.verify("Either rx or tx queues should be non-zero" in outst= ring, > "The output of testpmd start is different from expect when set invalid VF > queue number 0.") > + time.sleep(2) > + command_17 =3D "./%s/app/testpmd -c %s -n %d %s -- -i %s" \ > + % (self.dut.target, '0xf', self.dut.get_memory_channel= s(), > gest_eal_param, ' --rxq=3D17 --txq=3D17') > + outstring1 =3D self.vm0_testpmd.execute_cmd(command_17, > expected=3D'# ') > + self.verify("rxq 17 invalid - must be >=3D 0 && <=3D 16" in outs= tring1, > + "The output of testpmd start is different from > + expect when set invalid VF queue number 17.") > + > + def test_set_valid_vf_qn_with_testpmd_func_cmd(self): > + """ > + Test case 5: set valid VF queue number with testpmd function > command > + :return: > + """ > + host_eal_param =3D '-w %s --file-prefix=3Dtest1 --socket-mem 102= 4,1024' % > self.pf_pci > + self.host_testpmd.start_testpmd(VM_CORES_MASK, param=3D'', > + eal_param=3Dhost_eal_param) > + > + gest_eal_param =3D '-w %s --file-prefix=3Dtest2' % > self.vm_dut_0.ports_info[0]['pci'] > + self.vm0_testpmd =3D PmdOutput(self.vm_dut_0) > + self.vm0_testpmd.start_testpmd(VM_CORES_MASK, > eal_param=3Dgest_eal_param, param=3D'') > + for valid_qn in range(1, 17): > + if valid_qn =3D=3D 1: > + guest_cmds =3D self.testpmd_config_cmd_list(1) > + guest_cmds.insert(0, ['set fwd mac']) > + guest_cmds.insert(0, ['set promisc all off']) > + guest_cmds.insert(0, ['set verbose 1']) > + self.execute_testpmd_cmd(guest_cmds) > + self.verify_result(valid_qn, 500) > + else: > + guest_cmds =3D self.testpmd_config_cmd_list(valid_qn) > + guest_cmds.insert(0, ['set fwd mac']) > + guest_cmds.insert(0, ['set promisc all off']) > + self.execute_testpmd_cmd(guest_cmds) > + self.verify_result(valid_qn, 500) > + self.vm0_testpmd.execute_cmd('quit', '# ') > + > + def test_set_invalid_vf_qn_with_testpmd_func_cmd(self): > + """ > + Test case 6: set invalid VF queue number with testpmd function > command > + :return: > + """ > + # There is a bug of this test case, so the function hasn't been > implemented. > + pass > + > + def test_reserve_vf_qn(self): > + """ > + Test case 7: Reserve VF queue number when VF bind to kernel driv= er > + :return: > + """ > + host_eal_param =3D '-w %s,queue-num-per-vf=3D2 --file-prefix=3Dt= est1 -- > socket-mem 1024,1024' % self.pf_pci > + self.host_testpmd.start_testpmd(VM_CORES_MASK, param=3D'', > eal_param=3Dhost_eal_param) > + self.vm0_testpmd =3D PmdOutput(self.vm_dut_0) > + self.vm0_testpmd.execute_cmd("./usertools/dpdk-devbind.py -b > i40evf %s" % self.vm_dut_0.ports_info[0]['pci'], expected=3D'# ') > + # wait few seconds for link ready > + countdown =3D 60 > + while countdown: > + nic_info =3D self.vm0_testpmd.execute_cmd( > + "./usertools/dpdk-devbind.py -s | grep %s" % > self.vm_dut_0.ports_info[0]['pci'], expected=3D'# ') > + inf_str =3D nic_info.split("if=3D")[1] > + inf =3D inf_str.split(" ")[0] > + if "drv" not in inf and inf !=3D "": > + break > + else: > + time.sleep(0.01) > + countdown -=3D 1 > + continue > + output =3D self.vm0_testpmd.execute_cmd("ethtool -S %s" % inf, > expected=3D'# ') > + self.verify("tx-0.packets: 0" in output and "tx-1.packets: 0" > + in output, "VF0 rxq and txq number is not 2.") > + > + def tear_down(self): > + self.stop_vm0() > + self.dut.send_expect("quit", "# ") > + > + def tear_down_all(self): > + self.destroy_vm_env() > + for port_id in self.dut_ports: > + self.dut.destroy_sriov_vfs_by_port(port_id) > \ No newline at end of file > -- > 2.17.2