test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V2 1/3] add vf rss test plan
@ 2016-01-15  6:48 xu,huilong
  2016-01-15  6:48 ` [dts] [PATCH V2 2/3] add vm config for vf rss test case xu,huilong
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: xu,huilong @ 2016-01-15  6:48 UTC (permalink / raw)
  To: dts

---
 test_plans/vf_rss_test_plan.rst | 186 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 186 insertions(+)
 create mode 100644 test_plans/vf_rss_test_plan.rst

diff --git a/test_plans/vf_rss_test_plan.rst b/test_plans/vf_rss_test_plan.rst
new file mode 100644
index 0000000..864b0a1
--- /dev/null
+++ b/test_plans/vf_rss_test_plan.rst
@@ -0,0 +1,186 @@
+.. Copyright (c) <2016>, 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.
+
+==================================================================
+Fortville RSS full support - Support configuring hash functions
+==================================================================
+
+This document provides test plan for testing the function of Fortville:
+Support configuring hash functions.
+
+Prerequisites
+-------------
+
+2x Intel? 82599 (Niantic) NICs (2x 10GbE full duplex optical ports per NIC)
+1x Fortville_eagle NIC (4x 10G)
+1x Fortville_spirit NIC (2x 40G) 
+2x Fortville_spirit_single NIC (1x 40G)
+
+The one port of the 82599 connect to the Fortville_eagle;
+The one port of Fortville_spirit connect to Fortville_spirit_single.
+The three kinds of NICs are the target NICs. the connected NICs can send packets
+to these three NICs using scapy.
+
+Network Traffic
+---------------
+
+The RSS feature is designed to improve networking performance by load balancing
+the packets received from a NIC port to multiple NIC RX queues, with each queue
+handled by a different logical core.
+
+#1. The receive packet is parsed into the header fields used by the hash
+operation (such as IP addresses, TCP port, etc.)
+
+#2. A hash calculation is performed. The Fortville  supports three hash function:
+Toeplitz, simple XOR and their Symmetric RSS.
+
+#3. Hash result are used as an index into a 128/512 entry
+'redirection table'. 
+
+#4. Niantic VF only support simple default hash algorithm(simple). Fortville NIC
+support all hash algorithm only used dpdk driver on host. when used kernel driver on host,
+fortville nic only support default hash algorithm(simple).
+
+The RSS RETA update feature is designed to make RSS more flexible by allowing
+users to define the correspondence between the seven LSBs of hash result and
+the queue id(RSS output index) by themself.
+
+
+Test Case:  test_rss_hash
+========================================
+
+The following RX Ports/Queues configurations have to be benchmarked:
+
+- 1 RX port / 4 RX queues (1P/4Q)
+
+
+Testpmd configuration - 4 RX/TX queues per port
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+::
+  
+  testpmd -c 1f -n 3  -- -i --rxq=4 --txq=4 --txqflags=0
+
+Testpmd Configuration Options
+-----------------------------
+
+By default, a single logical core runs the test.
+The CPU IDs and the number of logical cores running the test in parallel can
+be manually set with the ``set corelist X,Y`` and the ``set nbcore N``
+interactive commands of the ``testpmd`` application.
+#1. got the pci device id of DUT, for example,
+
+./dpdk_nic_bind.py --st
+
+0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=ens259f0 drv=i40e unused=
+0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=ens259f1 drv=i40e unused=
+
+#2. create 2 VFs from 2 PFs,
+
+echo 1 > /sys/bus/pci/devices/0000\:81\:00.0/sriov_numvfs
+echo 1 > /sys/bus/pci/devices/0000\:81\:00.1/sriov_numvfs
+./dpdk_nic_bind.py --st
+
+0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=ens259f0 drv=i40e unused=
+0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=ens259f1 drv=i40e unused=
+0000:81:02.0 'XL710/X710 Virtual Function' unused=
+0000:81:0a.0 'XL710/X710 Virtual Function' unused=
+
+#3. detach VFs from the host, bind them to pci-stub driver,
+
+/sbin/modprobe pci-stub
+
+using `lspci -nn|grep -i ethernet` got VF device id, for example "8086 154c",
+
+echo "8086 154c" > /sys/bus/pci/drivers/pci-stub/new_id
+echo 0000:81:02.0 > /sys/bus/pci/devices/0000:08:02.0/driver/unbind
+echo 0000:81:02.0 > /sys/bus/pci/drivers/pci-stub/bind
+
+echo "8086 154c" > /sys/bus/pci/drivers/pci-stub/new_id
+echo 0000:81:0a.0 > /sys/bus/pci/devices/0000:08:0a.0/driver/unbind
+echo 0000:81:0a.0 > /sys/bus/pci/drivers/pci-stub/bind
+
+  or using the following more easy way,
+
+  virsh nodedev-detach pci_0000_81_02_0; 
+  virsh nodedev-detach pci_0000_81_0a_0;
+
+  ./dpdk_nic_bind.py --st
+
+  0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=ens259f0 drv=i40e unused=
+  0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=ens259f1 drv=i40e unused=
+  0000:81:02.0 'XL710/X710 Virtual Function' if= drv=pci-stub unused=
+  0000:81:0a.0 'XL710/X710 Virtual Function' if= drv=pci-stub unused=
+
+  it can be seen that VFs 81:02.0 & 81:0a.0 's drv is pci-stub.
+
+#4. passthrough VFs 81:02.0 & 81:0a.0 to vm0, and start vm0,
+
+  /usr/bin/qemu-system-x86_64  -name vm0 -enable-kvm \
+  -cpu host -smp 4 -m 2048 -drive file=/home/image/sriov-fc20-1.img -vnc :1 \
+  -device pci-assign,host=81:02.0,id=pt_0 \
+  -device pci-assign,host=81:0a.0,id=pt_1
+
+#5. 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
+
+#6. Reta Configuration.  128 reta entries configuration::
+
+  testpmd command: port config 0 rss reta (hash_index,queue_id)
+
+#7. PMD fwd only receive the packets::
+
+  testpmd command: set fwd rxonly
+
+#8. rss recived package type configuration two received packet types configuration::
+
+  testpmd command: port config 0 rss ip/udp/tcp
+
+#9. verbose configuration::
+
+  testpmd command: set verbose 8
+
+#10. start packet receive::
+
+  testpmd command: start
+#11. send packet and check rx port received packet by different queue.
+  different hash type send different packet, example hash type is ip, packet src and dts ip not different
+  sendp([Ether(dst="90:e2:ba:36:99:3c")/IP(src="192.168.0.4", dst="192.168.0.5")], iface="eth3")
+  sendp([Ether(dst="90:e2:ba:36:99:3c")/IP(src="192.168.0.5", dst="192.168.0.4")], iface="eth3")   
+Test Case:  test_reta
+========================================
+   this case test hash reta table, the test steps same with test_rss_hash except config hash reta table
+#1 before send packet, config hash reta,512(niantic nic have 128 reta) reta entries configuration::
+
+     testpmd command: port config 0 rss reta (hash_index,queue_id)
-- 
1.9.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dts] [PATCH V2 2/3] add vm config for vf rss test case
  2016-01-15  6:48 [dts] [PATCH V2 1/3] add vf rss test plan xu,huilong
@ 2016-01-15  6:48 ` xu,huilong
  2016-01-15  6:48 ` [dts] [PATCH V2 3/3] add vf rss test script xu,huilong
  2016-01-19  3:21 ` [dts] [PATCH V2 1/3] add vf rss test plan Liu, Yong
  2 siblings, 0 replies; 4+ messages in thread
From: xu,huilong @ 2016-01-15  6:48 UTC (permalink / raw)
  To: dts

---
 conf/vf_rss.cfg | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100644 conf/vf_rss.cfg

diff --git a/conf/vf_rss.cfg b/conf/vf_rss.cfg
new file mode 100644
index 0000000..fb88ad9
--- /dev/null
+++ b/conf/vf_rss.cfg
@@ -0,0 +1,105 @@
+# QEMU options
+# name
+#       name: vm0
+#
+# enable_kvm
+#       enable: [yes | no]
+#
+# cpu
+#       model: [host | core2duo | ...]
+#           usage:
+#               choose model value from the command
+#                   qemu-system-x86_64 -cpu help
+#       number: '4' #number of vcpus
+#       cpupin: '3 4 5 6' # host cpu list
+#
+# mem
+#       size: 1024
+#
+# disk
+#       file: /path/to/image/test.img
+#
+# net
+#        type: [nic | user | tap | bridge | ...]
+#           nic
+#               opt_vlan: 0
+#                   note: Default is 0.
+#               opt_macaddr: 00:00:00:00:01:01
+#                   note: if creating a nic, it`s better to specify a MAC,
+#                         else it will get a random number.
+#               opt_model:["e1000" | "virtio" | "i82551" | ...]
+#                   note: Default is e1000.
+#               opt_name: 'nic1'
+#               opt_addr: ''
+#                   note: PCI cards only.
+#               opt_vectors:
+#                   note: This option currently only affects virtio cards.
+#           user
+#               opt_vlan: 0
+#                   note: default is 0.
+#               opt_hostfwd: [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport
+#                   note: If not specified, it will be setted automatically.
+#           tap
+#               opt_vlan: 0
+#                   note: default is 0.
+#               opt_br: br0
+#                   note: if choosing tap, need to specify bridge name,
+#                         else it will be br0.
+#               opt_script: QEMU_IFUP_PATH
+#                   note: if not specified, default is self.QEMU_IFUP_PATH.
+#               opt_downscript: QEMU_IFDOWN_PATH
+#                   note: if not specified, default is self.QEMU_IFDOWN_PATH.
+#
+# device
+#       driver: [pci-assign | virtio-net-pci | ...]
+#           pci-assign
+#               prop_host: 08:00.0
+#               prop_addr: 00:00:00:00:01:02
+#           virtio-net-pci
+#               prop_netdev: mynet1
+#               prop_id: net1
+#               prop_mac: 00:00:00:00:01:03
+#               prop_bus: pci.0
+#               prop_addr: 0x3
+#
+# monitor
+#       port: 6061   
+#           note: if adding monitor to vm, need to specicy
+#                 this port, else it will get a free port
+#                 on the host machine.
+#
+# qga
+#       enable: [yes | no]
+#
+# serial_port
+#       enable: [yes | no]
+#
+# vnc
+#       displayNum: 1
+#           note: you can choose a number not used on the host.
+#
+# daemon
+#       enable: 'yes'
+#           note:
+#               By default VM will start with the daemonize status.
+#               Not support starting it on the stdin now.
+
+# vm configuration for pmd sriov case
+[vm0]
+cpu =
+    model=host,number=8,cpupin=5 6 7 8 9 10 11 12 ;
+disk =
+    file=/home/image/fedora23-ok.img;
+login =
+    user=root,password=tester;
+net = 
+   type=nic,opt_vlan=0;
+   type=user,opt_vlan=0; 
+monitor = 
+    port=;
+qga = 
+    enable=yes;
+vnc = 
+    displayNum=1;
+daemon =
+    enable=yes;
-- 
1.9.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dts] [PATCH V2 3/3] add vf rss test script
  2016-01-15  6:48 [dts] [PATCH V2 1/3] add vf rss test plan xu,huilong
  2016-01-15  6:48 ` [dts] [PATCH V2 2/3] add vm config for vf rss test case xu,huilong
@ 2016-01-15  6:48 ` xu,huilong
  2016-01-19  3:21 ` [dts] [PATCH V2 1/3] add vf rss test plan Liu, Yong
  2 siblings, 0 replies; 4+ messages in thread
From: xu,huilong @ 2016-01-15  6:48 UTC (permalink / raw)
  To: dts

---
 tests/TestSuite_vf_rss.py | 375 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 375 insertions(+)
 create mode 100644 tests/TestSuite_vf_rss.py

diff --git a/tests/TestSuite_vf_rss.py b/tests/TestSuite_vf_rss.py
new file mode 100644
index 0000000..42c1c0a
--- /dev/null
+++ b/tests/TestSuite_vf_rss.py
@@ -0,0 +1,375 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2016 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.
+
+"""
+DPDK Test suite.
+Test RSS reta (redirection table) update function.
+"""
+import time
+import random
+import re
+import dts
+testQueues = [4]
+reta_entries = []
+reta_lines = []
+
+# Use scapy to send packets with different source and dest ip.
+# and collect the hash result of five tuple and the queue id.
+from test_case import TestCase
+from pmd_output import PmdOutput
+from qemu_kvm import QEMUKvm
+
+class TestVfRss(TestCase):
+    def send_packet(self, itf, tran_type):
+        """
+        Sends packets.
+        """
+        global reta_lines
+        reta_lines = []
+        self.tester.scapy_foreground()
+        self.tester.scapy_append('sys.path.append("./")')
+        self.tester.scapy_append('from sctp import *')
+        self.vm_dut_0.send_expect("start", "testpmd>")
+        mac = self.vm_dut_0.get_mac_address(0)
+        # send packet with different source and dest ip
+        if tran_type == "ipv4-other":
+            for i in range(16):
+                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")], iface="%s")' % (
+                    mac, i + 1, i + 2, itf)
+                self.tester.scapy_append(packet)
+                self.tester.scapy_execute()
+                time.sleep(.5)
+        elif tran_type == "ipv4-tcp":
+            for i in range(16):
+                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")/TCP(sport=1024,dport=1024)], iface="%s")' % (
+                    mac, i + 1, i + 2, itf)
+                self.tester.scapy_append(packet)
+                self.tester.scapy_execute()
+                time.sleep(.5)
+        elif tran_type == "ipv4-udp":
+            for i in range(16):
+                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IP(src="192.168.0.%d", dst="192.168.0.%d")/UDP(sport=1024,dport=1024)], iface="%s")' % (
+                    mac, i + 1, i + 2, itf)
+                self.tester.scapy_append(packet)
+                self.tester.scapy_execute()
+                time.sleep(.5)
+        elif tran_type == "ipv4-sctp":
+            for i in range(16):
+                packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")/SCTP(sport=1024,dport=1025,tag=1)], iface="%s")' % (
+                    mac, i + 1, i + 2, itf)
+                self.tester.scapy_append(packet)
+                self.tester.scapy_execute()
+                time.sleep(.5)
+                packet = r'sendp([Ether(dst="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")/SCTP(sport=1025,dport=1024,tag=1)], iface="%s")' % (
+                    mac, i + 2, i + 1, itf)
+                self.tester.scapy_append(packet)
+                self.tester.scapy_execute()
+                time.sleep(.5)
+        elif tran_type == "l2_payload":
+            for i in range(16):
+                packet = r'sendp([Ether(src="00:00:00:00:00:%02d",dst="%s")], iface="%s")' % (
+                    i + 1, mac, itf)
+                self.tester.scapy_append(packet)
+                self.tester.scapy_execute()
+                time.sleep(.5)
+
+        elif tran_type == "ipv6-other":
+            for i in range(16):
+                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")], iface="%s")' % (
+                    mac, i + 1, i + 2, itf)
+                self.tester.scapy_append(packet)
+                self.tester.scapy_execute()
+                time.sleep(.5)
+        elif tran_type == "ipv6-tcp":
+            for i in range(16):
+                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")/TCP(sport=1024,dport=1024)], iface="%s")' % (
+                    mac, i + 1, i + 2, itf)
+                self.tester.scapy_append(packet)
+                self.tester.scapy_execute()
+                time.sleep(.5)
+        elif tran_type == "ipv6-udp":
+            for i in range(16):
+                packet = r'sendp([Ether(dst="%s", src="02:00:00:00:00:00")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")/UDP(sport=1024,dport=1024)], iface="%s")' % (
+                    mac, i + 1, i + 2, itf)
+                self.tester.scapy_append(packet)
+                self.tester.scapy_execute()
+                time.sleep(.5)
+        elif tran_type == "ipv6-sctp":
+            for i in range(16):
+                packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")/SCTP(sport=1024,dport=1025,tag=1)], iface="%s")' % (
+                    mac, i + 1, i + 2, itf)
+                self.tester.scapy_append(packet)
+                self.tester.scapy_execute()
+                time.sleep(.5)
+                packet = r'sendp([Ether(dst="%s")/IPv6(src="3ffe:2501:200:1fff::%d", dst="3ffe:2501:200:3::%d")/SCTP(sport=1025,dport=1024,tag=1)], iface="%s")' % (
+                    mac, i + 2, i + 1, itf)
+                self.tester.scapy_append(packet)
+                self.tester.scapy_execute()
+                time.sleep(.5)
+
+        else:
+            print "\ntran_type error!\n"
+
+        #out = self.vm_dut_0.send_expect("stop", "testpmd>")
+        out = self.vm_dut_0.get_session_output()
+        print '*******************************************'
+        print out
+        if  not reta_entries:
+           self.verify('RSS hash=' in out, 'rss faied')
+           return 
+        lines = out.split("\r\n")
+        out = ''
+        reta_line = {}
+
+        # collect the hash result of five tuple and the queue id
+        for line in lines:
+            line = line.strip()
+            if len(line) != 0 and line.startswith(("src=",)):
+                for item in line.split("-"):
+                    item = item.strip()
+                    if(item.startswith("RSS hash")):
+                        name, value = item.split("=", 1)
+                        print name + "-" + value
+
+                reta_line[name.strip()] = value.strip()
+                reta_lines.append(reta_line)
+                reta_line = {}
+            elif len(line) != 0 and line.strip().startswith("port "):
+                rexp = r"port (\d)/queue (\d{1,2}): received (\d) packets"
+                m = re.match(rexp, line.strip())
+                if m:
+                    reta_line["port"] = m.group(1)
+                    reta_line["queue"] = m.group(2)
+            elif len(line) != 0 and line.startswith("stop"):
+                break
+            else:
+                pass
+        self.verifyResult()
+             
+
+    def verifyResult(self):
+        """
+        Verify whether or not the result passes.
+        """
+
+        global reta_lines
+        result = []
+        dts.results_table_add_header(
+            ['packet index', 'hash value', 'hash index', 'queue id', 'actual queue id', 'pass '])
+
+        i = 0
+        for tmp_reta_line in reta_lines:
+            status = "false"
+            if(self.nic in ["niantic", "redrockcanyou"]):
+                # compute the hash result of five tuple into the 7 LSBs value.
+                hash_index = int(tmp_reta_line["RSS hash"], 16) % 128
+            else:
+                # compute the hash result of five tuple into the 7 LSBs value.
+                hash_index = int(tmp_reta_line["RSS hash"], 16) % 512
+            if(reta_entries[hash_index] == int(tmp_reta_line["queue"])):
+                status = "true"
+                result.insert(i, 0)
+            else:
+                status = "fail"
+                result.insert(i, 1)
+            dts.results_table_add_row(
+                [i, tmp_reta_line["RSS hash"], hash_index, reta_entries[hash_index], tmp_reta_line["queue"], status])
+            i = i + 1
+
+        dts.results_table_print()
+        reta_lines = []
+        self.verify(sum(result) == 0, "the reta update function failed!")
+
+    def set_up_all(self):
+        """
+        Run at the start of each test suite.
+        """
+
+        self.verify(
+            self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_spirit_single"],
+            "NIC Unsupported: " + str(self.nic))
+        self.dut_ports = self.dut.get_ports(self.nic)
+        self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])
+        self.verify(len(self.dut_ports) >= 1, "Not enough ports available")
+
+        self.vm0 = None
+        self.setup_1pf_1vf_1vm_env_flag = 0
+        self.setup_1pf_1vf_1vm_env(driver='')
+
+    def set_up(self):
+        """
+        Run before each test case.
+        """
+        pass
+    def setup_1pf_1vf_1vm_env(self, driver='default'):
+        
+        self.used_dut_port_0 = self.dut_ports[0]
+        self.dut.generate_sriov_vfs_by_port(self.used_dut_port_0, 1, driver=driver)
+        self.sriov_vfs_port_0 = self.dut.ports_info[self.used_dut_port_0]['vfs_port']
+
+        try:
+
+            for port in self.sriov_vfs_port_0:
+                port.bind_driver('pci-stub')
+
+            time.sleep(1)
+            vf0_prot = {'opt_host': self.sriov_vfs_port_0[0].pci}
+
+            if driver == 'igb_uio':
+                # start testpmd without the two VFs on the host
+                self.host_testpmd = PmdOutput(self.dut)
+                eal_param = '-b %(vf0)s -b %(vf1)s' % {'vf0': self.sriov_vfs_port_0[0].pci}
+                self.host_testpmd.start_testpmd("1S/2C/2T", eal_param=eal_param)
+
+            # set up VM0 ENV
+            self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_rss')
+            self.vm0.set_vm_device(driver='pci-assign', **vf0_prot)
+
+            self.vm_dut_0 = self.vm0.start()
+            self.vm0_testpmd = PmdOutput(self.vm_dut_0)
+            if self.vm_dut_0 is None:
+                raise Exception("Set up VM0 ENV failed!")
+
+            self.setup_1pf_1vf_1vm_env_flag = 1
+        except Exception as e:
+            self.destroy_1pf_1vf_1vm_env()
+            raise Exception(e)
+
+    def destroy_1pf_1vf_1vm_env(self):
+        if getattr(self, 'vm0', None):
+            self.vm0_testpmd.execute_cmd('quit', '# ')
+            self.vm0_testpmd = None
+            self.vm0_dut_ports = None
+            #destroy vm0
+            self.vm0.stop()
+            self.vm0 = None
+
+        if getattr(self, 'host_testpmd', None):
+            self.host_testpmd.execute_cmd('quit', '# ')
+            self.host_testpmd = None
+
+        if getattr(self, 'used_dut_port_0', None):
+            self.dut.destroy_sriov_vfs_by_port(self.used_dut_port_0)
+            port = self.dut.ports_info[self.used_dut_port_0]['port']
+            port.bind_driver()
+            self.used_dut_port_0 = None
+
+        for port_id in self.dut_ports:
+            port = self.dut.ports_info[port_id]['port']
+            port.bind_driver()
+
+        self.setup_1pf_2vf_1vm_env_flag = 0
+
+    def test_vf_pmdrss_reta(self):
+        
+        # niantic kernel host driver not support this case
+        if self.nic is 'niantic' and not self.host_testpmd:
+            return
+        vm0dutPorts = self.vm_dut_0.get_ports('any')
+        localPort = self.tester.get_local_port(vm0dutPorts[0])
+        itf = self.tester.get_interface(localPort)
+        iptypes = ['IPV4']
+
+        self.vm_dut_0.kill_all()
+
+        # test with different rss queues
+        for queue in testQueues:
+
+            self.vm0_testpmd.start_testpmd(
+                "all", "--rxq=%d --txq=%d" % (queue, queue), socket=self.ports_socket)
+
+            for iptype in iptypes:
+                self.vm_dut_0.send_expect("set verbose 8", "testpmd> ")
+                self.vm_dut_0.send_expect("set fwd rxonly", "testpmd> ")
+                self.vm_dut_0.send_expect(
+                    "set nbcore %d" % (queue + 1), "testpmd> ")
+
+                # configure the reta with specific mappings.
+                if(self.nic in ["niantic", "redrockcanyou"]):
+                    for i in range(128):
+                        reta_entries.insert(i, random.randint(0, queue - 1))
+                        self.vm_dut_0.send_expect(
+                            "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ")
+                else:
+                    for i in range(512):
+                        reta_entries.insert(i, random.randint(0, queue - 1))
+                        self.vm_dut_0.send_expect(
+                            "port config 0 rss reta (%d,%d)" % (i, reta_entries[i]), "testpmd> ")
+
+                self.send_packet(itf, iptype)
+
+            self.vm_dut_0.send_expect("quit", "# ", 30)
+    def test_vf_pmdrss(self): 
+        vm0dutPorts = self.vm_dut_0.get_ports('any')
+        localPort = self.tester.get_local_port(vm0dutPorts[0])
+        itf = self.tester.get_interface(localPort)
+        iptypes = {'ipv4-sctp':'ip',
+                   'ipv4-other':'ip',
+                   'ipv4-udp':'udp',
+                   'ipv4-tcp':'tcp',
+                   'ipv4-sctp':'sctp',
+                   'ipv6-other':'ip',
+                   'ipv6-udp':'udp',
+                   'ipv6-tcp':'tcp',
+                   'ipv6-sctp':'sctp',
+                 #  'l2_payload':'ether'
+                  }
+
+        self.vm_dut_0.kill_all()
+
+        # test with different rss queues
+        for queue in testQueues:
+
+            self.vm0_testpmd.start_testpmd(
+                "all", "--rxq=%d --txq=%d" % (queue, queue), socket=self.ports_socket)
+
+            for iptype,rsstype in iptypes.items():
+                self.vm_dut_0.send_expect("set verbose 8", "testpmd> ")
+                self.vm_dut_0.send_expect("set fwd rxonly", "testpmd> ")
+                self.vm_dut_0.send_expect("port config all rss %s" % rsstype, "testpmd> ")
+                self.vm_dut_0.send_expect(
+                    "set nbcore %d" % (queue + 1), "testpmd> ")
+
+                self.send_packet(itf, iptype)
+
+            self.vm_dut_0.send_expect("quit", "# ", 30)
+    def tear_down(self):
+        """
+        Run after each test case.
+        """
+        pass
+
+    def tear_down_all(self):
+        """
+        Run after each test suite.
+        """
+        #self.vm_dut_0.kill_all()
+        self.destroy_1pf_1vf_1vm_env()
-- 
1.9.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dts] [PATCH V2 1/3] add vf rss test plan
  2016-01-15  6:48 [dts] [PATCH V2 1/3] add vf rss test plan xu,huilong
  2016-01-15  6:48 ` [dts] [PATCH V2 2/3] add vm config for vf rss test case xu,huilong
  2016-01-15  6:48 ` [dts] [PATCH V2 3/3] add vf rss test script xu,huilong
@ 2016-01-19  3:21 ` Liu, Yong
  2 siblings, 0 replies; 4+ messages in thread
From: Liu, Yong @ 2016-01-19  3:21 UTC (permalink / raw)
  To: xu,huilong, dts

Applied. Thanks.

On 01/15/2016 02:48 PM, xu,huilong wrote:
> ---
>   test_plans/vf_rss_test_plan.rst | 186 ++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 186 insertions(+)
>   create mode 100644 test_plans/vf_rss_test_plan.rst
>
> diff --git a/test_plans/vf_rss_test_plan.rst b/test_plans/vf_rss_test_plan.rst
> new file mode 100644
> index 0000000..864b0a1
> --- /dev/null
> +++ b/test_plans/vf_rss_test_plan.rst
> @@ -0,0 +1,186 @@
> +.. Copyright (c) <2016>, 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.
> +
> +==================================================================
> +Fortville RSS full support - Support configuring hash functions
> +==================================================================
> +
> +This document provides test plan for testing the function of Fortville:
> +Support configuring hash functions.
> +
> +Prerequisites
> +-------------
> +
> +2x Intel? 82599 (Niantic) NICs (2x 10GbE full duplex optical ports per NIC)
> +1x Fortville_eagle NIC (4x 10G)
> +1x Fortville_spirit NIC (2x 40G)
> +2x Fortville_spirit_single NIC (1x 40G)
> +
> +The one port of the 82599 connect to the Fortville_eagle;
> +The one port of Fortville_spirit connect to Fortville_spirit_single.
> +The three kinds of NICs are the target NICs. the connected NICs can send packets
> +to these three NICs using scapy.
> +
> +Network Traffic
> +---------------
> +
> +The RSS feature is designed to improve networking performance by load balancing
> +the packets received from a NIC port to multiple NIC RX queues, with each queue
> +handled by a different logical core.
> +
> +#1. The receive packet is parsed into the header fields used by the hash
> +operation (such as IP addresses, TCP port, etc.)
> +
> +#2. A hash calculation is performed. The Fortville  supports three hash function:
> +Toeplitz, simple XOR and their Symmetric RSS.
> +
> +#3. Hash result are used as an index into a 128/512 entry
> +'redirection table'.
> +
> +#4. Niantic VF only support simple default hash algorithm(simple). Fortville NIC
> +support all hash algorithm only used dpdk driver on host. when used kernel driver on host,
> +fortville nic only support default hash algorithm(simple).
> +
> +The RSS RETA update feature is designed to make RSS more flexible by allowing
> +users to define the correspondence between the seven LSBs of hash result and
> +the queue id(RSS output index) by themself.
> +
> +
> +Test Case:  test_rss_hash
> +========================================
> +
> +The following RX Ports/Queues configurations have to be benchmarked:
> +
> +- 1 RX port / 4 RX queues (1P/4Q)
> +
> +
> +Testpmd configuration - 4 RX/TX queues per port
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +::
> +
> +  testpmd -c 1f -n 3  -- -i --rxq=4 --txq=4 --txqflags=0
> +
> +Testpmd Configuration Options
> +-----------------------------
> +
> +By default, a single logical core runs the test.
> +The CPU IDs and the number of logical cores running the test in parallel can
> +be manually set with the ``set corelist X,Y`` and the ``set nbcore N``
> +interactive commands of the ``testpmd`` application.
> +#1. got the pci device id of DUT, for example,
> +
> +./dpdk_nic_bind.py --st
> +
> +0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=ens259f0 drv=i40e unused=
> +0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=ens259f1 drv=i40e unused=
> +
> +#2. create 2 VFs from 2 PFs,
> +
> +echo 1 > /sys/bus/pci/devices/0000\:81\:00.0/sriov_numvfs
> +echo 1 > /sys/bus/pci/devices/0000\:81\:00.1/sriov_numvfs
> +./dpdk_nic_bind.py --st
> +
> +0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=ens259f0 drv=i40e unused=
> +0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=ens259f1 drv=i40e unused=
> +0000:81:02.0 'XL710/X710 Virtual Function' unused=
> +0000:81:0a.0 'XL710/X710 Virtual Function' unused=
> +
> +#3. detach VFs from the host, bind them to pci-stub driver,
> +
> +/sbin/modprobe pci-stub
> +
> +using `lspci -nn|grep -i ethernet` got VF device id, for example "8086 154c",
> +
> +echo "8086 154c" > /sys/bus/pci/drivers/pci-stub/new_id
> +echo 0000:81:02.0 > /sys/bus/pci/devices/0000:08:02.0/driver/unbind
> +echo 0000:81:02.0 > /sys/bus/pci/drivers/pci-stub/bind
> +
> +echo "8086 154c" > /sys/bus/pci/drivers/pci-stub/new_id
> +echo 0000:81:0a.0 > /sys/bus/pci/devices/0000:08:0a.0/driver/unbind
> +echo 0000:81:0a.0 > /sys/bus/pci/drivers/pci-stub/bind
> +
> +  or using the following more easy way,
> +
> +  virsh nodedev-detach pci_0000_81_02_0;
> +  virsh nodedev-detach pci_0000_81_0a_0;
> +
> +  ./dpdk_nic_bind.py --st
> +
> +  0000:81:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=ens259f0 drv=i40e unused=
> +  0000:81:00.1 'Ethernet Controller X710 for 10GbE SFP+' if=ens259f1 drv=i40e unused=
> +  0000:81:02.0 'XL710/X710 Virtual Function' if= drv=pci-stub unused=
> +  0000:81:0a.0 'XL710/X710 Virtual Function' if= drv=pci-stub unused=
> +
> +  it can be seen that VFs 81:02.0 & 81:0a.0 's drv is pci-stub.
> +
> +#4. passthrough VFs 81:02.0 & 81:0a.0 to vm0, and start vm0,
> +
> +  /usr/bin/qemu-system-x86_64  -name vm0 -enable-kvm \
> +  -cpu host -smp 4 -m 2048 -drive file=/home/image/sriov-fc20-1.img -vnc :1 \
> +  -device pci-assign,host=81:02.0,id=pt_0 \
> +  -device pci-assign,host=81:0a.0,id=pt_1
> +
> +#5. 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
> +
> +#6. Reta Configuration.  128 reta entries configuration::
> +
> +  testpmd command: port config 0 rss reta (hash_index,queue_id)
> +
> +#7. PMD fwd only receive the packets::
> +
> +  testpmd command: set fwd rxonly
> +
> +#8. rss recived package type configuration two received packet types configuration::
> +
> +  testpmd command: port config 0 rss ip/udp/tcp
> +
> +#9. verbose configuration::
> +
> +  testpmd command: set verbose 8
> +
> +#10. start packet receive::
> +
> +  testpmd command: start
> +#11. send packet and check rx port received packet by different queue.
> +  different hash type send different packet, example hash type is ip, packet src and dts ip not different
> +  sendp([Ether(dst="90:e2:ba:36:99:3c")/IP(src="192.168.0.4", dst="192.168.0.5")], iface="eth3")
> +  sendp([Ether(dst="90:e2:ba:36:99:3c")/IP(src="192.168.0.5", dst="192.168.0.4")], iface="eth3")
> +Test Case:  test_reta
> +========================================
> +   this case test hash reta table, the test steps same with test_rss_hash except config hash reta table
> +#1 before send packet, config hash reta,512(niantic nic have 128 reta) reta entries configuration::
> +
> +     testpmd command: port config 0 rss reta (hash_index,queue_id)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-01-19  3:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-15  6:48 [dts] [PATCH V2 1/3] add vf rss test plan xu,huilong
2016-01-15  6:48 ` [dts] [PATCH V2 2/3] add vm config for vf rss test case xu,huilong
2016-01-15  6:48 ` [dts] [PATCH V2 3/3] add vf rss test script xu,huilong
2016-01-19  3:21 ` [dts] [PATCH V2 1/3] add vf rss test plan Liu, Yong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).