[PATCH 20.11.7-rc1] examples/vm_power_manager: revert backported commit

Hunt, David david.hunt at intel.com
Mon Jan 23 15:06:12 CET 2023


Hi Tadhg,

On 16/01/2023 14:10, Tadhg Kearney wrote:
> Revert backported commit a244dfa7d784 ("examples/vm_power_manager:
> use safe list iterator") that adds compilation errors while compiling
> dpdk with vm_power_manager. Issue is caused by TAILQ_FOREACH being used
> without dependencies also having being backported.
>
> Fixes: a244dfa7d784 ("examples/vm_power_manager: use safe list iterator")
> Cc: hamza.khan at intel.com
>
> Signed-off-by: Tadhg Kearney <tadhg.kearney at intel.com>
> ---
>   examples/vm_power_manager/channel_manager.c | 19 +++++++++----------
>   1 file changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
> index 5e0bbbb4c9..0a28cb643b 100644
> --- a/examples/vm_power_manager/channel_manager.c
> +++ b/examples/vm_power_manager/channel_manager.c
> @@ -23,7 +23,6 @@
>   #include <rte_log.h>
>   #include <rte_atomic.h>
>   #include <rte_spinlock.h>
> -#include <rte_tailq.h>
>   
>   #include <libvirt/libvirt.h>
>   
> @@ -60,16 +59,16 @@ struct virtual_machine_info {
>   	virDomainInfo info;
>   	rte_spinlock_t config_spinlock;
>   	int allow_query;
> -	RTE_TAILQ_ENTRY(virtual_machine_info) vms_info;
> +	LIST_ENTRY(virtual_machine_info) vms_info;
>   };
>   
> -RTE_TAILQ_HEAD(, virtual_machine_info) vm_list_head;
> +LIST_HEAD(, virtual_machine_info) vm_list_head;
>   
>   static struct virtual_machine_info *
>   find_domain_by_name(const char *name)
>   {
>   	struct virtual_machine_info *info;
> -	RTE_TAILQ_FOREACH(info, &vm_list_head, vms_info) {
> +	LIST_FOREACH(info, &vm_list_head, vms_info) {
>   		if (!strncmp(info->name, name, CHANNEL_MGR_MAX_NAME_LEN-1))
>   			return info;
>   	}
> @@ -878,7 +877,7 @@ add_vm(const char *vm_name)
>   
>   	new_domain->allow_query = 0;
>   	rte_spinlock_init(&(new_domain->config_spinlock));
> -	TAILQ_INSERT_HEAD(&vm_list_head, new_domain, vms_info);
> +	LIST_INSERT_HEAD(&vm_list_head, new_domain, vms_info);
>   	return 0;
>   }
>   
> @@ -900,7 +899,7 @@ remove_vm(const char *vm_name)
>   		rte_spinlock_unlock(&vm_info->config_spinlock);
>   		return -1;
>   	}
> -	TAILQ_REMOVE(&vm_list_head, vm_info, vms_info);
> +	LIST_REMOVE(vm_info, vms_info);
>   	rte_spinlock_unlock(&vm_info->config_spinlock);
>   	rte_free(vm_info);
>   	return 0;
> @@ -953,7 +952,7 @@ channel_manager_init(const char *path __rte_unused)
>   {
>   	virNodeInfo info;
>   
> -	TAILQ_INIT(&vm_list_head);
> +	LIST_INIT(&vm_list_head);
>   	if (connect_hypervisor(path) < 0) {
>   		global_n_host_cpus = 64;
>   		global_hypervisor_available = 0;
> @@ -1005,9 +1004,9 @@ channel_manager_exit(void)
>   {
>   	unsigned i;
>   	char mask[RTE_MAX_LCORE];
> -	struct virtual_machine_info *vm_info, *tmp;
> +	struct virtual_machine_info *vm_info;
>   
> -	RTE_TAILQ_FOREACH_SAFE(vm_info, &vm_list_head, vms_info, tmp) {
> +	LIST_FOREACH(vm_info, &vm_list_head, vms_info) {
>   
>   		rte_spinlock_lock(&(vm_info->config_spinlock));
>   
> @@ -1022,7 +1021,7 @@ channel_manager_exit(void)
>   		}
>   		rte_spinlock_unlock(&(vm_info->config_spinlock));
>   
> -		TAILQ_REMOVE(&vm_list_head, vm_info, vms_info);
> +		LIST_REMOVE(vm_info, vms_info);
>   		rte_free(vm_info);
>   	}
>   


Tested this patch set and it fixes the compilation issue. Thanks.

Tested-by: David Hunt <david.hunt at intel.com>






More information about the stable mailing list