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 53F7CA0546; Wed, 26 May 2021 08:14:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E7A14067C; Wed, 26 May 2021 08:14:08 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id D3E9940150 for ; Wed, 26 May 2021 08:14:06 +0200 (CEST) IronPort-SDR: 1D8cLqzm11naNRLnYYjO7Y2xF3dU0X/hWRiozWYNjhn8CgqnBEvMSoj2uIM6GOufUa247E6EU5 58ERp96VBc5g== X-IronPort-AV: E=McAfee;i="6200,9189,9995"; a="266285092" X-IronPort-AV: E=Sophos;i="5.82,330,1613462400"; d="scan'208";a="266285092" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2021 23:14:02 -0700 IronPort-SDR: 1TnisVpc+jYLqptX2j3v5a6joiWVcCaZPZ1CvSxpZpsriuuTLpPCLYgOJvCRPPe9+/AVUhw7B2 y3IwQaf6n+pg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,330,1613462400"; d="scan'208";a="443835078" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga008.fm.intel.com with ESMTP; 25 May 2021 23:14:02 -0700 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Tue, 25 May 2021 23:14:01 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX603.ccr.corp.intel.com (10.109.6.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Wed, 26 May 2021 14:13:59 +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.2242.008; Wed, 26 May 2021 14:13:59 +0800 From: "Tu, Lijuan" To: "Chen, BoX C" , "dts@dpdk.org" CC: "Chen, BoX C" Thread-Topic: [dts] [PATCH V1] tests/generic_filter: use flow api replace legancy Thread-Index: AQHXQkaw1pWoKGUkjU6hjDC/uIgQ4ar1Z9Cw Date: Wed, 26 May 2021 06:13:59 +0000 Message-ID: <5a86851a1fe44435b96bb6bdac92ed4c@intel.com> References: <20210506151015.418101-1-BoX.C.Chen@intel.com> In-Reply-To: <20210506151015.418101-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-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/generic_filter: use flow api replace legancy 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" > -----Original Message----- > From: dts On Behalf Of Bo Chen > Sent: 2021=1B$BG/=1B(B5=1B$B7n=1B(B6=1B$BF|=1B(B 23:10 > To: dts@dpdk.org > Cc: Chen, BoX C > Subject: [dts] [PATCH V1] tests/generic_filter: use flow api replace lega= ncy >=20 > use flow api replace legancy filter command >=20 > Signed-off-by: Bo Chen > --- > tests/TestSuite_generic_filter.py | 41 ++++++++++++++++++------------- > 1 file changed, 24 insertions(+), 17 deletions(-) >=20 > diff --git a/tests/TestSuite_generic_filter.py b/tests/TestSuite_generic_= filter.py > index d4ea8926..f3ea9774 100644 > --- a/tests/TestSuite_generic_filter.py > +++ b/tests/TestSuite_generic_filter.py > @@ -119,6 +119,12 @@ class TestGeneric_filter(TestCase): > """ > Run before each test case. > """ > + if self._suite_result.test_case =3D=3D "test_128_queues": > + print('will rebuild dpdk') Should use self.logger.info > + self.dut.send_expect( > + "sed -i -e 's/#define IXGBE_NONE_MODE_TX_NB_QUEUES > 64$/#define IXGBE_NONE_MODE_TX_NB_QUEUES 128/' > drivers/net/ixgbe/ixgbe_ethdev.h", > + "# ", 30) > + self.dut.build_install_dpdk(self.target) > pass >=20 > def filter_send_packet(self, type): > @@ -711,8 +717,6 @@ class TestGeneric_filter(TestCase): > set_filter_flag =3D 1 > packet_flag =3D 1 > if self.kdriver =3D=3D "ixgbe": > - self.dut.send_expect("sed -i -e 's/#define > IXGBE_NONE_MODE_TX_NB_QUEUES 64$/#define > IXGBE_NONE_MODE_TX_NB_QUEUES 128/' drivers/net/ixgbe/ixgbe_ethdev.h", > "# ",30) > - self.dut.build_install_dpdk(self.target) > global valports > total_mbufs =3D self.request_mbufs(128) * len(valports) > self.pmdout.start_testpmd( > @@ -729,7 +733,6 @@ class TestGeneric_filter(TestCase): > "vlan set filter off %s" % valports[0], "testpmd> ") > self.dut.send_expect( > "vlan set filter off %s" % valports[1], "testpmd> ") > - frames_to_send =3D 1 > queue =3D ['64', '127', '128'] >=20 > for i in [0, 1, 2]: > @@ -739,35 +742,34 @@ class TestGeneric_filter(TestCase): > if 'Invalid RX queue %s' % (queue[i]) not in out: > set_filter_flag =3D 0 > break > - out =3D self.dut.send_expect( > - "5tuple_filter %s add dst_ip 2.2.2.5 src_ip 2.2.= 2.4 dst_port %s > src_port 1 protocol 0x06 mask 0x1f tcp_flags 0x0 priority 3 queue %s " % > (valports[0], (i + 1), queue[i]), "testpmd> ") > - if 'error' not in out: > + cmd =3D "flow create {} ingress pattern eth / ".form= at( > + valports[0]) + "ipv4 dst is 2.2.2.5 src is 2.2.2= .4 / tcp dst is {} src is 1 > / ".format( > + i + 1) + "end actions queue index {} / end".form= at(queue[i]) > + out =3D self.dut.send_expect(cmd, "testpmd> ") > + if 'Invalid argument' not in out: > set_filter_flag =3D 0 > break > continue > else: > self.dut.send_expect("set stat_qmap rx %s %s %s" % > (valports[0], queue[i], (i + 1)= ), "testpmd> ") > - out =3D self.dut.send_expect("5tuple_filter %s add d= st_ip 2.2.2.5 src_ip > 2.2.2.4 dst_port %s src_port 1 protocol 0x06 mask 0x1f tcp_flags 0x0 prio= rity %d > queue %s " % ( > - valports[0], (i + 1), (3 - i), queue[i]), "testp= md> ") > + cmd =3D "flow create {} ingress pattern eth / ".form= at( > + valports[0]) + "ipv4 dst is 2.2.2.5 src is 2.2.2= .4 / tcp dst is {} src is 1 > / ".format( > + i + 1) + "end actions queue index {} / end".form= at(queue[i]) > + self.dut.send_expect(cmd, "testpmd> ") > self.dut.send_expect("start", "testpmd> ", 120) > global filters_index > filters_index =3D i > self.filter_send_packet("packet") > time.sleep(1) > out =3D self.dut.send_expect("stop", "testpmd> ") > - cmd =3D "Stats reg %s RX-packets: ([0-9]+)"= % ( > - i + 1) > - result_scanner =3D r"%s" % cmd > - scanner =3D re.compile(result_scanner, re.DOTALL) > - m =3D scanner.search(out) > - cur_pkt =3D m.group(1) > - if int(cur_pkt) !=3D frames_to_send: > + p =3D re.compile(r"Forward Stats for RX Port=3D \d+/Queu= e=3D(\s?\d+)") > + res =3D p.findall(out) > + queues =3D [int(i) for i in res] > + if queues[0] !=3D int(queue[i]): > packet_flag =3D 0 > break > self.dut.send_expect("quit", "#", timeout=3D30) > - self.dut.send_expect("sed -i -e 's/#define > IXGBE_NONE_MODE_TX_NB_QUEUES 128$/#define > IXGBE_NONE_MODE_TX_NB_QUEUES 64/' drivers/net/ixgbe/ixgbe_ethdev.h", > "# ",30) > - self.dut.build_install_dpdk(self.target) > self.verify(set_filter_flag =3D=3D 1, "set filters error") > self.verify(packet_flag =3D=3D 1, "packet pass assert error"= ) > else: > @@ -853,6 +855,11 @@ class TestGeneric_filter(TestCase): > Run after each test case. > """ > self.dut.kill_all() > + if self._suite_result.test_case =3D=3D "test_128_queues": > + self.dut.send_expect( > + "sed -i -e 's/#define IXGBE_NONE_MODE_TX_NB_QUEUES > 128$/#define IXGBE_NONE_MODE_TX_NB_QUEUES 64/' > drivers/net/ixgbe/ixgbe_ethdev.h", > + "# ", 30) > + self.dut.build_install_dpdk(self.target) >=20 > def tear_down_all(self): > pass > -- > 2.31.1