X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_power%2Fpower_kvm_vm.c;h=409c3e03ab22959e4475b3b83c229467174c3396;hb=0f9ac2afa62ebacd24f36a3b98272b7146be3edd;hp=38e9066f807f54e55fd7055be0e33685ad869239;hpb=5e1f62fb1a4bbcf7a6294c019adf36286cce5955;p=dpdk.git diff --git a/lib/librte_power/power_kvm_vm.c b/lib/librte_power/power_kvm_vm.c index 38e9066f80..409c3e03ab 100644 --- a/lib/librte_power/power_kvm_vm.c +++ b/lib/librte_power/power_kvm_vm.c @@ -13,15 +13,20 @@ #define FD_PATH "/dev/virtio-ports/virtio.serial.port.poweragent" -static struct channel_packet pkt[CHANNEL_CMDS_MAX_VM_CHANNELS]; +static struct channel_packet pkt[RTE_MAX_LCORE]; +int +power_kvm_vm_check_supported(void) +{ + return guest_channel_host_check_exists(FD_PATH); +} int power_kvm_vm_init(unsigned int lcore_id) { - if (lcore_id >= CHANNEL_CMDS_MAX_VM_CHANNELS) { + if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Core(%u) is out of range 0...%d\n", - lcore_id, CHANNEL_CMDS_MAX_VM_CHANNELS-1); + lcore_id, RTE_MAX_LCORE-1); return -1; } pkt[lcore_id].command = CPU_POWER; @@ -37,9 +42,9 @@ power_kvm_vm_exit(unsigned int lcore_id) } uint32_t -power_kvm_vm_freqs(__attribute__((unused)) unsigned int lcore_id, - __attribute__((unused)) uint32_t *freqs, - __attribute__((unused)) uint32_t num) +power_kvm_vm_freqs(__rte_unused unsigned int lcore_id, + __rte_unused uint32_t *freqs, + __rte_unused uint32_t num) { RTE_LOG(ERR, POWER, "rte_power_freqs is not implemented " "for Virtual Machine Power Management\n"); @@ -47,7 +52,7 @@ power_kvm_vm_freqs(__attribute__((unused)) unsigned int lcore_id, } uint32_t -power_kvm_vm_get_freq(__attribute__((unused)) unsigned int lcore_id) +power_kvm_vm_get_freq(__rte_unused unsigned int lcore_id) { RTE_LOG(ERR, POWER, "rte_power_get_freq is not implemented " "for Virtual Machine Power Management\n"); @@ -55,8 +60,8 @@ power_kvm_vm_get_freq(__attribute__((unused)) unsigned int lcore_id) } int -power_kvm_vm_set_freq(__attribute__((unused)) unsigned int lcore_id, - __attribute__((unused)) uint32_t index) +power_kvm_vm_set_freq(__rte_unused unsigned int lcore_id, + __rte_unused uint32_t index) { RTE_LOG(ERR, POWER, "rte_power_set_freq is not implemented " "for Virtual Machine Power Management\n"); @@ -68,9 +73,9 @@ send_msg(unsigned int lcore_id, uint32_t scale_direction) { int ret; - if (lcore_id >= CHANNEL_CMDS_MAX_VM_CHANNELS) { + if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Core(%u) is out of range 0...%d\n", - lcore_id, CHANNEL_CMDS_MAX_VM_CHANNELS-1); + lcore_id, RTE_MAX_LCORE-1); return -1; } pkt[lcore_id].unit = scale_direction; @@ -107,7 +112,7 @@ power_kvm_vm_freq_min(unsigned int lcore_id) } int -power_kvm_vm_turbo_status(__attribute__((unused)) unsigned int lcore_id) +power_kvm_vm_turbo_status(__rte_unused unsigned int lcore_id) { RTE_LOG(ERR, POWER, "rte_power_turbo_status is not implemented for Virtual Machine Power Management\n"); return -ENOTSUP; @@ -124,3 +129,11 @@ power_kvm_vm_disable_turbo(unsigned int lcore_id) { return send_msg(lcore_id, CPU_POWER_DISABLE_TURBO); } + +struct rte_power_core_capabilities; +int power_kvm_vm_get_capabilities(__rte_unused unsigned int lcore_id, + __rte_unused struct rte_power_core_capabilities *caps) +{ + RTE_LOG(ERR, POWER, "rte_power_get_capabilities is not implemented for Virtual Machine Power Management\n"); + return -ENOTSUP; +}