mempool: get memory size with unspecified page size
[dpdk.git] / lib / librte_mempool / rte_mempool.h
index 65455d1..53275e4 100644 (file)
@@ -187,6 +187,12 @@ struct rte_mempool_objtlr {
  */
 STAILQ_HEAD(rte_mempool_memhdr_list, rte_mempool_memhdr);
 
+/**
+ * Callback used to free a memory chunk
+ */
+typedef void (rte_mempool_memchunk_free_cb_t)(struct rte_mempool_memhdr *memhdr,
+       void *opaque);
+
 /**
  * Mempool objects memory header structure
  *
@@ -199,6 +205,8 @@ struct rte_mempool_memhdr {
        void *addr;              /**< Virtual address of the chunk */
        phys_addr_t phys_addr;   /**< Physical address of the chunk */
        size_t len;              /**< length of the chunk */
+       rte_mempool_memchunk_free_cb_t *free_cb; /**< Free callback */
+       void *opaque;            /**< Argument passed to the free callback */
 };
 
 /**
@@ -1253,7 +1261,7 @@ uint32_t rte_mempool_calc_obj_size(uint32_t elt_size, uint32_t flags,
  *   The size of each element, including header and trailer, as returned
  *   by rte_mempool_calc_obj_size().
  * @param pg_shift
- *   LOG2 of the physical pages size.
+ *   LOG2 of the physical pages size. If set to 0, ignore page boundaries.
  * @return
  *   Required memory size aligned at page boundary.
  */