DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: John McNamara <john.mcnamara@intel.com>,
	Marko Kovacevic <marko.kovacevic@intel.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH 3/3] ipc: add warnings about correct API usage
Date: Fri,  3 May 2019 12:50:50 +0100	[thread overview]
Message-ID: <d918c51389c904cd568485d82f3fdea7b5da79fc.1556883753.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <c5b98a67c6f0b66b3ef0534dc1b9ed553d4d7340.1556883753.git.anatoly.burakov@intel.com>
In-Reply-To: <c5b98a67c6f0b66b3ef0534dc1b9ed553d4d7340.1556883753.git.anatoly.burakov@intel.com>

When handling synchronous or asynchronous requests, the reply
must be sent explicitly even if the result of the operation is
an error, to avoid the other side timing out. Make note of this
in documentation explicitly.

Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 doc/guides/prog_guide/multi_proc_support.rst |  7 +++++++
 lib/librte_eal/common/include/rte_eal.h      | 15 +++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/doc/guides/prog_guide/multi_proc_support.rst b/doc/guides/prog_guide/multi_proc_support.rst
index 665474a4c..b9758d3fb 100644
--- a/doc/guides/prog_guide/multi_proc_support.rst
+++ b/doc/guides/prog_guide/multi_proc_support.rst
@@ -309,6 +309,13 @@ If a response is required, a new ``rte_mp_msg`` message descriptor must be
 constructed and sent via ``rte_mp_reply()`` function, along with ``peer``
 pointer. The resulting response will then be delivered to the correct requestor.
 
+.. warning::
+    Simply returning a value when processing a request callback will not send a
+    response to the request - it must always be explicitly sent even in case
+    of errors. Implementation of error signalling rests with the application,
+    there is no built-in way to indicate success or error for a request. Failing
+    to do so will cause the requestor to time out while waiting on a response.
+
 Misc considerations
 ~~~~~~~~~~~~~~~~~~~~~~~~
 
diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h
index 7db022532..82ee50fd5 100644
--- a/lib/librte_eal/common/include/rte_eal.h
+++ b/lib/librte_eal/common/include/rte_eal.h
@@ -226,6 +226,11 @@ struct rte_mp_reply {
  * As we create  socket channel for primary/secondary communication, use
  * this function typedef to register action for coming messages.
  *
+ * @note When handling IPC request callbacks, the reply must be sent even in
+ *   cases of error handling. Simply retuning success or failure will *not* send
+ *   a response to the requestor. Implementation of error signalling mechanism
+ *   is up to the application.
+ *
  * @note No memory allocations should take place inside the callback.
  */
 typedef int (*rte_mp_t)(const struct rte_mp_msg *msg, const void *peer);
@@ -237,6 +242,11 @@ typedef int (*rte_mp_t)(const struct rte_mp_msg *msg, const void *peer);
  * this function typedef to register action for coming responses to asynchronous
  * requests.
  *
+ * @note When handling IPC request callbacks, the reply must be sent even in
+ *   cases of error handling. Simply retuning success or failure will *not* send
+ *   a response to the requestor. Implementation of error signalling mechanism
+ *   is up to the application.
+ *
  * @note No memory allocations should take place inside the callback.
  */
 typedef int (*rte_mp_async_reply_t)(const struct rte_mp_msg *request,
@@ -368,6 +378,11 @@ rte_mp_request_async(struct rte_mp_msg *req, const struct timespec *ts,
  * This function will send a reply message in response to a request message
  * received previously.
  *
+ * @note When handling IPC request callbacks, the reply must be sent even in
+ *   cases of error handling. Simply retuning success or failure will *not* send
+ *   a response to the requestor. Implementation of error signalling mechanism
+ *   is up to the application.
+ *
  * @param msg
  *   The msg argument contains the customized message.
  *
-- 
2.17.1

  parent reply	other threads:[~2019-05-03 11:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-03 11:50 [dpdk-dev] [PATCH 1/3] doc: fix typo in ipc doc Anatoly Burakov
2019-05-03 11:50 ` Anatoly Burakov
2019-05-03 11:50 ` [dpdk-dev] [PATCH 2/3] ipc: add warnings about not using ipc with memory API's Anatoly Burakov
2019-05-03 11:50   ` Anatoly Burakov
2019-05-03 11:50 ` Anatoly Burakov [this message]
2019-05-03 11:50   ` [dpdk-dev] [PATCH 3/3] ipc: add warnings about correct API usage Anatoly Burakov
2019-05-09 14:59   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2019-05-09 14:59     ` Thomas Monjalon
2019-05-03 19:03 ` [dpdk-dev] [PATCH 1/3] doc: fix typo in ipc doc Rami Rosen
2019-05-03 19:03   ` Rami Rosen
2019-05-09 14:41 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2019-05-09 14:41   ` Thomas Monjalon
2019-05-09 15:25 ` [dpdk-dev] " Mcnamara, John
2019-05-09 15:25   ` Mcnamara, John
2019-05-09 15:55   ` Thomas Monjalon
2019-05-09 15:55     ` 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=d918c51389c904cd568485d82f3fdea7b5da79fc.1556883753.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=john.mcnamara@intel.com \
    --cc=marko.kovacevic@intel.com \
    --cc=stable@dpdk.org \
    /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).