[dpdk-dev] [PATCH v5 05/11] eal/mem: extract common code for dynamic memory allocation

Burakov, Anatoly anatoly.burakov at intel.com
Thu May 28 14:21:06 CEST 2020


On 25-May-20 1:37 AM, Dmitry Kozlyuk wrote:
> Code in Linux EAL that supports dynamic memory allocation (as opposed to
> static allocation used by FreeBSD) is not OS-dependent and can be reused
> by Windows EAL. Move such code to a file compiled only for the OS that
> require it.
> 
> Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
> ---

I believe you forgot to add dynmem to Makefile.

> +eal_dynmem_calc_num_pages_per_socket(
> +	uint64_t *memory, struct hugepage_info *hp_info,
> +	struct hugepage_info *hp_used, unsigned int num_hp_info)
> +{
> +	unsigned int socket, j, i = 0;
> +	unsigned int requested, available;
> +	int total_num_pages = 0;
> +	uint64_t remaining_mem, cur_mem;
> +	uint64_t total_mem = internal_config.memory;
> +
> +	if (num_hp_info == 0)
> +		return -1;
> +
> +	/* if specific memory amounts per socket weren't requested */
> +	if (internal_config.force_sockets == 0) {
> +		size_t total_size;
> +		int cpu_per_socket[RTE_MAX_NUMA_NODES];
> +		size_t default_size;
> +		unsigned int lcore_id;

Comparing code from eal_memory.c and this one, it seems like you've 
dropped all 32-bit code from this function. Is that intentional?

-- 
Thanks,
Anatoly


More information about the dev mailing list