From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 5D0207D3E for ; Thu, 24 Aug 2017 07:41:55 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Aug 2017 22:41:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,419,1498546800"; d="scan'208";a="303827289" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga004.fm.intel.com with ESMTP; 23 Aug 2017 22:41:55 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 23 Aug 2017 22:41:54 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 23 Aug 2017 22:41:54 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.128]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.117]) with mapi id 14.03.0319.002; Thu, 24 Aug 2017 13:41:52 +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+AgACGmmD//4zIgIAAjzGA Date: Thu, 24 Aug 2017 05:41:51 +0000 Message-ID: References: <1503478919-86948-1-git-send-email-gangx.xu@intel.com> <86228AFD5BCD8E4EBFD2B90117B5E81E62E665E0@SHSMSX101.ccr.corp.intel.com> <86228AFD5BCD8E4EBFD2B90117B5E81E62E66660@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <86228AFD5BCD8E4EBFD2B90117B5E81E62E66660@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 05:41:56 -0000 Hi, yong, Two comments as below, 1. use stat tools replace ls in next version 2. for use scapy replace packet mode. In this case, send packet very simple. We should use scapy default inte= rface for send packet. Because it very steady, the log is clearness and friendly, the functi= on interface in tester mode very simple also. Thanks a lot -----Original Message----- From: Liu, Yong=20 Sent: Thursday, August 24, 2017 1:00 PM To: Xu, HuilongX ; Xu, GangX ; d= ts@dpdk.org Subject: RE: [dts] [PATCH V1] fix userspace failed case Huilong, Comments inline. Thanks. > -----Original Message----- > From: Xu, HuilongX > Sent: Thursday, August 24, 2017 11:57 AM > To: Liu, Yong ; Xu, GangX ;=20 > 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=20 > > app update link status with fortville nic in port config case 3.=20 > > dpdk userspace tools dump eeprom file size different kernel ethtools=20 > > dump, so only compare same size bytes 4. use scapy tool send packet=20 > > replace packet model, because app can't received packet by use=20 > > 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=20 > > 2") > > > > - path =3D "./examples/ethtool/ethtool-app/ethtool-app/%s/ethtoo= l" % > > 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()) > > > > # pause frame basic configuration @@ -370,7 +370,10 @@=20 > > class 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' > > + % > > 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=20 > 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,=20 > > 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= =20 > > to set Rx ring parameter") > > self.verify(tx_ring =3D=3D tx_max, "Userspace tool failed= =20 > > 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=20 > > + 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=20 > "ff:ff:ff:ff:ff:ff", So I think not try again pkt with=20 > "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=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