i40e: get queue info and descriptor limits
[dpdk.git] / examples / vm_power_manager / channel_manager.c
index 34a395d..db76f2e 100644 (file)
@@ -389,7 +389,7 @@ add_all_channels(const char *vm_name)
                errno = 0;
                channel_num = (unsigned)strtol(remaining, &tail_ptr, 0);
                if ((errno != 0) || (remaining[0] == '\0') ||
-                               (*tail_ptr != '\0') || tail_ptr == NULL) {
+                               tail_ptr == NULL || (*tail_ptr != '\0')) {
                        RTE_LOG(WARNING, CHANNEL_MANAGER, "Malformed channel name"
                                        "'%s' found it should be in the form of "
                                        "'<guest_name>.<channel_num>(decimal)'\n",
@@ -765,10 +765,11 @@ channel_manager_init(const char *path)
        global_n_host_cpus = (unsigned)n_cpus;
 
        if (global_n_host_cpus > CHANNEL_CMDS_MAX_CPUS) {
-               RTE_LOG(ERR, CHANNEL_MANAGER, "The number of host CPUs(%u) exceeds the "
-                               "maximum of %u\n", global_n_host_cpus, CHANNEL_CMDS_MAX_CPUS);
-               goto error;
-
+               RTE_LOG(WARNING, CHANNEL_MANAGER, "The number of host CPUs(%u) exceeds the "
+                               "maximum of %u. No cores over %u should be used.\n",
+                               global_n_host_cpus, CHANNEL_CMDS_MAX_CPUS,
+                               CHANNEL_CMDS_MAX_CPUS - 1);
+               global_n_host_cpus = CHANNEL_CMDS_MAX_CPUS;
        }
 
        return 0;
@@ -800,9 +801,7 @@ channel_manager_exit(void)
                rte_free(vm_info);
        }
 
-       if (global_cpumaps != NULL)
-               rte_free(global_cpumaps);
-       if (global_vircpuinfo != NULL)
-               rte_free(global_vircpuinfo);
+       rte_free(global_cpumaps);
+       rte_free(global_vircpuinfo);
        disconnect_hypervisor();
 }