mempool: support no hugepage mode
[dpdk.git] / lib / librte_mempool / rte_mempool.h
index 0f900a1..e0aa698 100644 (file)
@@ -125,17 +125,6 @@ struct rte_mempool_objsz {
 /* "MP_<name>" */
 #define        RTE_MEMPOOL_MZ_FORMAT   RTE_MEMPOOL_MZ_PREFIX "%s"
 
-#ifdef RTE_LIBRTE_XEN_DOM0
-
-/* "<name>_MP_elt" */
-#define        RTE_MEMPOOL_OBJ_NAME    "%s_" RTE_MEMPOOL_MZ_PREFIX "elt"
-
-#else
-
-#define        RTE_MEMPOOL_OBJ_NAME    RTE_MEMPOOL_MZ_FORMAT
-
-#endif /* RTE_LIBRTE_XEN_DOM0 */
-
 #define        MEMPOOL_PG_SHIFT_MAX    (sizeof(uintptr_t) * CHAR_BIT - 1)
 
 /** Mempool over one chunk of physically continuous memory */
@@ -1161,19 +1150,10 @@ rte_mempool_empty(const struct rte_mempool *mp)
 static inline phys_addr_t
 rte_mempool_virt2phy(__rte_unused const struct rte_mempool *mp, const void *elt)
 {
-       if (rte_eal_has_hugepages()) {
-               const struct rte_mempool_objhdr *hdr;
-               hdr = (const struct rte_mempool_objhdr *)RTE_PTR_SUB(elt,
-                       sizeof(*hdr));
-               return hdr->physaddr;
-       } else {
-               /*
-                * If huge pages are disabled, we cannot assume the
-                * memory region to be physically contiguous.
-                * Lookup for each element.
-                */
-               return rte_mem_virt2phy(elt);
-       }
+       const struct rte_mempool_objhdr *hdr;
+       hdr = (const struct rte_mempool_objhdr *)RTE_PTR_SUB(elt,
+               sizeof(*hdr));
+       return hdr->physaddr;
 }
 
 /**
@@ -1261,7 +1241,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.
  */