summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDavid Hunt <david.hunt@intel.com>2018-07-13 15:23:00 +0100
committerThomas Monjalon <thomas@monjalon.net>2018-07-20 23:59:42 +0200
commitb89168ef150ef35046735ba76d8537532d8f417f (patch)
tree30e2777d98c51098e197e2aa0d78261bc61f7aa1 /examples
parent6e26957782ef80009409192346724bc624f432eb (diff)
downloaddpdk-b89168ef150ef35046735ba76d8537532d8f417f.zip
dpdk-b89168ef150ef35046735ba76d8537532d8f417f.tar.gz
dpdk-b89168ef150ef35046735ba76d8537532d8f417f.tar.xz
examples/vm_power: add branch ratio policy type
Add the capability for the vm_power_manager to receive a policy of type BRANCH_RATIO. This will add any vcpus in the policy to the oob monitoring thread. Signed-off-by: David Hunt <david.hunt@intel.com> Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/vm_power_manager/channel_monitor.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
index 73bddd9..7fa47ba 100644
--- a/examples/vm_power_manager/channel_monitor.c
+++ b/examples/vm_power_manager/channel_monitor.c
@@ -27,6 +27,7 @@
#include "channel_commands.h"
#include "channel_manager.h"
#include "power_manager.h"
+#include "oob_monitor.h"
#define RTE_LOGTYPE_CHANNEL_MONITOR RTE_LOGTYPE_USER1
@@ -92,6 +93,10 @@ get_pcpu_to_control(struct policy *pol)
struct vm_info info;
int pcpu, count;
uint64_t mask_u64b;
+ struct core_info *ci;
+ int ret;
+
+ ci = get_core_info();
RTE_LOG(INFO, CHANNEL_MONITOR, "Looking for pcpu for %s\n",
pol->pkt.vm_name);
@@ -100,8 +105,22 @@ get_pcpu_to_control(struct policy *pol)
for (count = 0; count < pol->pkt.num_vcpu; count++) {
mask_u64b = info.pcpu_mask[pol->pkt.vcpu_to_control[count]];
for (pcpu = 0; mask_u64b; mask_u64b &= ~(1ULL << pcpu++)) {
- if ((mask_u64b >> pcpu) & 1)
- pol->core_share[count].pcpu = pcpu;
+ if ((mask_u64b >> pcpu) & 1) {
+ if (pol->pkt.policy_to_use == BRANCH_RATIO) {
+ ci->cd[pcpu].oob_enabled = 1;
+ ret = add_core_to_monitor(pcpu);
+ if (ret == 0)
+ printf("Monitoring pcpu %d via Branch Ratio\n",
+ pcpu);
+ else
+ printf("Failed to start OOB Monitoring pcpu %d\n",
+ pcpu);
+
+ } else {
+ pol->core_share[count].pcpu = pcpu;
+ printf("Monitoring pcpu %d\n", pcpu);
+ }
+ }
}
}
}