]> git.proxmox.com Git - ceph.git/blob - ceph/src/seastar/dpdk/lib/librte_power/channel_commands.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / seastar / dpdk / lib / librte_power / channel_commands.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
3 */
4
5 #ifndef CHANNEL_COMMANDS_H_
6 #define CHANNEL_COMMANDS_H_
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 #include <stdint.h>
13 #include <stdbool.h>
14
15 /* Valid Commands */
16 #define CPU_POWER 1
17 #define CPU_POWER_CONNECT 2
18 #define PKT_POLICY 3
19 #define PKT_POLICY_REMOVE 4
20
21 /* CPU Power Command Scaling */
22 #define CPU_POWER_SCALE_UP 1
23 #define CPU_POWER_SCALE_DOWN 2
24 #define CPU_POWER_SCALE_MAX 3
25 #define CPU_POWER_SCALE_MIN 4
26 #define CPU_POWER_ENABLE_TURBO 5
27 #define CPU_POWER_DISABLE_TURBO 6
28 #define HOURS 24
29
30 #define MAX_VFS 10
31 #define VM_MAX_NAME_SZ 32
32
33 #define MAX_VCPU_PER_VM 8
34
35 struct t_boost_status {
36 bool tbEnabled;
37 };
38
39 struct timer_profile {
40 int busy_hours[HOURS];
41 int quiet_hours[HOURS];
42 int hours_to_use_traffic_profile[HOURS];
43 };
44
45 enum workload {HIGH, MEDIUM, LOW};
46 enum policy_to_use {
47 TRAFFIC,
48 TIME,
49 WORKLOAD,
50 BRANCH_RATIO
51 };
52
53 struct traffic {
54 uint32_t min_packet_thresh;
55 uint32_t avg_max_packet_thresh;
56 uint32_t max_max_packet_thresh;
57 };
58
59 #define CORE_TYPE_VIRTUAL 0
60 #define CORE_TYPE_PHYSICAL 1
61
62 struct channel_packet {
63 uint64_t resource_id; /**< core_num, device */
64 uint32_t unit; /**< scale down/up/min/max */
65 uint32_t command; /**< Power, IO, etc */
66 char vm_name[VM_MAX_NAME_SZ];
67
68 uint64_t vfid[MAX_VFS];
69 int nb_mac_to_monitor;
70 struct traffic traffic_policy;
71 uint8_t vcpu_to_control[MAX_VCPU_PER_VM];
72 uint8_t num_vcpu;
73 struct timer_profile timer_policy;
74 bool core_type;
75 enum workload workload;
76 enum policy_to_use policy_to_use;
77 struct t_boost_status t_boost_status;
78 };
79
80
81 #ifdef __cplusplus
82 }
83 #endif
84
85 #endif /* CHANNEL_COMMANDS_H_ */