From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 3E2547D30 for ; Thu, 24 Aug 2017 05:57:19 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP; 23 Aug 2017 20:57:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,419,1498546800"; d="scan'208";a="143323829" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga005.fm.intel.com with ESMTP; 23 Aug 2017 20:57:18 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 23 Aug 2017 20:57:16 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 23 Aug 2017 20:57:16 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.128]) by shsmsx102.ccr.corp.intel.com ([169.254.2.183]) with mapi id 14.03.0319.002; Thu, 24 Aug 2017 11:57:14 +0800 From: "Xu, HuilongX" To: "Liu, Yong" , "Xu, GangX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH V1] fix userspace failed case Thread-Index: AQHTG+5UA6pEWPBH102SmsKKdpsTBqKSWl+AgACGmmA= Date: Thu, 24 Aug 2017 03:57:13 +0000 Message-ID: References: <1503478919-86948-1-git-send-email-gangx.xu@intel.com> <86228AFD5BCD8E4EBFD2B90117B5E81E62E665E0@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <86228AFD5BCD8E4EBFD2B90117B5E81E62E665E0@SHSMSX101.ccr.corp.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: 10.0.102.7 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] fix userspace failed case 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, 24 Aug 2017 03:57:20 -0000 Hi yong, My comments as below. Could you check it? -----Original Message----- From: Liu, Yong=20 Sent: Thursday, August 24, 2017 11:51 AM To: Xu, GangX ; dts@dpdk.org Cc: Xu, HuilongX Subject: RE: [dts] [PATCH V1] fix userspace failed case Thanks gang, few comments below. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,gang > Sent: Wednesday, August 23, 2017 5:02 PM > To: dts@dpdk.org > Cc: Xu, HuilongX > Subject: [dts] [PATCH V1] fix userspace failed case >=20 > From: "xu,huilong" >=20 > update list: > 1. update userspace example path for setup app 2. add sleep time for=20 > app update link status with fortville nic in port config case 3. dpdk=20 > userspace tools dump eeprom file size different kernel ethtools dump,=20 > so only compare same size bytes 4. use scapy tool send packet replace=20 > packet model, because app can't received packet by use packet model >=20 > Signed-off-by: xu,huilong > --- > tests/TestSuite_userspace_ethtool.py | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) >=20 > diff --git a/tests/TestSuite_userspace_ethtool.py > b/tests/TestSuite_userspace_ethtool.py > index 937a9e5..1b234c1 100644 > --- a/tests/TestSuite_userspace_ethtool.py > +++ b/tests/TestSuite_userspace_ethtool.py > @@ -61,7 +61,7 @@ class TestUserspaceEthtool(TestCase, > IxiaPacketGenerator): > self.verify("Error" not in out, "compilation error 1") > self.verify("No such file" not in out, "compilation error 2") >=20 > - path =3D "./examples/ethtool/ethtool-app/ethtool-app/%s/ethtool"= % > self.target > + path =3D "./examples/ethtool/ethtool-app/%s/ethtool" %=20 > + self.target > self.cmd =3D "%s -c f -n %d" % (path, > self.dut.get_memory_channels()) >=20 > # pause frame basic configuration @@ -370,7 +370,10 @@ class=20 > TestUserspaceEthtool(TestCase, > IxiaPacketGenerator): > self.dut.send_expect("ethtool --eeprom-dump %s raw on >=20 > %s" % (intf, ethtool_eeprom), "# ") > # wait for file ready > time.sleep(2) > - portinfo['ethtool_eeprom'] =3D ethtool_eeprom > + # dpdk userspace dump eeprom-dump size different with=20 > + kernel > ethtool dump eeprom-dump, so only compare same size bytes > + dpdk_eeprom_size =3D int(self.dut.send_expect('ls -all %s'=20 > + % > portinfo['eeprom_file'], '# ').split(' ')[4].strip()) There is one more simple command to get file size. "stat -c %s" Stat command is default tools in all linux os?, if yes, I think can use sta= t command replace ls. > + self.dut.send_expect('dd if=3D%s of=3D%s bs=3D%d count=3D1' = % > (ethtool_eeprom, "ethtool_eeprom_%d_cat.bin" % index,=20 > dpdk_eeprom_size), > "#") > + portinfo['ethtool_eeprom'] =3D "ethtool_eeprom_%d_cat.bin"=20 > + % > index > # bind to original driver > portinfo['net_dev'].bind_driver(portinfo['ori_driver']) >=20 > @@ -394,10 +397,12 @@ class TestUserspaceEthtool(TestCase, > IxiaPacketGenerator): > rx_ring, _, tx_ring, _ =3D self.strip_ringparam(index) > self.verify(rx_ring =3D=3D rx_max, "Userspace tool failed to= =20 > set Rx ring parameter") > self.verify(tx_ring =3D=3D tx_max, "Userspace tool failed to= =20 > set Tx ring parameter") > - pkt =3D Packet() > tester_port =3D self.tester.get_local_port(port) > intf =3D self.tester.get_interface(tester_port) > - pkt.send_pkt(tx_port=3Dintf) > + # use scapy send packet, because example can't receive=20 > + packet > by packet model > + packet =3D > r'sendp([Ether(dst=3D"ff:ff:ff:ff:ff:ff")/IP()/UDP()/Raw()],=20 > iface=3D"%s")' % intf > + self.tester.scapy_append(packet) > + self.tester.scapy_execute() The only difference I can see is the destination mac address. Could you please try again with below code? I review packet mode, if destination mac address not set in packet mode. Packet model will set default destination mac address is "ff:ff:ff:ff:ff:ff= ",=20 So I think not try again pkt with "ff:ff:ff:ff:ff:ff" destination mac addre= ss. pkt.config_layer('ether', {'dst': 'ff:ff:ff:ff:ff:ff'}) > rx_pkts, tx_pkts =3D self.strip_portstats(index) > self.verify(rx_pkts =3D=3D ori_rx_pkts + 1, "Failed to=20 > forward after ring parameter changed") > self.dut.send_expect("quit", "# ") @@ -499,8 +504,11 @@=20 > class TestUserspaceEthtool(TestCase, > IxiaPacketGenerator): > for index in range(len(self.ports)): > port =3D self.ports[index] > ori_rx_pkts, _ =3D self.strip_portstats(index) > + # add sleep time for example update port link status > + time.sleep(10) > # stop port > self.dut.send_expect("stop %d" % index, "EthApp>") > + time.sleep(10) > # check packet not forwarded when port is stop > pkt =3D Packet() > tester_port =3D self.tester.get_local_port(port) > -- > 1.9.3