[v8,03/10] eal: add new rte_os.h header to build system

Message ID 20190402035458.14664-4-anand.rawat@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series HelloWorld example for Windows |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Anand Rawat April 2, 2019, 3:54 a.m. UTC
  Added rte_os.h files to support OS specific functionality.
Updated build system to contain OS headers in the include
path.

Signed-off-by: Anand Rawat <anand.rawat@intel.com>
Reviewed-by: Pallavi Kadam <pallavi.kadam@intel.com>
---
 lib/librte_eal/freebsd/eal/Makefile         |  4 ++--
 lib/librte_eal/freebsd/eal/include/rte_os.h | 14 ++++++++++++++
 lib/librte_eal/linux/eal/Makefile           |  3 ++-
 lib/librte_eal/linux/eal/include/rte_os.h   | 14 ++++++++++++++
 lib/librte_eal/windows/eal/include/rte_os.h | 14 ++++++++++++++
 meson.build                                 |  6 ++++--
 mk/exec-env/freebsd/rte.vars.mk             |  5 ++++-
 mk/exec-env/linux/rte.vars.mk               |  5 ++++-
 8 files changed, 58 insertions(+), 7 deletions(-)
 create mode 100644 lib/librte_eal/freebsd/eal/include/rte_os.h
 create mode 100644 lib/librte_eal/linux/eal/include/rte_os.h
 create mode 100644 lib/librte_eal/windows/eal/include/rte_os.h
  

Comments

Thomas Monjalon April 2, 2019, 7:56 p.m. UTC | #1
02/04/2019 05:54, Anand Rawat:
> Added rte_os.h files to support OS specific functionality.
> Updated build system to contain OS headers in the include
> path.
> 
> Signed-off-by: Anand Rawat <anand.rawat@intel.com>
> Reviewed-by: Pallavi Kadam <pallavi.kadam@intel.com>
> ---
> --- a/meson.build
> +++ b/meson.build
> -global_inc = include_directories('.', 'config', 'lib/librte_eal/common/include')
> +global_inc = include_directories('.', 'config',
> +						'lib/librte_eal/common/include',
> +						'lib/librte_eal/@0@/eal/include'.format(host_machine.system()))

After having worked on rte_kni_common.h which is only in Linux,
I think we should add rte_os.h in meson file of each OS:
	- lib/librte_eal/linux/eal/meson.build
	- lib/librte_eal/freebsd/eal/meson.build
	- lib/librte_eal/windows/eal/meson.build
  
Thomas Monjalon April 2, 2019, 8:47 p.m. UTC | #2
02/04/2019 21:56, Thomas Monjalon:
> 02/04/2019 05:54, Anand Rawat:
> > Added rte_os.h files to support OS specific functionality.
> > Updated build system to contain OS headers in the include
> > path.
> > 
> > Signed-off-by: Anand Rawat <anand.rawat@intel.com>
> > Reviewed-by: Pallavi Kadam <pallavi.kadam@intel.com>
> > ---
> > --- a/meson.build
> > +++ b/meson.build
> > -global_inc = include_directories('.', 'config', 'lib/librte_eal/common/include')
> > +global_inc = include_directories('.', 'config',
> > +						'lib/librte_eal/common/include',
> > +						'lib/librte_eal/@0@/eal/include'.format(host_machine.system()))
> 
> After having worked on rte_kni_common.h which is only in Linux,
> I think we should add rte_os.h in meson file of each OS:
> 	- lib/librte_eal/linux/eal/meson.build
> 	- lib/librte_eal/freebsd/eal/meson.build
> 	- lib/librte_eal/windows/eal/meson.build

I confirm:
"global_inc" is used in "includes" variable but not in "headers" variable,
so rte_os.h is not installed as other files in "headers".
We must fill "env_headers" which is pulled by:
	headers = common_headers + env_headers

I will fix it before merging in master if you agree.
  
Anand Rawat April 2, 2019, 10:11 p.m. UTC | #3
On 4/2/2019 1:47 PM, Thomas Monjalon wrote:
> 02/04/2019 21:56, Thomas Monjalon:
>> 02/04/2019 05:54, Anand Rawat:
>>> Added rte_os.h files to support OS specific functionality.
>>> Updated build system to contain OS headers in the include
>>> path.
>>>
>>> Signed-off-by: Anand Rawat <anand.rawat@intel.com>
>>> Reviewed-by: Pallavi Kadam <pallavi.kadam@intel.com>
>>> ---
>>> --- a/meson.build
>>> +++ b/meson.build
>>> -global_inc = include_directories('.', 'config', 'lib/librte_eal/common/include')
>>> +global_inc = include_directories('.', 'config',
>>> +						'lib/librte_eal/common/include',
>>> +						'lib/librte_eal/@0@/eal/include'.format(host_machine.system()))
>>
>> After having worked on rte_kni_common.h which is only in Linux,
>> I think we should add rte_os.h in meson file of each OS:
>> 	- lib/librte_eal/linux/eal/meson.build
>> 	- lib/librte_eal/freebsd/eal/meson.build
>> 	- lib/librte_eal/windows/eal/meson.build
> 
> I confirm:
> "global_inc" is used in "includes" variable but not in "headers" variable,
> so rte_os.h is not installed as other files in "headers".
> We must fill "env_headers" which is pulled by:
> 	headers = common_headers + env_headers
> 
> I will fix it before merging in master if you agree.
> 
> 
Agreed, env_headers need to be updated for rte_os.h.
I have tested the same and will incorporating the changes in v9.
Please update this patch with your fix.
  
Thomas Monjalon April 2, 2019, 10:32 p.m. UTC | #4
03/04/2019 00:11, Anand Rawat:
> On 4/2/2019 1:47 PM, Thomas Monjalon wrote:
> > 02/04/2019 21:56, Thomas Monjalon:
> >> 02/04/2019 05:54, Anand Rawat:
> >>> Added rte_os.h files to support OS specific functionality.
> >>> Updated build system to contain OS headers in the include
> >>> path.
> >>>
> >>> Signed-off-by: Anand Rawat <anand.rawat@intel.com>
> >>> Reviewed-by: Pallavi Kadam <pallavi.kadam@intel.com>
> >>> ---
> >>> --- a/meson.build
> >>> +++ b/meson.build
> >>> -global_inc = include_directories('.', 'config', 'lib/librte_eal/common/include')
> >>> +global_inc = include_directories('.', 'config',
> >>> +						'lib/librte_eal/common/include',
> >>> +						'lib/librte_eal/@0@/eal/include'.format(host_machine.system()))
> >>
> >> After having worked on rte_kni_common.h which is only in Linux,
> >> I think we should add rte_os.h in meson file of each OS:
> >> 	- lib/librte_eal/linux/eal/meson.build
> >> 	- lib/librte_eal/freebsd/eal/meson.build
> >> 	- lib/librte_eal/windows/eal/meson.build
> > 
> > I confirm:
> > "global_inc" is used in "includes" variable but not in "headers" variable,
> > so rte_os.h is not installed as other files in "headers".
> > We must fill "env_headers" which is pulled by:
> > 	headers = common_headers + env_headers
> > 
> > I will fix it before merging in master if you agree.
> > 
> Agreed, env_headers need to be updated for rte_os.h.
> I have tested the same and will incorporating the changes in v9.
> Please update this patch with your fix.

No need for a v9. Once it will be in master, new changes must be
submitted in a separate patch.
  
Anand Rawat April 2, 2019, 10:34 p.m. UTC | #5
On 4/2/2019 3:32 PM, Thomas Monjalon wrote:
> 03/04/2019 00:11, Anand Rawat:
> > On 4/2/2019 1:47 PM, Thomas Monjalon wrote:
> >> 02/04/2019 21:56, Thomas Monjalon:
> >>> 02/04/2019 05:54, Anand Rawat:
> >>>> Added rte_os.h files to support OS specific functionality.
> >>>> Updated build system to contain OS headers in the include
> >>>> path.
> >>>>
> >>>> Signed-off-by: Anand Rawat <anand.rawat@intel.com>
> >>>> Reviewed-by: Pallavi Kadam <pallavi.kadam@intel.com>
> >>>> ---
> >>>> --- a/meson.build
> >>>> +++ b/meson.build
> >>>> -global_inc = include_directories('.', 'config', 'lib/librte_eal/common/include')
> >>>> +global_inc = include_directories('.', 'config',
> >>>> +                        'lib/librte_eal/common/include',
> >>>> +                        'lib/librte_eal/@0@/eal/include'.format(host_machine.system()))
> >>>
> >>> After having worked on rte_kni_common.h which is only in Linux,
> >>> I think we should add rte_os.h in meson file of each OS:
> >>>     - lib/librte_eal/linux/eal/meson.build
> >>>     - lib/librte_eal/freebsd/eal/meson.build
> >>>     - lib/librte_eal/windows/eal/meson.build
> >>
> >> I confirm:
> >> "global_inc" is used in "includes" variable but not in "headers" variable,
> >> so rte_os.h is not installed as other files in "headers".
> >> We must fill "env_headers" which is pulled by:
> >>     headers = common_headers + env_headers
> >>
> >> I will fix it before merging in master if you agree.
> >>
> > Agreed, env_headers need to be updated for rte_os.h.
> > I have tested the same and will incorporating the changes in v9.
> > Please update this patch with your fix.
>
> No need for a v9. Once it will be in master, new changes must be
> submitted in a separate patch.
>
>
>

Understood. Thanks :)
  

Patch

diff --git a/lib/librte_eal/freebsd/eal/Makefile b/lib/librte_eal/freebsd/eal/Makefile
index 55d476e5b..19854ee2c 100644
--- a/lib/librte_eal/freebsd/eal/Makefile
+++ b/lib/librte_eal/freebsd/eal/Makefile
@@ -1,5 +1,5 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2010-2015 Intel Corporation
+# Copyright(c) 2010-2019 Intel Corporation
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
@@ -86,7 +86,7 @@  CFLAGS_eal_thread.o += -Wno-return-type
 CFLAGS_eal_hpet.o += -Wno-return-type
 endif
 
-INC :=  # no bsd specific headers
+INC := rte_os.h
 
 SYMLINK-$(CONFIG_RTE_EXEC_ENV_FREEBSD)-include := $(addprefix include/,$(INC))
 
diff --git a/lib/librte_eal/freebsd/eal/include/rte_os.h b/lib/librte_eal/freebsd/eal/include/rte_os.h
new file mode 100644
index 000000000..49cd4d4d9
--- /dev/null
+++ b/lib/librte_eal/freebsd/eal/include/rte_os.h
@@ -0,0 +1,14 @@ 
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2010-2019 Intel Corporation
+ */
+
+#ifndef _RTE_OS_H_
+#define _RTE_OS_H_
+
+/**
+ * This is header should contain any function/macro definition
+ * which are not supported natively or named differently in the
+ * freebsd OS. Functions will be added in future releases.
+ */
+
+#endif /* _RTE_OS_H_ */
diff --git a/lib/librte_eal/linux/eal/Makefile b/lib/librte_eal/linux/eal/Makefile
index 2aa6e8c6a..6e5261152 100644
--- a/lib/librte_eal/linux/eal/Makefile
+++ b/lib/librte_eal/linux/eal/Makefile
@@ -1,5 +1,5 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2010-2016 Intel Corporation
+# Copyright(c) 2010-2019 Intel Corporation
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
@@ -94,6 +94,7 @@  CFLAGS_eal_thread.o += -Wno-return-type
 endif
 
 INC := rte_kni_common.h
+INC += rte_os.h
 
 SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUX)-include := $(addprefix include/,$(INC))
 
diff --git a/lib/librte_eal/linux/eal/include/rte_os.h b/lib/librte_eal/linux/eal/include/rte_os.h
new file mode 100644
index 000000000..bc6ad14d2
--- /dev/null
+++ b/lib/librte_eal/linux/eal/include/rte_os.h
@@ -0,0 +1,14 @@ 
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2010-2019 Intel Corporation
+ */
+
+#ifndef _RTE_OS_H_
+#define _RTE_OS_H_
+
+/**
+ * This is header should contain any function/macro definition
+ * which are not supported natively or named differently in the
+ * linux OS. Functions will be added in future releases.
+ */
+
+#endif /* _RTE_OS_H_ */
diff --git a/lib/librte_eal/windows/eal/include/rte_os.h b/lib/librte_eal/windows/eal/include/rte_os.h
new file mode 100644
index 000000000..421ed8e7f
--- /dev/null
+++ b/lib/librte_eal/windows/eal/include/rte_os.h
@@ -0,0 +1,14 @@ 
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2010-2019 Intel Corporation
+ */
+
+#ifndef _RTE_OS_H_
+#define _RTE_OS_H_
+
+/**
+ * This is header should contain any function/macro definition
+ * which are not supported natively or named differently in the
+ * Windows OS. Functions will be added in future releases.
+ */
+
+#endif /* _RTE_OS_H_ */
diff --git a/meson.build b/meson.build
index 6061c4b1e..5a93c1f1a 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2017 Intel Corporation
+# Copyright(c) 2017-2019 Intel Corporation
 
 project('DPDK', 'C',
 	# Get version number from file.
@@ -24,7 +24,9 @@  dpdk_app_link_libraries = []
 # configure the build, and make sure configs here and in config folder are
 # able to be included in any file. We also store a global array of include dirs
 # for passing to pmdinfogen scripts
-global_inc = include_directories('.', 'config', 'lib/librte_eal/common/include')
+global_inc = include_directories('.', 'config',
+						'lib/librte_eal/common/include',
+						'lib/librte_eal/@0@/eal/include'.format(host_machine.system()))
 subdir('config')
 
 # build libs and drivers
diff --git a/mk/exec-env/freebsd/rte.vars.mk b/mk/exec-env/freebsd/rte.vars.mk
index c6be560b3..3608530d3 100644
--- a/mk/exec-env/freebsd/rte.vars.mk
+++ b/mk/exec-env/freebsd/rte.vars.mk
@@ -1,5 +1,5 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2010-2014 Intel Corporation
+# Copyright(c) 2010-2019 Intel Corporation
 
 #
 # exec-env:
@@ -17,6 +17,9 @@  else
 EXECENV_CFLAGS  = -pthread
 endif
 
+# include in every library to build
+EXECENV_CFLAGS += -I$(RTE_SDK)/lib/librte_eal/freebsd/eal/include
+
 EXECENV_LDFLAGS =
 EXECENV_LDLIBS  = -lexecinfo
 EXECENV_ASFLAGS =
diff --git a/mk/exec-env/linux/rte.vars.mk b/mk/exec-env/linux/rte.vars.mk
index d04d0e29c..bea3f7657 100644
--- a/mk/exec-env/linux/rte.vars.mk
+++ b/mk/exec-env/linux/rte.vars.mk
@@ -1,5 +1,5 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
-# Copyright(c) 2010-2014 Intel Corporation
+# Copyright(c) 2010-2019 Intel Corporation
 
 #
 # exec-env:
@@ -17,6 +17,9 @@  else
 EXECENV_CFLAGS  = -pthread
 endif
 
+# include in every library to build
+EXECENV_CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linux/eal/include
+
 EXECENV_LDLIBS  =
 EXECENV_ASFLAGS =