This commit removes MEMPOOL_IS_CONTIG().
The next commits will change the behavior of the mempool library so that
the objects will never be allocated in the same memzone than the mempool
header. Therefore, there is no reason to keep this macro that would
always return 0.
This macro was only used in app/test.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
MEMPOOL_HEADER_SIZE(mp, mp->pg_num, mp->cache_size))
return -1;
MEMPOOL_HEADER_SIZE(mp, mp->pg_num, mp->cache_size))
return -1;
+#ifndef RTE_EXEC_ENV_BSDAPP /* rte_mem_virt2phy() not supported on bsd */
printf("get physical address of an object\n");
printf("get physical address of an object\n");
- if (MEMPOOL_IS_CONTIG(mp) &&
- rte_mempool_virt2phy(mp, obj) !=
- (phys_addr_t) (mp->phys_addr +
- (phys_addr_t) ((char*) obj - (char*) mp)))
+ if (rte_mempool_virt2phy(mp, obj) != rte_mem_virt2phy(obj))
printf("put the object back\n");
rte_mempool_put(mp, obj);
printf("put the object back\n");
rte_mempool_put(mp, obj);
(sizeof(*(mp)) + __PA_SIZE(mp, pgn) + (((cs) == 0) ? 0 : \
(sizeof(struct rte_mempool_cache) * RTE_MAX_LCORE)))
(sizeof(*(mp)) + __PA_SIZE(mp, pgn) + (((cs) == 0) ? 0 : \
(sizeof(struct rte_mempool_cache) * RTE_MAX_LCORE)))
-/**
- * Return true if the whole mempool is in contiguous memory.
- */
-#define MEMPOOL_IS_CONTIG(mp) \
- ((mp)->pg_num == MEMPOOL_PG_NUM_DEFAULT && \
- (mp)->phys_addr == (mp)->elt_pa[0])
-
/* return the header of a mempool object (internal) */
static inline struct rte_mempool_objhdr *__mempool_get_header(void *obj)
{
/* return the header of a mempool object (internal) */
static inline struct rte_mempool_objhdr *__mempool_get_header(void *obj)
{