2 Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
9 * Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11 * Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in
13 the documentation and/or other materials provided with the
15 * Neither the name of Intel Corporation nor the names of its
16 contributors may be used to endorse or promote products derived
17 from this software without specific prior written permission.
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 The DPDK Power Management feature allows users space applications to save power
35 by dynamically adjusting CPU frequency or entering into different C-States.
37 * Adjusting the CPU frequency dynamically according to the utilization of RX queue.
39 * Entering into different deeper C-States according to the adaptive algorithms to speculate
40 brief periods of time suspending the application if no packets are received.
42 The interfaces for adjusting the operating CPU frequency are in the power management library.
43 C-State control is implemented in applications according to the different use cases.
48 The Linux kernel provides a cpufreq module for CPU frequency scaling for each lcore.
49 For example, for cpuX, /sys/devices/system/cpu/cpuX/cpufreq/ has the following sys files for frequency scaling:
61 * cpuinfo_transition_latency
65 * scaling_available_frequencies
67 * scaling_available_governors
81 In the DPDK, scaling_governor is configured in user space.
82 Then, a user space application can prompt the kernel by writing scaling_setspeed to adjust the CPU frequency
83 according to the strategies defined by the user space application.
85 Core-load Throttling through C-States
86 -------------------------------------
88 Core state can be altered by speculative sleeps whenever the specified lcore has nothing to do.
89 In the DPDK, if no packet is received after polling,
90 speculative sleeps can be triggered according the strategies defined by the user space application.
92 API Overview of the Power Library
93 ---------------------------------
95 The main methods exported by power library are for CPU frequency scaling and include the following:
97 * **Freq up**: Prompt the kernel to scale up the frequency of the specific lcore.
99 * **Freq down**: Prompt the kernel to scale down the frequency of the specific lcore.
101 * **Freq max**: Prompt the kernel to scale up the frequency of the specific lcore to the maximum.
103 * **Freq min**: Prompt the kernel to scale down the frequency of the specific lcore to the minimum.
105 * **Get available freqs**: Read the available frequencies of the specific lcore from the sys file.
107 * **Freq get**: Get the current frequency of the specific lcore.
109 * **Freq set**: Prompt the kernel to set the frequency for the specific lcore.
114 The power management mechanism is used to save power when performing L3 forwarding.
119 * l3fwd-power: The sample application in DPDK that performs L3 forwarding with power management.
121 * The "L3 Forwarding with Power Management Sample Application" chapter in the *DPDK Sample Application's User Guide*.