summaryrefslogtreecommitdiff
path: root/test_plans/tso_test_plan.rst
blob: 83756072868e218ad7ad8434588a47778ca6487e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
#   * Redistributions of source code must retain the above copyright
#     notice, this list of conditions and the following disclaimer.
#   * Redistributions in binary form must reproduce the above copyright
#     notice, this list of conditions and the following disclaimer in
#     the documentation and/or other materials provided with the
#     distribution.
#   * Neither the name of Intel Corporation nor the names of its
#     contributors may be used to endorse or promote products derived
#     from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



==============================================
Testing of TSO Support in DPDK
==============================================


Description
===========

This document provides the plan for testing the TSO(Transmit Segmentation 
Offload, also called Large Send offload - LSO) feature of
Intel Ethernet Controller, including Intel 82599 10GbE Ethernet Controller and
Fortville 40GbE Ethernet Controller. TSO enables the TCP/IP stack to
pass to the network device a larger ULP datagram than the Maximum Transmit 
Unit Size (MTU). NIC divides the large ULP datagram to multiple segments 
according to the MTU size. 


Prerequisites
=============

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::
./x86_64-native-linuxapp-gcc/app/testpmd -c 0xffffffff -n 2 -- -i --rxd=512 --txd=512 
--burst=32 --rxfreet=64 --mbcache=128 --portmask=0x3 --txpt=36 --txht=0 --txwt=0 
--txfreet=32 --txrst=32 --enable-rx-cksum
  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"

Test case: csum fwd engine, use TSO tunneling
====================================================

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::
./x86_64-native-linuxapp-gcc/app/testpmd -c 0xffffffff -n 2 -- -i --rxd=512 --txd=512 
--burst=32 --rxfreet=64 --mbcache=128 --portmask=0x3 --txpt=36 --txht=0 --txwt=0 
--txfreet=32 --txrst=32 --enable-rx-cksum
  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
  testpmd> tx_checksum set vxlan hw 0
  testpmd> tx_checksum set nvgre hw 0
  # enable TSO on tx port
  testpmd> tso set 800 1
  # set fwd engine and start
  testpmd> set fwd csum
  testpmd> start 

Test vxlan() 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=4789)/VXLAN(vni=1234)/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 nvgre() in scapy:
    sendp([Ether(dst="%s",src="52:00:00:00:00:00")/IP(src="192.168.1.1",dst="192.168.1.2",proto=47)/NVGRE()/Ether(dst=%s,src="52:00:00:00:00:00")/IP(src="192.168.1.1",dst="192.168.1.2")/TCP(sport="1021",dport="1021")/("X"*%s)], iface="%s")

Test case: TSO performance
====================================================
Set the packet stream to be sent out from packet generater before testing as 
below.

+-------+---------+---------+---------+----------+----------+ 
| Frame | 1S/1C/1T| 1S/1C/1T| 1S/2C/1T| 1S/2C/2T | 1S/2C/2T | 
| Size  |         |         |         |          |          | 
+-------+---------+---------+---------+----------+----------+ 
|  64   |         |         |         |          |          | 
+-------+---------+---------+---------+----------+----------+ 
|  65   |         |         |         |          |          | 
+-------+---------+---------+---------+----------+----------+ 
|  128  |         |         |         |          |          | 
+-------+---------+---------+---------+----------+----------+ 
|  256  |         |         |         |          |          | 
+-------+---------+---------+---------+----------+----------+ 
|  512  |         |         |         |          |          | 
+-------+---------+---------+---------+----------+----------+ 
|  1024 |         |         |         |          |          | 
+-------+---------+---------+---------+----------+----------+ 
|  1280 |         |         |         |          |          | 
+-------+---------+---------+---------+----------+----------+ 
|  1518 |         |         |         |          |          | 
+-------+---------+---------+---------+----------+----------+

Then run the test application as below:: 
./x86_64-native-linuxapp-gcc/app/testpmd -c 0xffffffff -n 2 -- -i --rxd=512 --txd=512 
--burst=32 --rxfreet=64 --mbcache=128 --portmask=0x3 --txpt=36 --txht=0 --txwt=0 
--txfreet=32 --txrst=32 --enable-rx-cksum
The -n command is used to select the number of memory channels. It should match the 
number of memory channels on that setup.