From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 043587CC4 for ; Tue, 27 Mar 2018 10:55:55 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2018 01:55:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,366,1517904000"; d="scan'208";a="40983538" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 27 Mar 2018 01:55:55 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 27 Mar 2018 01:55:54 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 27 Mar 2018 01:55:54 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.235]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.129]) with mapi id 14.03.0319.002; Tue, 27 Mar 2018 16:55:52 +0800 From: "Liu, Yong" To: "Han, YingyaX" , "dts@dpdk.org" CC: "Han, YingyaX" Thread-Topic: [dts] [PATCH V1]tests/mac_filter: fix FVL stats issue Thread-Index: AQHTwAV7j0ODb2PRYUWCVD+yh7H2cqPj0Wxw Date: Tue, 27 Mar 2018 08:55:51 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62FCB6F4@SHSMSX103.ccr.corp.intel.com> References: <1521520849-89149-1-git-send-email-yingyax.han@intel.com> In-Reply-To: <1521520849-89149-1-git-send-email-yingyax.han@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGM0NTg5ZDMtMTE3Ny00YmRmLWE5MTYtZTgwYWZmNzRkNWRhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJGdDl1dTVHSWFVY1Y1K2Erc1VnYnd4NFBmTzd6UE42RGFuVXM3MXVHdzYxNFc4UFwvRytIMUVrQ0h2Yk9aMXlsbCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action 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 V1]tests/mac_filter: fix FVL stats issue 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: Tue, 27 Mar 2018 08:55:56 -0000 Yingya, Some comments are inline. Thanks, Marvin > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of han,yingya > Sent: Tuesday, March 20, 2018 12:41 PM > To: dts@dpdk.org > Cc: Han, YingyaX > Subject: [dts] [PATCH V1]tests/mac_filter: fix FVL stats issue >=20 > In testpmd show port stats command is to read FVL register, and it's all > packets of FVL. > Contrast to FLV , Niantic's stats, tx/rx packets , don't include packets > filtered. > It's a difference between Niantic and FLV. > Signed-off-by: han,yingya > --- > tests/TestSuite_mac_filter.py | 35 ++++++++++++++++------------------- > 1 file changed, 16 insertions(+), 19 deletions(-) >=20 > diff --git a/tests/TestSuite_mac_filter.py b/tests/TestSuite_mac_filter.p= y > index 1c58b87..a0c890d 100644 > --- a/tests/TestSuite_mac_filter.py > +++ b/tests/TestSuite_mac_filter.py > @@ -107,48 +107,45 @@ class TestWhitelist(TestCase): >=20 > # send one packet with the portid MAC address > self.whitelist_send_packet(portid, self.dest) > - out =3D self.dut.send_expect("show port stats %d" % portid, > "testpmd> ") > - cur_rxpkt =3D utils.regexp(out, "RX-packets: ([0-9]+)") > + out =3D self.dut.get_session_output() > + cur_rxpkt =3D utils.regexp(out, "received ([0-9]+) packets") Checking packet number by Rx only verbose output is one alternative way to = get receive number of packets. You'd better add some comments about why here not use "port stats". > # check the packet increase > self.verify(int(cur_rxpkt) =3D=3D int(pre_rxpkt) + > self.frames_to_send, > "Packet has not been received on default address") > # send one packet to a different MAC address > # new_mac =3D self.dut.get_mac_address(portid) > self.whitelist_send_packet(portid, fake_mac_addr) > - > + out =3D self.dut.get_session_output() > pre_rxpkt =3D cur_rxpkt > - out =3D self.dut.send_expect("show port stats %d" % portid, > "testpmd> ") > - cur_rxpkt =3D utils.regexp(out, "RX-packets: ([0-9]+)") > - > - # check the packet DO NOT increase > - self.verify(int(cur_rxpkt) =3D=3D int(pre_rxpkt), > + if not out: > + cur_rxpkt =3D 0 > + # check the packet DO NOT increase > + self.verify(int(cur_rxpkt) =3D=3D int(pre_rxpkt) - > self.frames_to_send, > "Packet has been received on a new MAC address that > has not been added yet") I think here just need to check no packet is arrived. Only need to check no= "received" message in output is enough.=20 > # add the different MAC address > - out =3D self.dut.send_expect("mac_addr add %d" % portid + " %s" = % > fake_mac_addr, "testpmd>") > + self.dut.send_expect("mac_addr add %d" % portid + " %s" % > fake_mac_addr, "testpmd>") >=20 > # send again one packet to a different MAC address > self.whitelist_send_packet(portid, fake_mac_addr) > - > + out =3D self.dut.get_session_output() > pre_rxpkt =3D cur_rxpkt > - out =3D self.dut.send_expect("show port stats %d" % portid, > "testpmd> ") > - cur_rxpkt =3D utils.regexp(out, "RX-packets: ([0-9]+)") > + cur_rxpkt =3D utils.regexp(out, "received ([0-9]+) packets") >=20 > # check the packet increase > self.verify(int(cur_rxpkt) =3D=3D int(pre_rxpkt) + > self.frames_to_send, > "Packet has not been received on a new MAC address > that has been added to the port") >=20 > # remove the fake MAC address > - out =3D self.dut.send_expect("mac_addr remove %d" % portid + " %= s" % > fake_mac_addr, "testpmd>") > + self.dut.send_expect("mac_addr remove %d" % portid + " %s" % > fake_mac_addr, "testpmd>") >=20 > # send again one packet to a different MAC address > self.whitelist_send_packet(portid, fake_mac_addr) > - > + out =3D self.dut.get_session_output() > pre_rxpkt =3D cur_rxpkt > - out =3D self.dut.send_expect("show port stats %d" % portid, > "testpmd> ") > - cur_rxpkt =3D utils.regexp(out, "RX-packets: ([0-9]+)") > - > - # check the packet increase > - self.verify(int(cur_rxpkt) =3D=3D int(pre_rxpkt), > + if not out: > + cur_rxpkt =3D 0 > + # check the packet increase > + self.verify(int(cur_rxpkt) =3D=3D int(pre_rxpkt) - > self.frames_to_send, Same comment as previous one. > "Packet has been received on a new MAC address that > has been removed from the port") > self.dut.send_expect("stop", "testpmd> ") >=20 > -- > 1.9.3