[dpdk-stable] patch 'ipc: add warnings about not using IPC with memory API' has been queued to LTS release 18.11.2

Kevin Traynor ktraynor at redhat.com
Tue May 14 16:43:50 CEST 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/20/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/38d3874a0cf2cbfd5552d52eea99776cbd1e5b57

Thanks.

Kevin Traynor

---
>From 38d3874a0cf2cbfd5552d52eea99776cbd1e5b57 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov at intel.com>
Date: Fri, 3 May 2019 12:50:49 +0100
Subject: [PATCH] ipc: add warnings about not using IPC with memory API

[ upstream commit 3855b4150037142435b5c1f4195e44c142785f1f ]

IPC and memory-related API's should not be mixed because memory
relies on IPC internally. Add explicit warnings to IPC API and
to the documentation about this.

Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 doc/guides/prog_guide/env_abstraction_layer.rst | 8 ++++++++
 doc/guides/prog_guide/multi_proc_support.rst    | 5 +++++
 lib/librte_eal/common/include/rte_eal.h         | 7 +++++++
 3 files changed, 20 insertions(+)

diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst
index 94d19682e..2bb77b019 100644
--- a/doc/guides/prog_guide/env_abstraction_layer.rst
+++ b/doc/guides/prog_guide/env_abstraction_layer.rst
@@ -148,4 +148,12 @@ A default validator callback is provided by EAL, which can be enabled with a
 of memory that can be used by DPDK application.
 
+.. warning::
+    Memory subsystem uses DPDK IPC internally, so memory allocations/callbacks
+    and IPC must not be mixed: it is not safe to allocate/free memory inside
+    memory-related or IPC callbacks, and it is not safe to use IPC inside
+    memory-related callbacks. See chapter
+    :ref:`Multi-process Support <Multi-process_Support>` for more details about
+    DPDK IPC.
+
 + Legacy memory mode
 
diff --git a/doc/guides/prog_guide/multi_proc_support.rst b/doc/guides/prog_guide/multi_proc_support.rst
index 966097924..63d08b609 100644
--- a/doc/guides/prog_guide/multi_proc_support.rst
+++ b/doc/guides/prog_guide/multi_proc_support.rst
@@ -319,4 +319,9 @@ IPC thread, sending messages while processing another message or request is
 supported.
 
+Since the memory sybsystem uses IPC internally, memory allocations and IPC must
+not be mixed: it is not safe to use IPC inside a memory-related callback, nor is
+it safe to allocate/free memory inside IPC callbacks. Attempting to do so may
+lead to a deadlock.
+
 Asynchronous request callbacks may be triggered either from IPC thread or from
 interrupt thread, depending on whether the request has timed out. It is
diff --git a/lib/librte_eal/common/include/rte_eal.h b/lib/librte_eal/common/include/rte_eal.h
index 67a4ffb6b..1d3553cea 100644
--- a/lib/librte_eal/common/include/rte_eal.h
+++ b/lib/librte_eal/common/include/rte_eal.h
@@ -229,4 +229,6 @@ struct rte_mp_reply {
  * As we create  socket channel for primary/secondary communication, use
  * this function typedef to register action for coming messages.
+ *
+ * @note No memory allocations should take place inside the callback.
  */
 typedef int (*rte_mp_t)(const struct rte_mp_msg *msg, const void *peer);
@@ -238,4 +240,6 @@ 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 No memory allocations should take place inside the callback.
  */
 typedef int (*rte_mp_async_reply_t)(const struct rte_mp_msg *request,
@@ -312,4 +316,7 @@ rte_mp_sendmsg(struct rte_mp_msg *msg);
  * @note The caller is responsible to free reply->replies.
  *
+ * @note This API must not be used inside memory-related or IPC callbacks, and
+ *   no memory allocations should take place inside such callback.
+ *
  * @param req
  *   The req argument contains the customized request message.
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-05-14 15:39:07.601604422 +0100
+++ 0006-ipc-add-warnings-about-not-using-IPC-with-memory-API.patch	2019-05-14 15:39:07.303559011 +0100
@@ -1 +1 @@
-From 3855b4150037142435b5c1f4195e44c142785f1f Mon Sep 17 00:00:00 2001
+From 38d3874a0cf2cbfd5552d52eea99776cbd1e5b57 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3855b4150037142435b5c1f4195e44c142785f1f ]
+
@@ -10,2 +11,0 @@
-Cc: stable at dpdk.org
-
@@ -20 +20 @@
-index c27f730c7..f15bcd976 100644
+index 94d19682e..2bb77b019 100644
@@ -51 +51 @@
-index 0603eaf25..7db022532 100644
+index 67a4ffb6b..1d3553cea 100644
@@ -54 +54 @@
-@@ -226,4 +226,6 @@ struct rte_mp_reply {
+@@ -229,4 +229,6 @@ struct rte_mp_reply {
@@ -61 +61 @@
-@@ -235,4 +237,6 @@ typedef int (*rte_mp_t)(const struct rte_mp_msg *msg, const void *peer);
+@@ -238,4 +240,6 @@ typedef int (*rte_mp_t)(const struct rte_mp_msg *msg, const void *peer);
@@ -68 +68 @@
-@@ -309,4 +313,7 @@ rte_mp_sendmsg(struct rte_mp_msg *msg);
+@@ -312,4 +316,7 @@ rte_mp_sendmsg(struct rte_mp_msg *msg);


More information about the stable mailing list