[1/4] mempool: clarify mempool cache flush API behavior

Message ID 20230309045738.1261000-2-honnappa.nagarahalli@arm.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series Small corrections in mempool |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Honnappa Nagarahalli March 9, 2023, 4:57 a.m. UTC
  Clarify that mempool cache flush API works with default mempool cache.
It is applications responsibility to validate that the cache
belongs to the specified mempool.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 lib/mempool/rte_mempool.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
  

Comments

Morten Brørup June 7, 2023, 10:03 a.m. UTC | #1
> From: Honnappa Nagarahalli [mailto:honnappa.nagarahalli@arm.com]
> Sent: Thursday, 9 March 2023 05.58
> 
> Clarify that mempool cache flush API works with default mempool cache.
> It is applications responsibility to validate that the cache
> belongs to the specified mempool.
> 
> Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Reviewed-by: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---

Acked-by: Morten Brørup <mb@smartsharesystems.com>
  

Patch

diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
index 9f530db24b..009bd10215 100644
--- a/lib/mempool/rte_mempool.h
+++ b/lib/mempool/rte_mempool.h
@@ -1326,10 +1326,14 @@  rte_mempool_default_cache(struct rte_mempool *mp, unsigned lcore_id)
 }
 
 /**
- * Flush a user-owned mempool cache to the specified mempool.
+ * Flush a mempool cache to the specified mempool.
+ *
+ * It is application's responsibility to validate that the mempool cache
+ * belongs to the specified mempool.
  *
  * @param cache
- *   A pointer to the mempool cache.
+ *   A pointer to the mempool cache. If NULL, default mempool cache
+ *   is used if configured.
  * @param mp
  *   A pointer to the mempool.
  */