[dpdk-dev] [PATCH] eal/windows: refine public interface
thomas at monjalon.net
Tue Feb 4 23:00:39 CET 2020
31/01/2020 06:24, Dmitry Kozlyuk:
> The goal of rte_os.h is to mitigate OS differences for EAL users.
> In Windows EAL, rte_os.h did excessive things:
That's an interesting point of view.
The idea of rte_os.h was to hide OS-specifics, so the DPDK applications
have no Windows-specific header to include for using DPDK.
The secondary goal is to avoid Windows-specific includes in DPDK libs
I agree bloating rte_os.h is a concern.
If you can achieve the initial goal (no specific include in apps, libs
and drivers) while reducing rte_os.h, I think it is good.
> 1. It included platform SDK headers (windows.h, etc). Those files are
> huge, require specific inclusion order, and are generally unused by
> the code including rte_os.h. Declarations from platform SDK may
> break otherwise platform-independent code, e.g. min, max, ERROR.
> 2. It included pthread.h, which is clearly not always required.
> 3. It defined functions private to Windows EAL.
> Reorganize Windows EAL includes in the following way:
> 1. Create rte_windows.h to properly import Windows-specific facilities.
> Primary users are bus drivers, tests, and external applications.
> 2. Remove platform SDK includes from rte_os.h to make it portable.
This file is compiled only on Windows.
What do you mean with "portable"?
> Copy necessary definitions to avoid including those headers.
> 3. Remove pthread.h include from rte_os.h.
> 4. Move declarations private to Windows EAL into eal_windows.h.
> Fixes: 428eb983 ("eal: add OS specific header file")
nit: blank line missing here
> Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
More information about the dev