- struct rte_mem_config *mcfg;
- const struct rte_memzone *mz = NULL;
-
- /* both sizes cannot be explicitly called for */
- if (((flags & RTE_MEMZONE_1GB) && (flags & RTE_MEMZONE_2MB))
- || ((flags & RTE_MEMZONE_16MB) && (flags & RTE_MEMZONE_16GB))) {
- rte_errno = EINVAL;
- return NULL;
- }
-
- /* get pointer to global configuration */
- mcfg = rte_eal_get_configuration()->mem_config;
-
- rte_rwlock_write_lock(&mcfg->mlock);
-
- mz = memzone_reserve_aligned_thread_unsafe(
- name, len, socket_id, flags, align, bound);
-
- rte_rwlock_write_unlock(&mcfg->mlock);
+ return rte_memzone_reserve_thread_safe(name, len, socket_id, flags,
+ align, bound);
+}