eal: check coremask against detected lcores
authorDavid Marchand <david.marchand@6wind.com>
Tue, 15 Apr 2014 13:50:42 +0000 (15:50 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 17 Apr 2014 22:38:37 +0000 (00:38 +0200)
commit4f04db8b8909523d87486457f2fc4fa1f9a5740f
tree523d3e03695b389616149ca793a9472fe6629d54
parent5d529448030493b954165a4f38eeb8d8cf703a84
eal: check coremask against detected lcores

lcores that are set in coremask should be checked against lcores detected on
system. This way, we won't need to check them later.

Besides, if specifying an unavailable lcore, we currently panic in
eal_thread_loop() because pthread_setaffinity_np fails.
So this check will return an error with a more explicit message in
eal_parse_coremask().

"EAL: pthread_setaffinity_np failed
 PANIC in eal_thread_loop():
 cannot set affinity"

becomes :

"EAL: lcore 4 unavailable
 EAL: invalid coremask"

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
lib/librte_eal/linuxapp/eal/eal.c