From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 7C812379B for ; Thu, 23 Feb 2017 08:58:41 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Feb 2017 23:58:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,197,1484035200"; d="scan'208";a="1133749379" Received: from stv-crb-08.sh.intel.com (HELO dpdk-test60.sh.intel.com) ([10.239.128.48]) by fmsmga002.fm.intel.com with ESMTP; 22 Feb 2017 23:58:39 -0800 From: Xueqin Lin To: dts@dpdk.org Cc: Xueqin Lin Date: Wed, 22 Feb 2017 20:54:52 -0500 Message-Id: <1487814892-7793-1-git-send-email-xueqin.lin@intel.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH] TX preparation test plan 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, 23 Feb 2017 07:58:42 -0000 --- test_plans/tx_preparation_test_plan.rst | 166 ++++++++++++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 test_plans/tx_preparation_test_plan.rst diff --git a/test_plans/tx_preparation_test_plan.rst b/test_plans/tx_preparation_test_plan.rst new file mode 100644 index 0000000..6db07b1 --- /dev/null +++ b/test_plans/tx_preparation_test_plan.rst @@ -0,0 +1,166 @@ +.. Copyright (c) <2017>, Intel Corporation + 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. + +========================== +TX preparation forwarding +========================== + +The support of TX preparation forwarding feature consists in: +- Do necessary preparations of packet burst to be safely transmitted + on device for desired HW offloads: + Set/reset checksum field according to the hardware requirements. + Check HW constraints (number of segments per packet, etc). +- Provide information about max segments of TSO and non-TSO packets + accepted by device. + +APPLICATION (CASE OF USE): +- Application should initialize burst of packets to send, set required + tx offload flags and required fields, like l2_len, l3_len, l4_len and + tso_segsz. +- Application passes burst to check required conditions to send packets + through the NIC. +- The result can be used to send valid packets and restore invalid packets + if function fails. + +Prerequisites +============= +Support igb_uio, test txprep forwarding features on e1000, i40e, ixgbe and +fm10k drivers.Send packets from test platform through the interface eth1 to +the tested port 0, then testpmd sends back packet using same port and uses +tcpdump to capture packet information. +Test DUT +eth1 <---> port 0 + +Turn off all hardware offloads on tester machine:: + ethtool -K eth1 rx off tx off tso off gso off gro off lro off + +Launch the ``testpmd`` with the following arguments, set ``--txqflags=0`` to +let TX checksum offloads and TSO mode in the “Full Featured” TX path:: + ./testpmd -c 0x6 -n 4 -- -i --txqflags=0 --port-topology=chained + +Set the ``csum`` forwarding mode:: + testpmd> set fwd csum + +Set the verbose level to 1 to display informations for each received packet:: + testpmd> set verbose 1 + +Test Case: TX preparation forwarding of non-TSO packets +======================================================= +Set TSO turned off:: + testpmd> tso set 0 0 +Start the packet forwarding:: + testpmd> start + +Send few IP/TCP/UDP packets from test machine to DUT. Check IP/TCP/UDP +checksum correctness in captured packet, such as correct as below:: + 03:06:36.569730 3c:fd:fe:9d:64:30 > 90:e2:ba:63:22:e8, ethertype IPv4 + (0x0800), length 104: (tos 0x0, ttl 64, id 1, offset 0, flags [none], + proto TCP (6), length 90) + 127.0.0.1.ftp-data > 127.0.0.1.http: Flags [.], cksum 0x1998 (correct), + seq 0:50, ack 0, win 8192, length 50: HTTP + 03:06:36.569816 90:e2:ba:63:22:e8 > 02:00:00:00:00:00, ethertype IPv4 + (0x0800), length 104: (tos 0x0, ttl 64, id 1, offset 0, flags [none], + proto TCP (6), length 90) + 127.0.0.1.ftp-data > 127.0.0.1.http: Flags [.], cksum 0x1998 (correct), + seq 0:50, ack 1, win 8192, length 50: HTTP + + +Test Case: TX preparation forwarding of TSO packets +==================================================== + +Set TSO turned on:: + testpmd> tso set 800 0 + TSO segment size for non-tunneled packets is 800 + +Start the packet forwarding:: + testpmd> start + +Send few IP/TCP packets from test machine to DUT. Check IP/TCP checksum +correctness in captured packet and verify correctness of HW TSO offload +for large packets. One large TCP packet (1400 bytes + headers) segmented +to two fragments (800 and 600 bytes + headers), checksums are also ok:: + 15:44:14.478255 00:00:00:00:00:00 > ff:ff:ff:ff:ff:ff, ethertype IPv4 + (0x0800), length 1454: (tos 0x0, ttl 64, id 1, offset 0, flags [none], + proto TCP (6), length 1440, bad cksum 1234 (->7755)!) + 127.0.0.1.20 > 127.0.0.1.80: Flags [.], cksum 0x1234 (incorrect -> + 0xc5f2), seq 0:1400, ack 1, win 8192, length 1400 + 15:44:14.478350 00:1e:67:57:03:09 > 02:00:00:00:00:00, ethertype + IPv4 (0x0800), length 854: (tos 0x0, ttl 64, id 1, offset 0, flags + [none], proto TCP (6), length 840) + 127.0.0.1.20 > 127.0.0.1.80: Flags [.], cksum 0x498b (correct), seq + 0:800, ack 1, win 8192, length 800 + 15:44:14.478374 00:1e:67:57:03:09 > 02:00:00:00:00:00, ethertype IPv4 + (0x0800), length 654: (tos 0x0, ttl 64, id 2, offset 0, flags [none], + proto TCP (6), length 640) + 127.0.0.1.20 > 127.0.0.1.80: Flags [.], cksum 0x0ab6 (correct), seq + 800:1400, ack 1, win 8192, length 600 + +Note: TSO turned on case unsupports UDP packet. + +Packet:: + ######## + # IPv4 # + ######## + + # checksum TCP + p=Ether()/IP()/TCP(flags=0x10)/Raw(RandString(50)) + + # bad IP checksum + p=Ether()/IP(chksum=0x1234)/TCP(flags=0x10)/Raw(RandString(50)) + + # bad TCP checksum + p=Ether()/IP()/TCP(flags=0x10, chksum=0x1234)/Raw(RandString(50)) + + # large packet + p=Ether()/IP()/TCP(flags=0x10)/Raw(RandString(1400)) + + # bad checksum and large packet + p=Ether()/IP(chksum=0x1234)/TCP(flags=0x10,chksum=0x1234)/ + Raw(RandString(1400)) + + + ######## + # IPv6 # + ######## + + # checksum TCP + p=Ether()/IPv6()/TCP(flags=0x10)/Raw(RandString(50)) + + # checksum UDP + p=Ether()/IPv6()/UDP()/Raw(RandString(50)) + + # bad TCP checksum + p=Ether()/IPv6()/TCP(flags=0x10, chksum=0x1234)/Raw(RandString(50)) + + # large packet + p=Ether()/IPv6()/TCP(flags=0x10)/Raw(RandString(1400)) + -- 2.5.5