147. Short-lived Application Tests¶
147.1. Description¶
This feature is to reduce application start-up time, and do more cleanup when exit so that it could rerun many times.
147.2. Prerequisites¶
To test this feature, need to use linux time and start testpmd by: create and mount hugepage, must create more hugepages so that could measure time more obviously:
# echo 8192 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
# mount -t hugetlbfs hugetlbfs /mnt/huge
Bind nic to DPDK:
./usertools/dpdk-devbind.py -b vfio-pci device_bus_id
Start testpmd using time:
# echo quit | time ./app/dpdk-testpmd -c 0x3 -n 4 -- -i
147.2.1. Test Case 1: Basic fwd testing¶
Start testpmd:
./app/dpdk-testpmd -c 0x3 -n 4 -- -i
Set fwd mac.
Send packet from pkg.
Check all packets could be fwd back.
147.2.2. Test Case 2: Get start up time¶
Start testpmd:
echo quit | time ./app/dpdk-testpmd -c 0x3 -n 4 --huge-dir /mnt/huge -- -i
Get the time stats of the startup.
Repeat step 1~2 for at least 5 times to get the average.
147.2.3. Test Case 3: Clean up with Signal – testpmd¶
Create 4G hugepages, so that could save times when repeat:
echo 2048 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages mount -t hugetlbfs hugetlbfs /mnt/huge1
Start testpmd:
./app/dpdk-testpmd -c 0x3 -n 4 --huge-dir /mnt/huge1 -- -i --portmask=0x3
Set fwd mac.
Send packets from pkg.
Check all packets could be fwd back.
Kill the testpmd in shell using below commands alternately:
SIGINT: pkill -2 dpdk-testpmd SIGTERM: pkill -15 dpdk-testpmd
Repeat step 1-6 for 20 times, and packet must be fwd back with no error for each time.
147.2.4. Test Case 4: Clean up with Signal – l2fwd¶
Build l2fwd example:
meson configure -Dexamples=l2fwd x86_64-native-linuxapp-gcc ninja -C x86_64-native-linuxapp-gcc
Create 4G hugepages, so that could save times when repeat:
echo 2048 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages mount -t hugetlbfs hugetlbfs /mnt/huge1
Start testpmd:
./examples/dpdk-l2fwd -c 0x3 -n 4 --huge-dir /mnt/huge1 -- -p 0x03
Set fwd mac.
Send packets from pkg.
Check all packets could be fwd back.
Kill the testpmd in shell using below commands alternately:
SIGINT: pkill -2 dpdk-l2fwd SIGTERM: pkill -15 dpdk-l2fwd
Repeat step 1-6 for 20 times, and packet must be fwd back with no error for each time.
147.2.5. Test Case 5: Clean up with Signal – l3fwd¶
Build l3fwd example:
meson configure -Dexamples=l3fwd x86_64-native-linuxapp-gcc ninja -C x86_64-native-linuxapp-gcc
Create 4G hugepages, so that could save times when repeat:
echo 2048 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages mount -t hugetlbfs hugetlbfs /mnt/huge1
Start testpmd:
./examples/dpdk-l3fwd -c 0x3 -n 4 --huge-dir /mnt/huge1 -- -p 0x03 --config='(0,0,1),(1,0,2)' &
Set fwd mac.
Send packets from pkg.
Check all packets could be fwd back.
Kill the testpmd in shell using below commands alternately:
SIGINT: pkill -2 dpdk-l3fwd SIGTERM: pkill -15 dpdk-l3fwd
Repeat step 1-6 for 20 times, and packet must be fwd back with no error for each time.