.. SPDX-License-Identifier: BSD-3-Clause Copyright(c) 2010-2019 Intel Corporation ======================================== 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. CC=gcc meson -Denable_kmods=True -Dlibdir=lib --default-library=static ninja -C meson configure -Dexamples=vm_power_manager ninja -C .//examples/dpdk-vm_power_manager -c 0xffff -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. .//app/dpdk-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 dpdk-guest_cli on VM. CC=gcc meson -Denable_kmods=True -Dlibdir=lib --default-library=static ninja -C meson configure -Dexamples=vm_power_manager/guest_cli ninja -C .//examples/dpdk-guest_cli \ -c 0xff -n 4 --file-prefix=vmpower2 -- -i --vm-name= \ --policy= --vcpu-list= --busy-hours=