[dpdk-dev] [PATCH v5 2/8] eal: add header files to support windows

Jerin Jacob Kollanukkaran jerinj at marvell.com
Tue Mar 26 11:20:17 CET 2019


On Mon, 2019-03-25 at 23:02 -0700, Anand Rawat wrote:
> Added header files to support windows on x86 platforms.
> Updated rte_common.h to include rte_windows.h for windows
> build. Updated lib/meson.build to create shared libraries
> on windows. Added def file to list the exports for the
> eal library.
> 
> Signed-off-by: Anand Rawat <anand.rawat at intel.com>
> Signed-off-by: Pallavi Kadam <pallavi.kadam at intel.com>
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> Reviewed-by: Jeff Shaw <jeffrey.b.shaw at intel.com>
> Reviewed-by: Ranjit Menon <ranjit.menon at intel.com>
> ---
>  lib/librte_eal/common/include/rte_common.h    |  7 ++++-
>  .../common/include/rte_string_fns.h           |  4 ++-
>  lib/librte_eal/rte_eal_exports.def            |  9 ++++++
>  .../windows/eal/include/rte_windows.h         | 30
> +++++++++++++++++++
>  lib/librte_eal/windows/eal/meson.build        |  2 ++
>  lib/meson.build                               | 19 ++++++++++--
>  6 files changed, 66 insertions(+), 5 deletions(-)
>  create mode 100644 lib/librte_eal/rte_eal_exports.def
>  create mode 100644 lib/librte_eal/windows/eal/include/rte_windows.h
> 
> diff --git a/lib/librte_eal/common/include/rte_common.h
> b/lib/librte_eal/common/include/rte_common.h
> index 7178ba1e9..4775c84f5 100644
> --- a/lib/librte_eal/common/include/rte_common.h
> +++ b/lib/librte_eal/common/include/rte_common.h
> @@ -1,5 +1,5 @@
>  /* SPDX-License-Identifier: BSD-3-Clause
> - * Copyright(c) 2010-2014 Intel Corporation
> + * Copyright(c) 2010-2019 Intel Corporation
>   */
>  
>  #ifndef _RTE_COMMON_H_
> @@ -24,6 +24,11 @@ extern "C" {
>  
>  #include <rte_config.h>
>  
> +/* windows specific*/
> +#ifdef RTE_EXEC_ENV_WINDOWS
> +#include <rte_windows.h>
> +#endif
> +

IMO, Updating the rte_common.h for each execution environment is not
clean and unnecessary #ifdef clutter in the common code.

I think, it can be fixed by adding new os or eal specific header file
at the following location and simply include it(without any #ifdef)

lib/librte_eal/linux/eal/include/exec-env/rte_eal.h
lib/librte_eal/freebsd/eal/include/exec-env/rte_eal.h
lib/librte_eal/windows/eal/include/exec-env/rte_eal.h # the content of
exiting rte_windows.h goes here.

It can be rte_eal.h or rte_os.h or anything similar.


 


More information about the dev mailing list