X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fvm_power_manager%2Fchannel_manager.h;h=251d2163cba3d3a92cc5f4bcab718aa71755c6a4;hb=104dbec2081a50dac9dc53b474a5acd8c5e4d296;hp=c2520ab6f3821cacca8d9d3db45c48b32ef8d667;hpb=fd73630e95c1e4c0e258217c009bbceba0b7a250;p=dpdk.git diff --git a/examples/vm_power_manager/channel_manager.h b/examples/vm_power_manager/channel_manager.h index c2520ab6f3..251d2163cb 100644 --- a/examples/vm_power_manager/channel_manager.h +++ b/examples/vm_power_manager/channel_manager.h @@ -13,19 +13,9 @@ extern "C" { #include #include -/* Maximum number of CPUs */ -#define CHANNEL_CMDS_MAX_CPUS 64 -#if CHANNEL_CMDS_MAX_CPUS > 64 -#error Maximum number of cores is 64, overflow is guaranteed to \ - cause problems with VM Power Management -#endif - /* Maximum name length including '\0' terminator */ #define CHANNEL_MGR_MAX_NAME_LEN 64 -/* Maximum number of channels to each Virtual Machine */ -#define CHANNEL_MGR_MAX_CHANNELS 64 - /* Hypervisor Path for libvirt(qemu/KVM) */ #define CHANNEL_MGR_DEFAULT_HV_PATH "qemu:///system" @@ -82,9 +72,9 @@ struct channel_info { struct vm_info { char name[CHANNEL_MGR_MAX_NAME_LEN]; /**< VM name */ enum vm_status status; /**< libvirt status */ - uint64_t pcpu_mask[CHANNEL_CMDS_MAX_CPUS]; /**< pCPU mask for each vCPU */ + uint16_t pcpu_map[RTE_MAX_LCORE]; /**< pCPU map to vCPU */ unsigned num_vcpus; /**< number of vCPUS */ - struct channel_info channels[CHANNEL_MGR_MAX_CHANNELS]; /**< Array of channel_info */ + struct channel_info channels[RTE_MAX_LCORE]; /**< channel_info array */ unsigned num_channels; /**< Number of channels */ }; @@ -115,8 +105,7 @@ int channel_manager_init(const char *path); void channel_manager_exit(void); /** - * Get the Physical CPU mask for VM lcore channel(vcpu), result is assigned to - * core_mask. + * Get the Physical CPU for VM lcore channel(vcpu). * It is not thread-safe. * * @param chan_info @@ -130,26 +119,7 @@ void channel_manager_exit(void); * - 0 on error. * - >0 on success. */ -uint64_t get_pcpus_mask(struct channel_info *chan_info, unsigned vcpu); - -/** - * Set the Physical CPU mask for the specified vCPU. - * It is not thread-safe. - * - * @param name - * Virtual Machine name to lookup - * - * @param vcpu - * The virtual CPU to set. - * - * @param core_mask - * The core mask of the physical CPU(s) to bind the vCPU - * - * @return - * - 0 on success. - * - Negative on error. - */ -int set_pcpus_mask(char *vm_name, unsigned int vcpu, char *core_mask); +uint16_t get_pcpu(struct channel_info *chan_info, unsigned int vcpu); /** * Set the Physical CPU for the specified vCPU. @@ -168,7 +138,8 @@ int set_pcpus_mask(char *vm_name, unsigned int vcpu, char *core_mask); * - 0 on success. * - Negative on error. */ -int set_pcpu(char *vm_name, unsigned vcpu, unsigned core_num); +int set_pcpu(char *vm_name, unsigned int vcpu, unsigned int pcpu); + /** * Add a VM as specified by name to the Channel Manager. The name must * correspond to a valid libvirt domain name.