[2/2] build: add module definitions and pci lib support

Message ID 20200317004802.11424-3-pallavi.kadam@intel.com (mailing list archive)
State Rejected, archived
Delegated to: Thomas Monjalon
Headers
Series Support librte_pci on Windows |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK

Commit Message

Kadam, Pallavi March 17, 2020, 12:48 a.m. UTC
  Added mman functions to eal exports list.
Added librte_pci support for Windows.

Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
---
 lib/librte_eal/rte_eal_exports.def | 2 ++
 lib/meson.build                    | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
  

Comments

Thomas Monjalon March 17, 2020, 9:31 a.m. UTC | #1
17/03/2020 01:48, Pallavi Kadam:
> Added mman functions to eal exports list.
[...]
> --- a/lib/librte_eal/rte_eal_exports.def
> +++ b/lib/librte_eal/rte_eal_exports.def

This file is generated. Only the .map can be updated.

> @@ -7,3 +7,5 @@ EXPORTS
>  	rte_eal_remote_launch
>  	rte_log
>  	rte_vlog
> +	mmap
> +	munmap

These functions should not be exported for Linux.

And in general, I think it would be better to state what is
the memory management strategy on Windows first.
Maybe we will need to use a different abstraction.
  
Dmitry Kozlyuk March 18, 2020, 12:28 a.m. UTC | #2
> 17/03/2020 01:48, Pallavi Kadam:
> > Added mman functions to eal exports list.  
> [...]
> > --- a/lib/librte_eal/rte_eal_exports.def
> > +++ b/lib/librte_eal/rte_eal_exports.def  
> 
> This file is generated. Only the .map can be updated.

A minor correction: this file is not generated, it overrides generation of
*.def from *.map, see buildtools/map_to_def.py.

> > @@ -7,3 +7,5 @@ EXPORTS
> >  	rte_eal_remote_launch
> >  	rte_log
> >  	rte_vlog
> > +	mmap
> > +	munmap  
> 
> These functions should not be exported for Linux.
> 
> And in general, I think it would be better to state what is
> the memory management strategy on Windows first.
> Maybe we will need to use a different abstraction.

I concur, this patch should be postponed at least. Hopefully we'll settle
to something regarding Windows MM at the nearest Community Call.

EAL will have to export mmap/munmap-like functions for mapping files and
anonymous pages to support library code. Depending on the approach to MM
implementation for Windows, not all mmap() calls may even translate into its
Win32 equivalent. For example, hugepage allocation on Windows will use
different approach that MMF.

Mapping device BARs can only be done using IOCTLs on Windows, so
rte_pci_map/unmap_resource() code will not work even if it compiles.
  

Patch

diff --git a/lib/librte_eal/rte_eal_exports.def b/lib/librte_eal/rte_eal_exports.def
index 12a6c79d6..bc577dd45 100644
--- a/lib/librte_eal/rte_eal_exports.def
+++ b/lib/librte_eal/rte_eal_exports.def
@@ -7,3 +7,5 @@  EXPORTS
 	rte_eal_remote_launch
 	rte_log
 	rte_vlog
+	mmap
+	munmap
diff --git a/lib/meson.build b/lib/meson.build
index 0af3efab2..ab580202b 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -33,7 +33,7 @@  libraries = [
 	'flow_classify', 'bpf', 'telemetry']
 
 if is_windows
-	libraries = ['kvargs','eal'] # only supported libraries for windows
+	libraries = ['kvargs','eal','pci'] # only supported libraries for windows
 endif
 
 default_cflags = machine_args