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.
46 * @warning This function must be called when all affected Ethernet queues are
47 * stopped and no Rx/Tx is in progress!
50 * The lcore the Rx queue will be polled from.
52 * The port identifier of the Ethernet device.
54 * The queue identifier of the Ethernet device.
56 * The power management scheme to use for specified Rx queue.
63 rte_power_ethdev_pmgmt_queue_enable(unsigned int lcore_id,
64 uint16_t port_id, uint16_t queue_id,
65 enum rte_power_pmd_mgmt_type mode);
69 * @b EXPERIMENTAL: this API may change, or be removed, without prior notice.
71 * Disable power management on a specified Ethernet device Rx queue and lcore.
73 * @note This function is not thread-safe.
75 * @warning This function must be called when all affected Ethernet queues are
76 * stopped and no Rx/Tx is in progress!
79 * The lcore the Rx queue is polled from.
81 * The port identifier of the Ethernet device.
83 * The queue identifier of the Ethernet device.
90 rte_power_ethdev_pmgmt_queue_disable(unsigned int lcore_id,
91 uint16_t port_id, uint16_t queue_id);