From: Anatoly Burakov Date: Thu, 3 May 2018 16:25:58 +0000 (+0100) Subject: memzone: document reserving zero-length memzones X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7785c5588d7e8cb07d70a4986afb3685b55ace86;p=dpdk.git memzone: document reserving zero-length memzones Currently, reserving a memzone with length set to 0 will not trigger any memory allocations, and memzone will instead be looking through already allocated memory only. Document this limitation. Signed-off-by: Anatoly Burakov --- diff --git a/lib/librte_eal/common/include/rte_memzone.h b/lib/librte_eal/common/include/rte_memzone.h index 0eeb94fe45..a4c9bd68fa 100644 --- a/lib/librte_eal/common/include/rte_memzone.h +++ b/lib/librte_eal/common/include/rte_memzone.h @@ -77,6 +77,10 @@ struct rte_memzone { * correctly filled memzone descriptor. If the allocation cannot be * done, return NULL. * + * @note Reserving memzones with len set to 0 will only attempt to allocate + * memzones from memory that is already available. It will not trigger any + * new allocations. + * * @param name * The name of the memzone. If it already exists, the function will * fail and return NULL. @@ -130,6 +134,10 @@ const struct rte_memzone *rte_memzone_reserve(const char *name, * descriptor. If the allocation cannot be done or if the alignment * is not a power of 2, returns NULL. * + * @note Reserving memzones with len set to 0 will only attempt to allocate + * memzones from memory that is already available. It will not trigger any + * new allocations. + * * @param name * The name of the memzone. If it already exists, the function will * fail and return NULL. @@ -188,6 +196,10 @@ const struct rte_memzone *rte_memzone_reserve_aligned(const char *name, * boundary. That implies that requested length should be less or equal * then boundary. * + * @note Reserving memzones with len set to 0 will only attempt to allocate + * memzones from memory that is already available. It will not trigger any + * new allocations. + * * @param name * The name of the memzone. If it already exists, the function will * fail and return NULL.