summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Liu <yong.liu@intel.com>2017-08-25 22:12:52 +0800
committerMarvin Liu <yong.liu@intel.com>2017-08-25 22:12:52 +0800
commit7650dd07f3340518d268802c697ef241899ac110 (patch)
tree1e4c73f8e3de2fb38a386e96ecf558f60e52ad6d
parente12ed169b2b0bab3f0947525ef1d49756d217f6c (diff)
parentdfc0dffe3cab24e1ea25321f90fe514f1a73007c (diff)
downloaddts-7650dd07f3340518d268802c697ef241899ac110.zip
dts-7650dd07f3340518d268802c697ef241899ac110.tar.gz
dts-7650dd07f3340518d268802c697ef241899ac110.tar.xz
Merge branch 'master' into v17.08
-rwxr-xr-xframework/packet.py14
-rw-r--r--test_plans/kni_test_plan.rst4
-rw-r--r--test_plans/multiple_pthread_test_plan.rst4
-rw-r--r--test_plans/ptpclient_test_plan.rst14
-rw-r--r--test_plans/qinq_filter_test_plan.rst23
-rw-r--r--test_plans/vf_kernel_test_plan.rst154
-rw-r--r--test_plans/vf_pf_reset_test_plan.rst2
-rw-r--r--tests/TestSuite_hotplug.py21
-rw-r--r--tests/TestSuite_ieee1588.py50
-rw-r--r--tests/TestSuite_pmd.py24
-rw-r--r--tests/TestSuite_tx_preparation.py15
-rw-r--r--tests/TestSuite_userspace_ethtool.py10
12 files changed, 201 insertions, 134 deletions
diff --git a/framework/packet.py b/framework/packet.py
index 924fd5e..e9a1c41 100755
--- a/framework/packet.py
+++ b/framework/packet.py
@@ -351,7 +351,21 @@ class scapy(object):
def send_pkt(self, intf='', count=1):
self.print_summary()
+
if intf != '':
+ # wait few seconds for link ready
+ countdown = 600
+ while countdown:
+ link_st = subprocess.check_output("ip link show %s" % intf,
+ stderr=subprocess.STDOUT,
+ shell=True)
+ if "LOWER_UP" in link_st:
+ break
+ else:
+ time.sleep(0.01)
+ countdown -= 1
+ continue
+
# fix fortville can't receive packets with 00:00:00:00:00:00
if self.pkt.getlayer(0).src == "00:00:00:00:00:00":
self.pkt.getlayer(0).src = get_if_hwaddr(intf)
diff --git a/test_plans/kni_test_plan.rst b/test_plans/kni_test_plan.rst
index 2f1b65b..fc10f5e 100644
--- a/test_plans/kni_test_plan.rst
+++ b/test_plans/kni_test_plan.rst
@@ -560,7 +560,7 @@ The application is launched and the bridge is setup using the commands below::
./build/app/kni -c <Core mask> -n 4 -- -P -p <Port mask> --config="<Ports/Cores configuration>" &
ifconfig vEth2_0 192.170.2.1
- ifconfig vEth2_0 192.170.3.1
+ ifconfig vEth3_0 192.170.3.1
route add -net 192.170.2.0 netmask 255.255.255.0 gw 192.170.2.1
route add -net 192.170.3.0 netmask 255.255.255.0 gw 192.170.3.1
arp -s 192.170.2.2 vEth2_0
@@ -593,7 +593,7 @@ Set up the interfaces and the bridge::
echo 1 > /proc/sys/net/ipv4/ip_forward
rmmod rte_kni
ifconfig vEth2_0 192.170.2.1
- ifconfig vEth2_0 192.170.3.1
+ ifconfig vEth3_0 192.170.3.1
route add -net 192.170.2.0 netmask 255.255.255.0 gw 192.170.2.1
route add -net 192.170.3.0 netmask 255.255.255.0 gw 192.170.3.1
arp -s 192.170.2.2 vEth2_0
diff --git a/test_plans/multiple_pthread_test_plan.rst b/test_plans/multiple_pthread_test_plan.rst
index 4deeb1a..8dad22d 100644
--- a/test_plans/multiple_pthread_test_plan.rst
+++ b/test_plans/multiple_pthread_test_plan.rst
@@ -46,7 +46,7 @@ etc of a collection of processes. Now, it's focus on the CPU usage.
Prerequisites
-------------
Support igb_uio driver, kernel is 3.11+.
-Use "modeprobe uio" "modprobe igb_uio" and then
+Use "modprobe uio" "modprobe igb_uio" and then
use "./tools/dpdk_nic_bind.py --bind=igb_uio device_bus_id" to bind the ports.
Assuming that an Intel's DPDK build has been set up and the testpmd
@@ -78,7 +78,7 @@ which means start 9 EAL thread::
Test Case 1: Basic operation
----------------------------
-To run the application, start the testpmd with the lcoress all running with
+To run the application, start the testpmd with the lcores all running with
threads and also the unique core assigned, command as follows::
./x86_64-native-linuxapp-gcc/app/testpmd --lcores='0@8,(4-5)@9' -n 4 -- -i
diff --git a/test_plans/ptpclient_test_plan.rst b/test_plans/ptpclient_test_plan.rst
index c41cefd..7e349b5 100644
--- a/test_plans/ptpclient_test_plan.rst
+++ b/test_plans/ptpclient_test_plan.rst
@@ -48,9 +48,13 @@ The sample should be validated on Forville, Niantic and i350 Nics.
Test case: ptp client
======================
Start ptp server on tester with IEEE 802.3 network transport::
+
ptp4l -i p785p1 -2 -m
+
Start ptp client on DUT and wait few seconds::
+
./examples/ptpclient/build/ptpclient -c f -n 3 -- -T 0 -p 0x1
+
Check that output message contained T1,T2,T3,T4 clock and time difference
between master and slave time is about 10us in niantic, 20us in Fortville,
8us in i350.
@@ -58,16 +62,22 @@ between master and slave time is about 10us in niantic, 20us in Fortville,
Test case: update system
========================
Reset DUT clock to initial time and make sure system time has been changed::
+
date -s "1970-01-01 00:00:00"
+
Strip DUT and tester board system time::
+
date +"%s.%N"
+
Start ptp server on tester with IEEE 802.3 network transport::
+
ptp4l -i p785p1 -2 -m -S
+
Start ptp client on DUT and wait few seconds::
+
./examples/ptpclient/build/ptpclient -c f -n 3 -- -T 1 -p 0x1
+
Make sure DUT system time has been changed to same as tester.
Check that output message contained T1,T2,T3,T4 clock and time difference
between master and slave time is about 10us in niantic, 20us in Fortville,
8us in i350.
-
-
diff --git a/test_plans/qinq_filter_test_plan.rst b/test_plans/qinq_filter_test_plan.rst
index 516c167..fc2aef8 100644
--- a/test_plans/qinq_filter_test_plan.rst
+++ b/test_plans/qinq_filter_test_plan.rst
@@ -57,6 +57,7 @@ Testpmd configuration - 4 RX/TX queues per port
#. set up testpmd with fortville NICs::
./x86_64-native-linuxapp-gcc/app/testpmd -c 0x1f -n 4 -- -i --rxq=4 --txq=4 --txqflags=0x0 --disable-rss
+
#. enable qinq::
testpmd command: vlan set qinq on 0
@@ -75,19 +76,21 @@ Testpmd configuration - 4 RX/TX queues per port
tester Configuration
--------------------
-
+
#. send dual vlan packet with scapy, verify it can be recognized as qinq packet::
+
sendp([Ether(dst="3C:FD:FE:A3:A0:AE")/Dot1Q(type=0x8100,vlan=2)/Dot1Q(type=0x8100,vlan=3)/IP(src="192.168.0.1", dst="192.168.0.2")/Raw('x' * 20)], iface="eth17")
Test Case 2: qinq packet filter to PF queues
============================================
Testpmd configuration - 4 RX/TX queues per port
-------------------------------------------------
+-----------------------------------------------
#. set up testpmd with fortville NICs::
./x86_64-native-linuxapp-gcc/app/testpmd -c 0x1f -n 4 -- -i --rxq=4 --txq=4 --txqflags=0x0 --disable-rss
+
#. enable qinq::
testpmd command: vlan set qinq on 0
@@ -105,6 +108,7 @@ Testpmd configuration - 4 RX/TX queues per port
testpmd command: start
#. create filter rules::
+
testpmd command: flow create 0 ingress pattern eth / vlan tci is 1 / vlan tci is 4093 / end actions pf / queue index 1 / end
testpmd command: flow create 0 ingress pattern eth / vlan tci is 2 / vlan tci is 4094 / end actions pf / queue index 2 / end
@@ -112,6 +116,7 @@ tester Configuration
--------------------
#. send dual vlan packet with scapy, verify packets can filter to queues::
+
sendp([Ether(dst="3C:FD:FE:A3:A0:AE")/Dot1Q(type=0x8100,vlan=1)/Dot1Q(type=0x8100,vlan=4093)/IP(src="192.168.0.1", dst="192.168.0.2")/Raw('x' * 20)], iface="eth17")
sendp([Ether(dst="3C:FD:FE:A3:A0:AE")/Dot1Q(type=0x8100,vlan=2)/Dot1Q(type=0x8100,vlan=4093)/IP(src="192.168.0.1", dst="192.168.0.2")/Raw('x' * 20)], iface="eth17")
@@ -145,15 +150,14 @@ Test Case 3: qinq packet filter to VF queues
testpmd command: start
- #. create filter rules::
+#. create filter rules::
testpmd command: flow create 0 ingress pattern eth / vlan tci is 1 / vlan tci is 4093 / end actions vf id 0 / queue index 2 / end
-
testpmd command: flow create 0 ingress pattern eth / vlan tci is 2 / vlan tci is 4094 / end actions vf id 1 / queue index 3 / end
-
testpmd command: flow create 0 ingress pattern eth / vlan tci is 3 / vlan tci is 4094 / end actions pf / queue index 1 / end
#. set up testpmd with fortville VF0 NICs::
+
./x86_64-native-linuxapp-gcc/app/testpmd -c 0x3e0 -n 4 --socket-mem=1024,1024 --file-prefix=vf0 -w 81:02.0 -- -i --rxq=4 --txq=4 --rss-udp
#. PMD fwd only receive the packets::
@@ -169,6 +173,7 @@ Test Case 3: qinq packet filter to VF queues
testpmd command: start
#. set up testpmd with fortville VF0 NICs::
+
./x86_64-native-linuxapp-gcc/app/testpmd -c 0x7c0 -n 4 --socket-mem=1024,1024 --file-prefix=vf1 -w 81:02.0 -- -i --rxq=4 --txq=4 --rss-udp
#. PMD fwd only receive the packets::
@@ -187,6 +192,7 @@ tester Configuration
--------------------
#. send dual vlan packet with scapy, verify packets can filter to the corresponding PF and VF queues::
+
sendp([Ether(dst="3C:FD:FE:A3:A0:AE")/Dot1Q(type=0x8100,vlan=1)/Dot1Q(type=0x8100,vlan=4094)/IP(src="192.168.0.1", dst="192.168.0.2")/Raw('x' * 20)], iface="eth17")
sendp([Ether(dst="3C:FD:FE:A3:A0:AE")/Dot1Q(type=0x8100,vlan=2)/Dot1Q(type=0x8100,vlan=4094)/IP(src="192.168.0.1", dst="192.168.0.2")/Raw('x' * 20)], iface="eth17")
sendp([Ether(dst="3C:FD:FE:A3:A0:AE")/Dot1Q(type=0x8100,vlan=3)/Dot1Q(type=0x8100,vlan=4094)/IP(src="192.168.0.1", dst="192.168.0.2")/Raw('x' * 20)], iface="eth17")
@@ -228,12 +234,11 @@ Test Case 4: qinq packet filter with diffierent tpid
#. create filter rules::
testpmd command: flow create 0 ingress pattern eth / vlan tci is 1 / vlan tci is 4093 / end actions vf id 0 / queue index 2 / end
-
testpmd command: flow create 0 ingress pattern eth / vlan tci is 2 / vlan tci is 4094 / end actions vf id 1 / queue index 3 / end
-
testpmd command: flow create 0 ingress pattern eth / vlan tci is 3 / vlan tci is 4094 / end actions pf / queue index 1 / end
#. set up testpmd with fortville VF0 NICs::
+
./x86_64-native-linuxapp-gcc/app/testpmd -c 0x3e0 -n 4 --socket-mem=1024,1024 --file-prefix=vf0 -w 81:02.0 -- -i --rxq=4 --txq=4 --rss-udp
#. PMD fwd only receive the packets::
@@ -249,6 +254,7 @@ Test Case 4: qinq packet filter with diffierent tpid
testpmd command: start
#. set up testpmd with fortville VF0 NICs::
+
./x86_64-native-linuxapp-gcc/app/testpmd -c 0x7c0 -n 4 --socket-mem=1024,1024 --file-prefix=vf1 -w 81:02.0 -- -i --rxq=4 --txq=4 --rss-udp
#. PMD fwd only receive the packets::
@@ -273,6 +279,7 @@ Note
====================================================
#. How to send packet with specific TPID with scapy::
+
1. wrpcap("qinq.pcap",[Ether(dst="3C:FD:FE:A3:A0:AE")/Dot1Q(type=0x8100,vlan=1)/Dot1Q(type=0x8100,vlan=4092)/IP(src="192.168.0.1", dst="192.168.0.2")/Raw('x' * 20)]).
2. hexedit qinq.pcap; change tpid field, "ctrl+w" to save, "ctrl+x" to exit.
- 3. sendp(rdpcap("qinq.pcap"), iface="eth17"). \ No newline at end of file
+ 3. sendp(rdpcap("qinq.pcap"), iface="eth17").
diff --git a/test_plans/vf_kernel_test_plan.rst b/test_plans/vf_kernel_test_plan.rst
index 01627a5..b8f08d5 100644
--- a/test_plans/vf_kernel_test_plan.rst
+++ b/test_plans/vf_kernel_test_plan.rst
@@ -30,13 +30,13 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
-============================
+===========================
VFD as SRIOV Policy Manager
-============================
+===========================
-VFD is SRIOV Policy Manager (daemon) running on the host allowing
-configuration not supported by kernel NIC driver, supports ixgbe and
-i40e NIC. Run on the host for policy decisions w.r.t. what a VF can and
+VFD is SRIOV Policy Manager (daemon) running on the host allowing
+configuration not supported by kernel NIC driver, supports ixgbe and
+i40e NIC. Run on the host for policy decisions w.r.t. what a VF can and
cannot do to the PF. Only the DPDK PF would provide a callback to implement
these features, the normal kernel drivers would not have the callback so
would not support the features. Allow passing information to application
@@ -45,38 +45,43 @@ so action could be taken based on host policy. Stop VM1 from asking for
something that compromises VM2. Use DPDK DPDK PF + kernel VF mode to verify
below features.
-Case 1: Set up environment and load driver
-============================================
+Test Case 1: Set up environment and load driver
+===============================================
1. Get the pci device id of DUT, load ixgbe driver to required version,
take Niantic for example::
- rmmod ixgbe
- insmod ixgbe.ko
+
+ rmmod ixgbe
+ insmod ixgbe.ko
2. Host PF in DPDK driver. Create VFs from PF with dpdk driver::
+
./tools/dpdk-devbind.py -b igb_uio 05:00.0
echo 2 >/sys/bus/pci/devices/0000\:05\:00.0/max_vfs
-3. Check ixgbevf version and update ixgbevf to required version::
+3. Check ixgbevf version and update ixgbevf to required version
4. Detach VFs from the host::
- rmmod ixgbevf
+
+ rmmod ixgbevf
5. Pass through VF 05:10.0 and 05:10.2 to VM0,start and login VM0
6. Check ixgbevf version in VM and update to required version
-Case 2 : Link
-==========================================
+Test Case 2: Link
+=================
Pre-environment::
- (1)Host one DPDK PF and create two VFs, pass through VF0 and VF1 to VM0,
+
+ (1)Host one DPDK PF and create two VFs, pass through VF0 and VF1 to VM0,
start VM0
(2)Load host DPDK driver and VM0 kernel driver
Steps:
1. Enable multi-queues to start DPDK PF::
- ./testpmd -c f -n 4 -- -i --rxq=4 --txq=4
+
+ ./testpmd -c f -n 4 -- -i --rxq=4 --txq=4
2. Link up kernel VF and expect VF link up
@@ -85,13 +90,13 @@ Steps:
4. Repeat above 2~3 for 100 times, expect no crash or core dump issues.
-
Test Case 3: ping
-===========================================
+==================
Pre-environment::
+
(1)Establish link with link partner.
- (2)Host one DPDK PF and create two VFs, pass through VF0 and VF1 to VM0,
- start VM0
+ (2)Host one DPDK PF and create two VFs, pass through VF0 and VF1 to VM0,
+ start VM0
(3)Load host DPDK driver and VM0 kernel driver
Steps:
@@ -109,10 +114,11 @@ Steps:
Test Case 4: reset
-==========================================
+==================
Pre-environment::
+
(1)Establish link with link partner.
- (2)Host one DPDK PF and create two VFs, pass through VF0 to VM0 and VF1 to
+ (2)Host one DPDK PF and create two VFs, pass through VF0 to VM0 and VF1 to
VM1, start VM0 and VM1
(3)Load host DPDK driver and VM kernel driver
@@ -141,9 +147,10 @@ Steps:
Test Case 5: add/delete IP/MAC address
==========================================
Pre-environment::
- (1)Establish link with link partner.
- (2)Host one DPDK PF and create one VF, pass through VF0 to VM0, start VM0
- (3)Load host DPDK driver and VM0 kernel drive
+
+ (1)Establish link with link partner.
+ (2)Host one DPDK PF and create one VF, pass through VF0 to VM0, start VM0
+ (3)Load host DPDK driver and VM0 kernel drive
Steps:
@@ -154,13 +161,16 @@ Steps:
3. Kernel VF0 ping tester PF, tester PF ping kernel VF0
4. Add IPv6 on kernel VF0(e.g: ens3)::
- ifconfig ens3 add efdd::9fc8:6a6d:c232:f1c0
+
+ ifconfig ens3 add efdd::9fc8:6a6d:c232:f1c0
5. Delete IPv6 on kernel VF::
- ifconfig ens3 del efdd::9fc8:6a6d:c232:f1c0
+
+ ifconfig ens3 del efdd::9fc8:6a6d:c232:f1c0
6. Modify MAC address on kernel VF::
- ifconfig ens3 hw ether 00:AA:BB:CC:dd:EE
+
+ ifconfig ens3 hw ether 00:AA:BB:CC:dd:EE
7. Send packet to modified MAC, expect VF can receive packet successfully
@@ -168,19 +178,22 @@ Steps:
Test Case 6: add/delete vlan
==========================================
Pre-environment::
- (1)Establish link with link partner.
- (2)Host one DPDK PF and create one VF, pass through VF0 to VM0, start VM0
- (3)Load host DPDK driver and VM0 kernel driver
+
+ (1)Establish link with link partner.
+ (2)Host one DPDK PF and create one VF, pass through VF0 to VM0, start VM0
+ (3)Load host DPDK driver and VM0 kernel driver
Steps:
1. Add random vlan id(0~4095) on kernel VF0(e.g: ens3), take vlan id 51
for example::
- modprobe 8021q
- vconfig add ens3 51
+
+ modprobe 8021q
+ vconfig add ens3 51
2. Check add vlan id successfully, expect to have ens3.51 device::
- ls /proc/net/vlan
+
+ ls /proc/net/vlan
3. Send packet from tester to VF MAC with not-matching vlan id, check the
packet can't be received at the vlan device
@@ -189,7 +202,8 @@ Steps:
packet can be received at the vlan device.
5. Delete configured vlan device::
- vconfig rem ens3.51
+
+ vconfig rem ens3.51
6. Check delete vlan id 51 successfully
@@ -200,24 +214,27 @@ Steps:
Test Case 7: Get packet statistic
==========================================
Pre-environment::
- (1)Establish link with link partner.
- (2)Host one DPDK PF and create one VF, pass through VF0 to VM0, start VM0
- (3)Load host DPDK driver and VM0 kernel driver
+
+ (1)Establish link with link partner.
+ (2)Host one DPDK PF and create one VF, pass through VF0 to VM0, start VM0
+ (3)Load host DPDK driver and VM0 kernel driver
Steps:
1. Send packet to kernel VF0 mac
2. Check packet statistic could increase correctly::
- ethtool -S ens3
+
+ ethtool -S ens3
Test Case 8: MTU
==========================================
Pre-environment::
- (1)Establish link with link partner.
- (2)Host one DPDK PF and create one VF, pass through VF0 to VM0, start VM0
- (3)Load host DPDK driver and VM0 kernel driver
+
+ (1)Establish link with link partner.
+ (2)Host one DPDK PF and create one VF, pass through VF0 to VM0, start VM0
+ (3)Load host DPDK driver and VM0 kernel driver
Steps:
@@ -230,15 +247,17 @@ Steps:
DST MAC, check that Kernel VF can't receive packet
4. Change DPDK PF mtu as 3000,check no confusion/crash on kernel VF::
- Testpmd > port stop all
- Testpmd > port config mtu 0 3000
- Testpmd > port start all
+
+ Testpmd > port stop all
+ Testpmd > port config mtu 0 3000
+ Testpmd > port start all
5. Use scapy to send one packet with length as 2000 with DPDK PF MAC as
DST MAC, check that DPDK PF can receive packet
6. Change kernel VF mtu as 3000, check no confusion/crash on DPDK PF::
- ifconfig eth0 mtu 3000
+
+ ifconfig eth0 mtu 3000
7. Use scapy to send one packet with length as 2000 with kernel VF MAC
as DST MAC, check Kernel VF can receive packet
@@ -252,9 +271,10 @@ effect.
Test Case 9: Enable/disable promisc mode
=========================================
Pre-environment::
- (1)Establish link with link partner.
- (2)Host one DPDK PF and create one VF, pass through VF0 to VM0, start VM0
- (3)Load host DPDK driver and VM0 kernel driver
+
+ (1)Establish link with link partner.
+ (2)Host one DPDK PF and create one VF, pass through VF0 to VM0, start VM0
+ (3)Load host DPDK driver and VM0 kernel driver
Steps:
@@ -262,7 +282,8 @@ Steps:
2. Set up kernel VF tcpdump without -p parameter, without/with -p parameter
could enable/disable promisc mode::
- sudo tcpdump -i ens3 -n -e -vv
+
+ sudo tcpdump -i ens3 -n -e -vv
3. Send packet from tester with random DST MAC, check the packet can be
received by DPDK PF and kernel VF
@@ -271,7 +292,8 @@ Steps:
5. Set up kernel VF tcpdump with -p parameter, which means disable promisc
mode::
- sudo tcpdump -i ens3 -n -e –vv -p
+
+ sudo tcpdump -i ens3 -n -e –vv -p
6. Send packet from tester with random DST MAC, check the packet can't be
received by DPDK PF and kernel VF
@@ -289,9 +311,10 @@ Niantic NIC un-supports this case.
Test Case 10: RSS
=========================================
Pre-environment::
- (1)Establish link with link partner.
- (2)Host one DPDK PF and create one VF, pass through VF0 to VM0, start VM0
- (3)Load host DPDK driver and VM0 kernel driver
+
+ (1)Establish link with link partner.
+ (2)Host one DPDK PF and create one VF, pass through VF0 to VM0, start VM0
+ (3)Load host DPDK driver and VM0 kernel driver
Steps:
@@ -313,10 +336,11 @@ Niantic NIC un-supports this case.
Test Case 11: DPDK PF + kernel VF + DPDK VF
============================================
Pre-environment::
- (1)Establish link with IXIA.
- (2)Host one DPDK PF and create two VFs, pass through VF0 and VF1 to VM0,
- start VM0
- (3)Load host DPDK driver, VM0 DPDK driver and kernel driver
+
+ (1)Establish link with IXIA.
+ (2)Host one DPDK PF and create two VFs, pass through VF0 and VF1 to VM0,
+ start VM0
+ (3)Load host DPDK driver, VM0 DPDK driver and kernel driver
Steps:
@@ -343,10 +367,11 @@ Steps:
Test Case 12: DPDK PF + 2kernel VFs + 2DPDK VFs + 2VMs
======================================================
Pre-environment::
- (1)Establish link with IXIA.
- (2)Host one DPDK PF and create 6 VFs, pass through VF0, VF1, VF2 and VF3
- to VM0, pass through VF4, VF5 to VM1, start VM0 and VM1
- (3)Load host DPDK driver, VM DPDK driver and kernel driver
+
+ (1)Establish link with IXIA.
+ (2)Host one DPDK PF and create 6 VFs, pass through VF0, VF1, VF2 and VF3
+ to VM0, pass through VF4, VF5 to VM1, start VM0 and VM1
+ (3)Load host DPDK driver, VM DPDK driver and kernel driver
Steps:
@@ -379,10 +404,11 @@ Steps:
Test Case 13: Load kernel driver stress
-======================================================
+========================================
Pre-environment::
- (1)Host one DPDK PF and create one VF, pass through VF0 to VM0, start VM0
- (2)Load host DPDK driver and VM0 kernel driver
+
+ (1)Host one DPDK PF and create one VF, pass through VF0 to VM0, start VM0
+ (2)Load host DPDK driver and VM0 kernel driver
Steps:
diff --git a/test_plans/vf_pf_reset_test_plan.rst b/test_plans/vf_pf_reset_test_plan.rst
index 3a939bb..f59ab81 100644
--- a/test_plans/vf_pf_reset_test_plan.rst
+++ b/test_plans/vf_pf_reset_test_plan.rst
@@ -75,7 +75,7 @@ Test Case 1: vf reset -- create two vfs on one pf
3. Bind the VFs to dpdk driver::
- ./tools/dpdk-devbind.py -b vfio-pci 82:02.0 82:02.1
+ ./tools/dpdk-devbind.py -b vfio-pci 81:02.0 81:02.1
4. Set the VLAN id of VF1 and VF2::
diff --git a/tests/TestSuite_hotplug.py b/tests/TestSuite_hotplug.py
index 9fa922a..7704253 100644
--- a/tests/TestSuite_hotplug.py
+++ b/tests/TestSuite_hotplug.py
@@ -69,15 +69,20 @@ class TestPortHotPlug(TestCase):
"""
attach port
"""
- self.dut.send_expect("port attach %s" % self.dut.ports_info[port]['pci'],"is attached",60)
- self.dut.send_expect("port start %s" % port,"Link Up",60)
+ # dpdk hotplug discern NIC by pci bus not include domid
+ self.dut.send_expect("port attach %s" % self.dut.ports_info[port]['pci'][len("0000:"):],"is attached",60)
+ self.dut.send_expect("port start %s" % port,"Configuring Port",120)
+ # sleep 10 seconds for fortville update link stats
+ time.sleep(10)
self.dut.send_expect("show port info %s" % port,"testpmd>",60)
def detach(self, port):
"""
detach port
"""
- self.dut.send_expect("port stop %s" % port,"Link Down",60)
+ self.dut.send_expect("port stop %s" % port,"Stopping ports",60)
+ # sleep 10 seconds for fortville update link stats
+ time.sleep(10)
self.dut.send_expect("port close %s" % port,"Closing ports...",60)
self.dut.send_expect("port detach %s" % port,"is detached",60)
@@ -88,7 +93,7 @@ class TestPortHotPlug(TestCase):
cmd = "./x86_64-native-linuxapp-gcc/app/testpmd -c %s -n %s -- -i" % (self.coremask,self.dut.get_memory_channels())
self.dut.send_expect(cmd,"testpmd>",60)
session_secondary = self.dut.new_session()
- session_secondary.send_expect("./tools/dpdk-devbind.py --bind=igb_uio %s" % self.dut.ports_info[self.port]['pci'], "#", 60)
+ session_secondary.send_expect("./usertools/dpdk-devbind.py --bind=igb_uio %s" % self.dut.ports_info[self.port]['pci'], "#", 60)
self.dut.close_session(session_secondary)
self.attach(self.port)
self.dut.send_expect("start","testpmd>",60)
@@ -103,15 +108,15 @@ class TestPortHotPlug(TestCase):
out = self.dut.send_expect("show port stats %s" % self.port ,"testpmd>",60)
packet = re.search("RX-packets:\s*(\d*)",out)
sum_packet = packet.group(1)
- self.verify(sum_packet = 1, "Insufficient the received package")
+ self.verify(int(sum_packet) == 1, "Insufficient the received package")
self.dut.send_expect("quit","#",60)
def send_packet(self, port):
"""
Send a packet to port
"""
- self.dmac = self.dut.get_mac_address(self.dut_ports[0])
- txport = self.tester.get_local_port(self.dut_ports[0])
+ self.dmac = self.dut.get_mac_address(port)
+ txport = self.tester.get_local_port(port)
self.txItf = self.tester.get_interface(txport)
pkt = Packet(pkt_type='UDP')
pkt.config_layer('ether', {'dst': self.dmac,})
@@ -134,7 +139,7 @@ class TestPortHotPlug(TestCase):
out = self.dut.send_expect("show port stats %s" % self.port ,"testpmd>",60)
packet = re.search("RX-packets:\s*(\d*)",out)
sum_packet = packet.group(1)
- self.verify(sum_packet = 1, "Insufficient the received package")
+ self.verify(int(sum_packet) == 1, "Insufficient the received package")
self.dut.send_expect("quit","#",60)
diff --git a/tests/TestSuite_ieee1588.py b/tests/TestSuite_ieee1588.py
index 58d9a10..d9a7b3a 100644
--- a/tests/TestSuite_ieee1588.py
+++ b/tests/TestSuite_ieee1588.py
@@ -39,6 +39,8 @@ import time
import re
from test_case import TestCase
from pmd_output import PmdOutput
+from packet import Packet
+
class TestIeee1588(TestCase):
@@ -51,7 +53,8 @@ class TestIeee1588(TestCase):
self.verify(len(dutPorts) > 0, "No ports found for " + self.nic)
# Change the config file to support IEEE1588 and recompile the package.
- self.dut.send_expect("sed -i -e 's/IEEE1588=n$/IEEE1588=y/' config/common_base", "# ", 30)
+ self.dut.send_expect(
+ "sed -i -e 's/IEEE1588=n$/IEEE1588=y/' config/common_base", "# ", 30)
self.dut.skip_setup = False
self.dut.build_install_dpdk(self.target)
@@ -69,32 +72,32 @@ class TestIeee1588(TestCase):
IEEE1588 Enable test case.
"""
self.dut.send_expect("set fwd ieee1588", "testpmd> ", 10)
- # Waiting for 'testpmd> ' Fails due to log messages, "Received non PTP packet", in the output
- self.dut.send_expect("start", ">", 10)
- # Allow the output from the "start" command to finish before looking for a regexp in expect
+ # Waiting for 'testpmd> ' Fails due to log messages, "Received non PTP
+ # packet", in the output
+ self.dut.send_expect("start", ">", 10)
+ # Allow the output from the "start" command to finish before looking
+ # for a regexp in expect
time.sleep(1)
# use the first port on that self.nic
dutPorts = self.dut.get_ports()
- mac = self.dut.get_mac_address(dutPorts[0])
+ mac = self.dut.get_mac_address(dutPorts[0])
port = self.tester.get_local_port(dutPorts[0])
itf = self.tester.get_interface(port)
- self.tester.scapy_background()
- self.tester.scapy_append('p = sniff(iface="%s", count=2)' % itf)
- self.tester.scapy_append('RESULT = p[1].summary()')
+ self.tester.send_expect(
+ "tcpdump -i %s -e ether src %s" % (itf, mac), "tcpdump", 20)
- # this is the output of sniff
- # [<Ether dst=01:1b:19:00:00:00 src=00:00:00:00:00:00 type=0x88f7 |<Raw load='\x00\x02' |>>]
- self.tester.scapy_foreground()
- self.tester.scapy_append('nutmac="%s"' % mac)
- self.tester.scapy_append('sendp([Ether(dst=nutmac,type=0x88f7)/"\\x00\\x02"], iface="%s")' % itf)
- self.tester.scapy_append('time.sleep(1)')
+ pkt = Packet(pkt_type='TIMESYNC')
+ pkt.config_layer('ether', {'dst': mac, })
+ pkt.send_pkt(tx_port=itf)
+
+ time.sleep(1)
+ out = self.tester.get_session_output(timeout=20)
+
+ self.tester.send_expect("^C", "# ", 20)
- self.tester.scapy_execute()
- out = self.tester.scapy_get_result()
self.verify("0x88f7" in out, "Ether type is not PTP")
- # self.verify("\\x00\\x02" in out, "Payload wrong in PTP")
time.sleep(1)
out = self.dut.get_session_output()
@@ -102,7 +105,7 @@ class TestIeee1588(TestCase):
text = utils.regexp(out, "(.*) by hardware")
self.verify("IEEE1588 PTP V2 SYNC" in text, "Not filtered " + text)
-
+
pattern_rx = re.compile("RX timestamp value (\d+) s (\d+) ns")
pattern_tx = re.compile("TX timestamp value (\d+) s (\d+) ns")
@@ -126,17 +129,19 @@ class TestIeee1588(TestCase):
# use the first port on that self.nic
dutPorts = self.dut.get_ports()
- mac = self.dut.get_mac_address(dutPorts[0])
+ mac = self.dut.get_mac_address(dutPorts[0])
port = self.tester.get_local_port(dutPorts[0])
itf = self.tester.get_interface(port)
self.tester.scapy_background()
- self.tester.scapy_append('p = sniff(iface="%s", count=2, timeout=1)' % itf)
+ self.tester.scapy_append(
+ 'p = sniff(iface="%s", count=2, timeout=1)' % itf)
self.tester.scapy_append('RESULT = p[1].summary()')
self.tester.scapy_foreground()
self.tester.scapy_append('nutmac="%s"' % mac)
- self.tester.scapy_append('sendp([Ether(dst=nutmac,type=0x88f7)/"\\x00\\x02"], iface="%s")' % itf)
+ self.tester.scapy_append(
+ 'sendp([Ether(dst=nutmac,type=0x88f7)/"\\x00\\x02"], iface="%s")' % itf)
self.tester.scapy_execute()
time.sleep(2)
@@ -157,5 +162,6 @@ class TestIeee1588(TestCase):
self.dut.send_expect("quit", "# ", 30)
# Restore the config file and recompile the package.
- self.dut.send_expect("sed -i -e 's/IEEE1588=y$/IEEE1588=n/' config/common_base", "# ", 30)
+ self.dut.send_expect(
+ "sed -i -e 's/IEEE1588=y$/IEEE1588=n/' config/common_base", "# ", 30)
self.dut.build_install_dpdk(self.target)
diff --git a/tests/TestSuite_pmd.py b/tests/TestSuite_pmd.py
index 8f4b22c..dccaade 100644
--- a/tests/TestSuite_pmd.py
+++ b/tests/TestSuite_pmd.py
@@ -83,18 +83,18 @@ class TestPmd(TestCase,IxiaPacketGenerator):
# Based on h/w type, choose how many ports to use
self.dut_ports = self.dut.get_ports()
-
- # Get dut system information
- port_num = self.dut_ports[0]
- pci_device_id = self.dut.ports_info[port_num]['pci']
- ori_driver = self.dut.ports_info[port_num]['port'].get_nic_driver()
- self.dut.ports_info[port_num]['port'].bind_driver()
-
- sut = SystemInfo(self.dut, pci_device_id)
- self.system_info = sut.get_system_info()
- self.nic_info = sut.get_nic_info()
-
- self.dut.ports_info[port_num]['port'].bind_driver(ori_driver)
+ if self.dut.get_os_type() == 'linux':
+ # Get dut system information
+ port_num = self.dut_ports[0]
+ pci_device_id = self.dut.ports_info[port_num]['pci']
+ ori_driver = self.dut.ports_info[port_num]['port'].get_nic_driver()
+ self.dut.ports_info[port_num]['port'].bind_driver()
+
+ sut = SystemInfo(self.dut, pci_device_id)
+ self.system_info = sut.get_system_info()
+ self.nic_info = sut.get_nic_info()
+
+ self.dut.ports_info[port_num]['port'].bind_driver(ori_driver)
######
self.headers_size = HEADER_SIZE['eth'] + HEADER_SIZE[
diff --git a/tests/TestSuite_tx_preparation.py b/tests/TestSuite_tx_preparation.py
index 3c3080f..5916526 100644
--- a/tests/TestSuite_tx_preparation.py
+++ b/tests/TestSuite_tx_preparation.py
@@ -87,8 +87,9 @@ class TestTX_preparation(TestCase):
Run before each test case.
"""
self.dut_testpmd = PmdOutput(self.dut)
+ # use one port test the case
self.dut_testpmd.start_testpmd(
- "Default", "--port-topology=chained --max-pkt-len=%s" %Max_mtu)
+ "Default", " --portmask=1 --port-topology=chained --max-pkt-len=%s" %Max_mtu)
self.dmac = self.dut_testpmd.get_port_mac(0)
self.dut_testpmd.execute_cmd('set fwd csum')
self.dut_testpmd.execute_cmd('set verbose 1')
@@ -98,16 +99,8 @@ class TestTX_preparation(TestCase):
self.dut_testpmd.execute_cmd('csum set udp hw 0')
def start_tcpdump(self, rxItf):
-
- param = ""
- direct_param = r"(\s+)\[ -(\w) in\|out\|inout \]"
- tcpdump_help = subprocess.check_output("tcpdump -h; echo 0",
- stderr=subprocess.STDOUT,
- shell=True)
- for line in tcpdump_help.split('\n'):
- m = re.match(direct_param, line)
- if m:
- param = "-" + m.group(2) + " in"
+ # only sniff form dut packet and filter lldp packet
+ param = "ether[12:2]!=0x88cc and ether src %s" % self.dmac
self.tester.send_expect("rm -rf ./getPackageByTcpdump.cap", "#")
self.tester.send_expect("tcpdump %s -i %s -n -e -vv -w\
./getPackageByTcpdump.cap 2> /dev/null& " % (param,rxItf), "#")
diff --git a/tests/TestSuite_userspace_ethtool.py b/tests/TestSuite_userspace_ethtool.py
index 937a9e5..bf3f8e6 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 userspcae tools dump eeprom file size different with kernel ethtool dump
+ dpdk_eeprom_size = int(self.dut.send_expect('stat -c %%s %s' % portinfo['eeprom_file'], '# '))
+ 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'])
@@ -499,8 +502,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 update link status with fortville nic
+ 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)