net/hns3: fix queue state when concurrent with reset
[dpdk.git] / examples / vm_power_manager / channel_manager.c
index a263150..458e371 100644 (file)
@@ -27,7 +27,6 @@
 #include <libvirt/libvirt.h>
 
 #include "channel_manager.h"
-#include "channel_commands.h"
 #include "channel_monitor.h"
 #include "power_manager.h"
 
@@ -455,6 +454,9 @@ add_all_channels(const char *vm_name)
                                        CHANNEL_MGR_SOCKET_PATH, dir->d_name);
                        continue;
                }
+               if (rte_lcore_index(channel_num) == -1)
+                       continue;
+
                /* if channel has not been added previously */
                if (channel_exists(vm_info, channel_num))
                        continue;
@@ -512,6 +514,8 @@ add_channels(const char *vm_name, unsigned *channel_list,
        }
 
        for (i = 0; i < len_channel_list; i++) {
+               if (rte_lcore_index(i) == -1)
+                       continue;
 
                if (channel_list[i] >= RTE_MAX_LCORE) {
                        RTE_LOG(INFO, CHANNEL_MANAGER, "Channel(%u) is out of range "
@@ -574,6 +578,9 @@ add_host_channels(void)
        }
 
        for (i = 0; i < ci->core_count; i++) {
+               if (rte_lcore_index(i) == -1)
+                       continue;
+
                if (ci->cd[i].global_enabled_cpus == 0)
                        continue;