From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 9F3801B852 for ; Thu, 8 Feb 2018 07:13:44 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2018 22:13:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,477,1511856000"; d="scan'208";a="28334875" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 07 Feb 2018 22:13:43 -0800 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 7 Feb 2018 22:13:42 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 7 Feb 2018 22:13:42 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.125]) with mapi id 14.03.0319.002; Thu, 8 Feb 2018 14:13:40 +0800 From: "Liu, Yong" To: "Xu, GangX" , "dts@dpdk.org" CC: "Xu, GangX" Thread-Topic: [dts] [PATCH V2] fix RX TX different Thread-Index: AQHTnmfZpbCJhna+SUa9Ea3Mo8zCk6OaCgcA Date: Thu, 8 Feb 2018 06:13:40 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62F9C3CF@SHSMSX103.ccr.corp.intel.com> References: <1517824752-41843-1-git-send-email-gangx.xu@intel.com> In-Reply-To: <1517824752-41843-1-git-send-email-gangx.xu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWE3OGYxNjctODljZS00OTg2LWFhNGYtZWVjNTRlMWFkYWI0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiI2c0FcL3l1MFh1RUhMcFgrV0MwZUlTanp1KytcL0p0KzVrQVwvc2tJWkVMdG81MitIY0p0NzRiRXVrdEtOVW5teDYxIn0= 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 V2] fix RX TX different 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, 08 Feb 2018 06:13:45 -0000 Gang, Please keep same sequence for the arguments, it will be a little confused i= f sequence not matched. You can put vlan_strip to the end as it is new argument. Please also do not= forget to add space after comma.=20 check_forwarding(self, vlan_strip=3DFalse, ports=3DNone, pktSize=3D68,recei= ved=3DTrue,vlan=3DFalse, promisc=3DFalse): self.send_packet(ports[0], ports[0], pktSize, received, vlan, promisc, vlan= _strip) Thanks, Marvin > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,gang > Sent: Monday, February 05, 2018 5:59 PM > To: dts@dpdk.org > Cc: Xu, GangX > Subject: [dts] [PATCH V2] fix RX TX different >=20 > add vlan_strip option, when vlan_strip is off, > RX-bytes and TX-bytes equal. > rx_vlan add|rm need open vlan filter >=20 > Signed-off-by: xu,gang > --- > tests/TestSuite_shutdown_api.py | 26 ++++++++++++++++---------- > 1 file changed, 16 insertions(+), 10 deletions(-) >=20 > diff --git a/tests/TestSuite_shutdown_api.py > b/tests/TestSuite_shutdown_api.py > index f81c3d5..eb13c31 100644 > --- a/tests/TestSuite_shutdown_api.py > +++ b/tests/TestSuite_shutdown_api.py > @@ -83,14 +83,14 @@ class TestShutdownApi(TestCase): > stats =3D output.get_pmd_stats(portid) > return stats >=20 > - def check_forwarding(self, ports=3DNone, pktSize=3D68, received=3DTr= ue, > vlan=3DFalse, promisc=3DFalse): > + def check_forwarding(self, vlan_strip=3DFalse, ports=3DNone, pktSize= =3D68, > received=3DTrue,vlan=3DFalse, promisc=3DFalse): > if ports is None: > ports =3D self.ports > if len(ports) =3D=3D 1: > - self.send_packet(ports[0], ports[0], pktSize, received, vlan= , > promisc) > + self.send_packet(ports[0], ports[0], pktSize, received, vlan= , > vlan_strip, promisc) > return >=20 > - def send_packet(self, txPort, rxPort, pktSize=3D68, received=3DTrue, > vlan=3DFalse, promisc=3DFalse): > + def send_packet(self, txPort, rxPort, pktSize=3D68, received=3DTrue, > vlan=3DFalse, vlan_strip =3D False, promisc=3DFalse): > """ > Send packages according to parameters. > """ > @@ -138,7 +138,7 @@ class TestShutdownApi(TestCase): > # RRC will always strip rx/tx crc > rx_bytes_exp -=3D 4 > tx_bytes_exp -=3D 4 > - if vlan is True: > + if vlan_strip is True: > # RRC will always strip rx/tx vlan > rx_bytes_exp -=3D 4 > tx_bytes_exp -=3D 4 > @@ -146,8 +146,8 @@ class TestShutdownApi(TestCase): > # some NIC will always include tx crc > rx_bytes_exp -=3D 4 > tx_bytes_exp -=3D 4 > - if vlan is True: > - # vlan strip default is on > + if vlan_strip is True: > + # vlan strip default is off > tx_bytes_exp -=3D 4 >=20 > # fortville nic enable send lldp packet function when port setup > @@ -337,6 +337,7 @@ class TestShutdownApi(TestCase): > out =3D self.dut.send_expect("vlan set strip off all", "testpmd>= ") > if "fail" not in out: > for port in self.ports: > + self.dut.send_expect("vlan set filter on %d" % port, > "testpmd> ") > self.dut.send_expect("rx_vlan add 1 %d" % port, "testpmd= > > ") > self.dut.send_expect("set fwd mac", "testpmd>") > self.dut.send_expect("port start all", "testpmd> ", 100) > @@ -347,10 +348,15 @@ class TestShutdownApi(TestCase): > vlan_jumbo_size =3D jumbo_size + 4 > else: > vlan_jumbo_size =3D jumbo_size > - > - self.check_forwarding(pktSize=3Dvlan_jumbo_size - 1, vlan=3D= True) > - self.check_forwarding(pktSize=3Dvlan_jumbo_size, vlan=3DTrue= ) > - self.check_forwarding(pktSize=3Dvlan_jumbo_size + 1, > received=3DFalse, vlan=3DTrue) > + out =3D self.dut.send_expect("show port cap %d" % port, > "testpmd> ") > + state =3D re.findall("VLAN stripped:\s*([a-z]*)", out) > + if state[0] =3D=3D 'on': > + vlan_strip =3D True > + else: > + vlan_strip =3D False > + self.check_forwarding(vlan_strip, pktSize=3Dvlan_jumbo_size = - 1, > vlan=3DTrue) > + self.check_forwarding(vlan_strip, pktSize=3Dvlan_jumbo_size, > vlan=3DTrue) > + self.check_forwarding(vlan_strip, pktSize=3Dvlan_jumbo_size = + 1, > received=3DFalse, vlan=3DTrue) >=20 > self.dut.send_expect("stop", "testpmd> ") >=20 > -- > 1.9.3