[dpdk-dev] [PATCH v5 03/11] eal: introduce memory management wrappers

Burakov, Anatoly anatoly.burakov at intel.com
Thu May 28 13:52:50 CEST 2020


On 25-May-20 1:37 AM, Dmitry Kozlyuk wrote:
> Introduce OS-independent wrappers for memory management operations used
> across DPDK and specifically in common code of EAL:
> 
> * rte_mem_map()
> * rte_mem_unmap()
> * rte_get_page_size()
> * rte_mem_lock()
> 
> Windows uses different APIs for memory mapping and reservation, while
> Unices reserve memory by mapping it. Introduce EAL private functions to
> support memory reservation in common code:
> 
> * eal_mem_reserve()
> * eal_mem_free()
> * eal_mem_set_dump()
> 
> Wrappers follow POSIX semantics limited to DPDK tasks, but their
> signatures deliberately differ from POSIX ones to be more safe and
> expressive.
> 
> Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
> ---

<snip>

> +	} else if (mapped_addr == NULL) {
>   		RTE_LOG(ERR, EAL, "Cannot get a virtual area: %s\n",
> -			strerror(errno));
> -		/* pass errno up the call chain */
> -		rte_errno = errno;
> +			strerror(rte_errno));

Also, please check that you're using rte_strerror with rte_errno :)

-- 
Thanks,
Anatoly


More information about the dev mailing list