From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2FC93A0A03; Tue, 19 Jan 2021 07:32:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E9BEE140D38; Tue, 19 Jan 2021 07:32:57 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id E758A140D35 for ; Tue, 19 Jan 2021 07:32:54 +0100 (CET) IronPort-SDR: 0IlQ98WE6cvg83dmEi/XLbVGW2+KMyfmlAV3YXlF6UZtjQgida7lmZuGuHJNZ8weMdey4qTVs3 JMiCKMAtFs8w== X-IronPort-AV: E=McAfee;i="6000,8403,9868"; a="178106149" X-IronPort-AV: E=Sophos;i="5.79,358,1602572400"; d="scan'208";a="178106149" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2021 22:32:48 -0800 IronPort-SDR: dNrXHfN4lwWGR80P0cCpKiCqpKSJ0I/L+72s8SG9HEwCX03ay52s1ErhWsHzkq5YMqanx5Teod 9P17ikZADUsw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,358,1602572400"; d="scan'208";a="573467345" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga005.fm.intel.com with ESMTP; 18 Jan 2021 22:32:47 -0800 Received: from shsmsx604.ccr.corp.intel.com (10.109.6.214) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 18 Jan 2021 22:32:46 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX604.ccr.corp.intel.com (10.109.6.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 19 Jan 2021 14:32:44 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Tue, 19 Jan 2021 14:32:44 +0800 From: "Tu, Lijuan" To: "Xu, HailinX" , "dts@dpdk.org" CC: "Xu, HailinX" Thread-Topic: [dts] [PATCH v1] tests/large_vf:support cvl 25G Thread-Index: AQHW6iQQ4vejTbwXPUmKo0/doSj6d6ouhA1Q Date: Tue, 19 Jan 2021 06:32:44 +0000 Message-ID: <38d21c773c8b4ae297f49dcb300d99f5@intel.com> References: <1610593720-19326-1-git-send-email-hailinx.xu@intel.com> In-Reply-To: <1610593720-19326-1-git-send-email-hailinx.xu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH v1] tests/large_vf:support cvl 25G X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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" It's great to see get max vf numbers from system api, not use hard code. Could you please update notes too? > -----Original Message----- > From: dts On Behalf Of Xu Hailin > Sent: 2021=1B$BG/=1B(B1=1B$B7n=1B(B14=1B$BF|=1B(B 11:09 > To: dts@dpdk.org > Cc: Xu, HailinX > Subject: [dts] [PATCH v1] tests/large_vf:support cvl 25G >=20 > From: Hailin Xu >=20 > Add the judgment condition of cvl25g network card, because 25g is differe= nt > from 100g. > 1. The max number of VFS is different > 2. The number of VFS that can use 256 queues is different > 3. fix hard code >=20 > Signed-off-by: Hailin Xu > --- > tests/TestSuite_large_vf.py | 120 ++++++++++++++++++++++-------------- > 1 file changed, 73 insertions(+), 47 deletions(-) >=20 > diff --git a/tests/TestSuite_large_vf.py b/tests/TestSuite_large_vf.py in= dex > 77c9fc62..0cba1cdd 100755 > --- a/tests/TestSuite_large_vf.py > +++ b/tests/TestSuite_large_vf.py > @@ -172,19 +172,18 @@ multi_fdir_among =3D { > "count": 1000 > } >=20 > -more_than_4_queues_128_vfs =3D { > - "name": "test_more_than_4_queues_128_vfs", > +more_than_4_queues_max_vfs =3D { > + "name": "test_more_than_4_queues_max_vfs", > "param": ["--txq=3D8 --rxq=3D8", "--txq=3D4 --rxq=3D4"], > "check_param": "configure queues failed" > } >=20 > -more_than_128_vfs_4_queues =3D { > - "name": "test_more_than_128_vfs_4_queues", > - "vf_num": [128, 129], > +more_than_max_vfs_4_queues =3D { > + "name": "test_more_than_max_vfs_4_queues", > "check_param": "-bash: echo: write error: Numerical result out of ra= nge" > } >=20 > -max_vfs_4_queues_128 =3D [multi_fdir_among, > more_than_4_queues_128_vfs, more_than_128_vfs_4_queues] > +max_vfs_4_queues_128 =3D [multi_fdir_among, > more_than_4_queues_max_vfs, > +more_than_max_vfs_4_queues] >=20 >=20 > class TestLargeVf(TestCase): > @@ -203,6 +202,7 @@ class TestLargeVf(TestCase): > self.used_dut_port =3D self.dut_ports[0] > self.pf0_intf =3D self.dut.ports_info[self.dut_ports[0]]['intf'] > self.pf0_pci =3D self.dut.ports_info[self.dut_ports[0]]['pci'] > + self.max_vf_num =3D int(self.dut.send_expect('cat > + /sys/bus/pci/devices/%s/sriov_totalvfs' % self.pf0_pci, '#')) > self.pf0_mac =3D self.dut.get_mac_address(0) >=20 > self.vf_flag =3D False > @@ -213,6 +213,9 @@ class TestLargeVf(TestCase): > self.pkt =3D Packet() > self.pmd_output =3D PmdOutput(self.dut) >=20 > + self.app_path =3D self.dut.apps_name["test-pmd"] > + self.vf_num =3D 7 if self.max_vf_num > 128 else 3 > + > def set_up(self): > """ > Run before each test case. > @@ -241,11 +244,20 @@ class TestLargeVf(TestCase): > self.dut.destroy_sriov_vfs_by_port(self.used_dut_port) > self.vf_flag =3D False >=20 > - def launch_testpmd(self, param, total=3DFalse): > + def launch_testpmd(self, param, total=3DFalse, retry_times=3D3): > if total: > param =3D param + " --total-num-mbufs=3D500000" > - self.pmd_output.start_testpmd("all", param=3Dparam, > - ports=3D[self.sriov_vfs_port[0].pc= i], > socket=3Dself.ports_socket) > + while retry_times: > + try: > + self.pmd_output.start_testpmd("all", param=3Dparam, > + ports=3D[self.sriov_vfs_port= [0].pci], > socket=3Dself.ports_socket) > + break > + except Exception as e: > + self.logger.info('start testpmd occurred exception: {}'.= format(e)) > + retry_times =3D retry_times - 1 > + time.sleep(1) > + self.logger.info('try start testpmd the {} > + times'.format(retry_times)) > + >=20 > def config_testpmd(self): > self.pmd_output.execute_cmd("set verbose 1") @@ -289,55 +301,64 > @@ class TestLargeVf(TestCase): > self.create_fdir_rule(vectors[0]["rule"]) > self.check_match_mismatch_pkts(vectors[0]) > elif subcase_name =3D=3D "test_pf_large_vf_fdir_coexist"= : > - pmdout =3D PmdOutput(self.dut, self.session_list[0]) > - self.create_pf_rule(pmdout, self.pf0_intf, tv["param= "][0], > tv["param"][1]) > - self.send_pkts_pf_check(pmdout, self.pf0_intf, self.= pf0_mac, > tv["param"][0], tv["check_param"], tv["count"]) > + self.create_pf_rule(self.pmdout_list[0], self.pf0_in= tf, > tv["param"][0], tv["param"][1]) > + self.send_pkts_pf_check(self.pmdout_list[0], > + self.pf0_intf, self.pf0_mac, tv["param"][0], tv["check_param"], > + tv["count"]) > self.create_fdir_rule(vectors[0]["rule"]) > self.check_match_mismatch_pkts(vectors[0]) > - self.destroy_pf_rule(pmdout, self.pf0_intf) > + self.destroy_pf_rule(self.pmdout_list[0], > + self.pf0_intf) > elif subcase_name =3D=3D "test_exceed_256_queues": > self.pmd_output.execute_cmd("quit", "#") > - eal_param =3D "-w {} --file-prefix=3Dport0vf0 -- -i > ".format(self.sriov_vfs_port[0].pci) > - cmd =3D "x86_64-native-linuxapp-gcc/app/dpdk-testpmd= -l 1,2,3,4 > -n 4 " + eal_param + tv["param"][0] > + eal_param =3D self.dut.create_eal_parameters(prefix= =3D'port0vf0', > ports=3D[self.sriov_vfs_port[0].pci]) > + cmd =3D "{} ".format(self.app_path) + eal_param + "-= - > + -i " + tv["param"][0] > out =3D self.pmd_output.execute_cmd(cmd, "# ") > self.verify(tv["check_param"] in out, "fail: testpmd= start > successfully") > - self.pmd_output.execute_cmd("quit", "#") > self.launch_testpmd(tv["param"][1]) > self.check_rxqtxq_number(512, tv["check_param"]) > elif subcase_name =3D=3D "test_more_than_3_vfs_256_queue= s": > self.pmd_output.execute_cmd("quit", "#") > - self.destroy_iavf() > - self.create_iavf(4) > - # start 4 testpmd uss 256 queues Spelling error. > - for i in range(4): > - if i < 3: > - eal_param =3D "-w {} --file-prefix=3Dport0vf= {} -- -i > ".format(self.sriov_vfs_port[i].pci, i) > - cmd =3D "x86_64-native-linuxapp-gcc/app/dpdk= -testpmd -l > 1,2,3,4 -n 4 " + eal_param + tv["param"] > - self.session_list[i].send_expect(cmd, "testp= md> ") > - else: > - # start fourth testpmd failed > - eal_param =3D "-w {} --file-prefix=3Dport0vf= 3 -- -i > ".format(self.sriov_vfs_port[3].pci) > - cmd =3D "x86_64-native-linuxapp-gcc/app/dpdk= -testpmd -l > 1,2,3,4 -n 4 " + eal_param + tv[ > - "param"] > - out =3D self.dut.send_command(cmd) > + # start testpmd uss 256 queues > + for i in range(self.vf_num + 1): > + if self.max_vf_num =3D=3D 64: > + self.pmdout_list[0].start_testpmd(param=3Dtv= ["param"], > ports=3D[self.sriov_vfs_port[0].pci], prefix=3D'port0vf0') > + eal_param =3D > self.dut.create_eal_parameters(fixed_prefix=3DTrue, > ports=3D[self.sriov_vfs_port[1].pci]) > + cmd =3D "{} ".format(self.app_path) + eal_pa= ram + "-- -i " + > tv["param"] > + out =3D self.pmd_output.execute_cmd(cmd, "#"= ) > self.verify(tv["check_param"] in out, "fail:= testpmd start > successfully") > - # quit all testpmd > - self.session_list[0].send_expect("quit", "# = ") > - self.session_list[1].send_expect("quit", "# = ") > - self.session_list[2].send_expect("quit", "# = ") > + self.pmdout_list[0].execute_cmd("quit", "# "= ) > + break > + else: > + if i < self.vf_num: > + self.pmdout_list[i].start_testpmd(param= =3Dtv["param"], > ports=3D[self.sriov_vfs_port[i].pci], > + prefix= =3D'port0vf{}'.format(i)) > + else: > + # start fourth testpmd failed > + eal_param =3D > self.dut.create_eal_parameters(fixed_prefix=3DTrue, > ports=3D[self.sriov_vfs_port[-1].pci]) > + cmd =3D "{} ".format(self.app_path) + ea= l_param + "-- -i " + > tv["param"] > + out =3D self.pmd_output.execute_cmd(cmd,= "#") > + self.verify(tv["check_param"] in out, "f= ail: testpmd start > successfully") > + # quit all testpmd > + self.pmdout_list[0].execute_cmd("quit", = "# ") > + self.pmdout_list[1].execute_cmd("quit", = "# ") > + self.pmdout_list[2].execute_cmd("quit", = "# ") > + if self.vf_num > 3: > + self.pmdout_list[3].execute_cmd("qui= t", "# ") > + self.pmdout_list[4].execute_cmd("qui= t", "# ") > + self.pmdout_list[5].execute_cmd("qui= t", "# ") > + > + self.pmdout_list[6].execute_cmd("quit", "# ") > + > # case 2: 128_vfs_4_queues 128_vfs_4_queues should be updated too.=09 > elif subcase_name =3D=3D "test_multi_fdir_among": > self.create_fdir_rule(tv["rule"]) > self.check_match_mismatch_pkts(tv) > - elif subcase_name =3D=3D "test_more_than_128_vfs_4_queue= s": > + elif subcase_name =3D=3D "test_more_than_max_vfs_4_queue= s": > self.pmd_output.execute_cmd("quit", "#") > out =3D self.dut.send_expect("echo {} > > /sys/bus/pci/devices/{}/sriov_numvfs".format( > - tv["vf_num"][0], self.pf0_pci), "# ") > - self.verify(tv["check_param"] not in out, "fail: cre= ate vfs > successfully") > + self.max_vf_num, self.pf0_pci), "# ") > + self.verify(tv["check_param"] not in out, "fail: > + create vfs failed") > out =3D self.dut.send_expect("echo {} > > /sys/bus/pci/devices/{}/sriov_numvfs".format( > - tv["vf_num"][1], self.pf0_pci), "# ") > + self.max_vf_num + 1, self.pf0_pci), "# ") > self.verify(tv["check_param"] in out, "fail: create = vfs successfully") > - elif subcase_name =3D=3D "test_more_than_4_queues_128_vf= s": > + elif subcase_name =3D=3D "test_more_than_4_queues_max_vf= s": > self.pmd_output.execute_cmd("quit", "# ") > out =3D self.pmd_output.start_testpmd("all", > param=3Dtv["param"][0], > ports=3D[self.sriov_vfs_port[0].pc= i], > socket=3Dself.ports_socket) @@ -407,6 +428,7 @@ class TestLargeVf(TestCas= e): > packet =3D > "Ether(dst=3D'{}')/IP(src=3DRandIP(),dst=3D'192.168.0.{}')/UDP(sport=3D22= ,dport=3D23)/Ra > w('x'*80)".format(pf_mac, ip) > self.send_packets(packet, 1) > ip +=3D 1 > + time.sleep(1) > out =3D pmdout.execute_cmd("ethtool -S %s" % pf_intf, "# ") > for queue in range(check_param[0], check_param[1]+1): > packet_str =3D "rx_queue_%d_packets: (\d+)" % queue @@ -503,= 18 > +525,21 @@ class TestLargeVf(TestCase): > self.check_txonly_pkts(rxtx_num) >=20 > def test_3_vfs_256_queues(self): > - self.session_list =3D [] > - for i in range(3): > - name =3D self.dut.new_session() > - self.session_list.append(name) > - self.create_iavf(3) > + self.pmdout_list =3D [] > + session_list =3D [] > + for i in range(self.vf_num): > + session =3D self.dut.new_session() > + session_list.append(session) > + pmdout =3D PmdOutput(self.dut, session) > + self.pmdout_list.append(pmdout) > + self.create_iavf(self.vf_num + 1) > self.launch_testpmd("--rxq=3D256 --txq=3D256", total=3DTrue) > self.config_testpmd() > self.rte_flow_process(max_vfs_256_queues_3) > - self.dut.close_session(self.session_list) > + self.dut.close_session(session_list) >=20 > - def test_128_vfs_4_queues(self): > - self.create_iavf(128) > + def test_max_vfs_4_queues(self): > + self.create_iavf(self.max_vf_num) > self.launch_testpmd("--rxq=3D4 --txq=3D4") > self.config_testpmd() > self.rte_flow_process(max_vfs_4_queues_128) > @@ -524,6 +549,7 @@ class TestLargeVf(TestCase): > Run after each test case. > """ > self.pmd_output.execute_cmd("quit", "#") > + self.dut.kill_all() > self.destroy_iavf() >=20 >=20 > -- > 2.17.1