1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Intel Corporation
5 #ifndef _RTE_POWER_PMD_MGMT_H
6 #define _RTE_POWER_PMD_MGMT_H
10 * RTE PMD Power Management
16 #include <rte_common.h>
17 #include <rte_byteorder.h>
19 #include <rte_power.h>
20 #include <rte_atomic.h>
27 * PMD Power Management Type
29 enum rte_power_pmd_mgmt_type {
30 /** Use power-optimized monitoring to wait for incoming traffic */
31 RTE_POWER_MGMT_TYPE_MONITOR = 1,
32 /** Use power-optimized sleep to avoid busy polling */
33 RTE_POWER_MGMT_TYPE_PAUSE,
34 /** Use frequency scaling when traffic is low */
35 RTE_POWER_MGMT_TYPE_SCALE,
40 * @b EXPERIMENTAL: this API may change, or be removed, without prior notice.
42 * Enable power management on a specified Ethernet device Rx queue and lcore.
44 * @note This function is not thread-safe.
47 * The lcore the Rx queue will be polled from.
49 * The port identifier of the Ethernet device.
51 * The queue identifier of the Ethernet device.
53 * The power management scheme to use for specified Rx queue.
60 rte_power_ethdev_pmgmt_queue_enable(unsigned int lcore_id,
61 uint16_t port_id, uint16_t queue_id,
62 enum rte_power_pmd_mgmt_type mode);
66 * @b EXPERIMENTAL: this API may change, or be removed, without prior notice.
68 * Disable power management on a specified Ethernet device Rx queue and lcore.
70 * @note This function is not thread-safe.
73 * The lcore the Rx queue is polled from.
75 * The port identifier of the Ethernet device.
77 * The queue identifier of the Ethernet device.
84 rte_power_ethdev_pmgmt_queue_disable(unsigned int lcore_id,
85 uint16_t port_id, uint16_t queue_id);