patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 20.11.7-rc1] examples/vm_power_manager: revert backported commit
@ 2023-01-16 14:10 Tadhg Kearney
  2023-01-23 14:06 ` Hunt, David
  0 siblings, 1 reply; 2+ messages in thread
From: Tadhg Kearney @ 2023-01-16 14:10 UTC (permalink / raw)
  To: stable; +Cc: david.hunt, reshma.pattan, Tadhg Kearney, hamza.khan

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@intel.com

Signed-off-by: Tadhg Kearney <tadhg.kearney@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);
 	}
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 20.11.7-rc1] examples/vm_power_manager: revert backported commit
  2023-01-16 14:10 [PATCH 20.11.7-rc1] examples/vm_power_manager: revert backported commit Tadhg Kearney
@ 2023-01-23 14:06 ` Hunt, David
  0 siblings, 0 replies; 2+ messages in thread
From: Hunt, David @ 2023-01-23 14:06 UTC (permalink / raw)
  To: Tadhg Kearney, stable; +Cc: reshma.pattan, hamza.khan

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@intel.com
>
> Signed-off-by: Tadhg Kearney <tadhg.kearney@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@intel.com>





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-23 14:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-16 14:10 [PATCH 20.11.7-rc1] examples/vm_power_manager: revert backported commit Tadhg Kearney
2023-01-23 14:06 ` Hunt, David

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).