[19.08,6/6] ipc: handle unsupported ipc in async request

Message ID 29d36c2e796b75cee5a66f36f7cd48249bb40824.1556195691.git.anatoly.burakov@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [19.08,1/6] ipc: handle unsupported ipc in init |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Burakov, Anatoly April 25, 2019, 12:45 p.m. UTC
  Currently, IPC API will silently ignore unsupported IPC.
Fix the API call to explicitly handle unsupported IPC cases.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/common/eal_common_proc.c | 3 ++-
 lib/librte_eal/common/include/rte_eal.h | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)
  

Patch

diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c
index c6aa80bfc..3a876e021 100644
--- a/lib/librte_eal/common/eal_common_proc.c
+++ b/lib/librte_eal/common/eal_common_proc.c
@@ -1041,7 +1041,8 @@  rte_mp_request_async(struct rte_mp_msg *req, const struct timespec *ts,
 
 	if (internal_config.no_shconf) {
 		RTE_LOG(DEBUG, EAL, "No shared files mode enabled, IPC is disabled\n");
-		return 0;
+		rte_errno = ENOTSUP;
+		return -1;
 	}
 
 	if (gettimeofday(&now, NULL) < 0) {
diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h
index 4460ea14a..9acf85664 100644
--- a/lib/librte_eal/common/include/rte_eal.h
+++ b/lib/librte_eal/common/include/rte_eal.h
@@ -344,6 +344,9 @@  rte_mp_request_sync(struct rte_mp_msg *req, struct rte_mp_reply *reply,
  * This function sends a request message to the peer process, and will not
  * block. Instead, reply will be received in a separate callback.
  *
+ * @note IPC may be unsupported in certain circumstances, so caller should check
+ *    for ENOTSUP error.
+ *
  * @param req
  *   The req argument contains the customized request message.
  *