eventdev/eth_rx: fix telemetry Rx stats reset
[dpdk.git] / examples / vm_power_manager / power_manager.h
index 45385de..d51039e 100644 (file)
@@ -8,12 +8,25 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
+
+#define FREQ_WINDOW_SIZE 32
+
+enum {
+       FREQ_UNKNOWN,
+       FREQ_MIN,
+       FREQ_MAX
+};
+
 struct core_details {
        uint64_t last_branches;
        uint64_t last_branch_misses;
        uint16_t global_enabled_cpus;
        uint16_t oob_enabled;
        int msr_fd;
+       uint16_t freq_directions[FREQ_WINDOW_SIZE];
+       uint16_t freq_window_idx;
+       uint16_t freq_state;
+       float branch_ratio_threshold;
 };
 
 struct core_info {
@@ -21,6 +34,8 @@ struct core_info {
        struct core_details *cd;
 };
 
+#define BRANCH_RATIO_THRESHOLD 0.1
+
 struct core_info *
 get_core_info(void);
 
@@ -29,8 +44,6 @@ core_info_init(void);
 
 #define RTE_LOGTYPE_POWER_MANAGER RTE_LOGTYPE_USER1
 
-/* Maximum number of CPUS to manage */
-#define POWER_MGR_MAX_CPUS 64
 /**
  * Initialize power management.
  * Initializes resources and verifies the number of CPUs on the system.
@@ -211,7 +224,7 @@ int power_manager_enable_turbo_core(unsigned int core_num);
 int power_manager_disable_turbo_core(unsigned int core_num);
 
 /**
- * Get the current freuency of the core specified by core_num
+ * Get the current frequency of the core specified by core_num
  *
  * @param core_num
  *  The core number to get the current frequency