[3/4] eal: export needed functions for mbuf

Message ID 20200601093818.5420-4-talshn@mellanox.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Support librte_mbuf on Windows |

Checks

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

Commit Message

Tal Shnaiderman June 1, 2020, 9:38 a.m. UTC
  From: Tal Shnaiderman <talshn@mellanox.com>

Export needed eal functions used by the lib.

Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
---
 lib/librte_eal/common/meson.build  | 1 +
 lib/librte_eal/rte_eal_exports.def | 3 +++
 lib/librte_eal/rte_eal_version.map | 1 +
 3 files changed, 5 insertions(+)
  

Comments

Thomas Monjalon June 16, 2020, 8:09 a.m. UTC | #1
01/06/2020 11:38, talshn@mellanox.com:
> From: Tal Shnaiderman <talshn@mellanox.com>
> 
> Export needed eal functions used by the lib.
> 
> Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
> ---
> --- a/lib/librte_eal/rte_eal_exports.def
> +++ b/lib/librte_eal/rte_eal_exports.def
> @@ -3,6 +3,7 @@ EXPORTS
>  	per_lcore__rte_errno
>  	rte_calloc
>  	rte_calloc_socket
> +	per_lcore__lcore_id
[...]
> --- a/lib/librte_eal/rte_eal_version.map
> +++ b/lib/librte_eal/rte_eal_version.map
> @@ -394,4 +394,5 @@ EXPERIMENTAL {
>  	rte_mem_unmap;
>  	__emutls_v.per_lcore__rte_errno;
>  	__rte_trace_mem_per_thread_alloc;
> +	__emutls_v.per_lcore__lcore_id;

I'm surprised about this one in the Linux/BSD map.
Can it be removed?
  
Tal Shnaiderman June 16, 2020, 8:33 a.m. UTC | #2
> Subject: Re: [dpdk-dev] [PATCH 3/4] eal: export needed functions for mbuf
> 
> 01/06/2020 11:38, talshn@mellanox.com:
> > From: Tal Shnaiderman <talshn@mellanox.com>
> >
> > Export needed eal functions used by the lib.
> >
> > Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
> > ---
> > --- a/lib/librte_eal/rte_eal_exports.def
> > +++ b/lib/librte_eal/rte_eal_exports.def
> > @@ -3,6 +3,7 @@ EXPORTS
> >  	per_lcore__rte_errno
> >  	rte_calloc
> >  	rte_calloc_socket
> > +	per_lcore__lcore_id
> [...]
> > --- a/lib/librte_eal/rte_eal_version.map
> > +++ b/lib/librte_eal/rte_eal_version.map
> > @@ -394,4 +394,5 @@ EXPERIMENTAL {
> >  	rte_mem_unmap;
> >  	__emutls_v.per_lcore__rte_errno;
> >  	__rte_trace_mem_per_thread_alloc;
> > +	__emutls_v.per_lcore__lcore_id;
> 
> I'm surprised about this one in the Linux/BSD map.
> Can it be removed?
> 

It is needed for the MingGW build which requires the __emutls_v. prefix.
  
Thomas Monjalon June 16, 2020, 8:45 a.m. UTC | #3
16/06/2020 10:33, Tal Shnaiderman:
> > 01/06/2020 11:38, talshn@mellanox.com:
> > > From: Tal Shnaiderman <talshn@mellanox.com>
> > >
> > > Export needed eal functions used by the lib.
> > >
> > > Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
> > > ---
> > > --- a/lib/librte_eal/rte_eal_exports.def
> > > +++ b/lib/librte_eal/rte_eal_exports.def
> > > @@ -3,6 +3,7 @@ EXPORTS
> > >  	per_lcore__rte_errno
> > >  	rte_calloc
> > >  	rte_calloc_socket
> > > +	per_lcore__lcore_id
> > [...]
> > > --- a/lib/librte_eal/rte_eal_version.map
> > > +++ b/lib/librte_eal/rte_eal_version.map
> > > @@ -394,4 +394,5 @@ EXPERIMENTAL {
> > >  	rte_mem_unmap;
> > >  	__emutls_v.per_lcore__rte_errno;
> > >  	__rte_trace_mem_per_thread_alloc;
> > > +	__emutls_v.per_lcore__lcore_id;

Note the alphabetical order is not respected above.

> > I'm surprised about this one in the Linux/BSD map.
> > Can it be removed?
> 
> It is needed for the MingGW build which requires the __emutls_v. prefix.

We already have per_lcore__lcore_id and per_lcore__rte_errno
for Linux and FreeBSD.
The prefix __emutls_v. for MinGW looks wrong.
If it is really required, it should be added automatically
in my opinion.
I think we can do it in buildtools/map_to_def.py
by adding this prefix to per_lcore__ when required.
  
Dmitry Kozlyuk June 16, 2020, 9:26 a.m. UTC | #4
On Tue, 16 Jun 2020 10:45:49 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:

> 16/06/2020 10:33, Tal Shnaiderman:
> > > 01/06/2020 11:38, talshn@mellanox.com:  
> > > > From: Tal Shnaiderman <talshn@mellanox.com>
> > > >
> > > > Export needed eal functions used by the lib.
> > > >
> > > > Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
> > > > ---
> > > > --- a/lib/librte_eal/rte_eal_exports.def
> > > > +++ b/lib/librte_eal/rte_eal_exports.def
> > > > @@ -3,6 +3,7 @@ EXPORTS
> > > >  	per_lcore__rte_errno
> > > >  	rte_calloc
> > > >  	rte_calloc_socket
> > > > +	per_lcore__lcore_id  
> > > [...]  
> > > > --- a/lib/librte_eal/rte_eal_version.map
> > > > +++ b/lib/librte_eal/rte_eal_version.map
> > > > @@ -394,4 +394,5 @@ EXPERIMENTAL {
> > > >  	rte_mem_unmap;
> > > >  	__emutls_v.per_lcore__rte_errno;
> > > >  	__rte_trace_mem_per_thread_alloc;
> > > > +	__emutls_v.per_lcore__lcore_id;  
> 
> Note the alphabetical order is not respected above.
> 
> > > I'm surprised about this one in the Linux/BSD map.
> > > Can it be removed?  
> > 
> > It is needed for the MingGW build which requires the __emutls_v. prefix.  
> 
> We already have per_lcore__lcore_id and per_lcore__rte_errno
> for Linux and FreeBSD.
> The prefix __emutls_v. for MinGW looks wrong.
> If it is really required, it should be added automatically
> in my opinion.
> I think we can do it in buildtools/map_to_def.py
> by adding this prefix to per_lcore__ when required.

MinGW doesn't use .def, it's for link.exe only (used by Clang). To my
understanding, multiple .map files can be used [1]. The "overlay .map" for
MinGW can then be generated from the generic .map by a separate script.

[1]: https://github.com/PlushBeaver/dpdk/blob/windows/lib/meson.build#L174
  
Thomas Monjalon June 16, 2020, 11:44 a.m. UTC | #5
16/06/2020 11:26, Dmitry Kozlyuk:
> Thomas Monjalon <thomas@monjalon.net> wrote:
> > 16/06/2020 10:33, Tal Shnaiderman:
> > > > 01/06/2020 11:38, talshn@mellanox.com:  
> > > > > From: Tal Shnaiderman <talshn@mellanox.com>
> > > > >
> > > > > Export needed eal functions used by the lib.
> > > > >
> > > > > Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
> > > > > ---
> > > > > --- a/lib/librte_eal/rte_eal_version.map
> > > > > +++ b/lib/librte_eal/rte_eal_version.map
> > > > > @@ -394,4 +394,5 @@ EXPERIMENTAL {
> > > > >  	rte_mem_unmap;
> > > > >  	__emutls_v.per_lcore__rte_errno;
> > > > >  	__rte_trace_mem_per_thread_alloc;
> > > > > +	__emutls_v.per_lcore__lcore_id;  
> > 
> > We already have per_lcore__lcore_id and per_lcore__rte_errno
> > for Linux and FreeBSD.
> > The prefix __emutls_v. for MinGW looks wrong.
> > If it is really required, it should be added automatically
> > in my opinion.
> > I think we can do it in buildtools/map_to_def.py
> > by adding this prefix to per_lcore__ when required.
> 
> MinGW doesn't use .def, it's for link.exe only (used by Clang). To my
> understanding, multiple .map files can be used [1]. The "overlay .map" for
> MinGW can then be generated from the generic .map by a separate script.
> 
> [1]: https://github.com/PlushBeaver/dpdk/blob/windows/lib/meson.build#L174

Yes please generate a map with the fixed prefix.
It can be done in a script similar to buildtools/map_to_def.py, right?
  

Patch

diff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meson.build
index cf4b9e56eb..530e06033b 100644
--- a/lib/librte_eal/common/meson.build
+++ b/lib/librte_eal/common/meson.build
@@ -12,6 +12,7 @@  if is_windows
 		'eal_common_dynmem.c',
 		'eal_common_errno.c',
 		'eal_common_fbarray.c',
+		'eal_common_hexdump.c',
 		'eal_common_launch.c',
 		'eal_common_lcore.c',
 		'eal_common_log.c',
diff --git a/lib/librte_eal/rte_eal_exports.def b/lib/librte_eal/rte_eal_exports.def
index 9ebf0d641a..9b2ebbcdf5 100644
--- a/lib/librte_eal/rte_eal_exports.def
+++ b/lib/librte_eal/rte_eal_exports.def
@@ -3,6 +3,7 @@  EXPORTS
 	per_lcore__rte_errno
 	rte_calloc
 	rte_calloc_socket
+	per_lcore__lcore_id
 	per_lcore__rte_errno
 	rte_bus_register
 	rte_dev_is_probed
@@ -12,6 +13,7 @@  EXPORTS
 	rte_eal_has_hugepages
 	rte_eal_init
 	rte_eal_iova_mode
+	rte_eal_mbuf_user_pool_ops
 	rte_eal_mp_remote_launch
 	rte_eal_mp_wait_lcore
 	rte_eal_process_type
@@ -20,6 +22,7 @@  EXPORTS
 	rte_eal_tailq_register
 	rte_eal_using_phys_addrs
 	rte_free
+	rte_hexdump
 	rte_log
 	rte_malloc
 	rte_malloc_dump_stats
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 361d4808f5..8ecef1ace1 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -394,4 +394,5 @@  EXPERIMENTAL {
 	rte_mem_unmap;
 	__emutls_v.per_lcore__rte_errno;
 	__rte_trace_mem_per_thread_alloc;
+	__emutls_v.per_lcore__lcore_id;
 };