4 #ifndef RTE_POWER_GUEST_CHANNEL_H
5 #define RTE_POWER_GUEST_CHANNEL_H
15 #define RTE_POWER_MAX_VFS 10
16 #define RTE_POWER_VM_MAX_NAME_SZ 32
17 #define RTE_POWER_MAX_VCPU_PER_VM 8
18 #define RTE_POWER_HOURS_PER_DAY 24
21 #define RTE_POWER_CPU_POWER 1
22 #define RTE_POWER_CPU_POWER_CONNECT 2
23 #define RTE_POWER_PKT_POLICY 3
24 #define RTE_POWER_PKT_POLICY_REMOVE 4
26 #define RTE_POWER_CORE_TYPE_VIRTUAL 0
27 #define RTE_POWER_CORE_TYPE_PHYSICAL 1
30 #define RTE_POWER_SCALE_UP 1
31 #define RTE_POWER_SCALE_DOWN 2
32 #define RTE_POWER_SCALE_MAX 3
33 #define RTE_POWER_SCALE_MIN 4
34 #define RTE_POWER_ENABLE_TURBO 5
35 #define RTE_POWER_DISABLE_TURBO 6
38 #define RTE_POWER_QUERY_FREQ_LIST 7
39 #define RTE_POWER_QUERY_FREQ 8
40 #define RTE_POWER_QUERY_CAPS_LIST 9
41 #define RTE_POWER_QUERY_CAPS 10
44 #define RTE_POWER_CMD_ACK 1
45 #define RTE_POWER_CMD_NACK 2
48 #define RTE_POWER_FREQ_LIST 3
49 #define RTE_POWER_CAPS_LIST 4
51 struct rte_power_traffic_policy {
52 uint32_t min_packet_thresh;
53 uint32_t avg_max_packet_thresh;
54 uint32_t max_max_packet_thresh;
57 struct rte_power_timer_profile {
58 int busy_hours[RTE_POWER_HOURS_PER_DAY];
59 int quiet_hours[RTE_POWER_HOURS_PER_DAY];
60 int hours_to_use_traffic_profile[RTE_POWER_HOURS_PER_DAY];
63 enum rte_power_workload_level {
69 enum rte_power_policy {
70 RTE_POWER_POLICY_TRAFFIC,
71 RTE_POWER_POLICY_TIME,
72 RTE_POWER_POLICY_WORKLOAD,
73 RTE_POWER_POLICY_BRANCH_RATIO
80 struct rte_power_channel_packet {
84 char vm_name[RTE_POWER_VM_MAX_NAME_SZ];
86 uint64_t vfid[RTE_POWER_MAX_VFS];
87 int nb_mac_to_monitor;
88 struct rte_power_traffic_policy traffic_policy;
89 uint8_t vcpu_to_control[RTE_POWER_MAX_VCPU_PER_VM];
91 struct rte_power_timer_profile timer_policy;
93 enum rte_power_workload_level workload;
94 enum rte_power_policy policy_to_use;
98 struct rte_power_channel_packet_freq_list {
102 char vm_name[RTE_POWER_VM_MAX_NAME_SZ];
104 uint32_t freq_list[RTE_POWER_MAX_VCPU_PER_VM];
108 struct rte_power_channel_packet_caps_list {
109 uint64_t resource_id;
112 char vm_name[RTE_POWER_VM_MAX_NAME_SZ];
114 uint64_t turbo[RTE_POWER_MAX_VCPU_PER_VM];
115 uint64_t priority[RTE_POWER_MAX_VCPU_PER_VM];
132 int rte_power_guest_channel_send_msg(
struct rte_power_channel_packet *pkt,
133 unsigned int lcore_id);
153 int rte_power_guest_channel_receive_msg(
void *pkt,
155 unsigned int lcore_id);
rte_power_freq_change_t rte_power_turbo_status