[dts] [PATCH]Add Checksum/tso test plan: vf_offload_test_plan.rst

Liu, Yong yong.liu at intel.com
Mon Feb 1 09:57:50 CET 2016


Lijuan,
Some comments below.

On 01/29/2016 04:38 PM, Lijuan Tu wrote:
> From: Lijuan Tu <lijuanx.tu.a at intel.com>
>
> Signed-off-by: Lijuan Tu <lijuanx.tu.a at intel.com>
> ---
>   test_plans/vf_offload_test_plan.rst | 246 ++++++++++++++++++++++++++++++++++++
>   1 file changed, 246 insertions(+)
>   create mode 100644 test_plans/vf_offload_test_plan.rst
>
> diff --git a/test_plans/vf_offload_test_plan.rst b/test_plans/vf_offload_test_plan.rst
> new file mode 100644
> index 0000000..c5aa1c6
> --- /dev/null
> +++ b/test_plans/vf_offload_test_plan.rst
> @@ -0,0 +1,246 @@
> +Prerequisites
> +===============
> +
> +Create Two VF interfaces from two kernel PF ineterfaces, and then attach them to VM. Suppose PF is 0000:04:00.0. Generate 2VFs using commands below and make them in pci-stub mods.
> +
> +1. Get the pci device id of DUT::
> +
> +    ./dpdk_nic_bind.py --st
> +    0000:04:00.0 '82599ES 10-Gigabit SFI/SFP+ Network Connection' if=ens261f0 drv=ixgbe unused=igb_uio
> +
> +2. Create 2 VFs from 2 PFs::
> +
> +    echo 2 > /sys/bus/pci/devices/0000\:04\:00.0/sriov_numvfs
> +
> +VFs 04:10.0 & 04:10.1 have been created::
> +
> +    ./dpdk_nic_bind.py --st
> +    0000:04:00.0 '82599ES 10-Gigabit SFI/SFP+ Network Connection' if=ens261f0 drv=ixgbe unused=
> +    0000:04:10.0 '82599 Ethernet Controller Virtual Function' if=enp4s16 drv=ixgbevf unused=
> +    0000:04:10.1 '82599 Ethernet Controller Virtual Function' if=enp4s16f1 drv=ixgbevf unused=
> +
> +3. detach VFs from the host, bind them to pci-stub driver::
> +
> +    /sbin/modprobe pci-stub
> +    echo "8086 10ed" > /sys/bus/pci/drivers/pci-stub/new_id
> +    echo 0000:04:10.0 > /sys/bus/pci/devices/0000\:04\:10.0/driver/unbind
> +    echo 0000:04:10.0 > /sys/bus/pci/drivers/pci-stub/bind
> +    echo 0000:04:10.1 > /sys/bus/pci/devices/0000\:04\:10.1/driver/unbind
> +    echo 0000:04:10.1 > /sys/bus/pci/drivers/pci-stub/bind
> +
> +or using the following more easy way::
> +
> +    ./dpdk_nic_bind.py -b pci-stub 04:10.0 04:10.1
> +
> +it can be seen that VFs 04:10.0 & 04:10.1 's drv is pci-stub::
> +
> +    ./dpdk_nic_bind.py --st
> +    0000:04:00.0 '82599ES 10-Gigabit SFI/SFP+ Network Connection' if=ens261f0 drv=ixgbe unused=vfio-pci
> +    0000:04:10.0 '82599 Ethernet Controller Virtual Function' if= drv=pci-stub unused=ixgbevf,vfio-pci
> +    0000:04:10.1 '82599 Ethernet Controller Virtual Function' if= drv=pci-stub unused=ixgbevf,vfio-pci
> +
> +4. Do not forget bring up PFs::
> +
> +    ifconfig ens261f0 up
> +
> +Passthrough VFs 04:10.0 & 04:10.1 to vm0, and start vm0, you can refer to below command::
> +
> +    taskset -c 6-12 qemu-system-x86_64 \
> +    -enable-kvm -m 8192  -smp 6 -cpu host -name dpdk15-vm1 \
> +    -drive file=/home/image/fedora23.img \
> +    -netdev tap,id=hostnet1,ifname=tap1,script=/etc/qemu-ifup,vhost=on \
> +    -device rtl8139,netdev=hostnet1,id=net1,mac=52:54:01:6b:10:61,bus=pci.0,addr=0xa \
> +    -device pci-assign,bus=pci.0,addr=0x6,host=04:10.0 \
> +    -device pci-assign,bus=pci.0,addr=0x7,host=04:10.1 \
> +    -vnc :11 -daemonize
> +
> +the /etc/qemu-ifup can be below script, need you to create first::
> +
> +    #!/bin/sh
> +    set -x
> +    switch=br0
> +    if [ -n "$1" ];then
> +        /usr/sbin/tunctl -u `whoami` -t $1
> +        /sbin/ip link set $1 up
> +        sleep 0.5s
> +        /usr/sbin/brctl addif $switch $1
> +        exit 0
> +    else
> +        echo "Error: no interface specified"
> +    exit 1
> +    fi
On host, there maybe not bridge available. Suggest just use framework 
generate virtual machine.

> +
> +Set up bridge br0 before create /etc/qemu-ifup, for example::
> +
> +    cd /etc/sysconfig/network-scripts
> +    vim ifcfg-enp1s0f0
> +
> +    HWADDR=00:1e:67:fb:0f:d4
> +    TYPE=Ethernet
> +    NAME=enp1s0f0
> +    ONBOOT=yes
> +    DEVICE=enp1s0f0
> +    NM_CONTROLLED=no
> +    BRIDGE=br0
> +
> +    vim ifcfg-br0
> +    TYPE=Bridge
> +    DEVICE=br0
> +    ONBOOT=yes
> +    NM_CONTROLLED=no
> +    BOOTPROTO=dhcp
> +    HOSTNAME="dpdk-test58"
> +
> +Login vm0, got VFs pci device id in vm0, assume they are 00:06.0 &
> +00:07.0, bind them to igb_uio driver, and then start testpmd, set it in
> +mac forward mode::
> +
> +    ./tools/dpdk_nic_bind.py --bind=igb_uio 00:06.0 00:07.0
> +                                                                                                                                                                               102,5         32%
> +Prerequisites for checksum
> +==========================
> +
> +Support igb_uio and vfio driver, if used vfio, kernel need 3.6+ and enable vt-d in bios.
> +When used vfio , used "modprobe vfio" and "modprobe vfio-pci" insmod vfiod driver, then used
> +"./tools/dpdk_nic_bind.py --bind=vfio-pci device_bus_id" to bind vfio driver to test driver.
> +
> +Assuming that ports ``0`` and ``2`` are connected to a traffic generator,
> +launch the ``testpmd`` with the following arguments::
> +
> +  ./build/app/testpmd -cffffff -n 1 -- -i --burst=1 --txpt=32 \
> +  --txht=8 --txwt=0 --txfreet=0 --rxfreet=64 --mbcache=250 --portmask=0x5
> +  enable-rx-checksum
> +
Please check txqflags.

> +Set the verbose level to 1 to display informations for each received packet::
> +
> +  testpmd> set verbose 1
> +
> +
> +
> +Test Case: Insert IPv4/IPv6 UDP/TCP/SCTP checksum on the transmit packet
> +========================================================================
> +
> +Setup the ``csum`` forwarding mode::
> +
> +  testpmd> set fwd csum
> +  Set csum packet forwarding mode
> +
> +Enable the IPv4/UDP/TCP/SCTP checksum offload on port 0::
> +
> +  testpmd>
> +  testpmd> tx_checksum set ip hw 0
> +  testpmd> tx_checksum set udp hw 0
> +  testpmd> tx_checksum set tcp hw 0
> +  testpmd> tx_checksum set sctp hw 0
> +  testpmd> start
> +    csum packet forwarding - CRC stripping disabled - packets/burst=32
> +    nb forwarding cores=1 - nb forwarding ports=10
> +    RX queues=1 - RX desc=128 - RX free threshold=64
> +    RX threshold registers: pthresh=8 hthresh=8 wthresh=4
> +    TX queues=1 - TX desc=512 - TX free threshold=0
> +    TX threshold registers: pthresh=32 hthresh=8 wthresh=8
> +
> +Configure the traffic generator to send the multiple packets for the following
> +combination: IPv4/UDP, IPv4/TCP, IPv4/SCTP, IPv6/UDP, IPv6/TCP.
> +
> +Except that SCTP header + payload length must be a multiple of 4 bytes.
> +IPv4 + UDP/TCP packet length can range from the minimum length to 1518 bytes.
> +
> +Then verify that the same number of packet are correctly received on the traffic
> +generator side. And IPv4 checksum, TCP checksum, UDP checksum, SCTP CRC32c need
> +be validated as pass by the IXIA.
> +
> +The IPv4 source address will not be changed by testpmd.
> +
> +
> +Test Case: Do not insert IPv4/IPv6 UDP/TCP checksum on the transmit packet
> +==========================================================================
> +
> +Setup the ``csum`` forwarding mode::
> +
> +  testpmd> set fwd csum
> +  Set csum packet forwarding mode
> +
> +Disable the IPv4/UDP/TCP/SCTP checksum offload on port 0::
> +
> +  testpmd> tx_checksum set 0x0 0
> +  testpmd> start
> +    csum packet forwarding - CRC stripping disabled - packets/burst=32
> +    nb forwarding cores=1 - nb forwarding ports=10
> +    RX queues=1 - RX desc=128 - RX free threshold=64
> +    RX threshold registers: pthresh=8 hthresh=8 wthresh=4
> +    TX queues=1 - TX desc=512 - TX free threshold=0
> +    TX threshold registers: pthresh=32 hthresh=8 wthresh=8
> +
> +Configure the traffic generator to send the multiple packets for the follwing
> +combination: IPv4/UDP, IPv4/TCP, IPv6/UDP, IPv6/TCP.
> +
> +IPv4 + UDP/TCP packet length can range from the minimum length to 1518 bytes.
> +
> +Then verify that the same number of packet are correctly received on the traffic
> +generator side. And IPv4 checksum, TCP checksum, UDP checksum need
> +be validated as pass by the IXIA.
> +
> +The first byte of source IPv4 address will be increment by testpmd. The checksum
> +is indeed recalculated by software algorithms.
> +
> +Prerequisites for TSO
> +=====================
> +
> +The DUT must take one of the Ethernet controller ports connected to a port on another
> +device that is controlled by the Scapy packet generator.
> +
> +The Ethernet interface identifier of the port that Scapy will use must be known.
> +On tester, all offload feature should be disabled on tx port, and start rx port capture::
> +  ethtool -K <tx port> rx off tx off tso off gso off gro off lro off
> +  ip l set <tx port> up
> +  tcpdump -n -e -i <rx port> -s 0 -w /tmp/cap
> +
> +
> +On DUT, run pmd with parameter "--enable-rx-cksum". Then enable TSO on tx port
> +and checksum on rx port. The test commands is below::
> +  #enable hw checksum on rx port
> +  tx_checksum set ip hw 0
> +  tx_checksum set udp hw 0
> +  tx_checksum set tcp hw 0
> +  tx_checksum set sctp hw 0
> +  set fwd csum
> +
> +  # enable TSO on tx port
> +  *tso set 800 1
> +
> +
> +Test case: csum fwd engine, use TSO
> +====================================================
> +
> +This test uses ``Scapy`` to send out one large TCP package. The dut forwards package
> +with TSO enable on tx port while rx port turns checksum on. After package send out
> +by TSO on tx port, the tester receives multiple small TCP package.
> +
> +Turn off tx port by ethtool on tester::
> +  ethtool -K <tx port> rx off tx off tso off gso off gro off lro off
> +  ip l set <tx port> up
> +capture package rx port on tester::
> +  tcpdump -n -e -i <rx port> -s 0 -w /tmp/cap
> +
> +Launch the userland ``testpmd`` application on DUT as follows::
> +
> +  testpmd> set verbose 1
> +
> +  # enable hw checksum on rx port
> +  testpmd> tx_checksum set ip hw 0
> +  testpmd> tx_checksum set udp hw 0
> +  testpmd> tx_checksum set tcp hw 0
> +  testpmd> tx_checksum set sctp hw 0
> +  # enable TSO on tx port
> +  testpmd> tso set 800 1
> +  # set fwd engine and start
> +  testpmd> set fwd csum
> +  testpmd> start
> +
> +Test IPv4() in scapy:
> +    sendp([Ether(dst="%s", src="52:00:00:00:00:00")/IP(src="192.168.1.1",dst="192.168.1.2")/UDP(sport=1021,dport=1021)/Raw(load="\x50"*%s)], iface="%s")
> +
Packet size should over 800. And need check segment sequence.

> +Test IPv6() in scapy:
> +    sendp([Ether(dst="%s", src="52:00:00:00:00:00")/IPv6(src="FE80:0:0:0:200:1FF:FE00:200", dst="3555:5555:6666:6666:7777:7777:8888:8888")/UDP(sport=1021,dport=1021)/Raw(load="\x50"*%s)], iface="%s"
> +



More information about the dts mailing list