180. VFD as SRIOV Policy Manager Tests¶
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 can not 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 controlling PF when VF message box event received such as those listed below, 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.
180.1. Test Case 1: Set up environment and load driver¶
Get the pci device id of DUT, load ixgbe driver to required version, take 82599 for example:
rmmod ixgbe insmod ixgbe.ko
Host PF in DPDK driver. Create VFs from PF with dpdk driver:
./usertools/dpdk-devbind.py -b igb_uio 05:00.0 echo 2 >/sys/bus/pci/devices/0000\:05\:00.0/max_vfs
Check ixgbevf version and update ixgbevf to required version
Detach VFs from the host:
rmmod ixgbevf
Pass through VF 05:10.0 and 05:10.2 to VM0,start and login VM0
Check ixgbevf version in VM and update to required version
180.2. Test Case 2: Link¶
Pre-environment:
(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:
Enable multi-queues to start DPDK PF:
./<build_target>/app/dpdk-testpmd -c f -n 4 -- -i --rxq=4 --txq=4
Link up kernel VF and expect VF link up
Link down kernel VF and expect VF link down
Repeat above 2~3 for 100 times, expect no crash or core dump issues.
180.3. 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
(3)Load host DPDK driver and VM0 kernel driver
Steps:
- Ifconfig IP on VF0 and VF1
- Ifconfig IP on link partner PF, name as tester PF
- Start inbound and outbound pings, check ping successfully.
- Link down the devx, stop the pings, link up the devx then restart the pings, check port could ping successfully.
- Repeat step 3~4 for 5 times
180.4. 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
VM1, start VM0 and VM1
(3)Load host DPDK driver and VM kernel driver
Steps:
- Check host testpmd and PF at link up status
- Link up VF0 in VM0 and VF1 in VM1
- Link down VF1 in VM1 and check no impact on VF0 status
- Unload VF1 kernel driver and expect no impact on VF0
- Use tcpdump to dump packet on VF0
- Send packets to VF0 using IXIA or scapy tool, expect RX successfully
- Link down and up DPDK PF, ensure that the VF recovers and continues to receive packet.
- Load VF1 kernel driver and expect no impact on VF0
- Send packets to VF0 using IXIA or scapy tool, expect RX successfully
180.5. 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
Steps:
Ifconfig IP on kernel VF0
Ifconfig IP on link partner PF, name as tester PF
Kernel VF0 ping tester PF, tester PF ping kernel VF0
Add IPv6 on kernel VF0(e.g: ens3):
ifconfig ens3 add efdd::9fc8:6a6d:c232:f1c0
Delete IPv6 on kernel VF:
ifconfig ens3 del efdd::9fc8:6a6d:c232:f1c0
Modify MAC address on kernel VF:
ifconfig ens3 hw ether 00:AA:BB:CC:dd:EE
Send packet to modified MAC, expect VF can receive packet successfully
180.6. 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
Steps:
Add random vlan id(0~4095) on kernel VF0(e.g: ens3), take vlan id 51 for example:
modprobe 8021q vconfig add ens3 51
Check add vlan id successfully, expect to have ens3.51 device:
ls /proc/net/vlan
Send packet from tester to VF MAC with not-matching vlan id, check the packet can’t be received at the vlan device
Send packet from tester to VF MAC with matching vlan id, check the packet can be received at the vlan device.
Delete configured vlan device:
vconfig rem ens3.51
Check delete vlan id 51 successfully
Send packet from tester to VF MAC with vlan id(51), check that the packet can’t be received at the VF.
180.7. 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
Steps:
Send packet to kernel VF0 mac
Check packet statistic could increase correctly:
ethtool -S ens3
180.8. 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
Steps:
Check DPDK PF and kernel VF mtu, normal is 1500
Use scapy to send one packet with length as 2000 with DPDK PF MAC as DST MAC, check that DPDK PF can’t receive packet
Use scapy to send one packet with length as 2000 with kernel VF MAC as DST MAC, check that Kernel VF can’t receive packet
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
Use scapy to send one packet with length as 2000 with DPDK PF MAC as DST MAC, check that DPDK PF can receive packet
Change kernel VF mtu as 3000, check no confusion/crash on DPDK PF:
ifconfig eth0 mtu 3000
Use scapy to send one packet with length as 2000 with kernel VF MAC as DST MAC, check kernel VF can receive packet
Note: HW limitation on 82599, need add “–max-pkt-len=<length>” on testpmd to set mtu value, all the VFs and PF share same MTU, the largest one takes effect.
180.9. 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
Steps:
Start DPDK PF, enable promisc mode, set rxonly forwarding
Set up kernel VF tcpdump without -p parameter, without/with -p parameter could enable/disable promisc mode:
sudo tcpdump -i ens3 -n -e -vv
Send packet from tester with random DST MAC, check the packet can be received by DPDK PF and kernel VF
Disable DPDK PF promisc mode
Set up kernel VF tcpdump with -p parameter, which means disable promisc mode:
sudo tcpdump -i ens3 -n -e –vv -p
Send packet from tester with random DST MAC, check the packet can’t be received by DPDK PF and kernel VF
Send packet from tester to VF with correct DST MAC, check the packet can be received by kernel VF
Send packet from tester to PF with correct DST MAC, check the packet can be received by DPDK PF
Note: 82599 NIC un-supports this case.
180.10. 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
Steps:
- Verify kernel VF RSS using ethtool -“l” (lower case L) <devx> that the default RSS setting is equal to the number of CPUs in the system and that the maximum number of RSS queues displayed is correct for the DUT
- Run “ethtool -S <devx> | grep rx_bytes | column” to see the current queue count and verify that it is correct to step 1
- Send multi-threaded traffics to the DUT with a number of threads
- Check kernel VF each queue can receive packets
Note: 82599 NIC un-supports this case.
180.11. 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
Steps:
- Check DPDK testpmd and PF at link up status
- Bind kernel VF0 to igb_uio
- Link up DPDK VF0
- Link up kernel VF1
- Start DPDK VF0, enable promisc mode and set rxonly forwarding
- Set up kernel VF1 tcpdump without -p parameter on promisc mode
- Create 2 streams on IXIA, set DST MAC as each VF MAC, transmit these 2 streams at the same time, check DPDK VF0 and kernel VF1 can receive packet successfully
- Check DPDK VF0 and kernel VF1 don’t impact each other and no performance drop for 10 minutes
180.12. 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
Steps:
- Check DPDK testpmd and PF at link up status
- Bind kernel VF0, VF1 to igb_uio in VM0, bind kernel VF4 to igb_uio in VM1
- Link up DPDK VF0, VF1 in VM0, link up DPDK VF4 in VM1
- Link up kernel VF2, VF3 in VM0, link up kernel VF5 in VM1
- Start DPDK VF0, VF1 in VM0 and VF4 in VM1, enable promisc mode and set rxonly forwarding
- Set up kernel VF2, VF3 in VM0 and VF5 in VM1 tcpdump without -p parameter on promisc mode
- Create 6 streams on IXIA, set DST MAC as each VF MAC, transmit 6 streams at the same time, expect RX successfully
- Link down DPDK VF0 and expect no impact on other VFs
- Link down kernel VF2 and expect no impact on other VFs
- Quit VF4 DPDK testpmd and expect no impact on other VFs
- Unload VF5 kernel driver and expect no impact on other VFs
- Reboot VM1 and expect no impact on VM0’s VFs
180.13. 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
Steps:
- Check DPDK testpmd and PF at link up status
- Unload kernel VF0 driver
- Load kernel VF0 driver
- Write script to repeat step 2 and step 3 for 100 times stress test
- Check no error/crash and system work normally