From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A1E6C7D3A for ; Thu, 24 Aug 2017 07:00:15 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Aug 2017 22:00:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,419,1498546800"; d="scan'208";a="1209752276" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 23 Aug 2017 22:00:14 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 23 Aug 2017 22:00:13 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 23 Aug 2017 22:00:13 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.128]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.98]) with mapi id 14.03.0319.002; Thu, 24 Aug 2017 13:00:11 +0800 From: "Liu, Yong" To: "Xu, HuilongX" , "Xu, GangX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH V1] fix userspace failed case Thread-Index: AQHTG+5usX0RH4BQDEWV1e4eKiS3OKKS3zYA//9884CAAJZYIA== Date: Thu, 24 Aug 2017 05:00:11 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62E66660@SHSMSX101.ccr.corp.intel.com> References: <1503478919-86948-1-git-send-email-gangx.xu@intel.com> <86228AFD5BCD8E4EBFD2B90117B5E81E62E665E0@SHSMSX101.ccr.corp.intel.com> In-Reply-To: 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 05:00:16 -0000 Huilong,=20 Comments inline. Thanks. > -----Original Message----- > From: Xu, HuilongX > Sent: Thursday, August 24, 2017 11:57 AM > To: Liu, Yong ; Xu, GangX ; > dts@dpdk.org > Subject: RE: [dts] [PATCH V1] fix userspace failed case >=20 > Hi yong, > My comments as below. Could you check it? >=20 > -----Original Message----- > From: Liu, Yong > 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 >=20 > Thanks gang, few comments below. >=20 > > -----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 > > > > From: "xu,huilong" > > > > update list: > > 1. update userspace example path for setup app 2. add sleep time for > > app update link status with fortville nic in port config case 3. dpdk > > userspace tools dump eeprom file size different kernel ethtools dump, > > so only compare same size bytes 4. use scapy tool send packet replace > > packet model, because app can't received packet by use packet model > > > > Signed-off-by: xu,huilong > > --- > > tests/TestSuite_userspace_ethtool.py | 16 ++++++++++++---- > > 1 file changed, 12 insertions(+), 4 deletions(-) > > > > 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") > > > > - path =3D "./examples/ethtool/ethtool-app/ethtool-app/%s/ethtoo= l" % > > self.target > > + path =3D "./examples/ethtool/ethtool-app/%s/ethtool" % > > + self.target > > self.cmd =3D "%s -c f -n %d" % (path, > > self.dut.get_memory_channels()) > > > > # pause frame basic configuration @@ -370,7 +370,10 @@ class > > TestUserspaceEthtool(TestCase, > > IxiaPacketGenerator): > > self.dut.send_expect("ethtool --eeprom-dump %s raw on > > > %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 > > + kernel > > ethtool dump eeprom-dump, so only compare same size bytes > > + dpdk_eeprom_size =3D int(self.dut.send_expect('ls -all %s' > > + % > > portinfo['eeprom_file'], '# ').split(' ')[4].strip()) >=20 > 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 > stat command replace ls. Stat command is belong to GNU coreutils. "ls" also in the same package.=20 It will be fine to utilize stat command.=20 > > + self.dut.send_expect('dd if=3D%s of=3D%s bs=3D%d count=3D1= ' % > > (ethtool_eeprom, "ethtool_eeprom_%d_cat.bin" % index, > > dpdk_eeprom_size), > > "#") > > + portinfo['ethtool_eeprom'] =3D "ethtool_eeprom_%d_cat.bin" > > + % > > index > > # bind to original driver > > portinfo['net_dev'].bind_driver(portinfo['ori_driver']) > > > > @@ -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 > > set Rx ring parameter") > > self.verify(tx_ring =3D=3D tx_max, "Userspace tool failed = to > > 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 > > + packet > > by packet model > > + packet =3D > > r'sendp([Ether(dst=3D"ff:ff:ff:ff:ff:ff")/IP()/UDP()/Raw()], > > iface=3D"%s")' % intf > > + self.tester.scapy_append(packet) > > + self.tester.scapy_execute() >=20 > 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", > So I think not try again pkt with "ff:ff:ff:ff:ff:ff" destination mac > address. >=20 I'm wondering that if any bug in packet module which can cause this issue. packet module will call the same API as scapy cli. > pkt.config_layer('ether', {'dst': 'ff:ff:ff:ff:ff:ff'}) >=20 > > rx_pkts, tx_pkts =3D self.strip_portstats(index) > > self.verify(rx_pkts =3D=3D ori_rx_pkts + 1, "Failed to > > forward after ring parameter changed") > > self.dut.send_expect("quit", "# ") @@ -499,8 +504,11 @@ > > 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