Currently, when rte_service_init() fails at initialization, the
application always gets a ENOEXEC error code. For example, with testpmd,
this is displayed as:
Cannot init EAL: Exec format error
This error code does not describe the real issue. Instead, use the error
code returned by the function.
Fixes:
e39824500825 ("service: initialize with EAL")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
ret = rte_service_init();
if (ret) {
rte_eal_init_alert("rte_service_init() failed");
- rte_errno = ENOEXEC;
+ rte_errno = -ret;
return -1;
}
*/
ret = rte_service_start_with_defaults();
if (ret < 0 && ret != -ENOTSUP) {
- rte_errno = ENOEXEC;
+ rte_errno = -ret;
return -1;
}
ret = rte_service_init();
if (ret) {
rte_eal_init_alert("rte_service_init() failed");
- rte_errno = ENOEXEC;
+ rte_errno = -ret;
return -1;
}
*/
ret = rte_service_start_with_defaults();
if (ret < 0 && ret != -ENOTSUP) {
- rte_errno = ENOEXEC;
+ rte_errno = -ret;
return -1;
}
const struct rte_config *config = rte_eal_get_configuration();
struct internal_config *internal_conf =
eal_get_internal_configuration();
+ int ret;
rte_eal_log_init(NULL, 0);
}
/* Initialize services so drivers can register services during probe. */
- if (rte_service_init()) {
+ ret = rte_service_init();
+ if (ret) {
rte_eal_init_alert("rte_service_init() failed");
- rte_errno = ENOEXEC;
+ rte_errno = -ret;
return -1;
}