From: Nannan Lu <nannan.lu@intel.com>
To: dts@dpdk.org
Cc: Nannan Lu <nannan.lu@intel.com>
Subject: [dts] [PATCH V1] test_plans: add test plan port controls
Date: Fri, 6 Dec 2019 15:56:57 +0000 [thread overview]
Message-ID: <20191206155657.70413-1-nannan.lu@intel.com> (raw)
Signed-off-by: Nannan Lu <nannan.lu@intel.com>
---
test_plans/port_control_test_plan.rst | 257 ++++++++++++++++++++++++++
1 file changed, 257 insertions(+)
create mode 100644 test_plans/port_control_test_plan.rst
diff --git a/test_plans/port_control_test_plan.rst b/test_plans/port_control_test_plan.rst
new file mode 100644
index 0000000..2fca8fd
--- /dev/null
+++ b/test_plans/port_control_test_plan.rst
@@ -0,0 +1,257 @@
+.. Copyright (c) <2019>, Intel Corporation
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ - Neither the name of Intel Corporation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+
+==================
+Port Control Tests
+==================
+
+
+Prerequisites
+=============
+
+1. Hardware:
+
+ * Fortville
+ * Niantic
+ * Columbiaville
+ * i350 NIC
+ * e1000 emulated device
+
+
+Test Case: pf start/stop/reset/close
+====================================
+
+1. Bind the port to dpdk driver::
+
+ ./usertools/dpdk-devbind.py -b igb_uio 18:00.2
+
+2. Run testpmd::
+
+ ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xff -n 4 -- -i
+
+ testpmd> set fwd mac
+ testpmd> start
+
+ check port info::
+
+ testpmd> show port info all
+
+ ********************* Infos for port 0 *********************
+ Link status: up
+ Link speed: 1000 Mbps
+
+ verify that the link status is up.
+
+ Using scapy to send 1000 random packets from tester,
+ verify the packets can be received and can be forwarded::
+
+ scapy
+ >>>sendp([Ether(dst="00:11:22:33:44:11")/IP()/Raw('x'*40)], \
+ iface="enp27s0f2",count=1000)
+
+3. Stop and start port::
+
+ testpmd> stop
+ testpmd> port stop all
+ testpmd> show port info all
+
+ ********************* Infos for port 0 *********************
+ Link status: down
+ Link speed: 0 Mbps
+
+ verify that the link status is down.
+
+ Then start the port::
+
+ testpmd> port start all
+ testpmd> start
+
+ check port info::
+
+ testpmd> show port info all
+
+ ********************* Infos for port 0 *********************
+ Link status: up
+ Link speed: 10000 Mbps
+
+ verify that the link status is up.
+
+ Send the same 1000 packets with scapy from tester,
+ verify the packets can be received and forwarded.
+
+4. Reset the port, run the commands::
+
+ testpmd> stop
+ testpmd> port stop all
+ testpmd> port reset all
+ testpmd> show port info all
+
+ ********************* Infos for port 0 *********************
+ Link status: down
+ Link speed: 0 Mbps
+
+ verify that the link status is down.
+
+ Then start the port::
+
+ testpmd> port start all
+ testpmd> start
+
+ check port info::
+
+ testpmd> show port info all
+
+ ********************* Infos for port 0 *********************
+ Link status: up
+ Link speed: 10000 Mbps
+
+ verify that the link status is up.
+ Send the same 1000 packets with scapy from tester,
+ verify the packets can be received and forwarded.
+
+5. Close the port, run the commands::
+
+ testpmd> stop
+ testpmd> port stop all
+ testpmd> port close all
+
+ check the port info::
+
+ testpmd> show port info all
+ testpmd>
+
+ verify that there is no output after executing this command.
+
+
+Test Case: e1000 emulated device start/stop/reset/close
+=======================================================
+
+1. Set up qemu environment
+
+ Virtual an e1000 emulated device in vm, then start
+ vm with the following command::
+
+ qemu-system-x86_64 -enable-kvm -m 16G -vnc :20 \
+ -smp cores=10,sockets=1 -cpu host -hda ./u18.img \
+ -device e1000,netdev=net1,mac=00:01:02:33:44:22 \
+ -netdev user,id=net1,hostfwd=tcp:10.67.119.144:6666-:22 \
+ -device e1000,netdev=net2,mac=00:01:02:33:44:33 \
+ -netdev user,id=net2,hostfwd=tcp:10.67.119.144:7777-:23 \
+ -monitor stdio
+
+ Login vm, get the pci device id of the e1000 emulated device,
+ assume it is 0000:00:03.0, bind it to igb_uio driver, and then
+ start testpmd::
+
+ ./usertools/dpdk-devbind.py -b igb_uio 0000:00:03.0
+ ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xf -n 4 -- -i
+
+ testpmd-> set fwd mac
+ testpmd-> start
+
+ check port info::
+
+ testpmd> show port info all
+
+ ********************* Infos for port 0 *********************
+ Link status: up
+ Link speed: 1000 Mbps
+
+ verify that the link status is up.
+
+2. Stop and start port (not support)::
+
+ testpmd> stop
+ testpmd> port stop all
+ testpmd> show port info all
+
+ ********************* Infos for port 0 *********************
+ Link status: down
+ Link speed: 0 Mbps
+
+ verify that the link status is down.
+
+ Then start the port::
+
+ testmd-> port start all
+ testpmd> start
+
+ check the port info::
+
+ testpmd> show port info all
+
+ ********************* Infos for port 0 *********************
+ Link status: up
+ Link speed: 10000 Mbps
+
+ verify that the link status is up.
+
+3. Reset the port (not support)::
+
+ testpmd> stop
+ testpmd> port stop all
+ testpmd> port reset all
+ testpmd> show port info all
+
+ ********************* Infos for port 0 *********************
+ Link status: down
+ Link speed: 0 Mbps
+
+ verify that the link status is down.
+
+ Then start the port::
+
+ testpmd> port start all
+ testpmd> start
+
+ check the port info::
+
+ testpmd> show port info all
+
+ ********************* Infos for port 0 *********************
+ Link status: up
+ Link speed: 10000 Mbps
+
+ verify that the link status is up.
+
+4. Close the port::
+
+ testpmd> stop
+ testpmd> port stop all
+ testpmd> port close all
+
+ check the port info::
+
+ testpmd> show port info all
+ testpmd>
+
+ verify that there is no output after executing this command.
--
2.17.1
next reply other threads:[~2019-12-06 8:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-06 15:56 Nannan Lu [this message]
2019-12-19 7:54 ` 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=20191206155657.70413-1-nannan.lu@intel.com \
--to=nannan.lu@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).