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 96871A04F3; Tue, 24 Dec 2019 02:53:44 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CE77E1BE8A; Tue, 24 Dec 2019 02:53:43 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id D45DD1252 for ; Tue, 24 Dec 2019 02:53:41 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Dec 2019 17:53:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,349,1571727600"; d="scan'208";a="249670802" Received: from dpdk-moyufen06.sh.intel.com ([10.67.116.222]) by fmsmga002.fm.intel.com with ESMTP; 23 Dec 2019 17:53:40 -0800 From: yufengmx To: dts@dpdk.org, lei.a.yao@intel.com Cc: yufengmx Date: Tue, 24 Dec 2019 09:56:27 +0800 Message-Id: <20191224015628.11931-4-yufengx.mo@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191224015628.11931-1-yufengx.mo@intel.com> References: <20191224015628.11931-1-yufengx.mo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V4 3/4] test_plans/vm_pw_mgmt_policy: upload test plan 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" A feature allows workload to deliver policy to the host to manage power controls such as p-states extends the thinking of the current scheme moving away from direct controls to policy controls to avoid latency & jitter penalties. Also provides the ability to react faster. VM Power Manager would use a hint based mechanism by which a VM can communicate to a host based governor about its current processing requirements. By mapping VMs virtual CPUs to physical CPUs the Power Manager can then make decisions according to some policy as to what power state the physical CPUs can transition to. VM Agent shall have the ability to send the following policy to host. - traffic policy - time policy VM Agent shall have the ability to send the following hints to host:: - core disable turbo - core enable turbo Signed-off-by: yufengmx --- test_plans/vm_pw_mgmt_policy_test_plan.rst | 335 +++++++++++++++++++++ 1 file changed, 335 insertions(+) create mode 100644 test_plans/vm_pw_mgmt_policy_test_plan.rst diff --git a/test_plans/vm_pw_mgmt_policy_test_plan.rst b/test_plans/vm_pw_mgmt_policy_test_plan.rst new file mode 100644 index 0000000..cfbfe96 --- /dev/null +++ b/test_plans/vm_pw_mgmt_policy_test_plan.rst @@ -0,0 +1,335 @@ +.. Copyright (c) <2010-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. + +======================================== +VM Power Management Tests (Policy/Turbo) +======================================== + +Inband Policy Control +===================== + +A feature allows workload to deliver policy to the host to manage power controls +such as p-states extends the thinking of the current scheme moving away +from direct controls to policy controls to avoid latency & jitter +penalties. Also provides the ability to react faster. + +VM Power Manager would use a hint based mechanism by which a VM can +communicate to a host based governor about its current processing +requirements. By mapping VMs virtual CPUs to physical CPUs the Power Manager +can then make decisions according to some policy as to what power state the +physical CPUs can transition to. + +VM Agent shall have the ability to send the following policy to host. +- traffic policy +- time policy + +turbo +===== +A new feature extend the library to enable 'per-core' turbo among other APIs. + +VM Agent shall have the ability to send the following hints to host:: + + - core disable turbo + - core enable turbo + +The power manager will manage the file handles for each core as below:: + + ``/dev/cpu/%d/msr`` + +DPDK technical document refer to:: + + ``doc/guides/prog_guide/power_man.rst`` + ``doc/guides/sample_app_ug/vm_power_management.rst`` + +Prerequisites +============= +#. Hardware:: + + - NIC: i40e series('Ethernet Controller X710 for 10GbE SFP+ 1572') + +#. BIOS:: + + - Enable VT-d and VT-x + - Enable Enhanced Intel SpeedStep(R) Tech + - Enable Intel(R) Turbo Boost Technology + +#. OS and Kernel:: + + - Fedora 30 + vim /boot/grub2/grubenv + - Enable Kernel features IOMMU + iommu=pt + - Enable Intel IOMMU + intel_iommu=on + - Disable intel_pstate + intel_pstate=disable + +#. Virtualization:: + + - QEMU emulator version >= 2.3.1 + - libvirtd (libvirt) >= 1.2.13.2 + libvirt configuration refer to dpdk/doc/guides/howto/pvp_reference_benchmark.rst ``Libvirt way`` chapter + +#. port topology diagram:: + + packet generator DUT + .-----------. .-----------. + | .-------. | | .-------. | + | | portA | | <------------------> | | port0 | | + | | portB | | <------------------> | | port1 | | + | '-------' | | '-------' | + | | | nic | + '-----------' '-----------' + + +Set up testing environment +========================== +#. Configure VM XML to pin VCPUs/CPUs. + + .. code-block:: xml + + 8 + + + + + + + + + + + +#. Configure VM XML to set up virtio serial ports. + + Create temporary folder for vm_power socket. + + mkdir /tmp/powermonitor + chmod 777 /tmp/powermonitor + + Setup one serial port for every one vcpu in VM. + + .. code-block:: xml + + + + +
+ + +#. Create vf and passthrough it to VM. + + Create vf on one pf with system driver. + + echo 1 > /sys/bus/pci/devices/0000:d8:00.0/sriov_numvfs + + .. code-block:: xml + + + + +
+ +
+ + +#. Bind the vf passthrough on VM to igb_uio, bind pf on host to default system driver. + + ./usertools/dpdk-devbind.py --force --bind=igb_uio 0000:00:07.0 + +#. Compile and run power-manager in host, core number should >= 3, add vm in host. + + export RTE_SDK=`pwd` + export RTE_TARGET=x86_64-native-linuxapp-gcc + make -C examples/vm_power_manager + + ./examples/vm_power_manager/build/vm_power_mgr -c 0x7 -n 4 + + vmpower> add_vm + vmpower> add_channels all + vmpower> set_channel_status all enabled + +#. Run testpmd on vm0 when do traffic policy testing, other test cases ignore + this step. + + ./testpmd -c 0x3 -n 1 -v -m 1024 --file-prefix=vmpower1 -- -i --port-topology=loop + + testpmd> set fwd mac + testpmd> set promisc all on + testpmd> port start all + testpmd> start + +#. Compile and run guest_vm_power_mgr on VM. + + export RTE_SDK=`pwd` + export RTE_TARGET=x86_64-native-linuxapp-gcc + make -C examples/vm_power_manager/guest_cli + + ./examples/vm_power_manager/guest_cli/build/guest_vm_power_mgr \ + -c 0x1f -n 4 --file-prefix=vmpower2 -- -i --vm-name= \ + --policy= --vcpu-list= --busy-hours=