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 B601FA0513; Thu, 16 Jan 2020 02:54:00 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A11091C1A4; Thu, 16 Jan 2020 02:54:00 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id E75BE1C132 for ; Thu, 16 Jan 2020 02:53:58 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2020 17:53:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,324,1574150400"; d="scan'208";a="218357026" Received: from dpdk-moyufen06.sh.intel.com ([10.67.116.222]) by orsmga008.jf.intel.com with ESMTP; 15 Jan 2020 17:53:57 -0800 From: yufengmx To: dts@dpdk.org, lei.a.yao@intel.com Cc: yufengmx Date: Thu, 16 Jan 2020 09:56:30 +0800 Message-Id: <20200116015630.21250-5-yufengx.mo@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200116015630.21250-1-yufengx.mo@intel.com> References: <20200116015630.21250-1-yufengx.mo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V2 4/4] test_plans/power_bidirection_channel: 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" upload test plan. Signed-off-by: yufengmx --- .../power_bidirection_channel_test_plan.rst | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 test_plans/power_bidirection_channel_test_plan.rst diff --git a/test_plans/power_bidirection_channel_test_plan.rst b/test_plans/power_bidirection_channel_test_plan.rst new file mode 100644 index 0000000..e26a603 --- /dev/null +++ b/test_plans/power_bidirection_channel_test_plan.rst @@ -0,0 +1,173 @@ +.. Copyright (c) <2010-2020>, 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. + +=================================== +power bidirection channel test plan +=================================== + +preparation work +================ +1. Turn on speedstep option in BIOS. +2. Turn on CPU C3 and C6. +3. Turn on turbo in BIOS. +4. Disable intel_pstate in Linux kernel command ``intel_pstate=disable``. +5. modprobe msr module to let the application can get the CPU HW info. +6. Let user space can control the CPU frequency:: + + cpupower frequency-set -g userspace + +7. set a folder:: + + mkdir /tmp/powermonitor + chmod 777 /tmp/powermonitor + + +Test Case 1 : Check VM can send power policy command to host and get acked +========================================================================== +Step 1. Launch VM using libvirt:: + + virsh start [VM name] + +Step 2. Launch VM power manager example on the host to monitor the channel from VM:: + + ./examples/vm_power_manager/build/vm_power_mgr -l 12-14 -n 4 --no-pci + vmpower> add_vm [vm name] + vmpower> add_channels [vm name] all + vmpower> set_channel_status [vm name] all enabled + vmpower> show_vm [vm name] + + If VM name is ubuntu, the command as following: + vmpower> add_vm ubuntu + vmpower> add_channels ubuntu all + vmpower> set_channel_status ubuntu all enabled + vmpower> show_vm ubuntu + +Step 3. In the VM, launch guest_vm_power_mgr to set and send the power manager policy to the host power example:: + + ./examples/vm_power_manager/guest_cli/build/guest_vm_power_mgr -c 0xff -n 4 -m 1024 --no-pci --file-prefix=vm_power -- --vm-name=ubuntu --vcpu-list=0-7 + + Send command to the core 7 on host APP: + vmpower(guest)> set_cpu_freq 7 down + + Check following info will be returned for the ACK activity, as following: + ACK received for message sent to host. + + If command can't be executed, NACK will be returned, as following: + NACK received for message sent to host. + +Step 4. Set frequency on core which is out of the VM's core scope:: + + For example, the vcpu range is 0-7, we set command to vcpu number 9 as following: + vmpower(guest)> set_cpu_freq 9 down + GUEST_CHANNEL: Channel is not connected + Error sending message: Unknown error -1 + + +Test Case 2 : Query Host CPU frequency list from VM +=================================================== +Step 1. Launch VM using libvirt:: + + virsh start [VM name] + +Step 2. Launch VM power manager example on the host to monitor the channel from VM:: + + ./examples/vm_power_manager/build/vm_power_mgr -l 12-14 -n 4 --no-pci + vmpower> add_vm [vm name] + vmpower> add_channels [vm name] all + vmpower> set_channel_status [vm name] all enabled + vmpower> show_vm [vm name] + vmpower> set_query + +Step 3. Enable the query permission for target VM from host vm_power_mgr example:: + + Command format: set_query + if vm name is ubuntu,command as following: + vmpower> set_query ubuntu enable + +Step 4. Query the CPU frequency for all CPU cores from VM side:: + + ./examples/vm_power_manager/guest_cli/build/guest_vm_power_mgr -c 0xff -n 4 -m 1024 --no-pci --file-prefix=vm_power -- --vm-name=ubuntu --vcpu-list=0-7 + vmpower> query_cpu_freq | all + + Check vcpu 0~7 frequency info will be returned, for example: + Frequency of [0] vcore is 2300000. + Frequency of [1] vcore is 2200000. + Frequency of [2] vcore is 2800000. + Frequency of [3] vcore is 2300000. + Frequency of [4] vcore is 2300000. + Frequency of [5] vcore is 2300000. + Frequency of [6] vcore is 2300000. + Frequency of [7] vcore is 2300000. + +Step 5. Disable query permission from VM, check the host CPU frequency won't be returned:: + + at host side, disable query permission by vm_power_mgr example: + vmpower> set_query ubuntu disable + + at VM side, query CPU frequency again, this action should not be executed successfully, log as following: + vmpower(guest)> query_cpu_freq all + GUEST_CLI: Error receiving message. + Error during frequency list reception. + + +Test Case 3: Query CPU capability from VM +========================================= +Step1~3. The same as test case 2 + +Step4: Query all the valid CPU core capability of host, check all cores' information is returned. Check the high priority core is recognized correctly:: + + For example, core 2 is returned as high priority core: + vmpower(guest)> query_cpu_caps all + Capabilities of [0] vcore are: turbo possibility: 1, is priority core: 0. + Capabilities of [1] vcore are: turbo possibility: 1, is priority core: 0. + Capabilities of [2] vcore are: turbo possibility: 1, is priority core: 1. + Capabilities of [3] vcore are: turbo possibility: 1, is priority core: 0. + Capabilities of [4] vcore are: turbo possibility: 1, is priority core: 0. + Capabilities of [5] vcore are: turbo possibility: 1, is priority core: 0. + Capabilities of [6] vcore are: turbo possibility: 1, is priority core: 0. + Capabilities of [7] vcore are: turbo possibility: 1, is priority core: 0. + +Step 5: Query CPU capability for core out of scope, check no CPU info will be return:: + + For example, the valid vcpu range is 0~7, query cpu capability of core 9 should return error as following: + vmpower(guest)> query_cpu_caps 9 + Invalid parameter provided. + +Step 6: Disable query permission from VM, check the host CPU capability won't be returned:: + + at host side, disable query permission by vm_power_mgr example: + vmpower> set_query ubuntu disable + + at VM side, query CPU capability again, this action should not be executed successfully, log as following: + vmpower(guest)> query_cpu_caps all + GUEST_CLI: Error receiving message. + Error during capabilities reception. \ No newline at end of file -- 2.21.0