From: Anatoly Burakov Date: Thu, 25 Apr 2019 12:45:14 +0000 (+0100) Subject: ipc: handle unsupported IPC in init X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c830900d75c55ecebb4bffd86215e117dd4a2089;p=dpdk.git ipc: handle unsupported IPC in init Currently, IPC API will silently ignore unsupported IPC. Fix the API call and its callers to explicitly handle unsupported IPC cases. Signed-off-by: Anatoly Burakov --- diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c index 1a2259fe39..395161c565 100644 --- a/lib/librte_eal/common/eal_common_proc.c +++ b/lib/librte_eal/common/eal_common_proc.c @@ -576,7 +576,8 @@ rte_mp_channel_init(void) */ if (internal_config.no_shconf) { RTE_LOG(DEBUG, EAL, "No shared files mode enabled, IPC will be disabled\n"); - return 0; + rte_errno = ENOTSUP; + return -1; } /* create filter path */ diff --git a/lib/librte_eal/freebsd/eal/eal.c b/lib/librte_eal/freebsd/eal/eal.c index c6ac9028fa..4eaa53195e 100644 --- a/lib/librte_eal/freebsd/eal/eal.c +++ b/lib/librte_eal/freebsd/eal/eal.c @@ -671,7 +671,7 @@ rte_eal_init(int argc, char **argv) /* Put mp channel init before bus scan so that we can init the vdev * bus through mp channel in the secondary process before the bus scan. */ - if (rte_mp_channel_init() < 0) { + if (rte_mp_channel_init() < 0 && rte_errno != ENOTSUP) { rte_eal_init_alert("failed to init mp channel"); if (rte_eal_process_type() == RTE_PROC_PRIMARY) { rte_errno = EFAULT; diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c index 1613996190..3e1d6eb6a1 100644 --- a/lib/librte_eal/linux/eal/eal.c +++ b/lib/librte_eal/linux/eal/eal.c @@ -1014,7 +1014,7 @@ rte_eal_init(int argc, char **argv) /* Put mp channel init before bus scan so that we can init the vdev * bus through mp channel in the secondary process before the bus scan. */ - if (rte_mp_channel_init() < 0) { + if (rte_mp_channel_init() < 0 && rte_errno != ENOTSUP) { rte_eal_init_alert("failed to init mp channel"); if (rte_eal_process_type() == RTE_PROC_PRIMARY) { rte_errno = EFAULT;