DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/5] build mempool on Windows
@ 2020-05-31 12:41 Fady Bader
  2020-05-31 12:41 ` [dpdk-dev] [PATCH 1/5] mempool: disable tracing for Windows Fady Bader
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Fady Bader @ 2020-05-31 12:41 UTC (permalink / raw)
  To: dev
  Cc: thomas, tbashar, talshn, yohadt, dmitry.kozliuk, olivier.matz,
	arybchenko, mdr, nhorman

Added changes in order to build mempool lib on windows.

Depends-on: patch-70497 ("ring: build on Windows")

Fady Bader (5):
  mempool: disable tracing for Windows
  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_version.map               |  1 +
 lib/librte_mempool/mempool_trace_points.c        |  4 +++
 lib/librte_mempool/rte_mempool.c                 | 41 +++++++++++++++++-------
 lib/librte_mempool/rte_mempool.h                 | 22 +++++++++++++
 lib/librte_mempool/rte_mempool_ops.c             |  8 +++++
 lib/librte_mempool/rte_mempool_trace_fp.h        |  3 ++
 lib/meson.build                                  |  3 +-
 8 files changed, 74 insertions(+), 12 deletions(-)

-- 
2.16.1.windows.4


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

* [dpdk-dev] [PATCH 1/5] mempool: disable tracing for Windows
  2020-05-31 12:41 [dpdk-dev] [PATCH 0/5] build mempool on Windows Fady Bader
@ 2020-05-31 12:41 ` Fady Bader
  2020-05-31 13:02   ` Andrew Rybchenko
  2020-05-31 13:49   ` Jerin Jacob
  2020-05-31 12:41 ` [dpdk-dev] [PATCH 2/5] eal: disable function versioning on Windows Fady Bader
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 10+ messages in thread
From: Fady Bader @ 2020-05-31 12:41 UTC (permalink / raw)
  To: dev
  Cc: thomas, tbashar, talshn, yohadt, dmitry.kozliuk, olivier.matz,
	arybchenko, mdr, nhorman

Tracing is not supported for Windows.
Disabled all trace calls in for Windows.

Signed-off-by: Fady Bader <fady@mellanox.com>
---
 lib/librte_mempool/mempool_trace_points.c |  4 ++++
 lib/librte_mempool/rte_mempool.c          | 20 ++++++++++++++++++++
 lib/librte_mempool/rte_mempool.h          | 22 ++++++++++++++++++++++
 lib/librte_mempool/rte_mempool_ops.c      |  8 ++++++++
 lib/librte_mempool/rte_mempool_trace_fp.h |  3 +++
 5 files changed, 57 insertions(+)

diff --git a/lib/librte_mempool/mempool_trace_points.c b/lib/librte_mempool/mempool_trace_points.c
index df4368b17..51f0d1705 100644
--- a/lib/librte_mempool/mempool_trace_points.c
+++ b/lib/librte_mempool/mempool_trace_points.c
@@ -2,7 +2,9 @@
  * Copyright(C) 2020 Marvell International Ltd.
  */
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 #include <rte_trace_point_register.h>
+#endif
 
 #include "rte_mempool_trace.h"
 
@@ -31,6 +33,7 @@ RTE_TRACE_POINT_DEFINE(rte_mempool_trace_ops_alloc);
 RTE_TRACE_POINT_DEFINE(rte_mempool_trace_ops_free);
 RTE_TRACE_POINT_DEFINE(rte_mempool_trace_set_ops_byname);
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 RTE_INIT(mempool_trace_init)
 {
 	RTE_TRACE_POINT_REGISTER(rte_mempool_trace_ops_dequeue_bulk,
@@ -105,3 +108,4 @@ RTE_INIT(mempool_trace_init)
 	RTE_TRACE_POINT_REGISTER(rte_mempool_trace_set_ops_byname,
 		lib.mempool.set.ops.byname);
 }
+#endif
diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index 0bde995b5..bee082424 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -366,7 +366,9 @@ rte_mempool_populate_iova_v21(struct rte_mempool *mp, char *vaddr,
 	STAILQ_INSERT_TAIL(&mp->mem_list, memhdr, next);
 	mp->nb_mem_chunks++;
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_populate_iova(mp, vaddr, iova, len, free_cb, opaque);
+#endif
 	return i;
 
 fail:
@@ -469,7 +471,9 @@ rte_mempool_populate_virt_v21(struct rte_mempool *mp, char *addr,
 		cnt += ret;
 	}
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_populate_virt(mp, addr, len, pg_sz, free_cb, opaque);
+#endif
 	return cnt;
 
  fail:
@@ -528,7 +532,9 @@ rte_mempool_get_page_size(struct rte_mempool *mp, size_t *pg_sz)
 	else
 		*pg_sz = getpagesize();
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_get_page_size(mp, *pg_sz);
+#endif
 	return 0;
 }
 
@@ -669,7 +675,9 @@ rte_mempool_populate_default(struct rte_mempool *mp)
 		}
 	}
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_populate_default(mp);
+#endif
 	return mp->size;
 
  fail:
@@ -762,7 +770,9 @@ rte_mempool_populate_anon(struct rte_mempool *mp)
 		goto fail;
 	}
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_populate_anon(mp);
+#endif
 	return mp->populated_size;
 
  fail:
@@ -794,7 +804,9 @@ rte_mempool_free(struct rte_mempool *mp)
 	}
 	rte_mcfg_tailq_write_unlock();
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_free(mp);
+#endif
 	rte_mempool_free_memchunks(mp);
 	rte_mempool_ops_free(mp);
 	rte_memzone_free(mp->mz);
@@ -833,7 +845,9 @@ rte_mempool_cache_create(uint32_t size, int socket_id)
 
 	mempool_cache_init(cache, size);
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_cache_create(size, socket_id, cache);
+#endif
 	return cache;
 }
 
@@ -845,7 +859,9 @@ rte_mempool_cache_create(uint32_t size, int socket_id)
 void
 rte_mempool_cache_free(struct rte_mempool_cache *cache)
 {
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_cache_free(cache);
+#endif
 	rte_free(cache);
 }
 
@@ -976,8 +992,10 @@ rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size,
 	rte_mcfg_tailq_write_unlock();
 	rte_mcfg_mempool_write_unlock();
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_create_empty(name, n, elt_size, cache_size,
 		private_data_size, flags, mp);
+#endif
 	return mp;
 
 exit_unlock:
@@ -1030,9 +1048,11 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size,
 	if (obj_init)
 		rte_mempool_obj_iter(mp, obj_init, obj_init_arg);
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_create(name, n, elt_size, cache_size,
 		private_data_size, mp_init, mp_init_arg, obj_init,
 		obj_init_arg, flags, mp);
+#endif
 	return mp;
 
  fail:
diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
index 652d19f9f..2f358a7c3 100644
--- a/lib/librte_mempool/rte_mempool.h
+++ b/lib/librte_mempool/rte_mempool.h
@@ -738,7 +738,9 @@ rte_mempool_ops_dequeue_bulk(struct rte_mempool *mp,
 {
 	struct rte_mempool_ops *ops;
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_ops_dequeue_bulk(mp, obj_table, n);
+#endif
 	ops = rte_mempool_get_ops(mp->ops_index);
 	return ops->dequeue(mp, obj_table, n);
 }
@@ -764,7 +766,10 @@ rte_mempool_ops_dequeue_contig_blocks(struct rte_mempool *mp,
 
 	ops = rte_mempool_get_ops(mp->ops_index);
 	RTE_ASSERT(ops->dequeue_contig_blocks != NULL);
+
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_ops_dequeue_contig_blocks(mp, first_obj_table, n);
+#endif
 	return ops->dequeue_contig_blocks(mp, first_obj_table, n);
 }
 
@@ -787,7 +792,9 @@ rte_mempool_ops_enqueue_bulk(struct rte_mempool *mp, void * const *obj_table,
 {
 	struct rte_mempool_ops *ops;
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_ops_enqueue_bulk(mp, obj_table, n);
+#endif
 	ops = rte_mempool_get_ops(mp->ops_index);
 	return ops->enqueue(mp, obj_table, n);
 }
@@ -1275,8 +1282,10 @@ rte_mempool_default_cache(struct rte_mempool *mp, unsigned lcore_id)
 	if (lcore_id >= RTE_MAX_LCORE)
 		return NULL;
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_default_cache(mp, lcore_id,
 		&mp->local_cache[lcore_id]);
+#endif
 	return &mp->local_cache[lcore_id];
 }
 
@@ -1296,7 +1305,10 @@ rte_mempool_cache_flush(struct rte_mempool_cache *cache,
 		cache = rte_mempool_default_cache(mp, rte_lcore_id());
 	if (cache == NULL || cache->len == 0)
 		return;
+
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_cache_flush(cache, mp);
+#endif
 	rte_mempool_ops_enqueue_bulk(mp, cache->objs, cache->len);
 	cache->len = 0;
 }
@@ -1376,7 +1388,9 @@ static __rte_always_inline void
 rte_mempool_generic_put(struct rte_mempool *mp, void * const *obj_table,
 			unsigned int n, struct rte_mempool_cache *cache)
 {
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_generic_put(mp, obj_table, n, cache);
+#endif
 	__mempool_check_cookies(mp, obj_table, n, 0);
 	__mempool_generic_put(mp, obj_table, n, cache);
 }
@@ -1401,7 +1415,9 @@ rte_mempool_put_bulk(struct rte_mempool *mp, void * const *obj_table,
 {
 	struct rte_mempool_cache *cache;
 	cache = rte_mempool_default_cache(mp, rte_lcore_id());
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_put_bulk(mp, obj_table, n, cache);
+#endif
 	rte_mempool_generic_put(mp, obj_table, n, cache);
 }
 
@@ -1523,7 +1539,9 @@ rte_mempool_generic_get(struct rte_mempool *mp, void **obj_table,
 	ret = __mempool_generic_get(mp, obj_table, n, cache);
 	if (ret == 0)
 		__mempool_check_cookies(mp, obj_table, n, 1);
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_generic_get(mp, obj_table, n, cache);
+#endif
 	return ret;
 }
 
@@ -1554,7 +1572,9 @@ rte_mempool_get_bulk(struct rte_mempool *mp, void **obj_table, unsigned int n)
 {
 	struct rte_mempool_cache *cache;
 	cache = rte_mempool_default_cache(mp, rte_lcore_id());
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_get_bulk(mp, obj_table, n, cache);
+#endif
 	return rte_mempool_generic_get(mp, obj_table, n, cache);
 }
 
@@ -1624,7 +1644,9 @@ rte_mempool_get_contig_blocks(struct rte_mempool *mp,
 		__MEMPOOL_CONTIG_BLOCKS_STAT_ADD(mp, get_fail, n);
 	}
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_get_contig_blocks(mp, first_obj_table, n);
+#endif
 	return ret;
 }
 
diff --git a/lib/librte_mempool/rte_mempool_ops.c b/lib/librte_mempool/rte_mempool_ops.c
index 5e2266778..0cf375470 100644
--- a/lib/librte_mempool/rte_mempool_ops.c
+++ b/lib/librte_mempool/rte_mempool_ops.c
@@ -76,7 +76,9 @@ rte_mempool_ops_alloc(struct rte_mempool *mp)
 {
 	struct rte_mempool_ops *ops;
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_ops_alloc(mp);
+#endif
 	ops = rte_mempool_get_ops(mp->ops_index);
 	return ops->alloc(mp);
 }
@@ -87,7 +89,9 @@ rte_mempool_ops_free(struct rte_mempool *mp)
 {
 	struct rte_mempool_ops *ops;
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_ops_free(mp);
+#endif
 	ops = rte_mempool_get_ops(mp->ops_index);
 	if (ops->free == NULL)
 		return;
@@ -134,8 +138,10 @@ rte_mempool_ops_populate(struct rte_mempool *mp, unsigned int max_objs,
 
 	ops = rte_mempool_get_ops(mp->ops_index);
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_ops_populate(mp, max_objs, vaddr, iova, len, obj_cb,
 		obj_cb_arg);
+#endif
 	if (ops->populate == NULL)
 		return rte_mempool_op_populate_default(mp, max_objs, vaddr,
 						       iova, len, obj_cb,
@@ -184,6 +190,8 @@ rte_mempool_set_ops_byname(struct rte_mempool *mp, const char *name,
 
 	mp->ops_index = i;
 	mp->pool_config = pool_config;
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_set_ops_byname(mp, name, pool_config);
+#endif
 	return 0;
 }
diff --git a/lib/librte_mempool/rte_mempool_trace_fp.h b/lib/librte_mempool/rte_mempool_trace_fp.h
index ed060e887..6d1f51309 100644
--- a/lib/librte_mempool/rte_mempool_trace_fp.h
+++ b/lib/librte_mempool/rte_mempool_trace_fp.h
@@ -5,6 +5,7 @@
 #ifndef _RTE_MEMPOOL_TRACE_FP_H_
 #define _RTE_MEMPOOL_TRACE_FP_H_
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 /**
  * @file
  *
@@ -113,4 +114,6 @@ RTE_TRACE_POINT_FP(
 }
 #endif
 
+#endif
+
 #endif /* _RTE_MEMPOOL_TRACE_FP_H_ */
-- 
2.16.1.windows.4


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

* [dpdk-dev] [PATCH 2/5] eal: disable function versioning on Windows
  2020-05-31 12:41 [dpdk-dev] [PATCH 0/5] build mempool on Windows Fady Bader
  2020-05-31 12:41 ` [dpdk-dev] [PATCH 1/5] mempool: disable tracing for Windows Fady Bader
@ 2020-05-31 12:41 ` Fady Bader
  2020-05-31 12:41 ` [dpdk-dev] [PATCH 3/5] mempool: use generic memory management Fady Bader
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Fady Bader @ 2020-05-31 12:41 UTC (permalink / raw)
  To: dev
  Cc: thomas, tbashar, talshn, yohadt, dmitry.kozliuk, 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 f588f2643..cee06602e 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] 10+ messages in thread

* [dpdk-dev] [PATCH 3/5] mempool: use generic memory management
  2020-05-31 12:41 [dpdk-dev] [PATCH 0/5] build mempool on Windows Fady Bader
  2020-05-31 12:41 ` [dpdk-dev] [PATCH 1/5] mempool: disable tracing for Windows Fady Bader
  2020-05-31 12:41 ` [dpdk-dev] [PATCH 2/5] eal: disable function versioning on Windows Fady Bader
@ 2020-05-31 12:41 ` Fady Bader
  2020-05-31 13:06   ` Andrew Rybchenko
  2020-05-31 12:41 ` [dpdk-dev] [PATCH 4/5] eal: export needed functions for mempool Fady Bader
  2020-05-31 12:41 ` [dpdk-dev] [PATCH 5/5] mempool: mempool build on Windows Fady Bader
  4 siblings, 1 reply; 10+ messages in thread
From: Fady Bader @ 2020-05-31 12:41 UTC (permalink / raw)
  To: dev
  Cc: thomas, tbashar, talshn, yohadt, dmitry.kozliuk, 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 | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index bee082424..598209dc3 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>
@@ -148,7 +147,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_get_page_size() : wa.min;
 }
 
 
@@ -530,7 +529,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_get_page_size();
 
 #ifndef RTE_EXEC_ENV_WINDOWS
 	rte_mempool_trace_get_page_size(mp, *pg_sz);
@@ -694,7 +693,7 @@ get_anon_size(const struct rte_mempool *mp)
 	size_t min_chunk_size;
 	size_t align;
 
-	pg_sz = getpagesize();
+	pg_sz = rte_get_page_size();
 	pg_shift = rte_bsf32(pg_sz);
 	size = rte_mempool_ops_calc_mem_size(mp, mp->size, pg_shift,
 					     &min_chunk_size, &align);
@@ -718,7 +717,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 */
@@ -748,20 +747,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_get_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] 10+ messages in thread

* [dpdk-dev] [PATCH 4/5] eal: export needed functions for mempool
  2020-05-31 12:41 [dpdk-dev] [PATCH 0/5] build mempool on Windows Fady Bader
                   ` (2 preceding siblings ...)
  2020-05-31 12:41 ` [dpdk-dev] [PATCH 3/5] mempool: use generic memory management Fady Bader
@ 2020-05-31 12:41 ` Fady Bader
  2020-05-31 12:41 ` [dpdk-dev] [PATCH 5/5] mempool: mempool build on Windows Fady Bader
  4 siblings, 0 replies; 10+ messages in thread
From: Fady Bader @ 2020-05-31 12:41 UTC (permalink / raw)
  To: dev
  Cc: thomas, tbashar, talshn, yohadt, dmitry.kozliuk, olivier.matz,
	arybchenko, mdr, nhorman

__rte_trace_mem_per_thread_alloc is 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_version.map | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index 8937bdfea..361d4808f 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -393,4 +393,5 @@ EXPERIMENTAL {
 	rte_mem_map;
 	rte_mem_unmap;
 	__emutls_v.per_lcore__rte_errno;
+	__rte_trace_mem_per_thread_alloc;
 };
-- 
2.16.1.windows.4


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

* [dpdk-dev] [PATCH 5/5] mempool: mempool build on Windows
  2020-05-31 12:41 [dpdk-dev] [PATCH 0/5] build mempool on Windows Fady Bader
                   ` (3 preceding siblings ...)
  2020-05-31 12:41 ` [dpdk-dev] [PATCH 4/5] eal: export needed functions for mempool Fady Bader
@ 2020-05-31 12:41 ` Fady Bader
  4 siblings, 0 replies; 10+ messages in thread
From: Fady Bader @ 2020-05-31 12:41 UTC (permalink / raw)
  To: dev
  Cc: thomas, tbashar, talshn, yohadt, dmitry.kozliuk, olivier.matz,
	arybchenko, mdr, nhorman

Mempool didn't compile on Windows.
Needed changes were made to fix this.

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

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


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

* Re: [dpdk-dev] [PATCH 1/5] mempool: disable tracing for Windows
  2020-05-31 12:41 ` [dpdk-dev] [PATCH 1/5] mempool: disable tracing for Windows Fady Bader
@ 2020-05-31 13:02   ` Andrew Rybchenko
  2020-06-01  1:54     ` Dmitry Kozlyuk
  2020-05-31 13:49   ` Jerin Jacob
  1 sibling, 1 reply; 10+ messages in thread
From: Andrew Rybchenko @ 2020-05-31 13:02 UTC (permalink / raw)
  To: Fady Bader, dev
  Cc: thomas, tbashar, talshn, yohadt, dmitry.kozliuk, olivier.matz,
	mdr, nhorman

On 5/31/20 3:41 PM, Fady Bader wrote:
> Tracing is not supported for Windows.
> Disabled all trace calls in for Windows.
> 
> Signed-off-by: Fady Bader <fady@mellanox.com>
> ---
>  lib/librte_mempool/mempool_trace_points.c |  4 ++++
>  lib/librte_mempool/rte_mempool.c          | 20 ++++++++++++++++++++
>  lib/librte_mempool/rte_mempool.h          | 22 ++++++++++++++++++++++
>  lib/librte_mempool/rte_mempool_ops.c      |  8 ++++++++
>  lib/librte_mempool/rte_mempool_trace_fp.h |  3 +++
>  5 files changed, 57 insertions(+)
> 
> diff --git a/lib/librte_mempool/mempool_trace_points.c b/lib/librte_mempool/mempool_trace_points.c
> index df4368b17..51f0d1705 100644
> --- a/lib/librte_mempool/mempool_trace_points.c
> +++ b/lib/librte_mempool/mempool_trace_points.c
> @@ -2,7 +2,9 @@
>   * Copyright(C) 2020 Marvell International Ltd.
>   */
>  
> +#ifndef RTE_EXEC_ENV_WINDOWS
>  #include <rte_trace_point_register.h>
> +#endif

I really dislike the approach. It adds too many conditional
compilation statements which make code harder to read.

You can have dummy implementation of these functions on
Windows to avoid the conditional compilation.

...

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

* Re: [dpdk-dev] [PATCH 3/5] mempool: use generic memory management
  2020-05-31 12:41 ` [dpdk-dev] [PATCH 3/5] mempool: use generic memory management Fady Bader
@ 2020-05-31 13:06   ` Andrew Rybchenko
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Rybchenko @ 2020-05-31 13:06 UTC (permalink / raw)
  To: Fady Bader, dev
  Cc: thomas, tbashar, talshn, yohadt, dmitry.kozliuk, olivier.matz,
	mdr, nhorman

On 5/31/20 3:41 PM, Fady Bader wrote:
> 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>

LGTM, but I've expected rte_eal_ prefix, not just rte_.
Anyway, these functions are added early and it is out-of-scope
of the patch.

Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>


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

* Re: [dpdk-dev] [PATCH 1/5] mempool: disable tracing for Windows
  2020-05-31 12:41 ` [dpdk-dev] [PATCH 1/5] mempool: disable tracing for Windows Fady Bader
  2020-05-31 13:02   ` Andrew Rybchenko
@ 2020-05-31 13:49   ` Jerin Jacob
  1 sibling, 0 replies; 10+ messages in thread
From: Jerin Jacob @ 2020-05-31 13:49 UTC (permalink / raw)
  To: Fady Bader
  Cc: dpdk-dev, Thomas Monjalon, tbashar, Tal Shnaiderman, yohadt,
	Dmitry Kozlyuk, Olivier Matz, Andrew Rybchenko, Ray Kinsella,
	Neil Horman

On Sun, May 31, 2020 at 6:12 PM Fady Bader <fady@mellanox.com> wrote:
>
> Tracing is not supported for Windows.
> Disabled all trace calls in for Windows.

What is the current major issue to enable Trace for windows?.
Trace does not need to rte_malloc support, it can work with malloc as
well incase rte_malloc is not available.
If there is not a major issue in enabling trace for windows, we should
enable trace instead of introducing
conditional compilation stuff.

>
> Signed-off-by: Fady Bader <fady@mellanox.com>
> ---
>  lib/librte_mempool/mempool_trace_points.c |  4 ++++
>  lib/librte_mempool/rte_mempool.c          | 20 ++++++++++++++++++++
>  lib/librte_mempool/rte_mempool.h          | 22 ++++++++++++++++++++++
>  lib/librte_mempool/rte_mempool_ops.c      |  8 ++++++++
>  lib/librte_mempool/rte_mempool_trace_fp.h |  3 +++
>  5 files changed, 57 insertions(+)
>

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

* Re: [dpdk-dev] [PATCH 1/5] mempool: disable tracing for Windows
  2020-05-31 13:02   ` Andrew Rybchenko
@ 2020-06-01  1:54     ` Dmitry Kozlyuk
  0 siblings, 0 replies; 10+ messages in thread
From: Dmitry Kozlyuk @ 2020-06-01  1:54 UTC (permalink / raw)
  To: Andrew Rybchenko
  Cc: Fady Bader, dev, thomas, tbashar, talshn, yohadt, olivier.matz,
	mdr, nhorman

On Sun, 31 May 2020 16:02:21 +0300
Andrew Rybchenko <arybchenko@solarflare.com> wrote:

[snip]
> >  
> > +#ifndef RTE_EXEC_ENV_WINDOWS
> >  #include <rte_trace_point_register.h>
> > +#endif  
> 
> I really dislike the approach. It adds too many conditional
> compilation statements which make code harder to read.
> 
> You can have dummy implementation of these functions on
> Windows to avoid the conditional compilation.

Memory management series, on which this patchset depends, does have such
wrappers: http://patchwork.dpdk.org/patch/70565/.

-- 
Dmitry Kozlyuk

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

end of thread, other threads:[~2020-06-01  1:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-31 12:41 [dpdk-dev] [PATCH 0/5] build mempool on Windows Fady Bader
2020-05-31 12:41 ` [dpdk-dev] [PATCH 1/5] mempool: disable tracing for Windows Fady Bader
2020-05-31 13:02   ` Andrew Rybchenko
2020-06-01  1:54     ` Dmitry Kozlyuk
2020-05-31 13:49   ` Jerin Jacob
2020-05-31 12:41 ` [dpdk-dev] [PATCH 2/5] eal: disable function versioning on Windows Fady Bader
2020-05-31 12:41 ` [dpdk-dev] [PATCH 3/5] mempool: use generic memory management Fady Bader
2020-05-31 13:06   ` Andrew Rybchenko
2020-05-31 12:41 ` [dpdk-dev] [PATCH 4/5] eal: export needed functions for mempool Fady Bader
2020-05-31 12:41 ` [dpdk-dev] [PATCH 5/5] mempool: mempool build on Windows Fady Bader

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git