dev_info.sync_phys = mz->phys_addr;
/* MBUF mempool */
- rte_snprintf(mz_name, sizeof(mz_name), "MP_%s", pktmbuf_pool->name);
+ rte_snprintf(mz_name, sizeof(mz_name), RTE_MEMPOOL_OBJ_NAME,
+ pktmbuf_pool->name);
mz = rte_memzone_lookup(mz_name);
KNI_MZ_CHECK(mz == NULL);
dev_info.mbuf_va = mz->addr;
/* Ring functions will return appropriate errors if we are
* running as a secondary process etc., so no checks made
* in this function for that condition */
- rte_snprintf(rg_name, sizeof(rg_name), "MP_%s", name);
+ rte_snprintf(rg_name, sizeof(rg_name), RTE_MEMPOOL_MZ_FORMAT, name);
r = rte_ring_create(rg_name, rte_align32pow2(n+1), socket_id, rg_flags);
if (r == NULL)
goto exit;
CACHE_LINE_MASK) & (~CACHE_LINE_MASK);
mempool_size = total_elt_size * n +
sizeof(struct rte_mempool) + private_data_size;
- rte_snprintf(mz_name, sizeof(mz_name), "MP_%s", name);
+ rte_snprintf(mz_name, sizeof(mz_name), RTE_MEMPOOL_MZ_FORMAT, name);
mz = rte_memzone_reserve(mz_name, mempool_size, socket_id, mz_flags);
#endif /* RTE_MEMPOOL_CACHE_MAX_SIZE > 0 */
#define RTE_MEMPOOL_NAMESIZE 32 /**< Maximum length of a memory pool. */
+#define RTE_MEMPOOL_MZ_PREFIX "MP_"
+
+/* "MP_<name>" */
+#define RTE_MEMPOOL_MZ_FORMAT RTE_MEMPOOL_MZ_PREFIX "%s"
+
+#define RTE_MEMPOOL_OBJ_NAME RTE_MEMPOOL_MZ_FORMAT
/**
* The RTE mempool structure.
return NULL;
}
- rte_snprintf(mz_name, sizeof(mz_name), "RG_%s", name);
+ rte_snprintf(mz_name, sizeof(mz_name), "%s%s", RTE_RING_MZ_PREFIX, name);
ring_size = count * sizeof(void *) + sizeof(struct rte_ring);
rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);
#endif
#define RTE_RING_NAMESIZE 32 /**< The maximum length of a ring name. */
+#define RTE_RING_MZ_PREFIX "RG_"
/**
* An RTE ring structure.