#include <stdint.h>
#include <rte_log.h>
#include <rte_power.h>
Go to the source code of this file.
RTE PMD Power Management
Definition in file rte_power_pmd_mgmt.h.
◆ rte_power_pmd_mgmt_type
PMD Power Management Type
Enumerator |
---|
RTE_POWER_MGMT_TYPE_MONITOR | Use power-optimized monitoring to wait for incoming traffic
|
RTE_POWER_MGMT_TYPE_PAUSE | Use power-optimized sleep to avoid busy polling
|
RTE_POWER_MGMT_TYPE_SCALE | Use frequency scaling when traffic is low
|
Definition at line 25 of file rte_power_pmd_mgmt.h.
◆ rte_power_ethdev_pmgmt_queue_enable()
__rte_experimental int rte_power_ethdev_pmgmt_queue_enable |
( |
unsigned int |
lcore_id, |
|
|
uint16_t |
port_id, |
|
|
uint16_t |
queue_id, |
|
|
enum rte_power_pmd_mgmt_type |
mode |
|
) |
| |
- Warning
- EXPERIMENTAL: this API may change, or be removed, without prior notice.
Enable power management on a specified Ethernet device Rx queue and lcore.
- Note
- This function is not thread-safe.
- Warning
- This function must be called when all affected Ethernet queues are stopped and no Rx/Tx is in progress!
- Parameters
-
lcore_id | The lcore the Rx queue will be polled from. |
port_id | The port identifier of the Ethernet device. |
queue_id | The queue identifier of the Ethernet device. |
mode | The power management scheme to use for specified Rx queue. |
- Returns
- 0 on success <0 on error
- Examples:
- examples/l3fwd-power/main.c.
◆ rte_power_ethdev_pmgmt_queue_disable()
__rte_experimental int rte_power_ethdev_pmgmt_queue_disable |
( |
unsigned int |
lcore_id, |
|
|
uint16_t |
port_id, |
|
|
uint16_t |
queue_id |
|
) |
| |
- Warning
- EXPERIMENTAL: this API may change, or be removed, without prior notice.
Disable power management on a specified Ethernet device Rx queue and lcore.
- Note
- This function is not thread-safe.
- Warning
- This function must be called when all affected Ethernet queues are stopped and no Rx/Tx is in progress!
- Parameters
-
lcore_id | The lcore the Rx queue is polled from. |
port_id | The port identifier of the Ethernet device. |
queue_id | The queue identifier of the Ethernet device. |
- Returns
- 0 on success <0 on error
- Examples:
- examples/l3fwd-power/main.c.
◆ rte_power_pmd_mgmt_set_emptypoll_max()
__rte_experimental void rte_power_pmd_mgmt_set_emptypoll_max |
( |
unsigned int |
max | ) |
|
- Warning
- EXPERIMENTAL: this API may change, or be removed, without prior notice.
Set a emptypoll_max to specified value. Used to specify the number of empty polls to wait before entering sleep state.
- Parameters
-
max | The value to set emptypoll_max to. |
- Examples:
- examples/l3fwd-power/main.c.
◆ rte_power_pmd_mgmt_get_emptypoll_max()
__rte_experimental unsigned int rte_power_pmd_mgmt_get_emptypoll_max |
( |
void |
| ) |
|
- Warning
- EXPERIMENTAL: this API may change, or be removed, without prior notice.
Get the current value of emptypoll_max.
- Returns
- The current emptypoll_max value
◆ rte_power_pmd_mgmt_set_pause_duration()
__rte_experimental int rte_power_pmd_mgmt_set_pause_duration |
( |
unsigned int |
duration | ) |
|
- Warning
- EXPERIMENTAL: this API may change, or be removed, without prior notice.
Set the pause_duration. Used to adjust the pause mode callback duration.
- Note
- Duration must be greater than zero.
- Parameters
-
duration | The value to set pause_duration to. |
- Returns
- 0 on success <0 on error
- Examples:
- examples/l3fwd-power/main.c.
◆ rte_power_pmd_mgmt_get_pause_duration()
__rte_experimental unsigned int rte_power_pmd_mgmt_get_pause_duration |
( |
void |
| ) |
|
- Warning
- EXPERIMENTAL: this API may change, or be removed, without prior notice.
Get the current value of pause_duration.
- Returns
- The current pause_duration value.
◆ rte_power_pmd_mgmt_set_scaling_freq_min()
__rte_experimental int rte_power_pmd_mgmt_set_scaling_freq_min |
( |
unsigned int |
lcore, |
|
|
unsigned int |
min |
|
) |
| |
- Warning
- EXPERIMENTAL: this API may change, or be removed, without prior notice.
Set the min frequency to be used for frequency scaling or zero to use defaults.
- Note
- Supported by: Pstate mode.
- Parameters
-
lcore | The ID of the lcore to set the min frequency for. |
min | The value, in KiloHertz, to set the minimum frequency to. |
- Returns
- 0 on success <0 on error
- Examples:
- examples/l3fwd-power/main.c.
◆ rte_power_pmd_mgmt_set_scaling_freq_max()
__rte_experimental int rte_power_pmd_mgmt_set_scaling_freq_max |
( |
unsigned int |
lcore, |
|
|
unsigned int |
max |
|
) |
| |
- Warning
- EXPERIMENTAL: this API may change, or be removed, without prior notice.
Set the max frequency to be used for frequency scaling or zero to use defaults.
- Note
- Supported by: Pstate mode.
- Parameters
-
lcore | The ID of the lcore to set the max frequency for. |
max | The value, in KiloHertz, to set the maximum frequency to. If 'max' is 0, it is considered 'not set'. |
- Returns
- 0 on success <0 on error
- Examples:
- examples/l3fwd-power/main.c.
◆ rte_power_pmd_mgmt_get_scaling_freq_min()
__rte_experimental int rte_power_pmd_mgmt_get_scaling_freq_min |
( |
unsigned int |
lcore | ) |
|
- Warning
- EXPERIMENTAL: this API may change, or be removed, without prior notice.
Get the current configured min frequency used for frequency scaling.
- Note
- Supported by: Pstate mode.
- Parameters
-
lcore | The ID of the lcore to get the min frequency for. |
- Returns
- 0 if no value has been configured via the 'set' API. >0 if a minimum frequency has been configured. Value is the minimum frequency , in KiloHertz, used for frequency scaling. <0 on error
◆ rte_power_pmd_mgmt_get_scaling_freq_max()
__rte_experimental int rte_power_pmd_mgmt_get_scaling_freq_max |
( |
unsigned int |
lcore | ) |
|
- Warning
- EXPERIMENTAL: this API may change, or be removed, without prior notice.
Get the current configured max frequency used for frequency scaling.
- Note
- Supported by: Pstate mode.
- Parameters
-
lcore | The ID of the lcore to get the max frequency for. |
- Returns
- 0 if no value has been configured via the 'set' API. >0 if a maximum frequency has been configured. Value is the maximum frequency , in KiloHertz, used for frequency scaling. <0 on error