From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id E518ADE3 for ; Fri, 25 May 2018 15:39:47 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 May 2018 06:39:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,440,1520924400"; d="scan'208";a="44175161" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga008.jf.intel.com with ESMTP; 25 May 2018 06:39:45 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w4PDdjtG007166; Fri, 25 May 2018 14:39:45 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w4PDdjMC023100; Fri, 25 May 2018 14:39:45 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w4PDdjCu023096; Fri, 25 May 2018 14:39:45 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: thomas@monjalon.net Date: Fri, 25 May 2018 14:39:44 +0100 Message-Id: <693c688e4189c1f7cb131ab76a287743011743b9.1527255565.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH 1/2] mem: document callbacks not being supported in some cases X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2018 13:39:48 -0000 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 --- 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