From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 54A9BD4CE for ; Mon, 27 Mar 2017 03:15:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490577334; x=1522113334; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=crqmz8YhYK+mQnICmXmJnXNKixEIhz9zRsRXfKgeYy0=; b=gpT1cLOPqKhbr/41A1lHuzoXPNRlhjSYRZrOZEsX3yBjSuwrWrsmQNwu d57ViNGRoWEN/2VZcPzKPHdg04H0Pw==; Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Mar 2017 18:15:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="70803276" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga004.jf.intel.com with ESMTP; 26 Mar 2017 18:15:32 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 26 Mar 2017 18:15:32 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 26 Mar 2017 18:15:31 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.253]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.82]) with mapi id 14.03.0248.002; Mon, 27 Mar 2017 09:15:28 +0800 From: "Liu, Yong" To: "Peng, Yuan" , "dts@dpdk.org" CC: "Peng, Yuan" Thread-Topic: [dts] [PATCH v1] test_plans: add i40e NFV vf/pf reset Thread-Index: AQHSnhLlWOMBeDdvZEq55I2KfK20VqGn8oRg Date: Mon, 27 Mar 2017 01:15:27 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62D97D71@SHSMSX103.ccr.corp.intel.com> References: <1489686294-114865-1-git-send-email-yuan.peng@intel.com> In-Reply-To: <1489686294-114865-1-git-send-email-yuan.peng@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH v1] test_plans: add i40e NFV vf/pf reset 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: Mon, 27 Mar 2017 01:15:35 -0000 Yuan, Please try to keep each line in 79 characters. Some specific information like mac address you can abstract it to macro lik= e $VF0_MAC. Thanks, Marvin > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Peng Yuan > Sent: Friday, March 17, 2017 1:45 AM > To: dts@dpdk.org > Cc: Peng, Yuan > Subject: [dts] [PATCH v1] test_plans: add i40e NFV vf/pf reset >=20 > Signed-off-by: Peng Yuan >=20 > diff --git a/test_plans/vf_pf_reset_test_plan.rst > b/test_plans/vf_pf_reset_test_plan.rst > new file mode 100644 > index 0000000..2817c93 > --- /dev/null > +++ b/test_plans/vf_pf_reset_test_plan.rst > @@ -0,0 +1,428 @@ > +.. Copyright (c) <2015>, 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. > + > +Prerequisites > +------------- > + > +1. Hardware: > + > + Fortville 4*10G NIC (driver: i40e) > + tester: ens3f0 > + dut: ens5f0(pf0), ens5f1(pf1) > + ens3f0 connect with ens5f0 by cable > + > +2. added command:: > + > + testpmd> port reset (port_id|all) > + "Reset all ports or port_id" > + > + > +Test Case 1: vf reset -- create two vfs on one pf > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +1. got the pci device id of DUT, for example:: > + > + ./dpdk_nic_bind.py --st > + > + 0000:05:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens785f0 > drv=3Di40e unused=3D > + > +2. create 2 VFs from 1 PF,and set the VF MAC address at PF0:: > + > + echo 2 > /sys/bus/pci/devices/0000\:05\:00.0/sriov_numvfs > + ./dpdk_nic_bind.py --st > + > + 0000:05:00.0 'Ethernet Controller X710 for 10GbE SFP+' if=3Dens785f0 > drv=3Di40e unused=3D > + 0000:05:02.0 'XL710/X710 Virtual Function' unused=3D > + 0000:05:02.1 'XL710/X710 Virtual Function' unused=3D > + ip link set ens785f0 vf 0 mac 00:11:22:33:44:11 > + ip link set ens785f0 vf 1 mac 00:11:22:33:44:12 > + > +3. Bind the VFs to dpdk driver:: > + > + ./tools/dpdk-devbind.py -b vfio-pci 05:02.0 05:02.1 > + > +4. Reserve huge pages memory(before using DPDK):: > + > + echo 16 > /sys/devices/system/node/node0/hugepages/hugepages- > 1048576kB/nr_hugepages > + > +5. Set the VLAN id of VF1 and VF2:: > + > + ip link set ens785f0 vf 0 vlan 1 > + ip link set ens785f0 vf 1 vlan 1 > + > +6. run testpmd:: > + > + ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x0f -n 4 -- -i -- > portmask=3D0x3 --txqflags=3D0 --crc-strip > + testpmd> set fwd mac > + testpmd> start > + testpmd> set allmulti all on > + testpmd> set promisc all off > + testpmd> show port info all > + > + Promiscuous mode: disabled > + Allmulticast mode: enabled > + > +the status are not different from the default value. > + > +7. get mac address of one VF and use it as dest mac, using scapy to send > 1000 random packets from tester, > +verify the packets can be received by one VF and can be forward to > another VF correctly:: > + > + scapy > + >>>sendp([Ether(dst=3D"00:11:22:33:44:11")/Dot1Q(vlan=3D1)/IP()/Raw('x= '*40) > ],iface=3D"ens785f0",count=3D1000) > + > +8. reset pf:: > + > + ifconfig ens785f0 promisc > + > +or:: > + > + ifconfig ens785f0 -promisc > + > +9. vf receive a pf reset message:: > + > + Event type: RESET interrupt on port 0 > + Event type: RESET interrupt on port 1 > + > +if don't reset the vf, send the same 1000 packets with scapy from tester= , > +the vf cannot receive any packets, including vlan=3D0 and vlan=3D1 > + > +10. reset the vfs, run the command:: > + > + testpmd> stop > + testpmd> port reset 0 > + testpmd> port reset 1 > + testpmd> start > + > +or just run the command "port reset all" > +send the same 1000 packets with scapy from tester, verify the packets ca= n > be received by one VF and can be forward to another VF correctly > +check the port info:: > + > + testpmd> show port info all > + > + ********************* Infos for port 0 ********************* > + MAC address: 00:11:22:33:44:11 > + Promiscuous mode: disabled > + Allmulticast mode: enabled > + > + ********************* Infos for port 1 ********************* > + MAC address: 00:11:22:33:44:12 > + Promiscuous mode: disabled > + Allmulticast mode: enabled > + > +the info status is consistent to the status before reset. > + > + > +Test Case 2: vf reset -- create one vf on each pf > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +1. create vf0 from pf0, create vf1 from pf1:: > + > + echo 1 > /sys/bus/pci/devices/0000\:81\:00.0/sriov_numvfs > + echo 1 > /sys/bus/pci/devices/0000\:81\:00.1/sriov_numvfs > + ip link set ens5f0 vf 0 mac 00:11:22:33:44:11 > + ip link set ens5f1 vf 0 mac 00:11:22:33:44:12 > + > +2. bind the two vfs to vfio-pci:: > + > + ./usertools/dpdk-devbind.py -b vfio-pci 81:02.0 81:06.0 > + > +3. start testpmd on two vf ports:: > + > + ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xf -n 4 \ > + --socket-mem 1024,1024 -w 81:02.0 --file-prefix=3Dtest1 \ > + -- -i --crc-strip --eth-peer=3D0,00:11:22:33:44:12 \ > + > + ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xf0 -n 4 \ > + --socket-mem 1024,1024 -w 81:06.0 --file-prefix=3Dtest2 \ > + -- -i --crc-strip > + > +4. start forwarding:: > + > + testpmd> set fwd mac > + testpmd> start > + > +5. send packets with scapy from tester:: > + > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/IP()/Raw('x'*1000)],iface=3D"ens3= f0",c > ount=3D1000) > + > +vf0 can forward the packets to vf1. > + > +6. reset pf0 and pf1, don't reset vf0 and vf1, send the two packets, > + vf0 and vf1 cannot receive any packets. > + > +7. reset vf0 and vf1, send the two packets, > + vf0 can forward the packet to vf1. > + > + > +Test Case 3: vlan rx restore -- vf reset all ports > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > + > +1. excute the step1-step4 of test case 1, then start the testpmd:: > + > + ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x0f -n 4 -- -i -- > portmask=3D0x3 --txqflags=3D0 --crc-strip > + testpmd> set fwd mac > + > +2. add vlan on both ports:: > + > + testpmd> rx_vlan add 1 0 > + testpmd> rx_vlan add 1 1 > + testpmd> start > + > +send packets with scapy from tester:: > + > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:12")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/Dot1Q(vlan=3D1)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:12")/Dot1Q(vlan=3D1)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > +vfs can receive the packets and forward it. > +send packets with scapy from tester:: > + > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/Dot1Q(vlan=3D2)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > +vf0 cannot receive any packets. > + > +3. reset pf, don't reset vf, send packets from tester:: > + > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:12")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/Dot1Q(vlan=3D1)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:12")/Dot1Q(vlan=3D1)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > +the vfs cannot receive any packets. > + > +4. reset both vfs, send packets from tester:: > + > + testpmd> stop > + testpmd> port reset 0 > + testpmd> start > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:12")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/Dot1Q(vlan=3D1)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:12")/Dot1Q(vlan=3D1)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > +vfs can receive the packets and forward it. > +send packets with scapy from tester:: > + > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/Dot1Q(vlan=3D2)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > +vf0 cannot receive any packets. > + > + > +test Case 4: vlan rx restore -- vf reset one port > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +1. excute the step1-step4 of test case 1, then start the testpmd:: > + > + ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x0f -n 4 -- -i -- > portmask=3D0x3 --txqflags=3D0 --crc-strip > + testpmd> set fwd mac > + > +2. add vlan on both ports:: > + > + testpmd> rx_vlan add 1 0 > + testpmd> rx_vlan add 1 1 > + testpmd> start > + > +send packets with scapy from tester:: > + > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:12")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/Dot1Q(vlan=3D1)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:12")/Dot1Q(vlan=3D1)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > +vfs can receive the packets and forward it. > + > +3. pf reset, then reset vf0, send packets from tester:: > + > + testpmd> stop > + testpmd> port reset 0 > + testpmd> start > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/Dot1Q(vlan=3D1)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > +vf0 can receive the packets, but vf1 can't transmit the packets. > +send packets from tester:: > + > + > sendp([Ether(dst=3D"00:11:22:33:44:12")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:12")/Dot1Q(vlan=3D1)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > +vf1 cannot receive the packets. > + > +4. reset vf1:: > + > + testpmd> port reset 1 > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/Dot1Q(vlan=3D1)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:12")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:12")/Dot1Q(vlan=3D1)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > +vfs can receive and forward the packets. > + > + > +Test Case 5: vlan rx restore -- create one vf on each pf > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D > + > +1. excute the step1-step3 of test case 2 > + > +2. add vlan on both ports:: > + > + testpmd> rx_vlan add 1 0 > + > +3. set forward mode on vf0:: > + > + testpmd> set fwd mac > + testpmd> start > + > +set rxonly mode on vf1:: > + > + testpmd> set fwd rxonly > + testpmd> start > + > +4. send packets with scapy from tester:: > + > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/Dot1Q(vlan=3D1)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > +vf0 can forward the packets to vf1. > +send packets with scapy from tester:: > + > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/Dot1Q(vlan=3D2)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > +vf0 cannot receive any packets. > +remove vlan 0 on vf1:: > + > + testpmd> rx_vlan rm 0 0 > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > +vf0 can forward the packets, but vf1 can't receive the packets. > + > +5. reset pf, don't reset vf, send packets from tester:: > + > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/Dot1Q(vlan=3D1)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > +the vfs cannot receive any packets. > + > +4. reset both vfs, send packets from tester:: > + > + testpmd> stop > + testpmd> port reset 0 > + testpmd> start > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > +vf0 can forward the packets, but vf1 can't receive the packets. > +send packets from tester:: > + > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/Dot1Q(vlan=3D1)/IP()/Raw('x'*1000= )],if > ace=3D"ens5f0",count=3D1000) > + > +vf0 can forward the packets, and vf1 can receive the packets. > + > +Test Case 6: vlan tx restore -- create one vf on each pf > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D > + > +1. excute the step1-step3 of test case 2 > + > +2. Add tx vlan offload on VF0, take care the first param is port:: > + > + testpmd> tx_vlan 0 1 > + > +3. set forward mode on vf0:: > + > + testpmd> set fwd mac > + testpmd> start > + > +set rxonly mode on vf1:: > + > + testpmd> set fwd rxonly > + testpmd> set verbose 1 > + testpmd> start > + > +4. send packets with scapy from tester:: > + > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/IP()/Raw('x'*1000)],iface=3D"ens5= f0",c > ount=3D1000) > + > +check packets received by vf1, recevied packet with configured vlan 1 > + > +4. reset the two pfs, then reset the two vfs, > +send the same packets with no vlan tag, > +check packets received by vf1, recevied packet with configured vlan 1 > + > + > +test Case 7: MAC address configuration > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +1. create vf0 from pf0, create vf1 from pf1:: > + > + echo 1 > /sys/bus/pci/devices/0000\:81\:00.0/sriov_numvfs > + echo 1 > /sys/bus/pci/devices/0000\:81\:00.1/sriov_numvfs > + > +2. bind the two vfs to vfio-pci:: > + > + ./usertools/dpdk-devbind.py -b vfio-pci 81:02.0 81:06.0 > + > +3. start testpmd on two vf ports:: > + > + ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xf -n 4 \ > + --socket-mem 1024,1024 -w 81:02.0 --file-prefix=3Dtest1 \ > + -- -i --crc-strip --eth-peer=3D0,00:11:22:33:44:12 \ > + > + ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xf0 -n 4 \ > + --socket-mem 1024,1024 -w 81:06.0 --file-prefix=3Dtest2 \ > + -- -i --crc-strip > + > +4. add MAC address to the vf0 ports:: > + > + testpmd> mac_addr add 0 00:11:22:33:44:11 > + testpmd> mac_addr add 0 00:11:22:33:44:21 > + testpmd> set fwd mac > + > +add MAC address to the vf1 ports:: > + > + testpmd> mac_addr add 0 00:11:22:33:44:12 > + testpmd> set fwd rxonly > + > +5. start forwarding:: > + > + testpmd> start > + > +6. send packets with scapy from tester:: > + > + > sendp([Ether(dst=3D"00:11:22:33:44:11")/IP()/Raw('x'*1000)],iface=3D"ens3= f0",c > ount=3D1000) > + > sendp([Ether(dst=3D"00:11:22:33:44:12")/IP()/Raw('x'*1000)],iface=3D"ens3= f0",c > ount=3D1000) > + > +vf0 can forward both of the two type packets. vf1 can receive the packet= s. > + > +7. reset pf0 and pf1, don't reset vf0 and vf1, send the two packets, > + vf0 and vf1 cannot receive any packets. > + > +8. reset vf0 and vf1, send the two packets, > + vf0 can forward both of the two type packets. vf1 can receive the > packets. > -- > 2.5.0