DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v3 0/4] build mempool on Windows
       [not found] <'20200531124151.16848-2-fady@mellanox.com'>
@ 2020-06-22 11:55 ` Fady Bader
  2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning " Fady Bader
                     ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Fady Bader @ 2020-06-22 11:55 UTC (permalink / raw)
  To: dev
  Cc: thomas, tbashar, talshn, yohadt, dmitry.kozliuk,
	harini.ramakrishnan, ocardona, pallavi.kadam, ranjit.menon,
	olivier.matz, arybchenko, mdr, nhorman

Added changes in order to build mempool lib on windows.

Depends-on: patch-71845 ("eal/windows: ring build on Windows")

v3:
    * Rebased on current master and v5 of "eal/windows: ring build on Windows".

v2:
    * Replace ifndef of tracepoints with symbol export from memory management
      patchset.

Fady Bader (4):
  eal: disable function versioning on Windows
  mempool: use generic memory management
  eal: export needed functions for mempool
  mempool: mempool build on Windows

 lib/librte_eal/include/rte_function_versioning.h |  4 ++++
 lib/librte_eal/rte_eal_exports.def               |  6 ++++++
 lib/librte_eal/rte_eal_version.map               |  1 +
 lib/librte_mempool/rte_mempool.c                 | 23 ++++++++++++-----------
 lib/meson.build                                  |  2 +-
 5 files changed, 24 insertions(+), 12 deletions(-)

-- 
2.16.1.windows.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning on Windows
  2020-06-22 11:55 ` [dpdk-dev] [PATCH v3 0/4] build mempool on Windows Fady Bader
@ 2020-06-22 11:55   ` Fady Bader
  2020-06-29 23:26     ` Thomas Monjalon
  2020-06-30 10:49     ` Kinsella, Ray
  2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 2/4] mempool: use generic memory management Fady Bader
                     ` (2 subsequent siblings)
  3 siblings, 2 replies; 17+ messages in thread
From: Fady Bader @ 2020-06-22 11:55 UTC (permalink / raw)
  To: dev
  Cc: thomas, tbashar, talshn, yohadt, dmitry.kozliuk,
	harini.ramakrishnan, ocardona, pallavi.kadam, ranjit.menon,
	olivier.matz, arybchenko, mdr, nhorman

Function versioning is not needed on Windows, also the function versioning
implementation is not supported by Windows.
Function versioning was disabled on Windows.

Signed-off-by: Fady Bader <fady@mellanox.com>
---
 lib/librte_eal/include/rte_function_versioning.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_eal/include/rte_function_versioning.h b/lib/librte_eal/include/rte_function_versioning.h
index f588f2643b..cee06602e9 100644
--- a/lib/librte_eal/include/rte_function_versioning.h
+++ b/lib/librte_eal/include/rte_function_versioning.h
@@ -11,6 +11,10 @@
 #error Use of function versioning disabled, is "use_function_versioning=true" in meson.build?
 #endif
 
+#ifdef RTE_EXEC_ENV_WINDOWS
+#undef RTE_BUILD_SHARED_LIB
+#endif
+
 #ifdef RTE_BUILD_SHARED_LIB
 
 /*
-- 
2.16.1.windows.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v3 2/4] mempool: use generic memory management
  2020-06-22 11:55 ` [dpdk-dev] [PATCH v3 0/4] build mempool on Windows Fady Bader
  2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning " Fady Bader
@ 2020-06-22 11:55   ` Fady Bader
  2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 3/4] eal: export needed functions for mempool Fady Bader
  2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 4/4] mempool: mempool build on Windows Fady Bader
  3 siblings, 0 replies; 17+ messages in thread
From: Fady Bader @ 2020-06-22 11:55 UTC (permalink / raw)
  To: dev
  Cc: thomas, tbashar, talshn, yohadt, dmitry.kozliuk,
	harini.ramakrishnan, ocardona, pallavi.kadam, ranjit.menon,
	olivier.matz, arybchenko, mdr, nhorman

mempool used Unix memory management calls, which are not supported
on Windows.
Used generic memory management instead.

Signed-off-by: Fady Bader <fady@mellanox.com>
---
 lib/librte_mempool/rte_mempool.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index 0bde995b52..1f346dcb87 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -12,7 +12,6 @@
 #include <inttypes.h>
 #include <errno.h>
 #include <sys/queue.h>
-#include <sys/mman.h>
 
 #include <rte_common.h>
 #include <rte_log.h>
@@ -32,6 +31,8 @@
 #include <rte_spinlock.h>
 #include <rte_tailq.h>
 #include <rte_function_versioning.h>
+#include <rte_eal_paging.h>
+
 
 #include "rte_mempool.h"
 #include "rte_mempool_trace.h"
@@ -148,7 +149,7 @@ get_min_page_size(int socket_id)
 
 	rte_memseg_list_walk(find_min_pagesz, &wa);
 
-	return wa.min == SIZE_MAX ? (size_t) getpagesize() : wa.min;
+	return wa.min == SIZE_MAX ? (size_t) rte_mem_page_size() : wa.min;
 }
 
 
@@ -526,7 +527,7 @@ rte_mempool_get_page_size(struct rte_mempool *mp, size_t *pg_sz)
 	else if (rte_eal_has_hugepages() || alloc_in_ext_mem)
 		*pg_sz = get_min_page_size(mp->socket_id);
 	else
-		*pg_sz = getpagesize();
+		*pg_sz = rte_mem_page_size();
 
 	rte_mempool_trace_get_page_size(mp, *pg_sz);
 	return 0;
@@ -686,7 +687,7 @@ get_anon_size(const struct rte_mempool *mp)
 	size_t min_chunk_size;
 	size_t align;
 
-	pg_sz = getpagesize();
+	pg_sz = rte_mem_page_size();
 	pg_shift = rte_bsf32(pg_sz);
 	size = rte_mempool_ops_calc_mem_size(mp, mp->size, pg_shift,
 					     &min_chunk_size, &align);
@@ -710,7 +711,7 @@ rte_mempool_memchunk_anon_free(struct rte_mempool_memhdr *memhdr,
 	if (size < 0)
 		return;
 
-	munmap(opaque, size);
+	rte_mem_unmap(opaque, size);
 }
 
 /* populate the mempool with an anonymous mapping */
@@ -740,20 +741,20 @@ rte_mempool_populate_anon(struct rte_mempool *mp)
 	}
 
 	/* get chunk of virtually continuous memory */
-	addr = mmap(NULL, size, PROT_READ | PROT_WRITE,
-		MAP_SHARED | MAP_ANONYMOUS, -1, 0);
-	if (addr == MAP_FAILED) {
+	addr = rte_mem_map(NULL, size, RTE_PROT_READ | RTE_PROT_WRITE,
+		RTE_MAP_SHARED | RTE_MAP_ANONYMOUS, -1, 0);
+	if (addr == NULL) {
 		rte_errno = errno;
 		return 0;
 	}
 	/* can't use MMAP_LOCKED, it does not exist on BSD */
-	if (mlock(addr, size) < 0) {
+	if (rte_mem_lock(addr, size) < 0) {
 		rte_errno = errno;
-		munmap(addr, size);
+		rte_mem_unmap(addr, size);
 		return 0;
 	}
 
-	ret = rte_mempool_populate_virt(mp, addr, size, getpagesize(),
+	ret = rte_mempool_populate_virt(mp, addr, size, rte_mem_page_size(),
 		rte_mempool_memchunk_anon_free, addr);
 	if (ret == 0) /* should not happen */
 		ret = -ENOBUFS;
-- 
2.16.1.windows.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v3 3/4] eal: export needed functions for mempool
  2020-06-22 11:55 ` [dpdk-dev] [PATCH v3 0/4] build mempool on Windows Fady Bader
  2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning " Fady Bader
  2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 2/4] mempool: use generic memory management Fady Bader
@ 2020-06-22 11:55   ` Fady Bader
  2020-06-29 23:28     ` Thomas Monjalon
  2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 4/4] mempool: mempool build on Windows Fady Bader
  3 siblings, 1 reply; 17+ messages in thread
From: Fady Bader @ 2020-06-22 11:55 UTC (permalink / raw)
  To: dev
  Cc: thomas, tbashar, talshn, yohadt, dmitry.kozliuk,
	harini.ramakrishnan, ocardona, pallavi.kadam, ranjit.menon,
	olivier.matz, arybchenko, mdr, nhorman

Some eal functions were used by mempool lib but not exported on Windows.
The function was exported.

Signed-off-by: Fady Bader <fady@mellanox.com>
---
 lib/librte_eal/rte_eal_exports.def | 6 ++++++
 lib/librte_eal/rte_eal_version.map | 1 +
 2 files changed, 7 insertions(+)

diff --git a/lib/librte_eal/rte_eal_exports.def b/lib/librte_eal/rte_eal_exports.def
index 897278c1c8..19d33a91f9 100644
--- a/lib/librte_eal/rte_eal_exports.def
+++ b/lib/librte_eal/rte_eal_exports.def
@@ -1,6 +1,11 @@
 EXPORTS
 	__rte_panic
+	__rte_trace_mem_per_thread_alloc
+	__rte_trace_point_emit_field
+	__rte_trace_point_register
 	per_lcore__rte_errno
+	per_lcore_trace_mem
+	per_lcore_trace_point_sz
 	rte_calloc
 	rte_calloc_socket
 	per_lcore__rte_errno
@@ -59,6 +64,7 @@ EXPORTS
 	rte_vfio_container_dma_unmap
 	rte_vlog
 	rte_realloc
+	rte_strscpy
 	rte_zmalloc
 	rte_zmalloc_socket
 
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 196eef5afa..9ad843c754 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -395,4 +395,5 @@ INTERNAL {
 	rte_mem_map;
 	rte_mem_page_size;
 	rte_mem_unmap;
+	__rte_trace_mem_per_thread_alloc;
 };
-- 
2.16.1.windows.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [dpdk-dev] [PATCH v3 4/4] mempool: mempool build on Windows
  2020-06-22 11:55 ` [dpdk-dev] [PATCH v3 0/4] build mempool on Windows Fady Bader
                     ` (2 preceding siblings ...)
  2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 3/4] eal: export needed functions for mempool Fady Bader
@ 2020-06-22 11:55   ` Fady Bader
  3 siblings, 0 replies; 17+ messages in thread
From: Fady Bader @ 2020-06-22 11:55 UTC (permalink / raw)
  To: dev
  Cc: thomas, tbashar, talshn, yohadt, dmitry.kozliuk,
	harini.ramakrishnan, ocardona, pallavi.kadam, ranjit.menon,
	olivier.matz, arybchenko, mdr, nhorman

Added mempool to supported libraries for Windows compilation.

Signed-off-by: Fady Bader <fady@mellanox.com>
---
 lib/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/meson.build b/lib/meson.build
index 9074cb58af..a9a5be0e5e 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -39,7 +39,7 @@ if is_windows
 	libraries = [
 		'kvargs','eal',
 		'ring',
-		'pci',
+		'mempool', 'pci',
 	] # only supported libraries for windows
 endif
 
-- 
2.16.1.windows.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning on Windows
  2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning " Fady Bader
@ 2020-06-29 23:26     ` Thomas Monjalon
  2020-07-02 10:25       ` Fady Bader
  2020-06-30 10:49     ` Kinsella, Ray
  1 sibling, 1 reply; 17+ messages in thread
From: Thomas Monjalon @ 2020-06-29 23:26 UTC (permalink / raw)
  To: Fady Bader
  Cc: dev, tbashar, talshn, yohadt, dmitry.kozliuk,
	harini.ramakrishnan, ocardona, pallavi.kadam, ranjit.menon,
	olivier.matz, arybchenko, mdr, nhorman

22/06/2020 13:55, Fady Bader:
> Function versioning is not needed on Windows, also the function versioning
> implementation is not supported by Windows.

I think it was said that "not needed" is not right.
Let's just say that it is not supported for now.

> Function versioning was disabled on Windows.
> 
> Signed-off-by: Fady Bader <fady@mellanox.com>
> ---
> --- a/lib/librte_eal/include/rte_function_versioning.h
> +++ b/lib/librte_eal/include/rte_function_versioning.h
> +#ifdef RTE_EXEC_ENV_WINDOWS
> +#undef RTE_BUILD_SHARED_LIB
> +#endif

This trick is a bit weird but works.
A comment is missing to explain that function versioning is disabled
but shared libraries are allowed for Windows.




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v3 3/4] eal: export needed functions for mempool
  2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 3/4] eal: export needed functions for mempool Fady Bader
@ 2020-06-29 23:28     ` Thomas Monjalon
  2020-07-02 10:24       ` Fady Bader
  0 siblings, 1 reply; 17+ messages in thread
From: Thomas Monjalon @ 2020-06-29 23:28 UTC (permalink / raw)
  To: Fady Bader
  Cc: dev, tbashar, talshn, yohadt, dmitry.kozliuk,
	harini.ramakrishnan, ocardona, pallavi.kadam, ranjit.menon,
	olivier.matz, arybchenko, mdr, nhorman

22/06/2020 13:55, Fady Bader:
> Some eal functions were used by mempool lib but not exported on Windows.
> The function was exported.

Do not use past for facts which are still true after the patch.

This patch could be merged with next one enabling the compilation.




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning on Windows
  2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning " Fady Bader
  2020-06-29 23:26     ` Thomas Monjalon
@ 2020-06-30 10:49     ` Kinsella, Ray
  2020-07-02 14:56       ` Kinsella, Ray
  1 sibling, 1 reply; 17+ messages in thread
From: Kinsella, Ray @ 2020-06-30 10:49 UTC (permalink / raw)
  To: Fady Bader, dev
  Cc: thomas, tbashar, talshn, yohadt, dmitry.kozliuk,
	harini.ramakrishnan, ocardona, pallavi.kadam, ranjit.menon,
	olivier.matz, arybchenko, nhorman



On 22/06/2020 12:55, Fady Bader wrote:
> Function versioning is not needed on Windows, also the function versioning
> implementation is not supported by Windows.
> Function versioning was disabled on Windows.
> 
> Signed-off-by: Fady Bader <fady@mellanox.com>
> ---
>  lib/librte_eal/include/rte_function_versioning.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/librte_eal/include/rte_function_versioning.h b/lib/librte_eal/include/rte_function_versioning.h
> index f588f2643b..cee06602e9 100644
> --- a/lib/librte_eal/include/rte_function_versioning.h
> +++ b/lib/librte_eal/include/rte_function_versioning.h
> @@ -11,6 +11,10 @@
>  #error Use of function versioning disabled, is "use_function_versioning=true" in meson.build?
Do we need a meson error/rule that catches if people explicitly try to enable function_versioning. 
We don't want to just silently fail under such circumstances? 

Would something in lib/meson.build would work better?

if use_function_versioning and target_machine.system == "Windows"
	// complain loudly ... 	
endif 

>  #endif
>  
> +#ifdef RTE_EXEC_ENV_WINDOWS
> +#undef RTE_BUILD_SHARED_LIB
> +#endif
> +
>  #ifdef RTE_BUILD_SHARED_LIB
>  
>  /*
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v3 3/4] eal: export needed functions for mempool
  2020-06-29 23:28     ` Thomas Monjalon
@ 2020-07-02 10:24       ` Fady Bader
  0 siblings, 0 replies; 17+ messages in thread
From: Fady Bader @ 2020-07-02 10:24 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, Tasnim Bashar, Tal Shnaiderman, Yohad Tor, dmitry.kozliuk,
	harini.ramakrishnan, ocardona, pallavi.kadam, ranjit.menon,
	olivier.matz, arybchenko, mdr, nhorman

Ok, I'll send a new version today.

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Tuesday, June 30, 2020 2:29 AM
> To: Fady Bader <fady@mellanox.com>
> Cc: dev@dpdk.org; Tasnim Bashar <tbashar@mellanox.com>; Tal Shnaiderman
> <talshn@mellanox.com>; Yohad Tor <yohadt@mellanox.com>;
> dmitry.kozliuk@gmail.com; harini.ramakrishnan@microsoft.com;
> ocardona@microsoft.com; pallavi.kadam@intel.com; ranjit.menon@intel.com;
> olivier.matz@6wind.com; arybchenko@solarflare.com; mdr@ashroe.eu;
> nhorman@tuxdriver.com
> Subject: Re: [dpdk-dev] [PATCH v3 3/4] eal: export needed functions for
> mempool
> 
> 22/06/2020 13:55, Fady Bader:
> > Some eal functions were used by mempool lib but not exported on Windows.
> > The function was exported.
> 
> Do not use past for facts which are still true after the patch.
> 
> This patch could be merged with next one enabling the compilation.
> 
> 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning on Windows
  2020-06-29 23:26     ` Thomas Monjalon
@ 2020-07-02 10:25       ` Fady Bader
  0 siblings, 0 replies; 17+ messages in thread
From: Fady Bader @ 2020-07-02 10:25 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, Tasnim Bashar, Tal Shnaiderman, Yohad Tor, dmitry.kozliuk,
	harini.ramakrishnan, ocardona, pallavi.kadam, ranjit.menon,
	olivier.matz, arybchenko, mdr, nhorman



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Tuesday, June 30, 2020 2:26 AM
> To: Fady Bader <fady@mellanox.com>
> Cc: dev@dpdk.org; Tasnim Bashar <tbashar@mellanox.com>; Tal Shnaiderman
> <talshn@mellanox.com>; Yohad Tor <yohadt@mellanox.com>;
> dmitry.kozliuk@gmail.com; harini.ramakrishnan@microsoft.com;
> ocardona@microsoft.com; pallavi.kadam@intel.com; ranjit.menon@intel.com;
> olivier.matz@6wind.com; arybchenko@solarflare.com; mdr@ashroe.eu;
> nhorman@tuxdriver.com
> Subject: Re: [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning on
> Windows
> 
> 22/06/2020 13:55, Fady Bader:
> > Function versioning is not needed on Windows, also the function
> > versioning implementation is not supported by Windows.
> 
> I think it was said that "not needed" is not right.
> Let's just say that it is not supported for now.

Ok, I'll change.

> 
> > Function versioning was disabled on Windows.
> >
> > Signed-off-by: Fady Bader <fady@mellanox.com>
> > ---
> > --- a/lib/librte_eal/include/rte_function_versioning.h
> > +++ b/lib/librte_eal/include/rte_function_versioning.h
> > +#ifdef RTE_EXEC_ENV_WINDOWS
> > +#undef RTE_BUILD_SHARED_LIB
> > +#endif
> 
> This trick is a bit weird but works.
> A comment is missing to explain that function versioning is disabled but shared
> libraries are allowed for Windows.

Sure, I'll add a comment to explain.

> 
> 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning on Windows
  2020-06-30 10:49     ` Kinsella, Ray
@ 2020-07-02 14:56       ` Kinsella, Ray
  2020-07-05  7:00         ` Fady Bader
  0 siblings, 1 reply; 17+ messages in thread
From: Kinsella, Ray @ 2020-07-02 14:56 UTC (permalink / raw)
  To: Fady Bader, dev
  Cc: thomas, tbashar, talshn, yohadt, dmitry.kozliuk,
	harini.ramakrishnan, ocardona, pallavi.kadam, ranjit.menon,
	olivier.matz, arybchenko, nhorman

Fady,

Any comments on the below?

Ray K

On 30/06/2020 11:49, Kinsella, Ray wrote:
> 
> 
> On 22/06/2020 12:55, Fady Bader wrote:
>> Function versioning is not needed on Windows, also the function versioning
>> implementation is not supported by Windows.
>> Function versioning was disabled on Windows.
>>
>> Signed-off-by: Fady Bader <fady@mellanox.com>
>> ---
>>  lib/librte_eal/include/rte_function_versioning.h | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/lib/librte_eal/include/rte_function_versioning.h b/lib/librte_eal/include/rte_function_versioning.h
>> index f588f2643b..cee06602e9 100644
>> --- a/lib/librte_eal/include/rte_function_versioning.h
>> +++ b/lib/librte_eal/include/rte_function_versioning.h
>> @@ -11,6 +11,10 @@
>>  #error Use of function versioning disabled, is "use_function_versioning=true" in meson.build?
> Do we need a meson error/rule that catches if people explicitly try to enable function_versioning. 
> We don't want to just silently fail under such circumstances? 
> 
> Would something in lib/meson.build would work better?
> 
> if use_function_versioning and target_machine.system == "Windows"
> 	// complain loudly ... 	
> endif 
> 
>>  #endif
>>  
>> +#ifdef RTE_EXEC_ENV_WINDOWS
>> +#undef RTE_BUILD_SHARED_LIB
>> +#endif
>> +
>>  #ifdef RTE_BUILD_SHARED_LIB
>>  
>>  /*
>>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning on Windows
  2020-07-02 14:56       ` Kinsella, Ray
@ 2020-07-05  7:00         ` Fady Bader
  2020-07-05  8:37           ` Thomas Monjalon
  0 siblings, 1 reply; 17+ messages in thread
From: Fady Bader @ 2020-07-05  7:00 UTC (permalink / raw)
  To: Kinsella, Ray, dev
  Cc: Thomas Monjalon, Tasnim Bashar, Tal Shnaiderman, Yohad Tor,
	dmitry.kozliuk, harini.ramakrishnan, ocardona, pallavi.kadam,
	ranjit.menon, olivier.matz, arybchenko, nhorman



> -----Original Message-----
> From: Kinsella, Ray <mdr@ashroe.eu>
> Sent: Thursday, July 2, 2020 5:57 PM
> To: Fady Bader <fady@mellanox.com>; dev@dpdk.org
> Cc: Thomas Monjalon <thomas@monjalon.net>; Tasnim Bashar
> <tbashar@mellanox.com>; Tal Shnaiderman <talshn@mellanox.com>; Yohad Tor
> <yohadt@mellanox.com>; dmitry.kozliuk@gmail.com;
> harini.ramakrishnan@microsoft.com; ocardona@microsoft.com;
> pallavi.kadam@intel.com; ranjit.menon@intel.com; olivier.matz@6wind.com;
> arybchenko@solarflare.com; nhorman@tuxdriver.com
> Subject: Re: [PATCH v3 1/4] eal: disable function versioning on Windows
> 
> Fady,
> 
> Any comments on the below?
> 
> Ray K
> 
> On 30/06/2020 11:49, Kinsella, Ray wrote:
> >
> >
> > On 22/06/2020 12:55, Fady Bader wrote:
> >> Function versioning is not needed on Windows, also the function
> >> versioning implementation is not supported by Windows.
> >> Function versioning was disabled on Windows.
> >>
> >> Signed-off-by: Fady Bader <fady@mellanox.com>
> >> ---
> >>  lib/librte_eal/include/rte_function_versioning.h | 4 ++++
> >>  1 file changed, 4 insertions(+)
> >>
> >> diff --git a/lib/librte_eal/include/rte_function_versioning.h
> >> b/lib/librte_eal/include/rte_function_versioning.h
> >> index f588f2643b..cee06602e9 100644
> >> --- a/lib/librte_eal/include/rte_function_versioning.h
> >> +++ b/lib/librte_eal/include/rte_function_versioning.h
> >> @@ -11,6 +11,10 @@
> >>  #error Use of function versioning disabled, is "use_function_versioning=true"
> in meson.build?
> > Do we need a meson error/rule that catches if people explicitly try to enable
> function_versioning.
> > We don't want to just silently fail under such circumstances?
> >
> > Would something in lib/meson.build would work better?
> >
> > if use_function_versioning and target_machine.system == "Windows"
> > 	// complain loudly ...
> > endif
> >

I think this would be a better approach. 
But instead of checking if the use of function versioning is enabled under Windows
and then complain, I think we should simply disable it from Windows in the 
meson.build file. Something like this:

if target_machine.system == "Windows"
	use_function_versioning = false
endif

> >>  #endif
> >>
> >> +#ifdef RTE_EXEC_ENV_WINDOWS
> >> +#undef RTE_BUILD_SHARED_LIB
> >> +#endif
> >> +
> >>  #ifdef RTE_BUILD_SHARED_LIB
> >>
> >>  /*
> >>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning on Windows
  2020-07-05  7:00         ` Fady Bader
@ 2020-07-05  8:37           ` Thomas Monjalon
  2020-07-05  8:51             ` Fady Bader
  0 siblings, 1 reply; 17+ messages in thread
From: Thomas Monjalon @ 2020-07-05  8:37 UTC (permalink / raw)
  To: Kinsella, Ray, Fady Bader
  Cc: dev, Tasnim Bashar, Tal Shnaiderman, Yohad Tor, dmitry.kozliuk,
	harini.ramakrishnan, ocardona, pallavi.kadam, ranjit.menon,
	olivier.matz, arybchenko, nhorman

05/07/2020 09:00, Fady Bader:
> > On 30/06/2020 11:49, Kinsella, Ray wrote:
> > > On 22/06/2020 12:55, Fady Bader wrote:
> > >> --- a/lib/librte_eal/include/rte_function_versioning.h
> > >> +++ b/lib/librte_eal/include/rte_function_versioning.h
> > >> @@ -11,6 +11,10 @@
> > >>  #error Use of function versioning disabled, is "use_function_versioning=true"
> > in meson.build?
> > > Do we need a meson error/rule that catches if people explicitly try to enable
> > function_versioning.
> > > We don't want to just silently fail under such circumstances?
> > >
> > > Would something in lib/meson.build would work better?
> > >
> > > if use_function_versioning and target_machine.system == "Windows"
> > > 	// complain loudly ...
> > > endif
> > >
> 
> I think this would be a better approach. 
> But instead of checking if the use of function versioning is enabled under Windows
> and then complain, I think we should simply disable it from Windows in the 
> meson.build file. Something like this:
> 
> if target_machine.system == "Windows"
> 	use_function_versioning = false
> endif

Did you try?

If you disable function versioning, compilation will fail
with the #error message above, right?



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning on Windows
  2020-07-05  8:37           ` Thomas Monjalon
@ 2020-07-05  8:51             ` Fady Bader
  2020-07-05  9:00               ` Thomas Monjalon
  0 siblings, 1 reply; 17+ messages in thread
From: Fady Bader @ 2020-07-05  8:51 UTC (permalink / raw)
  To: Thomas Monjalon, Kinsella, Ray
  Cc: dev, Tasnim Bashar, Tal Shnaiderman, Yohad Tor, dmitry.kozliuk,
	harini.ramakrishnan, ocardona, pallavi.kadam, ranjit.menon,
	olivier.matz, arybchenko, nhorman



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Sunday, July 5, 2020 11:38 AM
> To: Kinsella, Ray <mdr@ashroe.eu>; Fady Bader <fady@mellanox.com>
> Cc: dev@dpdk.org; Tasnim Bashar <tbashar@mellanox.com>; Tal Shnaiderman
> <talshn@mellanox.com>; Yohad Tor <yohadt@mellanox.com>;
> dmitry.kozliuk@gmail.com; harini.ramakrishnan@microsoft.com;
> ocardona@microsoft.com; pallavi.kadam@intel.com; ranjit.menon@intel.com;
> olivier.matz@6wind.com; arybchenko@solarflare.com; nhorman@tuxdriver.com
> Subject: Re: [PATCH v3 1/4] eal: disable function versioning on Windows
> 
> 05/07/2020 09:00, Fady Bader:
> > > On 30/06/2020 11:49, Kinsella, Ray wrote:
> > > > On 22/06/2020 12:55, Fady Bader wrote:
> > > >> --- a/lib/librte_eal/include/rte_function_versioning.h
> > > >> +++ b/lib/librte_eal/include/rte_function_versioning.h
> > > >> @@ -11,6 +11,10 @@
> > > >>  #error Use of function versioning disabled, is
> "use_function_versioning=true"
> > > in meson.build?
> > > > Do we need a meson error/rule that catches if people explicitly
> > > > try to enable
> > > function_versioning.
> > > > We don't want to just silently fail under such circumstances?
> > > >
> > > > Would something in lib/meson.build would work better?
> > > >
> > > > if use_function_versioning and target_machine.system == "Windows"
> > > > 	// complain loudly ...
> > > > endif
> > > >
> >
> > I think this would be a better approach.
> > But instead of checking if the use of function versioning is enabled
> > under Windows and then complain, I think we should simply disable it
> > from Windows in the meson.build file. Something like this:
> >
> > if target_machine.system == "Windows"
> > 	use_function_versioning = false
> > endif
> 
> Did you try?
> 
> If you disable function versioning, compilation will fail with the #error message
> above, right?
>

Yes, the compilation fails, we can also change the rte_function_versioning.h
code in order not to fail under Windows.
What do you think ?
 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning on Windows
  2020-07-05  8:51             ` Fady Bader
@ 2020-07-05  9:00               ` Thomas Monjalon
  2020-07-05 20:00                 ` Thomas Monjalon
  0 siblings, 1 reply; 17+ messages in thread
From: Thomas Monjalon @ 2020-07-05  9:00 UTC (permalink / raw)
  To: Kinsella, Ray, Fady Bader
  Cc: dev, Tasnim Bashar, Tal Shnaiderman, Yohad Tor, dmitry.kozliuk,
	harini.ramakrishnan, ocardona, pallavi.kadam, ranjit.menon,
	olivier.matz, arybchenko, nhorman

05/07/2020 10:51, Fady Bader:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 05/07/2020 09:00, Fady Bader:
> > > > On 30/06/2020 11:49, Kinsella, Ray wrote:
> > > > > On 22/06/2020 12:55, Fady Bader wrote:
> > > > >> --- a/lib/librte_eal/include/rte_function_versioning.h
> > > > >> +++ b/lib/librte_eal/include/rte_function_versioning.h
> > > > >> @@ -11,6 +11,10 @@
> > > > >>  #error Use of function versioning disabled, is
> > "use_function_versioning=true"
> > > > in meson.build?
> > > > > Do we need a meson error/rule that catches if people explicitly
> > > > > try to enable
> > > > function_versioning.
> > > > > We don't want to just silently fail under such circumstances?
> > > > >
> > > > > Would something in lib/meson.build would work better?
> > > > >
> > > > > if use_function_versioning and target_machine.system == "Windows"
> > > > > 	// complain loudly ...
> > > > > endif
> > > > >
> > >
> > > I think this would be a better approach.
> > > But instead of checking if the use of function versioning is enabled
> > > under Windows and then complain, I think we should simply disable it
> > > from Windows in the meson.build file. Something like this:
> > >
> > > if target_machine.system == "Windows"
> > > 	use_function_versioning = false
> > > endif
> > 
> > Did you try?
> > 
> > If you disable function versioning, compilation will fail with the #error message
> > above, right?
> >
> 
> Yes, the compilation fails, we can also change the rte_function_versioning.h
> code in order not to fail under Windows.
> What do you think ?

Function versioning CANNOT be supported currently on Windows.
Function versioning macros are MANDATORY in some libraries.
That's why I think the only path is to have a specific
implementation of the function versioning macros for Windows.



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning on Windows
  2020-07-05  9:00               ` Thomas Monjalon
@ 2020-07-05 20:00                 ` Thomas Monjalon
  2020-07-07  7:57                   ` Kinsella, Ray
  0 siblings, 1 reply; 17+ messages in thread
From: Thomas Monjalon @ 2020-07-05 20:00 UTC (permalink / raw)
  To: Kinsella, Ray, Fady Bader
  Cc: dev, dev, Tasnim Bashar, Tal Shnaiderman, Yohad Tor,
	dmitry.kozliuk, harini.ramakrishnan, ocardona, pallavi.kadam,
	ranjit.menon, olivier.matz, arybchenko, nhorman

05/07/2020 11:00, Thomas Monjalon:
> 05/07/2020 10:51, Fady Bader:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > 05/07/2020 09:00, Fady Bader:
> > > > > On 30/06/2020 11:49, Kinsella, Ray wrote:
> > > > > > On 22/06/2020 12:55, Fady Bader wrote:
> > > > > >> --- a/lib/librte_eal/include/rte_function_versioning.h
> > > > > >> +++ b/lib/librte_eal/include/rte_function_versioning.h
> > > > > >> @@ -11,6 +11,10 @@
> > > > > >>  #error Use of function versioning disabled, is
> > > "use_function_versioning=true"
> > > > > in meson.build?
> > > > > > Do we need a meson error/rule that catches if people explicitly
> > > > > > try to enable
> > > > > function_versioning.
> > > > > > We don't want to just silently fail under such circumstances?
> > > > > >
> > > > > > Would something in lib/meson.build would work better?
> > > > > >
> > > > > > if use_function_versioning and target_machine.system == "Windows"
> > > > > > 	// complain loudly ...
> > > > > > endif
> > > > > >
> > > >
> > > > I think this would be a better approach.
> > > > But instead of checking if the use of function versioning is enabled
> > > > under Windows and then complain, I think we should simply disable it
> > > > from Windows in the meson.build file. Something like this:
> > > >
> > > > if target_machine.system == "Windows"
> > > > 	use_function_versioning = false
> > > > endif
> > > 
> > > Did you try?
> > > 
> > > If you disable function versioning, compilation will fail with the #error message
> > > above, right?
> > >
> > 
> > Yes, the compilation fails, we can also change the rte_function_versioning.h
> > code in order not to fail under Windows.
> > What do you think ?
> 
> Function versioning CANNOT be supported currently on Windows.
> Function versioning macros are MANDATORY in some libraries.
> That's why I think the only path is to have a specific
> implementation of the function versioning macros for Windows.

After a closer look with Fady, the empty macros already exist
for the static case.
If disabling function versioning in shared case, the DLL is built
with the object files compiled for the static library.
Conclusion: disabling function versioning on Windows works
(after disabling the error message).



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning on Windows
  2020-07-05 20:00                 ` Thomas Monjalon
@ 2020-07-07  7:57                   ` Kinsella, Ray
  0 siblings, 0 replies; 17+ messages in thread
From: Kinsella, Ray @ 2020-07-07  7:57 UTC (permalink / raw)
  To: Thomas Monjalon, Fady Bader
  Cc: dev, Tasnim Bashar, Tal Shnaiderman, Yohad Tor, dmitry.kozliuk,
	harini.ramakrishnan, ocardona, pallavi.kadam, ranjit.menon,
	olivier.matz, arybchenko, nhorman



On 05/07/2020 21:00, Thomas Monjalon wrote:
> 05/07/2020 11:00, Thomas Monjalon:
>> 05/07/2020 10:51, Fady Bader:
>>> From: Thomas Monjalon <thomas@monjalon.net>
>>>> 05/07/2020 09:00, Fady Bader:
>>>>>> On 30/06/2020 11:49, Kinsella, Ray wrote:
>>>>>>> On 22/06/2020 12:55, Fady Bader wrote:
>>>>>>>> --- a/lib/librte_eal/include/rte_function_versioning.h
>>>>>>>> +++ b/lib/librte_eal/include/rte_function_versioning.h
>>>>>>>> @@ -11,6 +11,10 @@
>>>>>>>>  #error Use of function versioning disabled, is
>>>> "use_function_versioning=true"
>>>>>> in meson.build?
>>>>>>> Do we need a meson error/rule that catches if people explicitly
>>>>>>> try to enable
>>>>>> function_versioning.
>>>>>>> We don't want to just silently fail under such circumstances?
>>>>>>>
>>>>>>> Would something in lib/meson.build would work better?
>>>>>>>
>>>>>>> if use_function_versioning and target_machine.system == "Windows"
>>>>>>> 	// complain loudly ...
>>>>>>> endif
>>>>>>>
>>>>>
>>>>> I think this would be a better approach.
>>>>> But instead of checking if the use of function versioning is enabled
>>>>> under Windows and then complain, I think we should simply disable it
>>>>> from Windows in the meson.build file. Something like this:
>>>>>
>>>>> if target_machine.system == "Windows"
>>>>> 	use_function_versioning = false
>>>>> endif
>>>>
>>>> Did you try?
>>>>
>>>> If you disable function versioning, compilation will fail with the #error message
>>>> above, right?
>>>>
>>>
>>> Yes, the compilation fails, we can also change the rte_function_versioning.h
>>> code in order not to fail under Windows.
>>> What do you think ?
>>
>> Function versioning CANNOT be supported currently on Windows.
>> Function versioning macros are MANDATORY in some libraries.
>> That's why I think the only path is to have a specific
>> implementation of the function versioning macros for Windows.
> 
> After a closer look with Fady, the empty macros already exist
> for the static case.
> If disabling function versioning in shared case, the DLL is built
> with the object files compiled for the static library.
> Conclusion: disabling function versioning on Windows works
> (after disabling the error message).
> 

perfect, good work.
 

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2020-07-07  7:57 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <'20200531124151.16848-2-fady@mellanox.com'>
2020-06-22 11:55 ` [dpdk-dev] [PATCH v3 0/4] build mempool on Windows Fady Bader
2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 1/4] eal: disable function versioning " Fady Bader
2020-06-29 23:26     ` Thomas Monjalon
2020-07-02 10:25       ` Fady Bader
2020-06-30 10:49     ` Kinsella, Ray
2020-07-02 14:56       ` Kinsella, Ray
2020-07-05  7:00         ` Fady Bader
2020-07-05  8:37           ` Thomas Monjalon
2020-07-05  8:51             ` Fady Bader
2020-07-05  9:00               ` Thomas Monjalon
2020-07-05 20:00                 ` Thomas Monjalon
2020-07-07  7:57                   ` Kinsella, Ray
2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 2/4] mempool: use generic memory management Fady Bader
2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 3/4] eal: export needed functions for mempool Fady Bader
2020-06-29 23:28     ` Thomas Monjalon
2020-07-02 10:24       ` Fady Bader
2020-06-22 11:55   ` [dpdk-dev] [PATCH v3 4/4] mempool: mempool build on Windows Fady Bader

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).