DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] mem: document callbacks not being supported in some cases
@ 2018-05-25 13:39 Anatoly Burakov
  2018-05-25 13:39 ` [dpdk-dev] [PATCH 2/2] memzone: clarify support for zero-length memzones Anatoly Burakov
  0 siblings, 1 reply; 3+ messages in thread
From: Anatoly Burakov @ 2018-05-25 13:39 UTC (permalink / raw)
  To: dev; +Cc: thomas

Mem event and validator callbacks may not be supported under all
circumstances (such as when running in legacy memory mode, or on
FreeBSD), and this case needs to be handled by any code that will
use these callbacks. Spell this out more clearly, because it's not
immediately obvious that this is an expected use case.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/common/include/rte_memory.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
index 857773c..aab9f6f 100644
--- a/lib/librte_eal/common/include/rte_memory.h
+++ b/lib/librte_eal/common/include/rte_memory.h
@@ -339,6 +339,10 @@ typedef void (*rte_mem_event_callback_t)(enum rte_mem_event event_type,
  *       therefore some functions (e.g. `rte_memseg_walk()`) will cause a
  *       deadlock when called from within such callbacks.
  *
+ * @note mem event callbacks not being supported is an expected error condition,
+ *       so user code needs to handle this situation. In these cases, return
+ *       value will be -1, and rte_errno will be set to ENOTSUP.
+ *
  * @param name
  *   Name associated with specified callback to be added to the list.
  *
@@ -399,6 +403,10 @@ typedef int (*rte_mem_alloc_validator_t)(int socket_id,
  *       therefore some functions (e.g. `rte_memseg_walk()`) will cause a
  *       deadlock when called from within such callbacks.
  *
+ * @note validator callbacks not being supported is an expected error condition,
+ *       so user code needs to handle this situation. In these cases, return
+ *       value will be -1, and rte_errno will be set to ENOTSUP.
+ *
  * @param name
  *   Name associated with specified callback to be added to the list.
  *
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH 2/2] memzone: clarify support for zero-length memzones
  2018-05-25 13:39 [dpdk-dev] [PATCH 1/2] mem: document callbacks not being supported in some cases Anatoly Burakov
@ 2018-05-25 13:39 ` Anatoly Burakov
  2018-05-27 23:48   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Anatoly Burakov @ 2018-05-25 13:39 UTC (permalink / raw)
  To: dev; +Cc: thomas

Currently, memzone allocation with length set to 0 that are also
IOVA-contiguous is not supported. Document this limitation.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/common/include/rte_memzone.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/librte_eal/common/include/rte_memzone.h b/lib/librte_eal/common/include/rte_memzone.h
index a4c9bd6..ef370fa 100644
--- a/lib/librte_eal/common/include/rte_memzone.h
+++ b/lib/librte_eal/common/include/rte_memzone.h
@@ -81,6 +81,9 @@ struct rte_memzone {
  *   memzones from memory that is already available. It will not trigger any
  *   new allocations.
  *
+ * @note Reserving IOVA-contiguous memzones with len set to 0 is not currently
+ *   supported.
+ *
  * @param name
  *   The name of the memzone. If it already exists, the function will
  *   fail and return NULL.
@@ -138,6 +141,9 @@ const struct rte_memzone *rte_memzone_reserve(const char *name,
  *   memzones from memory that is already available. It will not trigger any
  *   new allocations.
  *
+ * @note Reserving IOVA-contiguous memzones with len set to 0 is not currently
+ *   supported.
+ *
  * @param name
  *   The name of the memzone. If it already exists, the function will
  *   fail and return NULL.
@@ -200,6 +206,9 @@ const struct rte_memzone *rte_memzone_reserve_aligned(const char *name,
  *   memzones from memory that is already available. It will not trigger any
  *   new allocations.
  *
+ * @note Reserving IOVA-contiguous memzones with len set to 0 is not currently
+ *   supported.
+ *
  * @param name
  *   The name of the memzone. If it already exists, the function will
  *   fail and return NULL.
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] memzone: clarify support for zero-length memzones
  2018-05-25 13:39 ` [dpdk-dev] [PATCH 2/2] memzone: clarify support for zero-length memzones Anatoly Burakov
@ 2018-05-27 23:48   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-05-27 23:48 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: dev

25/05/2018 15:39, Anatoly Burakov:
> Currently, memzone allocation with length set to 0 that are also
> IOVA-contiguous is not supported. Document this limitation.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>

Series applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-27 23:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-25 13:39 [dpdk-dev] [PATCH 1/2] mem: document callbacks not being supported in some cases Anatoly Burakov
2018-05-25 13:39 ` [dpdk-dev] [PATCH 2/2] memzone: clarify support for zero-length memzones Anatoly Burakov
2018-05-27 23:48   ` Thomas Monjalon

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