From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 34F431DA4 for ; Thu, 7 Mar 2019 11:35:51 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2019 02:35:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,451,1544515200"; d="scan'208";a="139910830" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 07 Mar 2019 02:35:50 -0800 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 7 Mar 2019 02:35:50 -0800 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 7 Mar 2019 02:35:49 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.158]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.223]) with mapi id 14.03.0415.000; Thu, 7 Mar 2019 18:35:47 +0800 From: "Tu, Lijuan" To: "Luo, Michael" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH] tests/vhost_pmd_xstats: Detect the categories of packet size from xstats Thread-Index: AQHU0+1rI95IEgq6uUKcMBZvVO6ciaX/+yfg Date: Thu, 7 Mar 2019 10:35:46 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BA3F761@SHSMSX101.ccr.corp.intel.com> References: <1551856752-16081-1-git-send-email-michael.luo@intel.com> In-Reply-To: <1551856752-16081-1-git-send-email-michael.luo@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.400.15 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzk1YWRkZDEtYjZhNS00OTg1LTkyNWUtZmMyZmNlMDIxOGY4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiXC9CV2RoUUV6VmZYSndWUXJ4SVhyZ1c2S1VGdEg5MzVKazBQdmU4YlZEVVdZdGpNR2l3d0g1a3ZkNGtlSmYzSTAifQ== 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] tests/vhost_pmd_xstats: Detect the categories of packet size from xstats 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: , X-List-Received-Date: Thu, 07 Mar 2019 10:35:52 -0000 Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of michael.luo@intel.co= m > Sent: Wednesday, March 6, 2019 3:19 PM > To: dts@dpdk.org > Subject: [dts] [PATCH] tests/vhost_pmd_xstats: Detect the categories of p= acket > size from xstats >=20 > From: Luo Gaoliang >=20 > Detecting the categories of packet size from xstats to test the case > test_based_size instead of using the hardcoded sizes. Because different N= ICs > may categorize the big packets differently. For example, a 1024Byte packe= t, > Niantic counts it into rx_size_1024_to_max_packets, but Fortville puts it= into > tx_size_1024_to_1522_packets. >=20 > Signed-off-by: Luo Gaoliang > --- > tests/TestSuite_vhost_pmd_xstats.py | 23 ++++++++--------------- > 1 file changed, 8 insertions(+), 15 deletions(-) >=20 > diff --git a/tests/TestSuite_vhost_pmd_xstats.py > b/tests/TestSuite_vhost_pmd_xstats.py > index e33b342..db59f48 100755 > --- a/tests/TestSuite_vhost_pmd_xstats.py > +++ b/tests/TestSuite_vhost_pmd_xstats.py > @@ -158,21 +158,14 @@ class TestVhostPmdXstats(TestCase): > Verify receiving and transmitting packets correctly in the Vhost= PMD xstats > """ > self.prepare_start() > - sizes =3D [64, 65, 128, 256, 513, 1025] > - scope =3D '' > - for pktsize in sizes: > - if pktsize =3D=3D 64: > - scope =3D 'size_64' > - elif 65 <=3D pktsize <=3D 127: > - scope =3D 'size_65_to_127' > - elif 128 <=3D pktsize <=3D 255: > - scope =3D 'size_128_to_255' > - elif 256 <=3D pktsize <=3D 511: > - scope =3D 'size_256_to_511' > - elif 512 <=3D pktsize <=3D 1023: > - scope =3D 'size_512_to_1023' > - elif 1024 <=3D pktsize: > - scope =3D 'size_1024_to_max' > + out =3D self.dut.send_expect( > + "show port xstats %s" % self.dut_ports[0], "testpmd>", 60) > + p =3D re.compile(r'rx_size_[0-9]+_[to_\w+]*packets') > + categories =3D p.findall(out) > + self.verify(len(categories) > 0, 'Unable to find the categories = of RX packet > size!') > + for cat in categories: > + scope =3D re.search(r'(?<=3Drx_)\w+(?=3D_packets)', cat).gro= up(0) > + pktsize =3D int(re.search(r'(?<=3Drx_size_)\d+', cat).group(= 0)) >=20 > self.scapy_send_packet(pktsize, self.dmac, 10000) > self.send_verify(scope, 10000) > -- > 2.7.4