From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id D3043C5D4 for ; Fri, 29 Jan 2016 09:43:01 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 29 Jan 2016 00:43:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,363,1449561600"; d="scan'208";a="871539164" Received: from unknown (HELO dpdk-fedora20.icx.intel.com) ([10.238.55.12]) by orsmga001.jf.intel.com with ESMTP; 29 Jan 2016 00:42:57 -0800 From: Lijuan Tu To: dts@dpdk.org Date: Fri, 29 Jan 2016 16:38:34 +0800 Message-Id: <1454056714-11156-1-git-send-email-lijuanx.a.tu@intel.com> X-Mailer: git-send-email 1.9.3 Cc: Lijuan Tu Subject: [dts] [PATCH]Add Checksum/tso test plan: vf_offload_test_plan.rst X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 08:43:02 -0000 From: Lijuan Tu Signed-off-by: Lijuan Tu --- 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 + +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 + +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 rx off tx off tso off gso off gro off lro off + ip l set up + tcpdump -n -e -i -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 rx off tx off tso off gso off gro off lro off + ip l set up +capture package rx port on tester:: + tcpdump -n -e -i -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") + +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" + -- 2.5.0