[dts] [PATCH V1] fix userspace failed case

Liu, Yong yong.liu at intel.com
Thu Aug 24 08:25:32 CEST 2017


Huilong,
First, "scapy internal function for build packet and send packet" is not the root cause for stable issue.
Scapy command line will call the same function.
Second, IXIA and Trex can do function test as they can transmit/sniff packets. There's one requirement that do function/performance cases in the same setup.

At last, let's close this discussion for it can't help us figure out what's the root cause.

Thanks,
Marvin

> -----Original Message-----
> From: Xu, HuilongX
> Sent: Thursday, August 24, 2017 2:18 PM
> To: Liu, Yong <yong.liu at intel.com>; Xu, GangX <gangx.xu at intel.com>;
> dts at dpdk.org
> Subject: RE: [dts] [PATCH V1] fix userspace failed case
> 
> 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)
> For performance test, we need send packet stream and set send packet line
> rate 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
> supplied default interface, not develop a new interface. Eg, set line rate
> function,
> In our unify interface maye is set_line_rate, but set_line_rate will use
> ixia_set_line_rate or trex_set_line_rate, not develop a new
> ixia_set_line_rate or trex_line_rate. Now packet mode in framework we use
> scapy internal function 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-
> develop packet model. In new packet mode, we can use send_packet for send
> packet.
> 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
> Sent: Thursday, August 24, 2017 1:50 PM
> To: Xu, HuilongX <huilongx.xu at intel.com>; Xu, GangX <gangx.xu at intel.com>;
> dts at 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 <yong.liu at intel.com>; Xu, GangX <gangx.xu at intel.com>;
> > dts at dpdk.org
> > Subject: RE: [dts] [PATCH V1] fix userspace failed case
> >
> > 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
> > interface for send packet.
> >     Because it very steady, the  log is clearness and friendly,  the
> > 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.
> 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
> that 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 <huilongx.xu at intel.com>; Xu, GangX
> > <gangx.xu at intel.com>; dts at 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 <yong.liu at intel.com>; Xu, GangX <gangx.xu at intel.com>;
> > > dts at 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 <gangx.xu at intel.com>; dts at dpdk.org
> > > Cc: Xu, HuilongX <huilongx.xu at intel.com>
> > > Subject: RE: [dts] [PATCH V1] fix userspace failed case
> > >
> > > Thanks gang, few comments below.
> > >
> > > > -----Original Message-----
> > > > From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of xu,gang
> > > > Sent: Wednesday, August 23, 2017 5:02 PM
> > > > To: dts at dpdk.org
> > > > Cc: Xu, HuilongX <huilongx.xu at intel.com>
> > > > Subject: [dts] [PATCH V1] fix userspace failed case
> > > >
> > > > From: "xu,huilong" <huilongx.xu at intel.com>
> > > >
> > > > 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 <huilongx.xu at intel.com>
> > > > ---
> > > >  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 = "./examples/ethtool/ethtool-app/ethtool-
> > app/%s/ethtool" %
> > > > self.target
> > > > +        path = "./examples/ethtool/ethtool-app/%s/ethtool" %
> > > > + self.target
> > > >          self.cmd = "%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'] = ethtool_eeprom
> > > > +            # dpdk userspace dump eeprom-dump size different with
> > > > + kernel
> > > > ethtool dump eeprom-dump, so only compare same size bytes
> > > > +            dpdk_eeprom_size = 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
> > > use stat command replace ls.
> >
> > Stat command is belong to GNU coreutils. "ls" also in the same package.
> > It will be fine to utilize stat command.
> >
> > > > +            self.dut.send_expect('dd if=%s of=%s bs=%d count=1' %
> > > > (ethtool_eeprom, "ethtool_eeprom_%d_cat.bin" % index,
> > > > dpdk_eeprom_size),
> > > > "#")
> > > > +            portinfo['ethtool_eeprom'] =
> "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, _ = self.strip_ringparam(index)
> > > >              self.verify(rx_ring == rx_max, "Userspace tool failed
> > > > to set Rx ring parameter")
> > > >              self.verify(tx_ring == tx_max, "Userspace tool failed
> > > > to set Tx ring parameter")
> > > > -            pkt = Packet()
> > > >              tester_port = self.tester.get_local_port(port)
> > > >              intf = self.tester.get_interface(tester_port)
> > > > -            pkt.send_pkt(tx_port=intf)
> > > > +            # use scapy send packet, because example can't
> > > > + receive packet
> > > > by packet model
> > > > +            packet =
> > > > r'sendp([Ether(dst="ff:ff:ff:ff:ff:ff")/IP()/UDP()/Raw()],
> > > > iface="%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", So I think not try again pkt with
> > > "ff:ff:ff:ff:ff:ff" destination mac address.
> > >
> >
> > 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'})
> > >
> > > >              rx_pkts, tx_pkts = self.strip_portstats(index)
> > > >              self.verify(rx_pkts == 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 = self.ports[index]
> > > >              ori_rx_pkts, _ = 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 = Packet()
> > > >              tester_port = self.tester.get_local_port(port)
> > > > --
> > > > 1.9.3



More information about the dts mailing list