[dpdk-dev] [PATCH v8 09/11] eal/windows: improve CPU and NUMA node detection

Thomas Monjalon thomas at monjalon.net
Sat Jun 13 00:09:11 CEST 2020


10/06/2020 16:27, Dmitry Kozlyuk:
> 1. Map CPU cores to their respective NUMA nodes as reported by system.
> 2. Support systems with more than 64 cores (multiple processor groups).
> 3. Fix magic constants, styling issues, and compiler warnings.
> 4. Add EAL private function to map DPDK socket ID to NUMA node number.
> 
> Fixes: 53ffd9f080fc ("eal/windows: add minimum viable code")
> 
> Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
> ---
> +eal_create_cpu_map(void)
> +	SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *infos, *info;
> +	DWORD infos_size;
> +	bool full = false;
> +
> +	infos_size = 0;
> +	if (!GetLogicalProcessorInformationEx(
> +			RelationNumaNode, NULL, &infos_size)) {
> +		DWORD error = GetLastError();
> +		if (error != ERROR_INSUFFICIENT_BUFFER) {
> +			rte_panic("cannot get NUMA node info size, error %lu",
> +				GetLastError());
> +		}
> +	}
> +
> +	infos = malloc(infos_size);
> +	if (infos == NULL) {
> +		rte_panic("cannot allocate memory for NUMA node information");
> +		return;
> +	}
> +
> +	if (!GetLogicalProcessorInformationEx(
> +			RelationNumaNode, infos, &infos_size)) {
> +		rte_panic("cannot get NUMA node information, error %lu",
> +			GetLastError());
> +	}

rte_panic addition is forbidden in the libraries.
An application may want to manage the error and shutdown
the DPDK part gracefully.
Please can you try to return an error to rte_eal_init()?




More information about the dev mailing list