From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id E12B07D3E for ; Thu, 24 Aug 2017 08:17:56 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Aug 2017 23:17:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,420,1498546800"; d="scan'208";a="1007117184" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 23 Aug 2017 23:17:55 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 23 Aug 2017 23:17:54 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 23 Aug 2017 23:17:54 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.128]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Thu, 24 Aug 2017 14:17:37 +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//9+n4CAAIdY4A== Date: Thu, 24 Aug 2017 06:17:36 +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> <86228AFD5BCD8E4EBFD2B90117B5E81E62E66723@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <86228AFD5BCD8E4EBFD2B90117B5E81E62E66723@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 06:17:58 -0000 Hi yong, Yes, you are right, but for function test, we only should send/analyze some= packets(most of the time, we only send one packet)=20 For performance test, we need send packet stream and set send packet line r= ate by ixia/trex or other tools. But whether use any tools, we should Use unify interface, and the unify interface must use send packet tools sup= plied default interface, not develop a new interface. Eg, set line rate fun= ction, In our unify interface maye is set_line_rate, but set_line_rate will use ix= ia_set_line_rate or trex_set_line_rate, not develop a new ixia_set_line_rat= e or trex_line_rate. Now packet mode in framework we use scapy internal fun= ction for build packet and send packet, it is the root case why packet mode= not stable. If we need use packet mode send packet for function, I think we can re-deve= lop packet model. In new packet mode, we can use send_packet for send packe= t. But send_packet shoud call sendp function from scpay, when use scapy, use= ixia_send_packet when use ixia. Thanks a lot -----Original Message----- From: Liu, Yong=20 Sent: Thursday, August 24, 2017 1:50 PM To: Xu, HuilongX ; Xu, GangX ; d= ts@dpdk.org Subject: RE: [dts] [PATCH V1] fix userspace failed case > -----Original Message----- > From: Xu, HuilongX > Sent: Thursday, August 24, 2017 1:42 PM > To: Liu, Yong ; Xu, GangX ;=20 > dts@dpdk.org > Subject: RE: [dts] [PATCH V1] fix userspace failed case >=20 > Hi, yong, > Two comments as below, > 1. use stat tools replace ls in next version 2. for use scapy replace=20 > packet mode. > In this case, send packet very simple. We should use scapy default=20 > interface for send packet. > Because it very steady, the log is clearness and friendly, the=20 > function interface in tester mode very simple also. Agree with you, send/analyze packets by scapy is very simple. But packet module is also very easy to use in transmission side.=20 Just two lines of code is needed. My option is that we should fix issue in = the module rather than just skip it. And I prefer that packet module to be the default method. The reason is tha= t we can used it for other kinds generator like Trex/Ixia later. > Thanks a lot > -----Original Message----- > From: Liu, Yong > Sent: Thursday, August 24, 2017 1:00 PM > To: Xu, HuilongX ; Xu, GangX=20 > ; dts@dpdk.org > Subject: RE: [dts] [PATCH V1] fix userspace failed case >=20 > Huilong, > Comments inline. Thanks. >=20 > > -----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 > > > > Hi yong, > > My comments as below. Could you check it? > > > > -----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 > > > > 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 > > > > > > From: "xu,huilong" > > > > > > update list: > > > 1. update userspace example path for setup app 2. add sleep time=20 > > > for app update link status with fortville nic in port config case 3. > > > dpdk userspace tools dump eeprom file size different kernel=20 > > > ethtools dump, so only compare same size bytes 4. use scapy tool=20 > > > send packet replace packet model, because app can't received=20 > > > 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/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()) > > > > > > # 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()) > > > > 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. >=20 > Stat command is belong to GNU coreutils. "ls" also in the same package. > 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.bi= n" > > > + % > > > index > > > # bind to original driver > > > =20 > > > 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 faile= d=20 > > > to set Rx ring parameter") > > > self.verify(tx_ring =3D=3D tx_max, "Userspace tool faile= d=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=20 > > > + 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() > > > > 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. >=20 > > 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