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 5B779568F for ; Thu, 4 Feb 2016 05:47:23 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 03 Feb 2016 20:47:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,393,1449561600"; d="scan'208";a="905201383" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga002.jf.intel.com with ESMTP; 03 Feb 2016 20:47:22 -0800 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 3 Feb 2016 20:47:22 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 3 Feb 2016 20:47:21 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.172]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.218]) with mapi id 14.03.0248.002; Thu, 4 Feb 2016 12:47:19 +0800 From: "Pei, Yulong" To: "Tu, LijuanX A" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH]Add Checksum/tso test plan: vf_offload_test_plan.rst Thread-Index: AQHRWnExGC5YDT8nDkWhp4cnvCyNdp8bWLlg Date: Thu, 4 Feb 2016 04:47:18 +0000 Message-ID: <188971FCDA171749BED5DA74ABF3E6F00352DE1F@shsmsx102.ccr.corp.intel.com> References: <1454056714-11156-1-git-send-email-lijuanx.a.tu@intel.com> In-Reply-To: <1454056714-11156-1-git-send-email-lijuanx.a.tu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjg2NzQ2NDctMmNiMC00YjMyLTgzMjUtNWJlNjhlNzBlMDEwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoieUZhd09XNlc2aGxNRll4R0lTSnIzaEc1UFpMZTRJeFBxQ0FYUHR4blpNYz0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: Lijuan Tu Subject: Re: [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: Thu, 04 Feb 2016 04:47:24 -0000 Hi Lijuan, one comment, I only saw "checksum on the transmit packet" test, no "checksum on the rece= ive packet" test. Best Regards Yulong Pei -----Original Message----- From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Lijuan Tu Sent: Friday, January 29, 2016 4:39 PM To: dts@dpdk.org Cc: Lijuan Tu Subject: [dts] [PATCH]Add Checksum/tso test plan: vf_offload_test_plan.rst 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_te= st_plan.rst new file mode 100644 index 0000000..c5aa1c6 --- /dev/null +++ b/test_plans/vf_offload_test_plan.rst @@ -0,0 +1,246 @@ +Prerequisites +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Create Two VF interfaces from two kernel PF ineterfaces, and then attach t= hem to VM. Suppose PF is 0000:04:00.0. Generate 2VFs using commands below a= nd 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'=20 + if=3Dens261f0 drv=3Dixgbe unused=3Digb_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=3Dens= 261f0 drv=3Dixgbe unused=3D + 0000:04:10.0 '82599 Ethernet Controller Virtual Function' if=3Denp4s16= drv=3Dixgbevf unused=3D + 0000:04:10.1 '82599 Ethernet Controller Virtual Function'=20 + if=3Denp4s16f1 drv=3Dixgbevf unused=3D + +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=3Dens= 261f0 drv=3Dixgbe unused=3Dvfio-pci + 0000:04:10.0 '82599 Ethernet Controller Virtual Function' if=3D drv=3D= pci-stub unused=3Dixgbevf,vfio-pci + 0000:04:10.1 '82599 Ethernet Controller Virtual Function' if=3D=20 + drv=3Dpci-stub unused=3Dixgbevf,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=3D/home/image/fedora23.img \ + -netdev tap,id=3Dhostnet1,ifname=3Dtap1,script=3D/etc/qemu-ifup,vhost= =3Don \ + -device rtl8139,netdev=3Dhostnet1,id=3Dnet1,mac=3D52:54:01:6b:10:61,bu= s=3Dpci.0,addr=3D0xa \ + -device pci-assign,bus=3Dpci.0,addr=3D0x6,host=3D04:10.0 \ + -device pci-assign,bus=3Dpci.0,addr=3D0x7,host=3D04:10.1 \ + -vnc :11 -daemonize + +the /etc/qemu-ifup can be below script, need you to create first:: + + #!/bin/sh + set -x + switch=3Dbr0 + 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=3D00:1e:67:fb:0f:d4 + TYPE=3DEthernet + NAME=3Denp1s0f0 + ONBOOT=3Dyes + DEVICE=3Denp1s0f0 + NM_CONTROLLED=3Dno + BRIDGE=3Dbr0 + + vim ifcfg-br0 + TYPE=3DBridge + DEVICE=3Dbr0 + ONBOOT=3Dyes + NM_CONTROLLED=3Dno + BOOTPROTO=3Ddhcp + HOSTNAME=3D"dpdk-test58" + +Login vm0, got VFs pci device id in vm0, assume they are 00:06.0 &=20 +00:07.0, bind them to igb_uio driver, and then start testpmd, set it in=20 +mac forward mode:: + + ./tools/dpdk_nic_bind.py --bind=3Digb_uio 00:06.0 00:07.0 + = = 102,5 32% +Prerequisites for checksum +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D + +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=20 +vfiod driver, then used "./tools/dpdk_nic_bind.py --bind=3Dvfio-pci device= _bus_id" to bind vfio driver to test driver. + +Assuming that ports ``0`` and ``2`` are connected to a traffic=20 +generator, launch the ``testpmd`` with the following arguments:: + + ./build/app/testpmd -cffffff -n 1 -- -i --burst=3D1 --txpt=3D32 \ + --txht=3D8 --txwt=3D0 --txfreet=3D0 --rxfreet=3D64 --mbcache=3D250=20 + --portmask=3D0x5 enable-rx-checksum + +Set the verbose level to 1 to display informations for each received packe= t:: + + testpmd> set verbose 1 + + + +Test Case: Insert IPv4/IPv6 UDP/TCP/SCTP checksum on the transmit=20 +packet=20 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +=3D + +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=3D32 + nb forwarding cores=3D1 - nb forwarding ports=3D10 + RX queues=3D1 - RX desc=3D128 - RX free threshold=3D64 + RX threshold registers: pthresh=3D8 hthresh=3D8 wthresh=3D4 + TX queues=3D1 - TX desc=3D512 - TX free threshold=3D0 + TX threshold registers: pthresh=3D32 hthresh=3D8 wthresh=3D8 + +Configure the traffic generator to send the multiple packets for the=20 +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 byt= es. + +Then verify that the same number of packet are correctly received on=20 +the traffic generator side. And IPv4 checksum, TCP checksum, UDP=20 +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=20 +packet=20 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +=3D=3D=3D + +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=3D32 + nb forwarding cores=3D1 - nb forwarding ports=3D10 + RX queues=3D1 - RX desc=3D128 - RX free threshold=3D64 + RX threshold registers: pthresh=3D8 hthresh=3D8 wthresh=3D4 + TX queues=3D1 - TX desc=3D512 - TX free threshold=3D0 + TX threshold registers: pthresh=3D32 hthresh=3D8 wthresh=3D8 + +Configure the traffic generator to send the multiple packets for the=20 +follwing +combination: IPv4/UDP, IPv4/TCP, IPv6/UDP, IPv6/TCP. + +IPv4 + UDP/TCP packet length can range from the minimum length to 1518 byt= es. + +Then verify that the same number of packet are correctly received on=20 +the traffic generator side. And IPv4 checksum, TCP checksum, UDP=20 +checksum need be validated as pass by the IXIA. + +The first byte of source IPv4 address will be increment by testpmd. The=20 +checksum is indeed recalculated by software algorithms. + +Prerequisites for TSO +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +The DUT must take one of the Ethernet controller ports connected to a=20 +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=20 +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 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D + +This test uses ``Scapy`` to send out one large TCP package. The dut=20 +forwards package with TSO enable on tx port while rx port turns=20 +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:: + =20 + 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=3D"%s",=20 +src=3D"52:00:00:00:00:00")/IP(src=3D"192.168.1.1",dst=3D"192.168.1.2")/UDP= (sp +ort=3D1021,dport=3D1021)/Raw(load=3D"\x50"*%s)], iface=3D"%s") + +Test IPv6() in scapy: + sendp([Ether(dst=3D"%s", src=3D"52:00:00:00:00:00")/IPv6(src=3D"FE80:0= :0:0:200:1FF:FE00:200", dst=3D"3555:5555:6666:6666:7777:7777:8888:8888")/UD= P(sport=3D1021,dport=3D1021)/Raw(load=3D"\x50"*%s)], iface=3D"%s" + -- 2.5.0