148. Shutdown API Feature Tests¶
148.1. Description¶
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.
148.2. 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:
$ ./app/dpdk-testpmd -c 0xf -n 4 -- -i
148.3. Test Case¶
148.3.1. Test Case 1: 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
start
to start forwarding packets. - Check that testpmd is able to forward traffic.
- Run
stop
to stop forwarding packets. - Run
port stop all
to stop all ports. - Check on the tester side that the ports are down using ethtool.
- Run
port start all
to restart all ports. - Check on the tester side that the ports are up using ethtool
- Run
start
again 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.
148.3.2. Test Case 2: 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 all
to stop all ports. - Run
port config all rxq 2
to change the number of receiving queues to two. - Run
port config all txq 2
to change the number of transmitting queues to two. - Run
port start all
to restart all ports. - Check with
show config rxtx
that the configuration for these parameters changed. - Run
start
again 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.
148.3.3. Test Case 3: 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 all
to stop all ports. - Run
set promisc all off
to disable promiscuous mode on all ports. - Run
port start all
to restart all ports. - Run
start
again 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 all
to stop all ports. - Run
set promisc all on
to enable promiscuous mode on all ports. - Run
port start all
to restart all ports. - Run
start
again 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.
148.3.4. Test Case 4: Set allmulticast mode¶
- If the testpmd application is not launched, run it as above command. Follow below steps to check if allmulticast mode setting works well after reconfiguring it while all ports are stopped.
- Run
set promisc all off
to disable promiscuous mode on all ports. - Run
set allmulti all off
to disable allmulticast mode on all ports. - Run
start
again to restart the forwarding. - Send packets with dst same to port address.
- Check that testpmd is able to receive and forward packets successfully.
- Send packets with unicast dst not same to port address.
- Check that testpmd is NOT able to receive and forward packets successfully.
- Send packets with multicast dst
01:00:00:33:00:01
packets. - Check that testpmd is NOT able to receive and forward packets successfully.
- Run
set allmulti all on
to enable allmulticast mode on all ports. - Send packets with multicast dst
01:00:00:33:00:01
packets. - Check that testpmd is able to receive and forward packets successfully.
- Send packets with unicast dst not same to port address.
- Check that testpmd is NOT able to receive and forward packets successfully.
- Run
set promisc all on
to enable promiscuous mode on all ports. - Send packets with unicast dst not same to port address.
- Check that testpmd is able to receive and forward packets successfully.
148.3.5. Test Case 5: 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 all
to stop all ports. - Run
port config all crc-strip on
to enable the CRC stripping mode. - Run
port start all
to restart all ports. - Check with
show config rxtx
that the configuration for these parameters changed. - Run
start
again 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.
148.3.6. Test Case 6: 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 all
to stop all ports. - Run
port config all speed SPEED duplex HALF/FULL
to select the new config for the link. - Run
port start all
to restart all ports. - Check on the tester side that the configuration actually changed using ethtool.
- Run
start
again 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.
148.3.7. Test Case 7: 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/dpdk-testpmd -l 0-3 -n 4 –file-prefix=minjq – -i
Run
port stop all
to stop all ports.Run
port config all speed SPEED duplex HALF/FULL
to select the new config for the link.Run
port start all
to restart all ports. show port info all Check on the tester side that the VF configuration actually changed using ethtool.Run
start
again 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.
148.3.8. Test Case 8: 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 all
to stop all ports. - Run
port config all max-pkt-len 2048
to set the maximum packet length. - Run
port start all
to restart all ports. - Run
start
again 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.
148.3.9. Test Case 9: 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 all
to stop all ports. - Run
port config rss ip
to enable RSS. - Run
port start all
to restart all ports. - Run
start
again 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.
148.3.10. Test Case 10: 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 all
to stop all ports. - Run
port config all rxd 1024
to change the rx descriptors. - Run
port config all txd 1024
to change the tx descriptors. - Run
port start all
to restart all ports. - Check with
show config rxtx
that the descriptors were actually changed. - Run
start
again 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.
148.3.11. Test Case 11: Change the number of rxd/txd after cycle¶
- 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 all
to stop all ports. - Run
port config all rxd 1024
to change the rx descriptors. - Run
port config all txd 1024
to change the tx descriptors. - Run
port start all
to restart all ports. - Check with
show config rxtx
that the descriptors were actually changed. - Run
start
again 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. - Run
stop
to stop the forwarding. - Run
port stop all
to stop all ports. - Run
port start all
to restart all ports. - Check again with
show config rxtx
that the descriptors were actually changed. - Run
start
again 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.
148.3.12. Test Case 12: Change thresholds¶
- 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 all
to stop all ports. - If NIC is IXGBE_10G-X550EM_X_10G_T, IXGBE_10G-X550T, IXGBE_10G-X540T, IXGBE_10G-82599_SFP,
Run
port config all rxd 1024
to change the rx descriptors, Runport config all txd 1024
to change the tx descriptors. - Run
port config all rxfreet 32
to change the rx descriptors. - Run
port config all txpt 64
to change the tx descriptors. - Run
port config all txht 64
to change the tx descriptors. - If NIC is IGC driver, Run
port config all txwt 16
to change the tx descriptors. Else, Runport config all txwt 0
to change the tx descriptors. - Run
port start all
to restart all ports. - Check with
show config rxtx
that the descriptors were actually changed. - Run
start
again 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.
148.3.13. Test Case 13: Stress test¶
- 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 all
to stop all ports. - Run
port start all
to restart all ports. - Check with
show config rxtx
that the descriptors were actually changed. - Run
start
again 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. - Run
stop
to stop the forwarding. - Repeat step 2~6 for 10 times stress test.
148.3.14. Test Case 14: 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 mac
to set fwd type. - Run
start
to start the forwarding, then start packet generator to transmit and receive packets - Run
set link-down port X
to 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 X
to set all port link up - Start packet generator to transmit and receive packets successfully.
148.3.15. Test Case 15: RX/TX descriptor status¶
- Lauch testpmd with rx/tx queue number
--txq=16 --rxq=16
and rx/tx descriptor size--txd=4096 --rxd=4096
- Run
show port 0 rxq * desc * status
to check rx descriptor status. - Check rx descriptor status can be
AVAILABLE
,DONE
orUNAVAILABLE
. - Run
show port 0 txq * desc * status
to check tx descriptor status. - Check tx descriptor status can be
FULL
,DONE
orUNAVAILABLE
.