87. Shutdown API Feature Tests¶
This tests for Shutdown API feature can be run on linux userspace. It will check if NIC port can be stopped and restarted without exiting the application process. Furthermore, it will check if it can reconfigure new configurations for a port after the port is stopped, and if it is able to restart with those new configurations. It is based on testpmd application.
The test is performed by running the testpmd application and using a traffic generator. Port/queue configurations can be set interactively, and still be set at the command line when launching the application in order to be compatible with previous test framework.
87.1. Prerequisites¶
If using vfio the kernel must be >= 3.6+ and VT-d must be enabled in bios.When using vfio, use the following commands to load the vfio driver and bind it to the device under test:
modprobe vfio
modprobe vfio-pci
usertools/dpdk-devbind.py --bind=vfio-pci device_bus_id
Assume port A and B are connected to the remote ports, e.g. packet generator. To run the testpmd application in linuxapp environment with 4 lcores, 4 channels with other default parameters in interactive mode:
$ ./testpmd -c 0xf -n 4 -- -i
87.2. Test Case: Stop and Restart¶
- If the testpmd application is not launched, run it as above command. Follow below steps to check if it works well after re-configuring all ports without changing any configurations.
- Run
startto start forwarding packets. - Check that testpmd is able to forward traffic.
- Run
stopto stop forwarding packets. - Run
port stop allto stop all ports. - Check on the tester side that the ports are down using ethtool.
- Run
port start allto restart all ports. - Check on the tester side that the ports are up using ethtool
- Run
startagain to restart the forwarding, then start packet generator to transmit and receive packets, and check if testpmd is able to receive and forward packets successfully.
87.3. Test Case: Reset RX/TX Queues¶
- If the testpmd application is not launched, run it as above command. Follow below steps to check if it works well after reconfiguring all ports without changing any configurations.
- Run
port stop allto stop all ports. - Run
port config all rxq 2to change the number of receiving queues to two. - Run
port config all txq 2to change the number of transmitting queues to two. - Run
port start allto restart all ports. - Check with
show config rxtxthat the configuration for these parameters changed. - Run
startagain to restart the forwarding, then start packet generator to transmit and receive packets, and check if testpmd is able to receive and forward packets successfully.
87.4. Test Case: Set promiscuous mode¶
- If the testpmd application is not launched, run it as above command. Follow below steps to check if promiscuous mode setting works well after reconfiguring it while all ports are stopped
- Run
port stop allto stop all ports. - Run
set promisc all offto disable promiscuous mode on all ports. - Run
port start allto restart all ports. - Run
startagain to restart the forwarding, then start packet generator to transmit and receive packets, and check that testpmd is NOT able to receive and forward packets successfully. - Run
port stop allto stop all ports. - Run
set promisc all onto enable promiscuous mode on all ports. - Run
port start allto restart all ports. - Run
startagain to restart the forwarding, then start packet generator to transmit and receive packets, and check that testpmd is able to receive and forward packets successfully.
87.5. Test Case: Reconfigure All Ports With The Same Configurations (CRC)¶
- If the testpmd application is not launched, run it as above command. Follow below steps to check if it works well after reconfiguring all ports without changing any configurations.
- Run
port stop allto stop all ports. - Run
port config all crc-strip onto enable the CRC stripping mode. - Run
port start allto restart all ports. - Check with
show config rxtxthat the configuration for these parameters changed. - Run
startagain to restart the forwarding, then start packet generator to transmit and receive packets, and check if testpmd is able to receive and forward packets successfully. Check that the packet received is 4 bytes smaller than the packet sent.
87.6. Test Case: Change Link Speed¶
- If the testpmd application is not launched, run it as above command. Follow below steps to check if it works well after reconfiguring all ports without changing any configurations.
- Run
port stop allto stop all ports. - Run
port config all speed SPEED duplex HALF/FULLto select the new config for the link. - Run
port start allto restart all ports. - Check on the tester side that the configuration actually changed using ethtool.
- Run
startagain to restart the forwarding, then start packet generator to transmit and receive packets, and check if testpmd is able to receive and forward packets successfully. - Repeat this process for every compatible speed depending on the NIC driver.
87.7. Test Case: Change Link Speed VF¶
This case support all the nic with driver i40e and ixgbe.
- bind a PF to DPDK::
./usertools/dpdk-devbind.py -b igb_uio 1b:00.0
- create a VF from this PF::
echo 1 > /sys/bus/pci/devices/0000:1b:00.0/max_vfs
- bind a VF to DPDK::
./usertools/dpdk-devbind.py -b igb_uio 1b:02.0
- launch testpmd with cmd::
./x86_64-native-linuxapp-gcc/app/testpmd -l 0-3 -n 4 –file-prefix=minjq – -i
Run
port stop allto stop all ports.Run
port config all speed SPEED duplex HALF/FULLto select the new config for the link.Run
port start allto restart all ports. show port info all Check on the tester side that the VF configuration actually changed using ethtool.Run
startagain to restart the forwarding, then start packet generator to transmit and receive packets, and check if testpmd is able to receive and forward packets successfully.Repeat this process for every compatible speed depending on the NIC driver.
87.8. Test Case: Enable/Disable Jumbo Frame¶
- If the testpmd application is not launched, run it as above command. Follow below steps to check if it works well after reconfiguring all ports without changing any configurations.
- Run
port stop allto stop all ports. - Run
port config all max-pkt-len 2048to set the maximum packet length. - Run
port start allto restart all ports. - Run
startagain to restart the forwarding, then start packet generator to transmit and receive packets, and check if testpmd is able to receive and forward packets successfully. Check this with the following packet sizes: 2047, 2048 & 2049. Only the third one should fail.
87.9. Test Case: Enable/Disable RSS¶
- If the testpmd application is not launched, run it as above command. Follow below steps to check if it works well after reconfiguring all ports without changing any configurations.
- Run
port stop allto stop all ports. - Run
port config rss ipto enable RSS. - Run
port start allto restart all ports. - Run
startagain to restart the forwarding, then start packet generator to transmit and receive packets, and check if testpmd is able to receive and forward packets successfully.
87.10. Test Case: Change the Number of rxd/txd¶
- If the testpmd application is not launched, run it as above command. Follow below steps to check if it works well after reconfiguring all ports without changing any configurations.
- Run
port stop allto stop all ports. - Run
port config all rxd 1024to change the rx descriptors. - Run
port config all txd 1024to change the tx descriptors. - Run
port start allto restart all ports. - Check with
show config rxtxthat the descriptors were actually changed. - Run
startagain to restart the forwarding, then start packet generator to transmit and receive packets, and check if testpmd is able to receive and forward packets successfully.
87.11. Test Case: link stats¶
- If the testpmd application is not launched, run it as above command. Follow below steps to check if it works well after reconfiguring all ports without changing any configurations.
- Run
set fwd macto set fwd type. - Run
startto start the forwarding, then start packet generator to transmit and receive packets - Run
set link-down port Xto set all port link down - Check on the tester side that the configuration actually changed using ethtool.
- Start packet generator to transmit and not receive packets
- Run
set link-up port Xto set all port link up - Start packet generator to transmit and receive packets successfully.