From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0951EA2EFC for ; Fri, 20 Sep 2019 08:30:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E75E21F2C7; Fri, 20 Sep 2019 08:30:04 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 7FB7A1F2C5 for ; Fri, 20 Sep 2019 08:30:03 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 23:30:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,527,1559545200"; d="scan'208";a="271461433" Received: from unknown (HELO dpdk-wenjielx-dtspatch135.sh.intel.com) ([10.240.176.135]) by orsmga001.jf.intel.com with ESMTP; 19 Sep 2019 23:30:00 -0700 From: Zhu Tao To: dts@dpdk.org Cc: Zhu Tao Date: Fri, 20 Sep 2019 14:34:30 +0800 Message-Id: <1568961270-41923-1-git-send-email-taox.zhu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1] test_plan: add test plan for port representor 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" add port_representor_test_plan.rst to test_plans Signed-off-by: Zhu Tao --- test_plans/port_representor_test_plan.rst | 206 ++++++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 test_plans/port_representor_test_plan.rst diff --git a/test_plans/port_representor_test_plan.rst b/test_plans/port_representor_test_plan.rst new file mode 100644 index 0000000..e7c1849 --- /dev/null +++ b/test_plans/port_representor_test_plan.rst @@ -0,0 +1,206 @@ +.. Copyright (c) <2019>, 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. + +============================================== +Port Representor Tests +============================================== + +Description +=========== +Use two representor ports as the control plane to manage the two VFs, +the control plane could change VFs behavior such as change promiscous +mode, stats reset, etc. our statistical data information is independent +on the control plane and data plane. + +Prerequisites +=============== +Create two VFs and two VFs representor ports which are used as control plane. + +1. bind PF to igb_uio:: + + ./usertools/dpdk-devbind.py -b igb_uio 0000:af:00.0 + +2. create two VFs from PF:: + + echo 2 > /sys/bus/pci/devices/0000\:af\:00.0/max_vfs + +3. bind two VFs to vfio-pci:: + + ./usertools/dpdk-devbind.py -b vfio-pci 0000:af:02.0 0000:af:02.1 + +4. start a testpmd with create 2 VFs representor ports as control plane named testpmd-pf:: + + ./testpmd --lcores 1,2 -n 4 -w af:00.0,representor=0-1 --socket-mem 1024,1024 \ + --proc-type auto --file-prefix testpmd-pf -- -i --port-topology=chained + +5. start two testpmd as dataplane named testpmd-vf0/testpmd-vf1(case 3 run later):: + + ./testpmd --lcores 3,4 -n 4 -w af:02.0 --socket-mem 1024,1024 --proc-type auto --file-prefix testpmd-vf0 -- -i + ./testpmd --lcores 5,6 -n 4 -w af:02.1 --socket-mem 1024,1024 --proc-type auto --file-prefix testpmd-vf1 -- -i + +Note: Every case needs to restart testpmd. + +Test Cases +========== + +1. Test Case 1: VF Stats show and clear [ixgbe not support] +----------------------------------------------------------- +Description: use control testpmd to get and clear dataplane testpmd ports Stats. + +1. prepare 3 testpmd to receive packets:: + + PF testpmd> set promisc 0 off + PF testpmd> start + VF0 testpmd> set promisc 0 off + VF0 testpmd> start + VF1 testpmd> set promisc 0 off + VF1 testpmd> start + +2. send 30 packets by scapy as below:: + + scapy> pkt1=Ether(src=src_mac, dst=pf_mac)/IP() + scapy> pkt2=Ether(src=src_mac, dst=vf0_mac)/IP() + scapy> pkt3=Ether(src=src_mac, dst=vf1_mac)/IP() + scapy> pkts=[pkt1, pkt2, pkt3]*10 + scapy> sendp(pkts, iface="ens785f0") + +3. check port stats in control testpmd, it will show 1 PF and 2 VF stats:: + + PF testpmd> show port stats all + + expected result: + VF0 and VF1 will show receive 10 packets separately in control testmpd. + +4. clear port stats in control testpmd:: + + PF testpmd> clear vf stats 0 0 + PF testpmd> clear vf stats 0 1 + PF testpmd> clear port stats all + PF testpmd> show port stats all + + expected result: + all the testpmd's port stats should be cleared + +Note: PF statistics superimpose the number of VFs, and the independent command + 'clear vf stats ' to clear this part of the data. + +2. Test Case 2: VF Promiscous enable/disable +-------------------------------------------- +Description: use control testpmd to enable/disable dataplane testpmd ports promiscous mode. + +1. prepare 3 testpmd to receive packets, turn on VF0 promisc mode in control testpmd:: + + PF testpmd> set promisc 0 off + PF testpmd> start + VF0 testpmd> set promisc 0 off + VF0 testpmd> start + VF1 testpmd> set promisc 0 off + VF1 testpmd> start + PF testpmd> set promisc 1 on + +2. send 40 packets by scapy as below:: + + scapy> pkt1=Ether(src=src_mac, dst=pf_mac)/IP() + scapy> pkt2=Ether(src=src_mac, dst=vf0_mac)/IP() + scapy> pkt3=Ether(src=src_mac, dst=vf1_mac)/IP() + scapy> pkt4=Ether(src=src_mac, dst=unicast_mac)/IP() + scapy> pkts=[pkt1, pkt2, pkt3, pkt4]*10 + scapy> sendp(pkts, iface="ens785f0") + +3. check port stats in DUT:: + + PF testpmd> show port stats all + + expected result: + VF0 should receive 20 packets(10 vf0_mac and 10 unicast_mac) and VF1 show receive 10 + packets in representor ports of PF. + +3. Test Case 3: set VF MAC address +---------------------------------- +Description: use control testpmd to set vf mac address + +1. Run PF testpmd with PF first, set VF0 and VF1 mac address use representor ports:: + + PF testpmd> mac_addr set 1 aa:11:22:33:44:55 + PF testpmd> mac_addr set 2 aa:22:33:44:55:66 + PF testpmd> set promisc 0 off + PF testpmd> start + +2. Run VFs testpmd, and turn off promisc mode:: + + VF0 testpmd> set promisc 0 off + VF0 testpmd> start + VF1 testpmd> set promisc 0 off + VF1 testpmd> start + +3. use test case 2 step 2 to send packets from traffic generator + +4. check port stats in DUT:: + + PF testpmd> show port stats all + + expected result: + VF0 should receive 10 packets and VF1 show receive 10 packets in representor ports of PF. + +4. Test Case 4: set vlan filter +------------------------------- +Description: use control testpmd to set vlan + +1. set promisc mode off in control testpmd, turn on vlan filter, add vlan filter in each VF:: + + PF testpmd> set promisc 1 off + PF testpmd> vlan set filter on 1 + PF testpmd> rx_vlan add 3 1 + PF testpmd> set promisc 2 off + PF testpmd> vlan set filter on 2 + PF testpmd> rx_vlan add 4 2 + VF0 testpmd> start + VF1 testpmd> start + + +2. use scapy to send packets as below:: + + scapy> pkt1=Ether(src=src_mac, dst=vf0_mac)/Dot1Q(vlan=3)/IP() + scapy> pkt2=Ether(src=src_mac, dst=vf1_mac)/Dot1Q(vlan=4)/IP() + scapy> pkts=[pkt1, pkt2]*10 + scapy> sendp(pkts, iface="ens785f0") + +3. check port stats in 2 VF testpmd: + expected result: + 2 VF testpmds should receive 10 packets separately. + + + + + + + -- 2.21.0.windows.1