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.kozl...@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()?


Reply via email to