From: Anatoly Burakov Date: Thu, 25 Apr 2019 12:45:17 +0000 (+0100) Subject: ipc: handle unsupported IPC in sendmsg X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=144767514e5ee8436f6e5959f95c2c6559f315b3;p=dpdk.git ipc: handle unsupported IPC in sendmsg 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 d14d55657b..5bb117c745 100644 --- a/lib/librte_eal/common/eal_common_proc.c +++ b/lib/librte_eal/common/eal_common_proc.c @@ -807,6 +807,12 @@ rte_mp_sendmsg(struct rte_mp_msg *msg) if (check_input(msg) != 0) return -1; + if (internal_config.no_shconf) { + RTE_LOG(DEBUG, EAL, "No shared files mode enabled, IPC is disabled\n"); + rte_errno = ENOTSUP; + return -1; + } + RTE_LOG(DEBUG, EAL, "sendmsg: %s\n", msg->name); return mp_send(msg, NULL, MP_MSG); } diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h index 4820298cfc..a409d32dee 100644 --- a/lib/librte_eal/common/include/rte_eal.h +++ b/lib/librte_eal/common/include/rte_eal.h @@ -288,6 +288,9 @@ rte_mp_action_register(const char *name, rte_mp_t action); * not want to response the messages from the corresponding component in its * primary process or secondary processes. * + * @note IPC may be unsupported in certain circumstances, so caller should check + * for ENOTSUP error. + * * @param name * The name argument plays as the nonredundant key to find the action. *