summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-03-29 15:04:41 +0300
committerIdo Barnea <ibarnea@cisco.com>2016-03-29 15:04:41 +0300
commit3cc8f7e9d8bca14e7cd309e5bf46c9346b42267b (patch)
tree5ed936c635cb394c08b2a578f26e8488b76023b8
parentffaa6fd004c93d1c8307fe70d4e702624a346ab4 (diff)
better error message for core_mask_sanity
-rw-r--r--src/main_dpdk.cpp9
1 files changed, 8 insertions, 1 deletions
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 <num>(%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 <num>.\n");
+ if (CGlobalInfo::m_options.preview.getCores() > 1)
+ printf(" Maybe try smaller -c <num>.\n");
+ printf(" If you are running on VM, consider adding more cores if possible\n");
return -1;
}