From 3cc8f7e9d8bca14e7cd309e5bf46c9346b42267b Mon Sep 17 00:00:00 2001 From: Ido Barnea Date: Tue, 29 Mar 2016 15:04:41 +0300 Subject: better error message for core_mask_sanity --- src/main_dpdk.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index 6b81916b..363189d4 100644 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -4284,12 +4284,19 @@ int core_mask_sanity(uint32_t wanted_core_mask) { wanted_core_num = num_set_bits(wanted_core_mask); calc_core_num = num_set_bits(calc_core_mask); + if (calc_core_num == 1) { + printf ("Error: You have only 1 core available. Minimum configuration requires 2 cores\n"); + printf(" If you are running on VM, consider adding more cores if possible\n"); + return -1; + } if (wanted_core_num > calc_core_num) { printf("Error: You have %d threads available, but you asked for %d threads.\n", calc_core_num, wanted_core_num); printf(" Calculation is: -c (%d) * dual ports (%d) + 1 master thread %s" , CGlobalInfo::m_options.preview.getCores(), CGlobalInfo::m_options.get_expected_dual_ports() , get_is_rx_thread_enabled() ? "+1 latency thread (because of -l flag)\n" : "\n"); - printf(" Maybe try smaller -c .\n"); + if (CGlobalInfo::m_options.preview.getCores() > 1) + printf(" Maybe try smaller -c .\n"); + printf(" If you are running on VM, consider adding more cores if possible\n"); return -1; } -- cgit 1.2.3-korg