From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D46B0A0540; Mon, 20 Jul 2020 08:55:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C1C4B1BEE6; Mon, 20 Jul 2020 08:55:23 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id DB54F1BEBF for ; Mon, 20 Jul 2020 08:55:21 +0200 (CEST) IronPort-SDR: 5mgpC7dvSmCakEDPWcn3KkrQ+NmNii05Ndua/6+5dH5t9HuqjNoYqD1wAiuqN+OSkabzNio94H NoyEzBvcPVZg== X-IronPort-AV: E=McAfee;i="6000,8403,9687"; a="211404630" X-IronPort-AV: E=Sophos;i="5.75,374,1589266800"; d="scan'208";a="211404630" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2020 23:55:20 -0700 IronPort-SDR: xeH62derXkz3QD+o1pON+510X95oFPII786X0fhYJPTMWoaUehuzryEfOlzgn5YFtiHhE3GVvI hw50RCKR638w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,374,1589266800"; d="scan'208";a="317929763" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga008.jf.intel.com with ESMTP; 19 Jul 2020 23:55:20 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 19 Jul 2020 23:55:19 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 19 Jul 2020 23:55:18 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.22]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.32]) with mapi id 14.03.0439.000; Mon, 20 Jul 2020 14:55:15 +0800 From: "Tu, Lijuan" To: "Chen, BoX C" , "dts@dpdk.org" CC: "Chen, BoX C" Thread-Topic: [dts] [PATCH V1] tests/iavf_fdir: Adaptation regression modification Thread-Index: AQHWUP/ZWpvpdd2V/kGeIrWmbrBkYKkQI2/w Date: Mon, 20 Jul 2020 06:55:15 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BC82129@SHSMSX101.ccr.corp.intel.com> References: <20200703055308.29197-1-box.c.chen@intel.com> In-Reply-To: <20200703055308.29197-1-box.c.chen@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.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1] tests/iavf_fdir: Adaptation regression modification 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 On Behalf Of ChenBo > Sent: 2020=1B$BG/=1B(B7=1B$B7n=1B(B3=1B$BF|=1B(B 13:53 > To: dts@dpdk.org > Cc: Chen, BoX C > Subject: [dts] [PATCH V1] tests/iavf_fdir: Adaptation regression modifica= tion >=20 > 1.Use global variables instead of devil numbers. > 2.Support for DUT and Tester is not the same ENV. > 3.Fixed an issue with group packet exceptions. > 4.Modify the environment cleanup process to increase code robustness. >=20 > Signed-off-by: ChenBo > --- > tests/TestSuite_iavf_fdir.py | 58 +++++++++++++++++++----------------- > tests/rte_flow_common.py | 24 ++++++++------- > 2 files changed, 44 insertions(+), 38 deletions(-) >=20 > diff --git a/tests/TestSuite_iavf_fdir.py b/tests/TestSuite_iavf_fdir.py = index > f1adc0f..f2004c6 100644 > --- a/tests/TestSuite_iavf_fdir.py > +++ b/tests/TestSuite_iavf_fdir.py > @@ -37,6 +37,7 @@ from packet import Packet from pmd_output import > PmdOutput from test_case import TestCase import rte_flow_common as rfc > +from rte_flow_common import CVL_TXQ_RXQ_NUMBER > from multiprocessing import Process > from multiprocessing import Manager >=20 > @@ -126,9 +127,9 @@ MAC_IPV6_PAY =3D { > MAC_IPV6_PAY_protocol =3D { > "match": [ >=20 > 'Ether(dst=3D"00:11:22:33:44:55")/IPv6(dst=3D"CDCD:910A:2222:5498:8475:11= 11:39 > 00:2020", src=3D"2001::2", nh=3D44, tc=3D1, hlim=3D2)/("X"*480)', > - > 'Ether(dst=3D"00:11:22:33:44:55")/IPv6(dst=3D"CDCD:910A:2222:5498:8475:11= 11:39 > 00:2020")/IPv6ExtHdrFragment(100)/("X"*480)', > + > + 'Ether(dst=3D"00:11:22:33:44:55")/IPv6(dst=3D"CDCD:910A:2222:5498:8475:= 111 > + 1:3900:2020")/IPv6ExtHdrFragment()/("X"*480)', >=20 > 'Ether(dst=3D"00:11:22:33:44:55")/IPv6(dst=3D"CDCD:910A:2222:5498:8475:11= 11:39 > 00:2020", nh=3D44)/TCP(sport=3D22,dport=3D23)/("X"*480)', > - > 'Ether(dst=3D"00:11:22:33:44:55")/IPv6(dst=3D"CDCD:910A:2222:5498:8475:11= 11:39 > 00:2020")/IPv6ExtHdrFragment(100)/TCP(sport=3D22,dport=3D23)/("X"*480)', > + > + 'Ether(dst=3D"00:11:22:33:44:55")/IPv6(dst=3D"CDCD:910A:2222:5498:8475:= 111 > + 1:3900:2020")/IPv6ExtHdrFragment()/TCP(sport=3D22,dport=3D23)/("X"*480)= ', >=20 > 'Ether(dst=3D"00:11:22:33:44:55")/IPv6(dst=3D"CDCD:910A:2222:5498:8475:11= 11:39 > 00:2020", nh=3D6)/("X"*480)', >=20 > 'Ether(dst=3D"00:11:22:33:44:55")/IPv6(dst=3D"CDCD:910A:2222:5498:8475:11= 11:39 > 00:2020")/TCP(sport=3D22,dport=3D23)/("X"*480)'], > "mismatch": [ > @@ -1302,11 +1303,16 @@ class TestIAVFFdir(TestCase): >=20 > self.src_file_dir =3D 'dep/' > self.dut_file_dir =3D '/tmp/' > + self.cvlq_num =3D CVL_TXQ_RXQ_NUMBER >=20 > def set_up(self): > """ > Run before each test case. > """ > + self.re_load_ice_driver() > + time.sleep(1) > + self.setup_2pf_4vf_env() > + time.sleep(1) > self.launch_testpmd() >=20 > def setup_2pf_4vf_env(self, driver=3D'default'): > @@ -1384,8 +1390,8 @@ class TestIAVFFdir(TestCase): > self.dut.send_expect("rmmod ice", "# ", 40) > ice_driver_file_location =3D self.suite_config["ice_driver_file_= location"] > self.dut.send_expect("insmod %s" % ice_driver_file_location, "# = ") > - self.dut.send_expect("ifconfig %s up" % self.tester_iface0, "# "= , 15) > - self.dut.send_expect("ifconfig %s up" % self.tester_iface1, "# "= , 15) > + self.dut.send_expect("ifconfig %s up" % self.dut_ports[0], "# ",= 15) > + self.dut.send_expect("ifconfig %s up" % self.dut_ports[1], "# > + ", 15) >=20 > def config_testpmd(self): > self.pmd_output.execute_cmd("set fwd rxonly") @@ -1401,7 +1407,7= @@ > class TestIAVFFdir(TestCase): >=20 > def launch_testpmd(self): > self.pmd_output.start_testpmd(cores=3D"1S/4C/1T", > - param=3D"--rxq=3D16 --txq=3D16", > + param=3D"--rxq=3D{} > + --txq=3D{}".format(self.cvlq_num, self.cvlq_num), > eal_param=3D"-w %s -w %s" % ( > self.sriov_vfs_pf0[0].pci,sel= f.sriov_vfs_pf0[1].pci), > socket=3Dself.ports_socket) @@ -15= 08,7 +1514,7 @@ class > TestIAVFFdir(TestCase): > self.verify(not p.search(out), "flow rule on port %s is exis= ted" % port_id) >=20 > def check_rule_number(self, port_id=3D0, num=3D0): > - out =3D self.pmd_output.execute_cmd("flow list %s" % port_id) > + out =3D self.dut.send_command("flow list %s" % port_id, > + timeout=3D30) > result_scanner =3D r'\d*.*?\d*.*?\d*.*?=3D>*' > scanner =3D re.compile(result_scanner, re.DOTALL) > li =3D scanner.findall(out) > @@ -1848,12 +1854,12 @@ class TestIAVFFdir(TestCase): > m1 =3D p.search(out_pf1) >=20 > eal_param =3D "-c 0xf -n 6 -w %s -w %s --file-prefix=3Dpf0" % > (self.sriov_vfs_pf0[0].pci,self.sriov_vfs_pf0[1].pci) > - command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, e= al_param, > "--rxq=3D16 --txq=3D16") > + command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, > + eal_param, "--rxq=3D{} --txq=3D{}".format(self.cvlq_num, self.cvlq_num)= ) > self.dut.send_expect(command, "testpmd> ", 300) > self.config_testpmd() >=20 > eal_param =3D "-c 0xf0 -n 6 -w %s -w %s --file-prefix=3Dpf1" % > (self.sriov_vfs_pf1[0].pci,self.sriov_vfs_pf1[1].pci) > - command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, e= al_param, > "--rxq=3D16 --txq=3D16") > + command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, > + eal_param, "--rxq=3D{} --txq=3D{}".format(self.cvlq_num, self.cvlq_num)= ) > self.session_secondary.send_expect(command, "testpmd> ", 300) > #self.session_secondary.config_testpmd() > self.session_secondary.send_expect("set fwd rxonly", "testpmd> "= ) @@ - > 2001,12 +2007,12 @@ class TestIAVFFdir(TestCase): > m1 =3D p.search(out_pf1) >=20 > eal_param =3D "-c 0xf -n 6 -w %s -w %s --file-prefix=3Dpf0" % > (self.sriov_vfs_pf0[0].pci,self.sriov_vfs_pf0[1].pci) > - command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, e= al_param, > "--rxq=3D16 --txq=3D16") > + command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, > + eal_param, "--rxq=3D{} --txq=3D{}".format(self.cvlq_num, self.cvlq_num)= ) > self.dut.send_expect(command, "testpmd> ", 300) > self.config_testpmd() >=20 > eal_param =3D "-c 0xf0 -n 6 -w %s -w %s --file-prefix=3Dpf1" % > (self.sriov_vfs_pf1[0].pci,self.sriov_vfs_pf1[1].pci) > - command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, e= al_param, > "--rxq=3D16 --txq=3D16") > + command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, > + eal_param, "--rxq=3D{} --txq=3D{}".format(self.cvlq_num, self.cvlq_num)= ) > self.session_secondary.send_expect(command, "testpmd> ", 300) > #self.session_secondary.config_testpmd() > self.session_secondary.send_expect("set fwd rxonly", "testpmd> "= ) @@ - > 2154,12 +2160,12 @@ class TestIAVFFdir(TestCase): > m1 =3D p.search(out_pf1) >=20 > eal_param =3D "-c 0xf -n 6 -w %s -w %s --file-prefix=3Dpf0" % > (self.sriov_vfs_pf0[0].pci,self.sriov_vfs_pf0[1].pci) > - command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, e= al_param, > "--rxq=3D16 --txq=3D16") > + command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, > + eal_param, "--rxq=3D{} --txq=3D{}".format(self.cvlq_num, self.cvlq_num)= ) > self.dut.send_expect(command, "testpmd> ", 300) > self.config_testpmd() >=20 > eal_param =3D "-c 0xf0 -n 6 -w %s -w %s --file-prefix=3Dpf1" % > (self.sriov_vfs_pf1[0].pci,self.sriov_vfs_pf1[1].pci) > - command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, e= al_param, > "--rxq=3D16 --txq=3D16") > + command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, > + eal_param, "--rxq=3D{} --txq=3D{}".format(self.cvlq_num, self.cvlq_num)= ) > self.session_secondary.send_expect(command, "testpmd> ", 300) > #self.session_secondary.config_testpmd() > self.session_secondary.send_expect("set fwd rxonly", "testpmd> "= ) @@ - > 2291,7 +2297,7 @@ class TestIAVFFdir(TestCase): > self.dut.session.copy_file_to(self.src_file_dir + src_file, self= .dut_file_dir) >=20 > eal_param =3D "-c f -n 6 -w %s -w %s" % > (self.sriov_vfs_pf0[0].pci,self.sriov_vfs_pf0[1].pci) > - command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, e= al_param, > "--rxq=3D16 --txq=3D16 --cmdline-file=3D%s" % self.dut_file_dir + src_fil= e) > + command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, > + eal_param, "--rxq=3D{} --txq=3D{} --cmdline-file=3D%s".format(self.cvlq= _num, > + self.cvlq_num) % self.dut_file_dir + src_file) > self.dut.send_expect(command, "testpmd> ", 300) > self.config_testpmd() >=20 > @@ -2361,7 +2367,7 @@ class TestIAVFFdir(TestCase): > self.dut.session.copy_file_to(self.src_file_dir + src_file, self= .dut_file_dir) >=20 > eal_param =3D "-c f -n 6 -w %s -w %s" % > (self.sriov_vfs_pf0[0].pci,self.sriov_vfs_pf1[0].pci) > - command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, e= al_param, > "--rxq=3D16 --txq=3D16 --cmdline-file=3D%s" % self.dut_file_dir + src_fil= e) > + command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, > + eal_param, "--rxq=3D{} --txq=3D{} --cmdline-file=3D%s".format(self.cvlq= _num, > + self.cvlq_num) % self.dut_file_dir + src_file) > self.dut.send_expect(command, "testpmd> ", 300) >=20 > self.config_testpmd() > @@ -2453,7 +2459,7 @@ class TestIAVFFdir(TestCase): > self.verify(count =3D=3D 513, "failed to create 1025 fdir ru= les on pf.") > self.dut.session.copy_file_to(self.src_file_dir + src_file, self= .dut_file_dir) > # create 1025 rules on pf1 > - fkr =3D open(self.dut_file_dir + src_file, "r+") > + fkr =3D open(self.src_file_dir + src_file, "r+") > kernel_rules =3D fkr.read() > fkr.close() > self.dut.send_expect(kernel_rules, "# ") @@ -2477,7 +2483,7 @@ c= lass > TestIAVFFdir(TestCase): >=20 > # start testpmd with creating rules in commandline > eal_param =3D "-c f -n 6 -w %s -w %s" % > (self.sriov_vfs_pf0[0].pci,self.sriov_vfs_pf0[1].pci) > - command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, e= al_param, > "--rxq=3D16 --txq=3D16 --cmdline-file=3D%s" % self.dut_file_dir + src_fil= e_vf) > + command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, > + eal_param, "--rxq=3D{} --txq=3D{} --cmdline-file=3D%s".format(self.cvlq= _num, > + self.cvlq_num) % self.dut_file_dir + src_file_vf) > fdw =3D open("15360_rules_vf_result.txt", "w") > fdw.write(self.dut.send_expect(command, "testpmd> ", 360)) > fdw.close() > @@ -2545,7 +2551,7 @@ class TestIAVFFdir(TestCase): > self.verify(count =3D=3D 14848, "failed to create 14848 fdir= rules on pf.") > self.dut.session.copy_file_to(self.src_file_dir + src_file, self= .dut_file_dir) > # create 15360 rules on pf1 > - fkr =3D open(self.dut_file_dir + src_file, "r+") > + fkr =3D open(self.src_file_dir + src_file, "r+") > kernel_rules =3D fkr.read() > fkr.close() > self.dut.send_expect(kernel_rules, "# ") @@ -2554,7 +2560,7 @@ c= lass > TestIAVFFdir(TestCase): > self.dut.send_expect("ethtool -N %s flow-type tcp4 src-ip 192.16= 8.100.0 > dst-ip 192.168.100.2 src-port 32 dst-port 33 action 8" % self.pf1_intf, "= Cannot > insert RX class rule: No space left on device") > # start testpmd with creating rules in commandline > eal_param =3D "-c f -n 6 -w %s -w %s" % > (self.sriov_vfs_pf0[0].pci,self.sriov_vfs_pf1[0].pci) > - command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, e= al_param, > "--rxq=3D16 --txq=3D16") > + command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, > + eal_param, "--rxq=3D{} --txq=3D{}".format(self.cvlq_num, self.cvlq_num)= ) > self.dut.send_expect(command, "testpmd> ", 20) >=20 > self.config_testpmd() > @@ -2606,7 +2612,7 @@ class TestIAVFFdir(TestCase): > self.destroy_env() > self.setup_npf_nvf_env(pf_num=3D1,vf_num=3D16) > self.dut.send_expect('ip link set %s vf 10 mac 00:11:22:33:44:55= ' % > self.pf0_intf, '#') > - command =3D "./%s/app/testpmd -c f -n 6 -- -i %s" % (self.dut.ta= rget, "-- > rxq=3D16 --txq=3D16") > + command =3D "./%s/app/testpmd -c f -n 6 -- -i %s" % > + (self.dut.target, "--rxq=3D4 --txq=3D4") > self.dut.send_expect(command, "testpmd> ", 360) > self.config_testpmd() > for port_id in range(11): > @@ -2637,9 +2643,6 @@ class TestIAVFFdir(TestCase): >=20 > self.create_fdir_rule(rule, check_stats=3DFalse) >=20 > - self.destroy_env() > - self.setup_2pf_4vf_env() > - > def test_stress_port_stop_start(self): > """ > Rules can take effect after port stop/start @@ -2681,7 +2684,7 @= @ class > TestIAVFFdir(TestCase): > self.dut.session.copy_file_to(self.src_file_dir + src_file, self= .dut_file_dir) >=20 > eal_param =3D "-c f -n 6 -w %s -w %s" % > (self.sriov_vfs_pf0[0].pci,self.sriov_vfs_pf0[1].pci) > - command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, e= al_param, > "--rxq=3D16 --txq=3D16 --cmdline-file=3D%s" % self.dut_file_dir + src_fil= e) > + command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, > + eal_param, "--rxq=3D{} --txq=3D{} --cmdline-file=3D%s".format(self.cvlq= _num, > + self.cvlq_num) % self.dut_file_dir + src_file) > self.dut.send_expect(command, "testpmd> ", 900) > self.config_testpmd() > self.check_fdir_rule(port_id=3D0, stats=3DFalse) @@ -2716,7 +271= 9,7 @@ class > TestIAVFFdir(TestCase): > self.dut.session.copy_file_to(self.src_file_dir + src_file, self= .dut_file_dir) >=20 > eal_param =3D "-c f -n 6 -w %s -w %s" % > (self.sriov_vfs_pf0[0].pci,self.sriov_vfs_pf0[1].pci) > - command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, e= al_param, > "--rxq=3D16 --txq=3D16 --cmdline-file=3D%s" % self.dut_file_dir + src_fil= e) > + command =3D "./%s/app/testpmd %s -- -i %s" % (self.dut.target, > + eal_param, "--rxq=3D{} --txq=3D{} --cmdline-file=3D%s".format(self.cvlq= _num, > + self.cvlq_num) % self.dut_file_dir + src_file) > self.dut.send_expect(command, "testpmd> ", 900) > self.config_testpmd() > self.check_fdir_rule(port_id=3D0, stats=3DFalse) @@ -3101,7 +310= 4,7 @@ class > TestIAVFFdir(TestCase): >=20 > self.dut.send_expect("quit", "# ") > self.pmd_output.start_testpmd(cores=3D"1S/4C/1T", > - param=3D"--rxq=3D16 --txq=3D16 --e= nable-rx-cksum --port- > topology=3Dloop", > + param=3D"--rxq=3D{} --txq=3D{} > + --enable-rx-cksum --port-topology=3Dloop".format(self.cvlq_num, > + self.cvlq_num), > eal_param=3D"-w %s" % self.sriov_v= fs_pf0[0].pci, > socket=3Dself.ports_socket) > vlan =3D 51 > @@ -3197,7 +3200,7 @@ class TestIAVFFdir(TestCase): >=20 > self.dut.send_expect("quit", "# ") > self.pmd_output.start_testpmd(cores=3D"1S/4C/1T", > - param=3D"--rxq=3D16 --txq=3D16 --e= nable-rx-cksum --port- > topology=3Dloop", > + param=3D"--rxq=3D{} --txq=3D{} > + --enable-rx-cksum --port-topology=3Dloop".format(self.cvlq_num, > + self.cvlq_num), > eal_param=3D"-w %s" % self.sriov_v= fs_pf0[0].pci, > socket=3Dself.ports_socket) > vlan =3D 51 > @@ -3286,7 +3289,7 @@ class TestIAVFFdir(TestCase): >=20 > self.dut.send_expect("quit", "# ") > self.pmd_output.start_testpmd(cores=3D"1S/4C/1T", > - param=3D"--rxq=3D16 --txq=3D16 --e= nable-rx-cksum --port- > topology=3Dloop", > + param=3D"--rxq=3D{} --txq=3D{} > + --enable-rx-cksum --port-topology=3Dloop".format(self.cvlq_num, > + self.cvlq_num), > eal_param=3D"-w %s" % self.sriov_v= fs_pf0[0].pci, > socket=3Dself.ports_socket) > vlan =3D 51 > @@ -3353,6 +3356,7 @@ class TestIAVFFdir(TestCase): >=20 > def tear_down(self): > # destroy all flow rule on port 0 > + self.destroy_env() > self.dut.kill_all() > if getattr(self, 'session_secondary', None): > self.dut.close_session(self.session_secondary) > diff --git a/tests/rte_flow_common.py b/tests/rte_flow_common.py index > 0574e49..3d46e5e 100644 > --- a/tests/rte_flow_common.py > +++ b/tests/rte_flow_common.py > @@ -34,6 +34,8 @@ import time > import re > from utils import GREEN, RED >=20 > +CVL_TXQ_RXQ_NUMBER =3D 16 > + > # switch filter common functions > def get_suite_config(test_case): > """ > @@ -400,7 +402,7 @@ def check_mark(out, pkt_num, check_param, > stats=3DTrue): > else: > raise Exception("got wrong output, not match pattern %s"= % p.pattern) > if mark_id is not None: > - mark_list =3D set(int(i, 16) for i in fdir_scanner.finda= ll(out)) > + mark_list =3D set(int(i, CVL_TXQ_RXQ_NUMBER) for i in > + fdir_scanner.findall(out)) > verify(all([i =3D=3D check_param["mark_id"] for i in mar= k_list]), > "failed: some packet mark id of %s not match" % m= ark_list) > else: > @@ -424,11 +426,11 @@ def check_mark(out, pkt_num, check_param, > stats=3DTrue): > def verify_directed_by_rss(out, rxq=3D64, stats=3DTrue): > p =3D re.compile('RSS\shash=3D(\w+)\s-\sRSS\squeue=3D(\w+)') > pkt_info =3D p.findall(out) > - pkt_queue =3D set([int(i[1], 16) for i in pkt_info]) > + pkt_queue =3D set([int(i[1], CVL_TXQ_RXQ_NUMBER) for i in pkt_info]) > if stats: > - verify(all([int(i[0], 16) % rxq =3D=3D int(i[1], 16) for i in pk= t_info]), 'some pkt not > directed by rss.') > + verify(all([int(i[0], CVL_TXQ_RXQ_NUMBER) % rxq =3D=3D int(i[1], > + CVL_TXQ_RXQ_NUMBER) for i in pkt_info]), 'some pkt not directed by > + rss.') > else: > - verify(not any([int(i[0], 16) % rxq =3D=3D int(i[1], 16) for i i= n pkt_info]), 'some > pkt directed by rss') > + verify(not any([int(i[0], CVL_TXQ_RXQ_NUMBER) % rxq =3D=3D > + int(i[1], CVL_TXQ_RXQ_NUMBER) for i in pkt_info]), 'some pkt directed > + by rss') > return pkt_queue >=20 >=20 > @@ -458,23 +460,23 @@ def check_iavf_fdir_queue(out, pkt_num, > check_param, stats=3DTrue): > verify(not any(q =3D=3D queue for q in res_queue), "fail= : queue id should not > matched, expect queue %s, got %s" % (queue, res_queue)) > print((GREEN("pass: queue id %s not matched" % res_queue= ))) > elif isinstance(queue, list): > - verify_iavf_fdir_directed_by_rss(out, rxq=3D16, stats=3D= True) > + verify_iavf_fdir_directed_by_rss(out, > + rxq=3DCVL_TXQ_RXQ_NUMBER, stats=3DTrue) > print((GREEN("pass: queue id %s not matched" % res_queue= ))) > else: > raise Exception("wrong action value, expect queue_index = or > queue_group") > else: > raise Exception("got wrong output, not match pattern %s" % p.pat= tern) >=20 > -def verify_iavf_fdir_directed_by_rss(out, rxq=3D16, stats=3DTrue): > +def verify_iavf_fdir_directed_by_rss(out, rxq=3DCVL_TXQ_RXQ_NUMBER, > stats=3DTrue): > p =3D re.compile("RSS hash=3D(0x\w+) - RSS queue=3D(0x\w+)") > pkt_info =3D p.findall(out) > if stats: > for i in pkt_info: > - verify((int(i[0],16) % rxq =3D=3D int(i[1],16)), "some packe= ts are not directed > by RSS") > + verify((int(i[0],CVL_TXQ_RXQ_NUMBER) % rxq =3D=3D > + int(i[1],CVL_TXQ_RXQ_NUMBER)), "some packets are not directed by RSS") > print(GREEN("pass: queue id %s is redirected by RSS hash val= ue %s" % > (i[1], i[0]))) > else: > for i in pkt_info: > - verify((int(i[0],16) % rxq !=3D int(i[1],16)), "some packets= are not directed > by RSS") > + verify((int(i[0],CVL_TXQ_RXQ_NUMBER) % rxq !=3D > + int(i[1],CVL_TXQ_RXQ_NUMBER)), "some packets are not directed by RSS") >=20 > def check_iavf_fdir_passthru(out, pkt_num, check_param, stats=3DTrue): > # check the actual queue is distributed by RSS @@ -485,7 +487,7 @@ d= ef > check_iavf_fdir_passthru(out, pkt_num, check_param, stats=3DTrue): > p =3D re.compile('RSS\shash=3D(\w+)\s-\sRSS\squeue=3D(\w+)') > pkt_hash =3D p.findall(out) > verify(pkt_num =3D=3D len(pkt_hash), "fail: got wrong number of pass= thru packets, > expect passthru packet number %s, got %s." % (pkt_num, len(pkt_hash))) > - verify_iavf_fdir_directed_by_rss(out, rxq=3D16, stats=3DTrue) > + verify_iavf_fdir_directed_by_rss(out, rxq=3DCVL_TXQ_RXQ_NUMBER, > + stats=3DTrue) >=20 > def check_iavf_fdir_mark(out, pkt_num, check_param, stats=3DTrue): > mark_scanner =3D "FDIR matched ID=3D(0x\w+)" > @@ -499,7 +501,7 @@ def check_iavf_fdir_mark(out, pkt_num, check_param, > stats=3DTrue): > mark_list =3D [i for i in res] > print("mark list is: ", mark_list) > verify(len(res) =3D=3D pkt_num, "get wrong number of packet = with mark_id") > - verify(all([int(i, 16) =3D=3D check_param["mark_id"] for i i= n res]), > + verify(all([int(i, CVL_TXQ_RXQ_NUMBER) =3D=3D > + check_param["mark_id"] for i in res]), > "failed: some packet mark id of %s not match" % = mark_list) > if check_param.get("queue") is not None: > check_iavf_fdir_queue(out, pkt_num, check_param, stats) = @@ -629,7 > +631,7 @@ def check_iavf_packets_rss_queue(out, count, rss_match=3DTrue): > packet_sumnum =3D packet_sumnum + int(packet_num) >=20 > if rss_match: > - if queue_flag =3D=3D 16 and packet_sumnum =3D=3D count: > + if queue_flag =3D=3D CVL_TXQ_RXQ_NUMBER and packet_sumnum =3D=3D= count: > log_msg =3D "Packets has send to %s queues" % queue_flag > return True, log_msg > else: > -- > 2.17.1