4#ifndef RTE_POWER_GUEST_CHANNEL_H
5#define RTE_POWER_GUEST_CHANNEL_H
11#include <rte_compat.h>
17#define RTE_POWER_MAX_VFS 10
18#define RTE_POWER_VM_MAX_NAME_SZ 32
19#define RTE_POWER_MAX_VCPU_PER_VM 8
20#define RTE_POWER_HOURS_PER_DAY 24
23#define RTE_POWER_CPU_POWER 1
24#define RTE_POWER_CPU_POWER_CONNECT 2
25#define RTE_POWER_PKT_POLICY 3
26#define RTE_POWER_PKT_POLICY_REMOVE 4
28#define RTE_POWER_CORE_TYPE_VIRTUAL 0
29#define RTE_POWER_CORE_TYPE_PHYSICAL 1
32#define RTE_POWER_SCALE_UP 1
33#define RTE_POWER_SCALE_DOWN 2
34#define RTE_POWER_SCALE_MAX 3
35#define RTE_POWER_SCALE_MIN 4
36#define RTE_POWER_ENABLE_TURBO 5
37#define RTE_POWER_DISABLE_TURBO 6
40#define RTE_POWER_QUERY_FREQ_LIST 7
41#define RTE_POWER_QUERY_FREQ 8
42#define RTE_POWER_QUERY_CAPS_LIST 9
43#define RTE_POWER_QUERY_CAPS 10
46#define RTE_POWER_CMD_ACK 1
47#define RTE_POWER_CMD_NACK 2
50#define RTE_POWER_FREQ_LIST 3
51#define RTE_POWER_CAPS_LIST 4
53struct rte_power_traffic_policy {
54 uint32_t min_packet_thresh;
55 uint32_t avg_max_packet_thresh;
56 uint32_t max_max_packet_thresh;
59struct rte_power_timer_profile {
60 int busy_hours[RTE_POWER_HOURS_PER_DAY];
61 int quiet_hours[RTE_POWER_HOURS_PER_DAY];
62 int hours_to_use_traffic_profile[RTE_POWER_HOURS_PER_DAY];
65enum rte_power_workload_level {
71enum rte_power_policy {
72 RTE_POWER_POLICY_TRAFFIC,
73 RTE_POWER_POLICY_TIME,
74 RTE_POWER_POLICY_WORKLOAD,
75 RTE_POWER_POLICY_BRANCH_RATIO
82struct rte_power_channel_packet {
86 char vm_name[RTE_POWER_VM_MAX_NAME_SZ];
88 uint64_t vfid[RTE_POWER_MAX_VFS];
89 int nb_mac_to_monitor;
90 struct rte_power_traffic_policy traffic_policy;
91 uint8_t vcpu_to_control[RTE_POWER_MAX_VCPU_PER_VM];
93 struct rte_power_timer_profile timer_policy;
95 enum rte_power_workload_level workload;
96 enum rte_power_policy policy_to_use;
100struct rte_power_channel_packet_freq_list {
101 uint64_t resource_id;
104 char vm_name[RTE_POWER_VM_MAX_NAME_SZ];
106 uint32_t freq_list[RTE_POWER_MAX_VCPU_PER_VM];
110struct rte_power_channel_packet_caps_list {
111 uint64_t resource_id;
114 char vm_name[RTE_POWER_VM_MAX_NAME_SZ];
116 uint64_t turbo[RTE_POWER_MAX_VCPU_PER_VM];
117 uint64_t priority[RTE_POWER_MAX_VCPU_PER_VM];
134int rte_power_guest_channel_send_msg(
struct rte_power_channel_packet *pkt,
135 unsigned int lcore_id);
159int rte_power_guest_channel_receive_msg(
void *pkt,
161 unsigned int lcore_id);
rte_power_freq_change_t rte_power_turbo_status