[dpdk-dev] [PATCH v2 11/16] Make --no-huge use mmap instead of malloc

Thomas Monjalon thomas.monjalon at 6wind.com
Thu May 22 15:04:22 CEST 2014


2014-05-19 16:51, Anatoly Burakov:
> This makes it possible to run DPDK without hugepage memory when VFIO
> is used, as VFIO uses virtual addresses to set up DMA mappings.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>

> -		addr = malloc(internal_config.memory);
> +		addr = mmap(NULL, internal_config.memory, PROT_READ | PROT_WRITE,
> +				MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);

Please, could you add a comment to explain why using mmap helps?

-- 
Thomas


More information about the dev mailing list