test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Xiao, QimaiX" <qimaix.xiao@intel.com>
To: "dts@dpdk.org" <dts@dpdk.org>
Subject: Re: [dts] [PATCH V1]tests/TestSuite_hotplug: add virtio case for hotplug
Date: Thu, 2 Apr 2020 11:19:06 +0000	[thread overview]
Message-ID: <8800ae6b3bf3490dba394ba07a1ec3f7@intel.com> (raw)
In-Reply-To: <1585825584-433414-1-git-send-email-qimaix.xiao@intel.com>

[-- Attachment #1: Type: text/plain, Size: 4361 bytes --]

Tested-by: Xiao, QimaiX <qimaix.xiao@intel.com>

Regards,
Xiao Qimai


> -----Original Message-----
> From: Xiao, QimaiX
> Sent: Thursday, April 2, 2020 7:06 PM
> To: dts@dpdk.org
> Cc: Xiao, QimaiX <qimaix.xiao@intel.com>
> Subject: [dts][PATCH V1]tests/TestSuite_hotplug: add virtio case for hotplug
> 
> *. add virtio case for hotplug
> 
> Signed-off-by: Xiao Qimai <qimaix.xiao@intel.com>
> ---
>  tests/TestSuite_hotplug.py | 47
> ++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)
> 
> diff --git a/tests/TestSuite_hotplug.py b/tests/TestSuite_hotplug.py index
> 8a0d743..4af9957 100644
> --- a/tests/TestSuite_hotplug.py
> +++ b/tests/TestSuite_hotplug.py
> @@ -40,6 +40,7 @@ import re
>  import utils
>  from test_case import TestCase
>  from packet import Packet
> +import os
> 
>  class TestPortHotPlug(TestCase):
>      """
> @@ -144,6 +145,52 @@ class TestPortHotPlug(TestCase):
>          self.verify(int(sum_packet) == 1, "Insufficient the received package")
>          self.dut.send_expect("quit","#",60)
> 
> +    def test_port_detach_attach_for_vhost_user_virtio_user(self):
> +        vdev = "eth_vhost0,iface=vhost-net,queues=1"
> +        iface = "vhost-net1"
> +        path = self.dut.base_dir + os.path.sep + iface
> +        path = path.replace("~", "/root")
> +        self.dut.send_expect("rm -rf %s" % iface, "# ")
> +        cores = self.dut.get_core_list("all")
> +        self.verify(len(cores) > 8, "insufficient cores for this case")
> +        eal_param = self.dut.create_eal_parameters(no_pci=True,
> cores=cores[1:5], vdevs=[vdev], prefix="vhost")
> +        testpmd_cmd = "./%s/app/testpmd " % self.target + eal_param + ' -- -i'
> +        self.dut.send_expect(testpmd_cmd, "testpmd>", timeout=60)
> +        self.dut.send_expect("port stop 0", "testpmd>")
> +        self.dut.send_expect("port detach 0", "Device is detached")
> +        stats = self.dut.send_expect("ls %s" % path, "#", timeout=3,
> +                                   alt_session=True, verify=True)
> +        self.verify(stats==2, 'port detach failed')
> +        time.sleep(1)
> +        self.dut.send_expect("port attach eth_vhost1,iface=%s,queues=1" %
> iface, "Port 0 is attached.")
> +        self.dut.send_expect("port start 0", "testpmd>")
> +        out = self.dut.send_expect("ls %s" % path, "#", timeout=3,
> +                                   alt_session=True, verify=True)
> +        self.verify(iface in out , 'port attach failed')
> +
> +        self.session2 = self.dut.create_session(name="virtio_user")
> +        eal_param = self.dut.create_eal_parameters(no_pci=True,
> fixed_prefix="virtio1", cores=cores[5:9])
> +        testpmd_cmd2 = "%s/%s/app/testpmd " %
> (self.dut.base_dir,self.target) + eal_param + ' -- -i'
> +        self.session2.send_expect(testpmd_cmd2, "testpmd>", timeout=60)
> +        self.session2.send_expect("port attach
> net_virtio_user1,mac=00:01:02:03:04:05,path=%s,queues=1,packed_vq=1,m
> rg_rxbuf=1,in_order=0" % path, "testpmd")
> +        self.session2.send_expect("port start 0", "testpmd>", timeout=60)
> +        out = self.dut.send_expect("ls %s" % path, "#", timeout=3,
> +                                   alt_session=True, verify=True)
> +        self.verify(iface in out, 'port attach failed')
> +        self.dut.send_expect("start", "testpmd")
> +        self.session2.send_expect("start tx_first 32", "testpmd")
> +        out = self.session2.send_expect("show port stats 0", "testpmd")
> +        rx_pkts = int(re.search("RX-packets: (\d+)", out).group(1))
> +        tx_pkts = int(re.search("TX-packets: (\d+)", out).group(1))
> +        self.logger.info("rx packets: %d" % rx_pkts)
> +        self.logger.info("tx packets: %d" % tx_pkts)
> +        self.verify(rx_pkts != 0 and tx_pkts != 0, "not received packets or
> transport packets")
> +        self.session2.send_expect("show port stats 0", "testpmd", timeout=2)
> +        self.session2.send_expect("stop", "testpmd", timeout=2)
> +        self.session2.send_expect("quit", "#", timeout=2)
> +        self.dut.send_expect("stop", "testpmd", timeout=2)
> +        self.dut.send_expect("quit", "#", timeout=2)
> +        self.session2.close()
> 
>      def tear_down(self):
>          """
> --
> 1.8.3.1


[-- Attachment #2: TestPortHotPlug.log --]
[-- Type: application/octet-stream, Size: 5469 bytes --]

02/04/2020 19:11:09                            dts: 
TEST SUITE : TestPortHotPlug
02/04/2020 19:11:09                            dts: NIC :        fortville_spirit
02/04/2020 19:11:09              dut.10.240.183.61: 
02/04/2020 19:11:09                         tester: 
02/04/2020 19:11:09                TestPortHotPlug: Test Case test_port_detach_attach_for_vhost_user_virtio_user Begin
02/04/2020 19:11:09              dut.10.240.183.61: 
02/04/2020 19:11:09                         tester: 
02/04/2020 19:11:09              dut.10.240.183.61: ./usertools/dpdk-devbind.py -u 0000:af:00.1
02/04/2020 19:11:10              dut.10.240.183.61: 
02/04/2020 19:11:10              dut.10.240.183.61: rm -rf vhost-net1
02/04/2020 19:11:10              dut.10.240.183.61: 
02/04/2020 19:11:10              dut.10.240.183.61: ./x86_64-native-linuxapp-gcc/app/testpmd -l 2,3,4,5 -n 4   --file-prefix=vhost_433748_20200402191047 --no-pci --vdev eth_vhost0,iface=vhost-net,queues=1 -- -i
02/04/2020 19:11:10              dut.10.240.183.61: EAL: Detected 72 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/vhost_433748_20200402191047/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: Probing VFIO support...
EAL: VFIO support initialized
Interactive-mode selected
testpmd: create a new mbuf pool <mbuf_pool_socket_0>: n=171456, size=2176, socket=0
testpmd: preferred mempool ops selected: ring_mp_mc

Warning! port-topology=paired and odd forward ports number, the last port will pair with itself.

Configuring Port 0 (socket 0)
VHOST_CONFIG: vhost-user server: socket created, fd: 32
VHOST_CONFIG: bind to vhost-net
Port 0: 56:48:4F:53:54:00
Checking link statuses...
Done
Error during enabling promiscuous mode for port 0: Operation not supported - ignore
02/04/2020 19:11:10              dut.10.240.183.61: port stop 0
02/04/2020 19:11:11              dut.10.240.183.61: port stop 0
Stopping ports...
Checking link statuses...
Done
02/04/2020 19:11:11              dut.10.240.183.61: port detach 0
02/04/2020 19:11:11              dut.10.240.183.61: port detach 0
Port was not closed
Removing a device...
02/04/2020 19:11:11              dut.10.240.183.61: Command: ls /root/dpdk/vhost-net1 failure!
02/04/2020 19:11:11              dut.10.240.183.61: ls: cannot access '/root/dpdk/vhost-net1': No such file or directory
02/04/2020 19:11:12              dut.10.240.183.61: port attach eth_vhost1,iface=vhost-net1,queues=1
02/04/2020 19:11:12              dut.10.240.183.61: port attach eth_vhost1,iface=vhost-net1,queues=1
Attaching a new port...
Error during enabling promiscuous mode for port 0: Operation not supported - ignore
02/04/2020 19:11:12              dut.10.240.183.61: port start 0
02/04/2020 19:11:12              dut.10.240.183.61: port start 0
Configuring Port 0 (socket 0)
VHOST_CONFIG: vhost-user server: socket created, fd: 32
VHOST_CONFIG: bind to vhost-net1
Port 0: 56:48:4F:53:54:00
Checking link statuses...
Done
02/04/2020 19:11:15              dut.10.240.183.61: start
02/04/2020 19:11:15              dut.10.240.183.61: start
io packet forwarding - ports=1 - cores=1 - streams=1 - NUMA support enabled, MP allocation mode: native
Logical Core 3 (socket 0) forwards packets on 1 streams:
  RX P=0/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00

  io packet forwarding packets/burst=32
  nb forwarding cores=1 - nb forwarding ports=1
  port 0: RX queue number: 1 Tx queue number: 1
    Rx offloads=0x0 Tx offloads=0x0
    RX queue: 0
      RX desc=0 - RX free threshold=0
      RX threshold registers: pthresh=0 hthresh=0  wthresh=0
      RX Offloads=0x0
    TX queue: 0
      TX desc=0 - TX free threshold=0
      TX threshold registers: pthresh=0 hthresh=0  wthresh=0
      TX offloads=0x0 - TX RS bit threshold=0
02/04/2020 19:11:15                TestPortHotPlug: rx packets: 827888
02/04/2020 19:11:15                TestPortHotPlug: tx packets: 828716
02/04/2020 19:11:16              dut.10.240.183.61: stop
02/04/2020 19:11:16              dut.10.240.183.61: stop
Telling cores to stop...
Waiting for lcores to finish...

  ---------------------- Forward statistics for port 0  ----------------------
  RX-packets: 2509568        RX-dropped: 0             RX-total: 2509568
  TX-packets: 2508800        TX-dropped: 768           TX-total: 2509568
  ----------------------------------------------------------------------------

  +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
  RX-packets: 2509568        RX-dropped: 0             RX-total: 2509568
  TX-packets: 2508800        TX-dropped: 768           TX-total: 2509568
  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Done.
02/04/2020 19:11:16              dut.10.240.183.61: quit
02/04/2020 19:11:17              dut.10.240.183.61: quit

Stopping port 0...
Stopping ports...
Done

Shutting down port 0...
Closing ports...
Done

Bye...
02/04/2020 19:11:17                TestPortHotPlug: Test Case test_port_detach_attach_for_vhost_user_virtio_user Result PASSED:
02/04/2020 19:11:17              dut.10.240.183.61: kill_all: called by dut and prefix list has value.
02/04/2020 19:11:18              dut.10.240.183.61: ./usertools/dpdk-devbind.py --bind=igb_uio 0000:af:00.1
02/04/2020 19:11:19              dut.10.240.183.61: 
02/04/2020 19:11:21                            dts: 
TEST SUITE ENDED: TestPortHotPlug

  reply	other threads:[~2020-04-02 11:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02 11:06 Xiao Qimai
2020-04-02 11:19 ` Xiao, QimaiX [this message]
2020-04-02 14:14   ` Wang, Yinan
2020-04-17  8:58 ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8800ae6b3bf3490dba394ba07a1ec3f7@intel.com \
    --to=qimaix.xiao@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).