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 4E227A2EFC for ; Fri, 20 Sep 2019 08:31:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 407BF1F179; Fri, 20 Sep 2019 08:31:15 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id BC99C1F178 for ; Fri, 20 Sep 2019 08:31:13 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2019 23:31:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,527,1559545200"; d="scan'208";a="181719073" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga008.jf.intel.com with ESMTP; 19 Sep 2019 23:31:11 -0700 Received: from fmsmsx162.amr.corp.intel.com (10.18.125.71) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 19 Sep 2019 23:31:10 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx162.amr.corp.intel.com (10.18.125.71) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 19 Sep 2019 23:31:10 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.92]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.89]) with mapi id 14.03.0439.000; Fri, 20 Sep 2019 14:31:08 +0800 From: "Tu, Lijuan" To: "Zhang, YanX A" , "dts@dpdk.org" CC: "Yao, Lei A" , "Zhang, YanX A" Thread-Topic: [dts] [PATCH V1] test_plans:add mdd_test_plan.rst Thread-Index: AQHVbG8TJzBJ5dTrqkSzq78Kw8xvhKc0IQrA Date: Fri, 20 Sep 2019 06:31:07 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BB24C5A@SHSMSX101.ccr.corp.intel.com> References: <1568625482-3862-1-git-send-email-yanx.a.zhang@intel.com> In-Reply-To: <1568625482-3862-1-git-send-email-yanx.a.zhang@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzI4YTBlZDAtN2Q4Yy00YWRmLWFhMTItNzU1NDdhYjE4OTEzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRGZcL3RHMXNHWVJTQzZxSXU2aFl4aXlUcEN1TDVVbFwvVk96VmZIa1FXaTREaENLcVdmZEFBOHZ2YklmajYzUUVuIn0= 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 mdd_test_plan.rst 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" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of zhang,yan > Sent: Monday, September 16, 2019 5:18 PM > To: dts@dpdk.org > Cc: Yao, Lei A ; Zhang, YanX A > > Subject: [dts] [PATCH V1] test_plans:add mdd_test_plan.rst >=20 > Add a new test_plan mdd. >=20 > Signed-off-by: zhang,yan > --- > test_plans/mdd_test_plan.rst | 314 > +++++++++++++++++++++++++++++++++++ > 1 file changed, 314 insertions(+) > create mode 100644 test_plans/mdd_test_plan.rst >=20 > diff --git a/test_plans/mdd_test_plan.rst b/test_plans/mdd_test_plan.rst > new file mode 100644 index 0000000..8e6acde > --- /dev/null > +++ b/test_plans/mdd_test_plan.rst > @@ -0,0 +1,314 @@ > +.. 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. > + > +Prerequisites > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > +Malicious Driver Detection (MDD) support sagevill and i350 nic, > +dpdk2.3+ only support sagevill NIC. ixgbe supports disable MDD from > +version 4.2.3 so this test must run dpdk2.3+ and used ixgbe 4.2.3+ in > +host. > + > +Notice: use command ``insmod ixgbe.ko MDD=3D0,0`` to disable MDD. Each > +"0" in the command refers to a port. For example, if there are 6 ixgbe > +ports, the command should be changed to ``insmod ixgbe.ko > +MDD=3D0,0,0,0,0,0`` > + > +Test Case 1: enable_mdd_dpdk_disable > +=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. enable the MDD:: > + > + rmmod ixgbe > + modprobe ixgbe MDD=3D1,1 > + ifconfig ens865f1 up > + ifconfig ens865f0 up > + > +2. pf_port0 virtualizes a vf0 and pf_port1 virtualizes a vf1:: > + > + echo 1 > /sys/bus/pci/devices/0000\:03\:00.0/sriov_numvfs > + echo 1 > /sys/bus/pci/devices/0000\:03\:00.1/sriov_numvfs > + > +3. passthrough vf0 and vf1 to vm0 and start vm0:: > + > + taskset -c 4,5,6,7 qemu-system-x86_64 -name vm0 -enable-kvm -pidfil= e > /tmp/.vm0.pid \ > + -daemonize -monitor unix:/tmp/vm0_monitor.sock,server,nowait -device > e1000,netdev=3Dnttsip1 \ > + -netdev user,id=3Dnttsip1,hostfwd=3Dtcp:127.0.0.1:6001-:22 -device v= fio- > pci,host=3D0000:03:10.0,id=3Dpt_0 \ > + -device vfio-pci,host=3D0000:03:10.1,id=3Dpt_1 -cpu host -smp 4 -m 1= 0240 \ > + -chardev socket,path=3D/tmp/vm0_qga0.sock,server,nowait,id=3Dvm0_qga= 0 - > device virtio-serial \ > + -device virtserialport,chardev=3Dvm0_qga0,name=3Dorg.qemu.guest_agen= t.0 - > vnc :1 \ > + -drive > + file=3D/home/image/ubuntu16- > 0.img,format=3Dqcow2,if=3Dvirtio,index=3D0,media=3Dd > + isk > + > +4. login vm0, got VFs pci device id in vm0, assume they are 00:06.0 & 00= :07.0, > bind them to igb_uio driver:: > + > + modprobe uio > + insmod igb_uio.ko > + ./tools/dpdk_nic_bind.py --bind=3Digb_uio 00:06.0 00:07.0 > + > +5. Turn on testpmd and set mac forwarding mode:: > + > + ./testpmd -c 0x0f -n 4 -- -i --portmask=3D0x3 --tx-offloads=3D0x1 > + > + testpmd> set fwd mac > + testpmd> start > + > +6. get mac address of VF0 and use it as dest mac, using scapy to send 20= 00 > packets from tester:: > + > + sendp(Ether(src=3D'tester_mac', > + dst=3D'vm_port0_mac')/IP()/UDP()/Raw(load=3D'XXXXXXXXXXXXXXXXXX'), > + iface=3D"tester_nic") > + > +7. verify the packets can't be received by VF1,As follows:: > + > + ######################## NIC statistics for port 0 > ######################## > + RX-packets: 2000 RX-missed: 0 RX-bytes: 120000 > + RX-errors: 0 > + RX-nombuf: 0 > + TX-packets: 0 TX-errors: 0 TX-bytes: 0 > + > + Throughput (since last show) > + Rx-pps: 634 > + Tx-pps: 0 > + > ################################################################ > ############ > + ######################## NIC statistics for port 1 > ######################## > + RX-packets: 0 RX-missed: 0 RX-bytes: 0 > + RX-errors: 0 > + RX-nombuf: 0 > + TX-packets: 0 TX-errors: 0 TX-bytes: 0 > + > + Throughput (since last show) > + Rx-pps: 0 > + Tx-pps: 0 > + > + > ################################################################ > ###### > + ###### > + > +8. You can see "ixgbe 0000:03:00.0: Malicious event on VF 0 tx:100000 rx= :0" > by using the "dmesg -c" command on the host:: > + > + dmesg -c | grep 'event' > + > +Test Case 2: enable_mdd_dpdk_enable > +=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. enable the MDD:: > + > + rmmod ixgbe > + modprobe ixgbe MDD=3D1,1 > + ifconfig ens865f1 up > + ifconfig ens865f0 up > + > +2. pf_port0 virtualizes a vf0 and pf_port1 virtualizes a vf1:: > + > + echo 1 > /sys/bus/pci/devices/0000\:03\:00.0/sriov_numvfs > + echo 1 > /sys/bus/pci/devices/0000\:03\:00.1/sriov_numvfs > + > +3. passthrough vf0 and vf1 to vm0 and start vm0:: > + > + taskset -c 4,5,6,7 qemu-system-x86_64 -name vm0 -enable-kvm -pidfil= e > /tmp/.vm0.pid \ > + -daemonize -monitor unix:/tmp/vm0_monitor.sock,server,nowait -device > e1000,netdev=3Dnttsip1 \ > + -netdev user,id=3Dnttsip1,hostfwd=3Dtcp:127.0.0.1:6001-:22 -device v= fio- > pci,host=3D0000:03:10.0,id=3Dpt_0 \ > + -device vfio-pci,host=3D0000:03:10.1,id=3Dpt_1 -cpu host -smp 4 -m 1= 0240 \ > + -chardev socket,path=3D/tmp/vm0_qga0.sock,server,nowait,id=3Dvm0_qga= 0 - > device virtio-serial \ > + -device virtserialport,chardev=3Dvm0_qga0,name=3Dorg.qemu.guest_agen= t.0 - > vnc :1 \ > + -drive > + file=3D/home/image/ubuntu16- > 0.img,format=3Dqcow2,if=3Dvirtio,index=3D0,media=3Dd > + isk > + > +4. login vm0, got VFs pci device id in vm0, assume they are 00:06.0 & 00= :07.0, > bind them to igb_uio driver:: > + > + modprobe uio > + insmod igb_uio.ko > + ./tools/dpdk_nic_bind.py --bind=3Digb_uio 00:06.0 00:07.0 > + > +5. Turn on testpmd and set mac forwarding mode:: > + > + ./testpmd -c 0x0f -n 4 -- -i --portmask=3D0x3 --tx-offloads=3D0x0 > + > + testpmd> set fwd mac > + testpmd> start > + > +6. get mac address of VF0 and use it as dest mac, using scapy to send 20= 00 > packets from tester:: > + > + sendp(Ether(src=3D'tester_mac', > + dst=3D'vm_port0_mac')/IP()/UDP()/Raw(load=3D'XXXXXXXXXXXXXXXXXX'), > + iface=3D"tester_nic") > + > +7. verify the packets can't be received by VF1,As follows:: > + > + ######################## NIC statistics for port 0 > ######################## > + RX-packets: 2000 RX-missed: 0 RX-bytes: 120000 > + RX-errors: 0 > + RX-nombuf: 0 > + TX-packets: 0 TX-errors: 0 TX-bytes: 0 > + > + Throughput (since last show) > + Rx-pps: 634 > + Tx-pps: 0 > + > ################################################################ > ############ > + ######################## NIC statistics for port 1 > ######################## > + RX-packets: 0 RX-missed: 0 RX-bytes: 0 > + RX-errors: 0 > + RX-nombuf: 0 > + TX-packets: 0 TX-errors: 0 TX-bytes: 0 > + > + Throughput (since last show) > + Rx-pps: 0 > + Tx-pps: 0 > + > + > ################################################################ > ###### > + ###### > + > +8. You can see "ixgbe 0000:03:00.0: Malicious event on VF 0 tx:100000 rx= :0" > by using the "dmesg -c" command on the host:: > + > + dmesg -c | grep 'event' > + > +Test Case 3: disable_mdd_dpdk_disable > +=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. disable the MDD:: > + > + rmmod ixgbe > + modprobe ixgbe MDD=3D0,0 > + ifconfig ens865f1 up > + ifconfig ens865f0 up > + > +2. pf_port0 virtualizes a vf0 and pf_port1 virtualizes a vf1:: > + > + echo 1 > /sys/bus/pci/devices/0000\:03\:00.0/sriov_numvfs > + echo 1 > /sys/bus/pci/devices/0000\:03\:00.1/sriov_numvfs > + > +3. passthrough vf0 and vf1 to vm0 and start vm0:: > + > + taskset -c 4,5,6,7 qemu-system-x86_64 -name vm0 -enable-kvm -pidfil= e > /tmp/.vm0.pid \ > + -daemonize -monitor unix:/tmp/vm0_monitor.sock,server,nowait -device > e1000,netdev=3Dnttsip1 \ > + -netdev user,id=3Dnttsip1,hostfwd=3Dtcp:127.0.0.1:6001-:22 -device v= fio- > pci,host=3D0000:03:10.0,id=3Dpt_0 \ > + -device vfio-pci,host=3D0000:03:10.1,id=3Dpt_1 -cpu host -smp 4 -m 1= 0240 \ > + -chardev socket,path=3D/tmp/vm0_qga0.sock,server,nowait,id=3Dvm0_qga= 0 - > device virtio-serial \ > + -device virtserialport,chardev=3Dvm0_qga0,name=3Dorg.qemu.guest_agen= t.0 - > vnc :1 \ > + -drive > + file=3D/home/image/ubuntu16- > 0.img,format=3Dqcow2,if=3Dvirtio,index=3D0,media=3Dd > + isk > + > +4. login vm0, got VFs pci device id in vm0, assume they are 00:06.0 & 00= :07.0, > bind them to igb_uio driver:: > + > + modprobe uio > + insmod igb_uio.ko > + ./tools/dpdk_nic_bind.py --bind=3Digb_uio 00:06.0 00:07.0 > + > +5. Turn on testpmd and set mac forwarding mode:: > + > + ./testpmd -c 0xf -n 4 -- -i --portmask=3D0x3 --tx-offloads=3D0x1 > + > + testpmd> set fwd mac > + testpmd> start > + > +6. get mac address of VF0 and use it as dest mac, using scapy to send 20= 00 > packets from tester:: > + > + sendp(Ether(src=3D'tester_mac', > + dst=3D'vm_port0_mac')/IP()/UDP()/Raw(load=3D'XXXXXXXXXXXXXXXXXX'), > + iface=3D"tester_nic") > + > +7. verify the packets can be received by VF1,As follows:: > + > + ######################## NIC statistics for port 0 > ######################## > + RX-packets: 2000 RX-missed: 0 RX-bytes: 120000 > + RX-errors: 0 > + RX-nombuf: 0 > + TX-packets: 0 TX-errors: 0 TX-bytes: 0 > + > + Throughput (since last show) > + Rx-pps: 634 > + Tx-pps: 0 > + > ################################################################ > ############ > + ######################## NIC statistics for port 1 > ######################## > + RX-packets: 0 RX-missed: 0 RX-bytes: 0 > + RX-errors: 0 > + RX-nombuf: 0 > + TX-packets: 2000 TX-errors: 0 TX-bytes: 120000 > + > + Throughput (since last show) > + Rx-pps: 0 > + Tx-pps: 618 > + > + > ################################################################ > ###### > + ###### > + > +8. You cannot see "ixgbe 0000:03:00.0: Malicious event on VF 0 tx:100000 > rx:0" by using the "dmesg -c" command on the host:: > + > + dmesg -c | grep 'event' > + > +Test Case 4: disable_mdd_dpdk_enable > +=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. disable the MDD:: > + > + rmmod ixgbe > + modprobe ixgbe MDD=3D0,0 > + ifconfig ens865f1 up > + ifconfig ens865f0 up > + > +2. pf_port0 virtualizes a vf0 and pf_port1 virtualizes a vf1:: > + > + echo 1 > /sys/bus/pci/devices/0000\:03\:00.0/sriov_numvfs > + echo 1 > /sys/bus/pci/devices/0000\:03\:00.1/sriov_numvfs > + > +3. passthrough vf0 and vf1 to vm0 and start vm0:: > + > + taskset -c 4,5,6,7 qemu-system-x86_64 -name vm0 -enable-kvm -pidfil= e > /tmp/.vm0.pid \ > + -daemonize -monitor unix:/tmp/vm0_monitor.sock,server,nowait -device > e1000,netdev=3Dnttsip1 \ > + -netdev user,id=3Dnttsip1,hostfwd=3Dtcp:127.0.0.1:6001-:22 -device v= fio- > pci,host=3D0000:03:10.0,id=3Dpt_0 \ > + -device vfio-pci,host=3D0000:03:10.1,id=3Dpt_1 -cpu host -smp 4 -m 1= 0240 \ > + -chardev socket,path=3D/tmp/vm0_qga0.sock,server,nowait,id=3Dvm0_qga= 0 - > device virtio-serial \ > + -device virtserialport,chardev=3Dvm0_qga0,name=3Dorg.qemu.guest_agen= t.0 - > vnc :1 \ > + -drive > + file=3D/home/image/ubuntu16- > 0.img,format=3Dqcow2,if=3Dvirtio,index=3D0,media=3Dd > + isk > + > +4. login vm0, got VFs pci device id in vm0, assume they are 00:06.0 & 00= :07.0, > bind them to igb_uio driver:: > + > + modprobe uio > + insmod igb_uio.ko > + ./tools/dpdk_nic_bind.py --bind=3Digb_uio 00:06.0 00:07.0 > + > +5. Turn on testpmd and set mac forwarding mode:: > + > + ./testpmd -c 0xf -n 4 -- -i --portmask=3D0x3 --tx-offloads=3D0x0 > + > + testpmd> set fwd mac > + testpmd> start > + > +6. get mac address of VF0 and use it as dest mac, using scapy to send 20= 00 > packets from tester:: > + > + sendp(Ether(src=3D'tester_mac', > + dst=3D'vm_port0_mac')/IP()/UDP()/Raw(load=3D'XXXXXXXXXXXXXXXXXX'), > + iface=3D"tester_nic") > + > +7. verify the packets can be received by VF1,As follows:: > + > + ######################## NIC statistics for port 0 > ######################## > + RX-packets: 2000 RX-missed: 0 RX-bytes: 120000 > + RX-errors: 0 > + RX-nombuf: 0 > + TX-packets: 0 TX-errors: 0 TX-bytes: 0 > + > + Throughput (since last show) > + Rx-pps: 634 > + Tx-pps: 0 > + > ################################################################ > ############ > + ######################## NIC statistics for port 1 > ######################## > + RX-packets: 0 RX-missed: 0 RX-bytes: 0 > + RX-errors: 0 > + RX-nombuf: 0 > + TX-packets: 2000 TX-errors: 0 TX-bytes: 120000 > + > + Throughput (since last show) > + Rx-pps: 0 > + Tx-pps: 618 > + > + > ################################################################ > ###### > + ###### > + > +8. You cannot see "ixgbe 0000:03:00.0: Malicious event on VF 0 tx:100000 > rx:0" by using the "dmesg -c" command on the host:: > + > + dmesg -c | grep 'event' > -- > 2.17.2