[dpdk-dev,1/2] mem: document callbacks not being supported in some cases

Message ID 693c688e4189c1f7cb131ab76a287743011743b9.1527255565.git.anatoly.burakov@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Anatoly Burakov May 25, 2018, 1:39 p.m. UTC
  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(+)
  

Patch

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