From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 7EE1D1BA8A for ; Tue, 10 Apr 2018 08:31:05 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Apr 2018 23:31:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,430,1517904000"; d="scan'208";a="30910714" Received: from unknown (HELO ubuntu.icx.intel.com) ([10.67.119.92]) by fmsmga007.fm.intel.com with ESMTP; 09 Apr 2018 23:31:02 -0700 From: lihong To: dts@dpdk.org Cc: lihong Message-Id: <1592587663-7975-1-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH V1] Add test plan about vhost qemu mtu 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: , Date: Tue, 10 Apr 2018 06:31:07 -0000 X-Original-Date: Sat, 20 Jun 2020 01:27:43 +0800 X-List-Received-Date: Tue, 10 Apr 2018 06:31:07 -0000 Signed-off-by: lihong --- test_plans/vhost_qemu_mtu_test_plan.rst | 146 ++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 test_plans/vhost_qemu_mtu_test_plan.rst diff --git a/test_plans/vhost_qemu_mtu_test_plan.rst b/test_plans/vhost_qemu_mtu_test_plan.rst new file mode 100644 index 0000000..0f0dab8 --- /dev/null +++ b/test_plans/vhost_qemu_mtu_test_plan.rst @@ -0,0 +1,146 @@ +.. Copyright (c) <2018>, 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. + +=================== +Vhost MTU Test Plan +=================== + +The feature test the setting of MTU value of virtio-net and kernel driver. + +Prerequisites: +============== + +The guests kernel should grand than 4.10 +The qemu version should greater or equal to 2.9 + +The MTU length is the length of Ether content, so the packet length is +MTU + length of Ether(not include CRC). +Test the MTU function, we send the packet size with: +packet length < MTU + len(Ether) +packek length = MTU + len(Ether) +packet length > MTU + len(Ether) +When the packet length less or equal to the MTU value + length of Ether, +the testpmd can received the packet. +And when the packet length greater than the MTU value + length of Ether, +the testpmd can not recevied the packet. + +Test Case: Test the MTU in virtio-net +===================================== +1. Launch the testpmd by below commands on host, and config mtu:: + + ./testpmd -c 0xc -n 4 --socket-mem 2048,2048 \ + --vdev 'net_vhost0,iface=vhost-net,queues=1' \ + -- -i --txd=512 --rxd=128 --nb-cores=1 --port-topology=chained + testpmd> port config mtu 0 2000 + testpmd> set fwd mac + testpmd> start + +2. Launch VM:: + + Use the qemu_2.9 or qemu 2.10 to start the VM and the VM kernel should + grand than 4.10, set the mtu value to 2000 + + qemu-system-x86_64 \ + -chardev socket,id=char0,path=./vhost-net \ + -netdev type=vhost-user,id=netdev0,chardev=char0,vhostforce \ + -device virtio-net-pci,netdev=netdev0,mrg_rxbuf=on,host_mtu=2000 + +3. Check the MTU value in VM:: + + Use the ifconfig command to check the MTU value of + virtio kernel driver is 2000 in VM. + +4. Use scapy to listen on virtio driver:: + >>> sniff(iface="ens4", count=1) + +5. Send a packet with size 1014, smaller than MTU + len(Ether):: + + The vm can receive the packet. + +6. Send a packet with size 2014, equal to MTU + len(Ether):: + + The vm can receive the packet. + +7. Send a packet with size 2015, greater than MTU + len(Ether):: + + The vm can not receive the packet. + +8. Exit the scapy. + +Test Case: Test the MTU in pmd +============================== +1. Continue use the VM in Test Case1, bind the kernel driver to igb_uio:: + +2. Launch testpmd in VM:: + + ./testpmd -c 0x03 -n 3 \ + -- -i --txd=512 --rxd=128 --tx-offloads=0x0 --enable-hw-vlan-strip + testpmd> set fwd mac + testpmd> start + +3. Run `show port info 0` in VM, and check the MTU value is equal to 2000. + +4. Send a packet with size 1014, smaller than MTU + len(Ether):: + testpmd> clear port stats all + testpmd> show port stats 0 + + ######################## NIC statistics for port 0 ####################### + RX-packets: 1 RX-missed: 0 RX-bytes: 1014 + RX-errors: 0 + RX-nombuf: 0 + TX-packets: 1 TX-errors: 0 TX-bytes: 1014 + + Throughput (since last show) + Rx-pps: 0 + Tx-pps: 0 + ########################################################################### + +5. Send a packet with size 2014, equal to MTU + len(Ether):: + testpmd> clear port stats all + testpmd> show port stats 0 + + ######################## NIC statistics for port 0 ####################### + RX-packets: 1 RX-missed: 0 RX-bytes: 2014 + RX-errors: 0 + RX-nombuf: 0 + RX-packets: 1 TX-errors: 0 TX-bytes: 2014 + + Throughput (since last show) + Rx-pps: 0 + Tx-pps: 0 + ########################################################################### + +6. Send a packet with size 2015, greater than MTU + len(Ether):: + testpmd> clear port stats all + testpmd> show port stats 0 + + The testpmd can not received the packet. -- 2.7.4