DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: herakliusz.lipiec@intel.com
Subject: [dpdk-dev] [PATCH 19.08 6/6] ipc: handle unsupported ipc in async request
Date: Thu, 25 Apr 2019 13:45:19 +0100	[thread overview]
Message-ID: <29d36c2e796b75cee5a66f36f7cd48249bb40824.1556195691.git.anatoly.burakov@intel.com> (raw)
Message-ID: <20190425124519.XelQMfRr7hREYX2GWSkjDvQAYxw3LNwPiiJM_4DE0v4@z> (raw)
In-Reply-To: <b0b218f0265ee9814de64f284d0d2d896ab01fa1.1556195690.git.anatoly.burakov@intel.com>
In-Reply-To: <b0b218f0265ee9814de64f284d0d2d896ab01fa1.1556195690.git.anatoly.burakov@intel.com>

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(-)

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.
  *
-- 
2.17.1

  parent reply	other threads:[~2019-04-25 12:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-25 12:45 [dpdk-dev] [PATCH 19.08 1/6] ipc: handle unsupported ipc in init Anatoly Burakov
2019-04-25 12:45 ` Anatoly Burakov
2019-04-25 12:45 ` [dpdk-dev] [PATCH 19.08 2/6] ipc: handle unsupported ipc in action register Anatoly Burakov
2019-04-25 12:45   ` Anatoly Burakov
2019-04-25 12:45 ` [dpdk-dev] [PATCH 19.08 3/6] ipc: don't unregister action if ipc unsupported Anatoly Burakov
2019-04-25 12:45   ` Anatoly Burakov
2019-04-25 12:45 ` [dpdk-dev] [PATCH 19.08 4/6] ipc: handle unsupported ipc in sendmsg Anatoly Burakov
2019-04-25 12:45   ` Anatoly Burakov
2019-04-25 12:45 ` [dpdk-dev] [PATCH 19.08 5/6] ipc: handle unsupported ipc in sync request Anatoly Burakov
2019-04-25 12:45   ` Anatoly Burakov
2019-04-25 12:45 ` Anatoly Burakov [this message]
2019-04-25 12:45   ` [dpdk-dev] [PATCH 19.08 6/6] ipc: handle unsupported ipc in async request Anatoly Burakov
2019-06-05  9:29 ` [dpdk-dev] [PATCH 19.08 1/6] ipc: handle unsupported ipc in init Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29d36c2e796b75cee5a66f36f7cd48249bb40824.1556195691.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=herakliusz.lipiec@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).