[lng-odp] [PATCHv2] validation: cleaning up Makefile

2015-07-09 Thread Christophe Milard
The validation/Makefile.am is now simply calling the Makefile of
each module and many older things can be cleaned-up from it.

Signed-off-by: Christophe Milard 
---

since v1: rebased.
To be applied once all modules have been converted to be called from
the platform side, i.e. after pull request:
https://lists.linaro.org/pipermail/lng-odp/2015-July/013121.html

 test/validation/Makefile.am | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 1b40d11..56ddd64 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -1,10 +1,3 @@
-AM_CFLAGS += -I$(srcdir)/common
-AM_LDFLAGS += -static
-
-ODP_CU_COMMON=common/odp_cunit_common.c
-
-odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
-
 ODP_MODULES = buffer \
  classification \
  cpumask \
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH] test: pktio_perf: add missing ns to cycle conversion for busy loop

2015-07-09 Thread Nicolas Morey-Chaisemartin
Signed-off-by: Benoît Ganne 
Reviewed-by: Nicolas Morey-Chaisemartin 
---
 test/performance/odp_pktio_perf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/performance/odp_pktio_perf.c 
b/test/performance/odp_pktio_perf.c
index 3a22f9d..f4d9d2d 100644
--- a/test/performance/odp_pktio_perf.c
+++ b/test/performance/odp_pktio_perf.c
@@ -573,7 +573,7 @@ static int setup_txrx_masks(odp_cpumask_t *thd_mask_tx,
  */
 static void busy_loop_ns(uint64_t wait_ns)
 {
-   uint64_t end = odp_time_cycles() + wait_ns;
+   uint64_t end = odp_time_cycles() + odp_time_ns_to_cycles(wait_ns);
while (odp_time_cycles() < end)
;
 }
-- 
2.4.5.3.g4915f6f

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT PATCH v6] queue: handle return value of odp_queue_enq_multi()

2015-07-09 Thread Maxim Uvarov

On 07/08/15 21:01, Zoltan Kiss wrote:

Unsent packet has to be released. If the event type is obvious from the
context, use directly the relevant release functions, otherwise
odp_event(free).
Wider error handling is attempted, but this patch can't fix all the flaws
in the many calling functions of odp_queue_enq()

Signed-off-by: Zoltan Kiss 
---
v5: fix array use in last hunk

v6: handle negative 'ret' in last hunk

  test/performance/odp_pktio_perf.c | 15 ++-
  test/performance/odp_scheduling.c | 10 --
  test/validation/pktio/pktio.c |  5 +
  test/validation/queue/queue.c |  4 
  4 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/test/performance/odp_pktio_perf.c 
b/test/performance/odp_pktio_perf.c
index 52bddc4..6e07c9f 100644
--- a/test/performance/odp_pktio_perf.c
+++ b/test/performance/odp_pktio_perf.c
@@ -270,6 +270,9 @@ static int alloc_packets(odp_event_t *event_tbl, int 
num_pkts)
  static int send_packets(odp_queue_t outq,
odp_event_t *event_tbl, unsigned num_pkts)
  {
+   int ret;
+   unsigned cnt;
+


still not clear why you use cnt if there is 'int i' and you can reuse it.

if (num_pkts == 0)
return 0;
else if (num_pkts == 1) {
@@ -281,7 +284,17 @@ static int send_packets(odp_queue_t outq,
}
}
  
-	return odp_queue_enq_multi(outq, event_tbl, num_pkts);

+   ret = odp_queue_enq_multi(outq, event_tbl, num_pkts);
+   if (ret == (signed)num_pkts)
+   return ret;
+
+   if (ret < 0)
+   ret = 0;
+   cnt = ret;
+   do
+   odp_event_free(event_tbl[cnt]);
+   while (++cnt < num_pkts);

with for() 4 lines above will be 2 lines.

+   return ret;
  }
  
  /*

diff --git a/test/performance/odp_scheduling.c 
b/test/performance/odp_scheduling.c
index 1283986..8b46eb2 100644
--- a/test/performance/odp_scheduling.c
+++ b/test/performance/odp_scheduling.c
@@ -535,9 +535,15 @@ static int test_schedule_multi(const char *str, int thr,
}
  
  		/* Assume we can enqueue all events */

-   if (odp_queue_enq_multi(queue, ev, MULTI_BUFS_MAX) !=
-   MULTI_BUFS_MAX) {
+   j = odp_queue_enq_multi(queue, ev, MULTI_BUFS_MAX);
+   if (j != MULTI_BUFS_MAX) {
LOG_ERR("  [%i] Queue enqueue failed.\n", thr);
+   if (j < 0)
+   j = 0;
+   do
+   odp_event_free(ev[j]);
+   while (++j < MULTI_BUFS_MAX);
+
return -1;
}
}
diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
index 9d5af22..ac12759 100644
--- a/test/validation/pktio/pktio.c
+++ b/test/validation/pktio/pktio.c
@@ -389,6 +389,11 @@ static void pktio_txrx_multi(pktio_info_t *pktio_a, 
pktio_info_t *pktio_b,
ret = odp_queue_enq_multi(pktio_a->outq, tx_ev, num_pkts);
if (ret != num_pkts) {
CU_FAIL("failed to enqueue test packets");
+   if (ret < 0)
+   ret = 0;
+   do
+   odp_packet_free(tx_pkt[ret]);
+   while (++ret < num_pkts);
return;
}
}
diff --git a/test/validation/queue/queue.c b/test/validation/queue/queue.c
index 5f05e49..d598dbf 100644
--- a/test/validation/queue/queue.c
+++ b/test/validation/queue/queue.c
@@ -91,6 +91,10 @@ static void queue_test_sunnydays(void)
 */
ret = odp_queue_enq_multi(queue_id, enev, MAX_BUFFER_QUEUE);
CU_ASSERT(MAX_BUFFER_QUEUE == ret);
+   i = ret < 0 ? 0 : ret;
+   for ( ; i < MAX_BUFFER_QUEUE; i++)
+   odp_event_free(enev[i]);
+
pev_tmp = deev;
do {
deq_ret  = odp_queue_deq_multi(queue_id, pev_tmp,


___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 0/3] validation: cleaning up in cunit_common

2015-07-09 Thread Christophe Milard
A few things that were needed when old-style modules (called directely
from the validation side) and new-style modules (lib and platform calls)
were both in use can now be cleaned up.
To be applied once all modules have been converted to be called from
the platform side, i.e. after pull request:
https://lists.linaro.org/pipermail/lng-odp/2015-July/013121.html

Christophe Milard (3):
  validation: remove WEAK def of global_test_init
  validation: removed main function from cunit_common
  validation: removal of odp_testsuites

 test/validation/common/Makefile.am|  8 ++--
 test/validation/common/odp_cunit_common.c | 16 
 test/validation/common/odp_cunit_common.h | 13 +
 test/validation/crypto/crypto.c   |  6 --
 test/validation/synchronizers/synchronizers.c |  3 ++-
 5 files changed, 13 insertions(+), 33 deletions(-)

-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 1/3] validation: remove WEAK def of global_test_init

2015-07-09 Thread Christophe Milard
Removal of the weak definitions of global_test_init and global_test_term.
This removes the last shared symbols between tests and therefore gives
the possibility to create a test "superlib" containing all tests of
all modules, if so wished.
Also, it forces the definition of these functions into each lib using
them.
Test executable init and term function are called:
_init[_*] and _term[_*]
Where the possible suffix (_*) identifies the test executable, if needed.
These functions are part of their module test library (lib.a)
and they are registered using:
odp_cunit_register_global_init(), and odp_cunit_register_global_term();

Signed-off-by: Christophe Milard 
---
 test/validation/common/odp_cunit_common.c | 8 
 test/validation/common/odp_cunit_common.h | 6 +-
 test/validation/crypto/crypto.c   | 6 --
 test/validation/synchronizers/synchronizers.c | 3 ++-
 4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/test/validation/common/odp_cunit_common.c 
b/test/validation/common/odp_cunit_common.c
index 67938f2..56493ac 100644
--- a/test/validation/common/odp_cunit_common.c
+++ b/test/validation/common/odp_cunit_common.c
@@ -15,6 +15,8 @@ static odph_linux_pthread_t thread_tbl[MAX_WORKERS];
  * global init/term functions which may be registered
  * defaults to functions performing odp init/term.
  */
+static int tests_global_init(void);
+static int tests_global_term(void);
 static struct {
int (*global_init_ptr)(void);
int (*global_term_ptr)(void);
@@ -42,7 +44,7 @@ int odp_cunit_thread_exit(pthrd_arg *arg)
return 0;
 }
 
-ODP_WEAK_SYMBOL int tests_global_init(void)
+static int tests_global_init(void)
 {
if (0 != odp_init_global(NULL, NULL)) {
fprintf(stderr, "error: odp_init_global() failed.\n");
@@ -56,7 +58,7 @@ ODP_WEAK_SYMBOL int tests_global_init(void)
return 0;
 }
 
-ODP_WEAK_SYMBOL int tests_global_term(void)
+static int tests_global_term(void)
 {
if (0 != odp_term_local()) {
fprintf(stderr, "error: odp_term_local() failed.\n");
@@ -76,8 +78,6 @@ ODP_WEAK_SYMBOL int tests_global_term(void)
  * If some of these functions are not registered, the defaults functions
  * (tests_global_init() and tests_global_term()) defined above are used.
  * One should use these register functions when defining these hooks.
- * (overloading the weak symbol above is obsolete and will be removed in
- * the future).
  * Note that passing NULL as function pointer is valid and will simply
  * prevent the default (odp init/term) to be done.
  */
diff --git a/test/validation/common/odp_cunit_common.h 
b/test/validation/common/odp_cunit_common.h
index bfb4cbf..92a22a9 100644
--- a/test/validation/common/odp_cunit_common.h
+++ b/test/validation/common/odp_cunit_common.h
@@ -50,16 +50,12 @@ extern int odp_cunit_thread_exit(pthrd_arg *);
  * Initialize global resources needed by the test executable. Default
  * definition does ODP init / term (both global and local).
  * Test executables can override it by calling one of the register function
- * below (or by defining a strong version, but this is deprecated).
+ * below.
  * The functions are called at the very beginning and very end of the test
  * execution. Passing NULL to odp_cunit_register_global_init() and/or
  * odp_cunit_register_global_term() is legal and will simply prevent the
  * default (ODP init/term) to be done.
  */
-extern int tests_global_init(void);
-
-extern int tests_global_term(void);
-
 void odp_cunit_register_global_init(int (*func_init_ptr)(void));
 
 void odp_cunit_register_global_term(int (*func_term_ptr)(void));
diff --git a/test/validation/crypto/crypto.c b/test/validation/crypto/crypto.c
index 899fb51..5b06cdc 100644
--- a/test/validation/crypto/crypto.c
+++ b/test/validation/crypto/crypto.c
@@ -23,7 +23,7 @@ static CU_SuiteInfo crypto_suites[] = {
CU_SUITE_INFO_NULL,
 };
 
-int tests_global_init(void)
+static int crypto_init(void)
 {
odp_pool_param_t params;
odp_pool_t pool;
@@ -60,7 +60,7 @@ int tests_global_init(void)
return 0;
 }
 
-int tests_global_term(void)
+static int crypto_term(void)
 {
odp_pool_t pool;
odp_queue_t out_queue;
@@ -96,5 +96,7 @@ int tests_global_term(void)
 
 int crypto_main(void)
 {
+   odp_cunit_register_global_init(crypto_init);
+   odp_cunit_register_global_term(crypto_term);
return odp_cunit_run(crypto_suites);
 }
diff --git a/test/validation/synchronizers/synchronizers.c 
b/test/validation/synchronizers/synchronizers.c
index 61c6026..fb12a05 100644
--- a/test/validation/synchronizers/synchronizers.c
+++ b/test/validation/synchronizers/synchronizers.c
@@ -1052,7 +1052,7 @@ static int synchronizers_suite_init(void)
return 0;
 }
 
-int tests_global_init(void)
+static int synchronizers_init(void)
 {
uint32_t core_count, max_threads;
int ret = 0;
@@ -1210,5 +1210,6 @@ static CU_SuiteInfo synchronizers_suites[] = {
 
 in

[lng-odp] [PATCH 2/3] validation: removed main function from cunit_common

2015-07-09 Thread Christophe Milard
Now that all modules defines their own main(), the dual
library builds for cunit_common (one with main(), the other without)
is no longer needed. It is therefore removed.

Signed-off-by: Christophe Milard 
---
 test/validation/common/Makefile.am| 8 ++--
 test/validation/common/odp_cunit_common.c | 8 
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/test/validation/common/Makefile.am 
b/test/validation/common/Makefile.am
index bd2f214..5548c52 100644
--- a/test/validation/common/Makefile.am
+++ b/test/validation/common/Makefile.am
@@ -1,10 +1,6 @@
 AUTOMAKE_OPTIONS = foreign
 include $(top_srcdir)/test/Makefile.inc
 
-#libcunit_common_as_main.a is meant to be removed when all tests define
-#their own main
-noinst_LIBRARIES = libcunit_common.a libcunit_common_as_main.a
-libcunit_common_a_CFLAGS = $(AM_CFLAGS) -DMODULE_HAS_OWN_MAIN
+noinst_LIBRARIES = libcunit_common.a
+libcunit_common_a_CFLAGS = $(AM_CFLAGS)
 libcunit_common_a_SOURCES = odp_cunit_common.c
-libcunit_common_as_main_a_CFLAGS = $(AM_CFLAGS)
-libcunit_common_as_main_a_SOURCES = odp_cunit_common.c
diff --git a/test/validation/common/odp_cunit_common.c 
b/test/validation/common/odp_cunit_common.c
index 56493ac..f0752c6 100644
--- a/test/validation/common/odp_cunit_common.c
+++ b/test/validation/common/odp_cunit_common.c
@@ -121,11 +121,3 @@ int odp_cunit_run(CU_SuiteInfo testsuites[])
 
return (ret) ? -1 : 0;
 }
-
-/* this is left for old style main declartion. will be removed soon */
-#ifndef MODULE_HAS_OWN_MAIN
-int main(void)
-{
-   return odp_cunit_run(odp_testsuites);
-}
-#endif
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 3/3] validation: removal of odp_testsuites

2015-07-09 Thread Christophe Milard
The obsolete symbol odp_testsuites is no longer used and therefore removed.
Suite arrays are now called _suites[_*], and are part of each
module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/common/odp_cunit_common.h | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/test/validation/common/odp_cunit_common.h 
b/test/validation/common/odp_cunit_common.h
index 92a22a9..98bccfb 100644
--- a/test/validation/common/odp_cunit_common.h
+++ b/test/validation/common/odp_cunit_common.h
@@ -17,13 +17,6 @@
 
 #define MAX_WORKERS 32 /**< Maximum number of work threads */
 
-/**
- * Array of testsuites provided by a test application. Array must be terminated
- * by CU_SUITE_INFO_NULL and must be suitable to be used by
- * CU_register_suites().
- */
-extern CU_SuiteInfo odp_testsuites[];
-
 /* the function, called by module main(), to run the testsuites: */
 int odp_cunit_run(CU_SuiteInfo testsuites[]);
 
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] Pull request: validation last modules from platform side

2015-07-09 Thread Nicolas Morey-Chaisemartin
Few merge conflicts with our branch (none your fault) but all the tests are 
still OK.
I'm good with this on the functional side anyway. I haven't taken the time to 
check all the patches individually.

Nicolas

On 07/08/2015 05:07 PM, Christophe Milard wrote:
> Hi Maxim,
> Hope this is what you need for a proper pull request.
> Let me know if anything is wrong/could be improved in this pull-req.
>
> All these patches have been reviewed by Stuart and do -hopefully-
> not contain any big surprises. just the continuation of the
> "run from platform side" for the last test/validation modules.
> Thanks,
> Christophe.
>
> The following changes since commit 493b618e8ad3184a97910485ad782732ec382979:
>
>   linux-generic: schedule: fix double free (2015-07-03 15:09:24 +0300)
>
> are available in the git repository at:
>
>   https://git.linaro.org/people/christophe.milard/odp.git test_module_timer
>
> for you to fetch changes up to 46fc2ab3225159d2bababe0d7f020009ebbb69f0:
>
>   validation: call to timer_main from platform (2015-07-08 16:18:41 +0200)
>
> 
> Christophe Milard (20):
>   validation: removed errno from odp_ver_abt_log_dbg
>   validation: cosmetic change in odp_errno.c
>   validation: new module errno
>   validation: renaming in odp_errno.c
>   validation: renaming system to time
>   validation: single src for odp_ver_abt_log_dbg
>   validation: mv odp_ver_abt_log_dbg to system
>   validation: own main in odp_system
>   validation: renaming in system.c
>   validation: creating own dir and lib for system
>   validation: call to system_main from platform side
>   validation: own main in odp_shared_memory.c
>   validation: renaming in odp_shared_memory.c
>   validation: creating own dir and lib for shmem
>   validation: call to shmem_main from platform side.
>   validation: own main in odp_timer.c
>   validation: renaming in odp_timer.c
>   validation: cosmetic changes in odp_timer.c
>   validation: creating own dir and lib for timer
>   validation: call to timer_main from platform
>
>  configure.ac   |   6 +-
>  platform/linux-generic/test/Makefile.am|   8 +-
>  test/validation/.gitignore |   3 -
>  test/validation/Makefile.am|  27 ++---
>  test/validation/errno/.gitignore   |   2 +
>  test/validation/errno/Makefile.am  |   8 ++
>  .../{ver_abt_log_dbg/odp_errno.c => errno/errno.c} |  17 +++-
>  test/validation/errno/errno.h  |   7 ++
>  test/validation/errno/errno_main.c |  12 +++
>  test/validation/shmem/.gitignore   |   2 +
>  test/validation/shmem/Makefile.am  |   8 ++
>  .../{odp_shared_memory.c => shmem/shmem.c} |  15 ++-
>  test/validation/shmem/shmem.h  |   7 ++
>  test/validation/shmem/shmem_main.c |  12 +++
>  test/validation/system/.gitignore  |   2 +-
>  test/validation/system/system.c| 112 
> +
>  test/validation/system/system.h|   2 +-
>  test/validation/system/system_main.c   |   2 +-
>  test/validation/time/.gitignore|   2 +
>  test/validation/time/Makefile.am   |   8 ++
>  test/validation/time/time.c|  79 +++
>  test/validation/time/time.h|   7 ++
>  test/validation/time/time_main.c   |  12 +++
>  test/validation/timer/.gitignore   |   2 +
>  test/validation/timer/Makefile.am  |   8 ++
>  test/validation/{odp_timer.c => timer/timer.c} |  63 ++--
>  test/validation/timer/timer.h  |   7 ++
>  test/validation/timer/timer_main.c |  12 +++
>  test/validation/ver_abt_log_dbg/odp_errno.h|   9 --
>  test/validation/ver_abt_log_dbg/odp_system.c   |  94 -
>  test/validation/ver_abt_log_dbg/odp_system.h   |   9 --
>  .../ver_abt_log_dbg/odp_ver_abt_log_dbg.c  |  16 ---
>  32 files changed, 343 insertions(+), 237 deletions(-)
>  create mode 100644 test/validation/errno/.gitignore
>  create mode 100644 test/validation/errno/Makefile.am
>  rename test/validation/{ver_abt_log_dbg/odp_errno.c => errno/errno.c} (55%)
>  create mode 100644 test/validation/errno/errno.h
>  create mode 100644 test/validation/errno/errno_main.c
>  create mode 100644 test/validation/shmem/.gitignore
>  create mode 100644 test/validation/shmem/Makefile.am
>  rename test/validation/{odp_shared_memory.c => shmem/shmem.c} (86%)
>  create mode 100644 test/validation/shmem/shmem.h
>  create mode 100644 test/validation/shmem/shmem_main.c
>  create mode 100644 test/validation/time/.gitignore
>  create mode 100644 test/validation/time/Makefile.am

Re: [lng-odp] [PATCH] linux-generic: types: increase alignment of odp_handle_t to avoid lint issues

2015-07-09 Thread Zoltan Kiss
I'm not sure it's sufficient enough. What happens if you cast the type 
into something which is not 8 byte aligned, but bigger? The example Mike 
saw was in ODP-DPDK CI:


18:50:48 ./include/odp_pool_internal.h:92:9: error: cast from 
'odp_buffer_t' (aka 'struct (anonymous at 
./include/odp/plat/buffer_types.h:29:9) *') to 'odp_buffer_hdr_t *' (aka 
'struct odp_buffer_hdr_t *') increases required alignment from 1 to 64 
[-Werror,-Wcast-align]

18:50:48 return (odp_buffer_hdr_t *)buf;

It wouldn't pass with this either, because odp_buffer_hdr_t is 64 byte 
aligned. You can't really find an universal size, because that could 
force unnecessary alignment restrictions to other types using this macro.

I would still recommend what I wrote in a separate mail chain:

typedef ODP_HANDLE_T(odp_buffer_t, sizeof(odp_buffer_hdr_t));
...
#define odp_handle_t(align) struct { uint8_t unused_dummy_var[align]; } *
/** C/C++ helper macro for strong typing */
#define ODP_HANDLE_T(type, align) odp_handle_t(align) type

That would make this flexible: you can use just 1 if your opaque type is 
never casted to a pointer for a different type, or 
sizeof(that_different_type) if it is.
The only problem I see in case of the above example, that you don't see 
the odp_buffer_hdr_t definition in buffer_types.h


Zoli



On 08/07/15 21:41, Bill Fischofer wrote:

ODP handles are abstract types however because compilers see their
implementation they assume these have alignments that can result in false
lint warnings. Increasing the apparent alignment to uint64_t removes these.
It has no effect on ODP operation or performance.

Signed-off-by: Bill Fischofer 
---
  platform/linux-generic/include/odp/plat/strong_types.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/platform/linux-generic/include/odp/plat/strong_types.h 
b/platform/linux-generic/include/odp/plat/strong_types.h
index a53d763..3eb4556 100644
--- a/platform/linux-generic/include/odp/plat/strong_types.h
+++ b/platform/linux-generic/include/odp/plat/strong_types.h
@@ -17,9 +17,9 @@

  /** Use strong typing for ODP types */
  #ifdef __cplusplus
-#define ODP_HANDLE_T(type) struct _##type { uint8_t unused_dummy_var; } *type
+#define ODP_HANDLE_T(type) struct _##type { uint64_t unused_dummy_var; } *type
  #else
-#define odp_handle_t struct { uint8_t unused_dummy_var; } *
+#define odp_handle_t struct { uint64_t unused_dummy_var; } *
  /** C/C++ helper macro for strong typing */
  #define ODP_HANDLE_T(type) odp_handle_t type
  #endif


___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] Pull request: validation last modules from platform side

2015-07-09 Thread Maxim Uvarov

Patch set merged!

Maxim.

On 07/09/15 12:43, Nicolas Morey-Chaisemartin wrote:

Few merge conflicts with our branch (none your fault) but all the tests are 
still OK.
I'm good with this on the functional side anyway. I haven't taken the time to 
check all the patches individually.

Nicolas

On 07/08/2015 05:07 PM, Christophe Milard wrote:

Hi Maxim,
Hope this is what you need for a proper pull request.
Let me know if anything is wrong/could be improved in this pull-req.

All these patches have been reviewed by Stuart and do -hopefully-
not contain any big surprises. just the continuation of the
"run from platform side" for the last test/validation modules.
Thanks,
Christophe.

The following changes since commit 493b618e8ad3184a97910485ad782732ec382979:

   linux-generic: schedule: fix double free (2015-07-03 15:09:24 +0300)

are available in the git repository at:

   https://git.linaro.org/people/christophe.milard/odp.git test_module_timer

for you to fetch changes up to 46fc2ab3225159d2bababe0d7f020009ebbb69f0:

   validation: call to timer_main from platform (2015-07-08 16:18:41 +0200)


Christophe Milard (20):
   validation: removed errno from odp_ver_abt_log_dbg
   validation: cosmetic change in odp_errno.c
   validation: new module errno
   validation: renaming in odp_errno.c
   validation: renaming system to time
   validation: single src for odp_ver_abt_log_dbg
   validation: mv odp_ver_abt_log_dbg to system
   validation: own main in odp_system
   validation: renaming in system.c
   validation: creating own dir and lib for system
   validation: call to system_main from platform side
   validation: own main in odp_shared_memory.c
   validation: renaming in odp_shared_memory.c
   validation: creating own dir and lib for shmem
   validation: call to shmem_main from platform side.
   validation: own main in odp_timer.c
   validation: renaming in odp_timer.c
   validation: cosmetic changes in odp_timer.c
   validation: creating own dir and lib for timer
   validation: call to timer_main from platform

  configure.ac   |   6 +-
  platform/linux-generic/test/Makefile.am|   8 +-
  test/validation/.gitignore |   3 -
  test/validation/Makefile.am|  27 ++---
  test/validation/errno/.gitignore   |   2 +
  test/validation/errno/Makefile.am  |   8 ++
  .../{ver_abt_log_dbg/odp_errno.c => errno/errno.c} |  17 +++-
  test/validation/errno/errno.h  |   7 ++
  test/validation/errno/errno_main.c |  12 +++
  test/validation/shmem/.gitignore   |   2 +
  test/validation/shmem/Makefile.am  |   8 ++
  .../{odp_shared_memory.c => shmem/shmem.c} |  15 ++-
  test/validation/shmem/shmem.h  |   7 ++
  test/validation/shmem/shmem_main.c |  12 +++
  test/validation/system/.gitignore  |   2 +-
  test/validation/system/system.c| 112 +
  test/validation/system/system.h|   2 +-
  test/validation/system/system_main.c   |   2 +-
  test/validation/time/.gitignore|   2 +
  test/validation/time/Makefile.am   |   8 ++
  test/validation/time/time.c|  79 +++
  test/validation/time/time.h|   7 ++
  test/validation/time/time_main.c   |  12 +++
  test/validation/timer/.gitignore   |   2 +
  test/validation/timer/Makefile.am  |   8 ++
  test/validation/{odp_timer.c => timer/timer.c} |  63 ++--
  test/validation/timer/timer.h  |   7 ++
  test/validation/timer/timer_main.c |  12 +++
  test/validation/ver_abt_log_dbg/odp_errno.h|   9 --
  test/validation/ver_abt_log_dbg/odp_system.c   |  94 -
  test/validation/ver_abt_log_dbg/odp_system.h   |   9 --
  .../ver_abt_log_dbg/odp_ver_abt_log_dbg.c  |  16 ---
  32 files changed, 343 insertions(+), 237 deletions(-)
  create mode 100644 test/validation/errno/.gitignore
  create mode 100644 test/validation/errno/Makefile.am
  rename test/validation/{ver_abt_log_dbg/odp_errno.c => errno/errno.c} (55%)
  create mode 100644 test/validation/errno/errno.h
  create mode 100644 test/validation/errno/errno_main.c
  create mode 100644 test/validation/shmem/.gitignore
  create mode 100644 test/validation/shmem/Makefile.am
  rename test/validation/{odp_shared_memory.c => shmem/shmem.c} (86%)
  create mode 100644 test/validation/shmem/shmem.h
  create mode 100644 test/validation/shmem/shmem_main.c
  create mode 100644 test/validation/time/.gitignore
  create mode 100644 test/validation/time/Makefile.am
  create mode 100644 t

[lng-odp] [API-NEXT PATCH v3 0/8] linux-generic: sysinfo: CPU frequency API clean up

2015-07-09 Thread hongbo.zhang
From: Hongbo Zhang 

v2 -> v3 changes:
- move all CPU related API declaration into cpu.h
- refine tests for per-CPU APIs
- revise API for getting current frequency

v1 -> v2 changes:
- separate original 1/3 patch to two
- add validation patch to test new APIs
- other minor updates upon review comments

v1 notes:
The current API of getting CPU frequency is really ambiguous.
CPU has its max frequency, and if enabled, the current frequency may be
scaled from time to time, what's more, on some AMP platforms, cores are
heterogenous, they have different max and current frequencies.

This patch set cleans up these above issues.
Patch 1/3 makes cpu_hz and model_str to be per-CPU data, then on AMP
system, it is possible to acquire data for each different CPU.
Patch 2/3 makes it clear that the cpu_hz stands for max CPU frequency
Patch 3/3 adds new API to get the current CPU frequency if needed.

Due to lack of test platform, only x86 platform is implemented right now,
the others should follow up if this patch set is accepted.

Hongbo Zhang (8):
  linux-generic: sysinfo: make the model_str per-CPU data
  linux-generic: sysinfo: make the cpu_hz per-CPU data
  linux-generic: sysinfo: move all CPU APIs to cpu.h
  linux-generic: sysinfo: clarify the API for max CPU frequency
  linux-generic: sysinfo: add new API to get model string for each CPU
  linux-generic: sysinfo: add new API to get max frequency for each CPU
  linux-generic: sysinfo: add API to get current CPU frequency
  validation: add test for new per_CPU system APIs

 example/classifier/odp_classifier.c   |   4 +-
 example/generator/odp_generator.c |   2 +-
 example/ipsec/odp_ipsec.c |   2 +-
 example/packet/odp_pktio.c|   2 +-
 example/timer/odp_timer_test.c|   6 +-
 include/odp/api/cpu.h |  58 +++
 include/odp/api/system_info.h |  14 ---
 platform/linux-generic/arch/linux/odp_time.c  |   3 +-
 platform/linux-generic/include/odp_internal.h |   6 +-
 platform/linux-generic/odp_system_info.c  | 137 +++---
 platform/linux-generic/odp_time.c |   5 +-
 test/api_test/odp_common.c|   4 +-
 test/performance/odp_atomic.c |   4 +-
 test/performance/odp_l2fwd.c  |   2 +-
 test/performance/odp_scheduling.c |   4 +-
 test/validation/ver_abt_log_dbg/odp_system.c  |  61 ++--
 16 files changed, 241 insertions(+), 73 deletions(-)

-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [API-NEXT PATCH v3 1/8] linux-generic: sysinfo: make the model_str per-CPU data

2015-07-09 Thread hongbo.zhang
From: Hongbo Zhang 

For AMP system such as ARM big.LITTLE, cores are heterogeneous, and the
model_str for each core may be different too, so this patch changes the
model_str to data array model_str[] to contain data for each different
core, while for the common SMP system, we can simply use the model_str[0]
to contain data for all cores because they are all same, but if like, we
can fill each item in the data array too.

The new API to get each model_str for AMP system will be added later.

Signed-off-by: Hongbo Zhang 
---
 platform/linux-generic/include/odp_internal.h |  4 +++-
 platform/linux-generic/odp_system_info.c  | 29 +--
 2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index 8c5d339..bcf7e63 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -22,13 +22,15 @@ extern "C" {
 
 extern __thread int __odp_errno;
 
+#define MAX_CPU_NUMBER 128
+
 typedef struct {
uint64_t cpu_hz;
uint64_t huge_page_size;
uint64_t page_size;
int  cache_line_size;
int  cpu_count;
-   char model_str[128];
+   char model_str[MAX_CPU_NUMBER][128];
 } odp_system_info_t;
 
 struct odp_global_data_s {
diff --git a/platform/linux-generic/odp_system_info.c 
b/platform/linux-generic/odp_system_info.c
index 31df29e..3add081 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -36,7 +36,6 @@ typedef struct {
 
 #define HUGE_PAGE_DIR "/sys/kernel/mm/hugepages"
 
-
 /*
  * Report the number of CPUs in the affinity mask of the main thread
  */
@@ -139,10 +138,10 @@ static int cpuinfo_x86(FILE *file, odp_system_info_t 
*sysinfo)
if (pos) {
int len;
pos = strchr(str, ':');
-   strncpy(sysinfo->model_str, pos+2,
-   sizeof(sysinfo->model_str));
-   len = strlen(sysinfo->model_str);
-   sysinfo->model_str[len - 1] = 0;
+   strncpy(sysinfo->model_str[0], pos + 2,
+   sizeof(sysinfo->model_str[0]));
+   len = strlen(sysinfo->model_str[0]);
+   sysinfo->model_str[0][len - 1] = 0;
model = 1;
count--;
}
@@ -188,10 +187,10 @@ static int cpuinfo_octeon(FILE *file, odp_system_info_t 
*sysinfo)
if (pos) {
int len;
pos = strchr(str, ':');
-   strncpy(sysinfo->model_str, pos+2,
-   sizeof(sysinfo->model_str));
-   len = strlen(sysinfo->model_str);
-   sysinfo->model_str[len - 1] = 0;
+   strncpy(sysinfo->model_str[0], pos + 2,
+   sizeof(sysinfo->model_str[0]));
+   len = strlen(sysinfo->model_str[0]);
+   sysinfo->model_str[0][len - 1] = 0;
model = 1;
count--;
}
@@ -228,10 +227,10 @@ static int cpuinfo_powerpc(FILE *file, odp_system_info_t 
*sysinfo)
if (pos) {
int len;
pos = strchr(str, ':');
-   strncpy(sysinfo->model_str, pos+2,
-   sizeof(sysinfo->model_str));
-   len = strlen(sysinfo->model_str);
-   sysinfo->model_str[len - 1] = 0;
+   strncpy(sysinfo->model_str[0], pos + 2,
+   sizeof(sysinfo->model_str[0]));
+   len = strlen(sysinfo->model_str[0]);
+   sysinfo->model_str[0][len - 1] = 0;
model = 1;
count--;
}
@@ -333,7 +332,7 @@ static int systemcpu(odp_system_info_t *sysinfo)
sysinfo->cpu_hz  = 14;
sysinfo->cache_line_size = 64;
 
-   strncpy(sysinfo->model_str, "UNKNOWN", sizeof(sysinfo->model_str));
+   strncpy(sysinfo->model_str[0], "UNKNOWN", sizeof(sysinfo->model_str));
 
return 0;
 }
@@ -391,7 +390,7 @@ uint64_t odp_sys_page_size(void)
 
 const char *odp_sys_cpu_model_str(void)
 {
-   return odp_global_data.system_info.model_str;
+   return odp_global_data.system_info.model_str[0];
 }
 
 int odp_sys_cache_line_size(void)
-- 
1.9.1

_

[lng-odp] [API-NEXT PATCH v3 2/8] linux-generic: sysinfo: make the cpu_hz per-CPU data

2015-07-09 Thread hongbo.zhang
From: Hongbo Zhang 

For AMP system such as ARM big.LITTLE, cores are heterogeneous, and cpu_hz
for each core may be different too, so this patch changes the cpu_hz to
data array cpu_hz[] to contain data for each different core, while for the
common SMP system, we can simply use the cpu_hz[0] to contain data for all
cores because they are all same, but if like, we can fill each item in the
data array too.

The new API to get cpu_hz for each core on AMP system will be added later.

Signed-off-by: Hongbo Zhang 
---
 platform/linux-generic/include/odp_internal.h |  2 +-
 platform/linux-generic/odp_system_info.c  | 10 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index bcf7e63..8df8c23 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -25,7 +25,7 @@ extern __thread int __odp_errno;
 #define MAX_CPU_NUMBER 128
 
 typedef struct {
-   uint64_t cpu_hz;
+   uint64_t cpu_hz[MAX_CPU_NUMBER];
uint64_t huge_page_size;
uint64_t page_size;
int  cache_line_size;
diff --git a/platform/linux-generic/odp_system_info.c 
b/platform/linux-generic/odp_system_info.c
index 3add081..ab741eb 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -148,7 +148,7 @@ static int cpuinfo_x86(FILE *file, odp_system_info_t 
*sysinfo)
}
}
 
-   sysinfo->cpu_hz = (uint64_t) (mhz * 100.0);
+   sysinfo->cpu_hz[0] = (uint64_t)(mhz * 100.0);
 
return 0;
 }
@@ -198,7 +198,7 @@ static int cpuinfo_octeon(FILE *file, odp_system_info_t 
*sysinfo)
}
 
/* bogomips seems to be 2x freq */
-   sysinfo->cpu_hz = (uint64_t) (mhz * 100.0 / 2.0);
+   sysinfo->cpu_hz[0] = (uint64_t)(mhz * 100.0 / 2.0);
 
return 0;
 }
@@ -236,7 +236,7 @@ static int cpuinfo_powerpc(FILE *file, odp_system_info_t 
*sysinfo)
}
}
 
-   sysinfo->cpu_hz = (uint64_t) (mhz * 100.0);
+   sysinfo->cpu_hz[0] = (uint64_t)(mhz * 100.0);
}
 
 
@@ -329,7 +329,7 @@ static int systemcpu(odp_system_info_t *sysinfo)
sysinfo->huge_page_size = huge_page_size();
 
/* Dummy values */
-   sysinfo->cpu_hz  = 14;
+   sysinfo->cpu_hz[0]   = 14;
sysinfo->cache_line_size = 64;
 
strncpy(sysinfo->model_str[0], "UNKNOWN", sizeof(sysinfo->model_str));
@@ -375,7 +375,7 @@ int odp_system_info_init(void)
  */
 uint64_t odp_sys_cpu_hz(void)
 {
-   return odp_global_data.system_info.cpu_hz;
+   return odp_global_data.system_info.cpu_hz[0];
 }
 
 uint64_t odp_sys_huge_page_size(void)
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [API-NEXT PATCH v3 5/8] linux-generic: sysinfo: add new API to get model string for each CPU

2015-07-09 Thread hongbo.zhang
From: Hongbo Zhang 

Previous patch makes varible model_str to array model_str[] to contain data
for each CPU on AMP platforms, and then this patch adds new API to get the
corresponding model string for each CPU indexed by CPU ID.

Signed-off-by: Hongbo Zhang 
---
 include/odp/api/cpu.h| 11 +++
 platform/linux-generic/odp_system_info.c | 11 ++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h
index 56efe14..c2efe31 100644
--- a/include/odp/api/cpu.h
+++ b/include/odp/api/cpu.h
@@ -60,6 +60,17 @@ uint64_t odp_cpu_hz_max(void);
 const char *odp_cpu_model_str(void);
 
 /**
+ * CPU model name of a CPU
+ *
+ * Return CPU model name of the specified CPU.
+ *
+ * @param idCPU ID
+ *
+ * @return Pointer to CPU model name string
+ */
+const char *odp_cpu_id_model_str(int id);
+
+/**
  * @}
  */
 
diff --git a/platform/linux-generic/odp_system_info.c 
b/platform/linux-generic/odp_system_info.c
index 225deea..2881695 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -194,6 +194,7 @@ static int cpuinfo_octeon(FILE *file, odp_system_info_t 
*sysinfo)
 
return 0;
 }
+
 #elif defined __powerpc__
 static int cpuinfo_powerpc(FILE *file, odp_system_info_t *sysinfo)
 {
@@ -382,7 +383,15 @@ uint64_t odp_sys_page_size(void)
 
 const char *odp_cpu_model_str(void)
 {
-   return odp_global_data.system_info.model_str[0];
+   return odp_cpu_id_model_str(0);
+}
+
+const char *odp_cpu_id_model_str(int id)
+{
+   if (id >= 0 && id < MAX_CPU_NUMBER)
+   return odp_global_data.system_info.model_str[id];
+   else
+   return NULL;
 }
 
 int odp_sys_cache_line_size(void)
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [API-NEXT PATCH v3 6/8] linux-generic: sysinfo: add new API to get max frequency for each CPU

2015-07-09 Thread hongbo.zhang
From: Hongbo Zhang 

Previous patch makes varible cpu_hz to array cpu_hz[] to contain data for
each CPU on AMP platforms, and then this patch adds new API to get the
corresponding max frequency for each CPU indexed by CPU ID.

Signed-off-by: Hongbo Zhang 
---
 include/odp/api/cpu.h| 11 +++
 platform/linux-generic/odp_system_info.c | 10 +-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h
index c2efe31..3ecef1f 100644
--- a/include/odp/api/cpu.h
+++ b/include/odp/api/cpu.h
@@ -53,6 +53,17 @@ int odp_cpu_count(void);
 uint64_t odp_cpu_hz_max(void);
 
 /**
+ * Maximum CPU frequency of a CPU (in Hz)
+ *
+ * Returns maximum frequency of the specified CPU
+ *
+ * @param idCPU ID
+ *
+ * @return CPU frequency in Hz
+ */
+uint64_t odp_cpu_id_hz_max(int id);
+
+/**
  * CPU model name
  *
  * @return Pointer to CPU model name string
diff --git a/platform/linux-generic/odp_system_info.c 
b/platform/linux-generic/odp_system_info.c
index 2881695..00d009c 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -368,7 +368,15 @@ int odp_system_info_init(void)
  */
 uint64_t odp_cpu_hz_max(void)
 {
-   return odp_global_data.system_info.cpu_hz[0];
+   return odp_cpu_id_hz_max(0);
+}
+
+uint64_t odp_cpu_id_hz_max(int id)
+{
+   if (id >= 0 && id < MAX_CPU_NUMBER)
+   return odp_global_data.system_info.cpu_hz[id];
+   else
+   return -1;
 }
 
 uint64_t odp_sys_huge_page_size(void)
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [API-NEXT PATCH v3 3/8] linux-generic: sysinfo: move all CPU APIs to cpu.h

2015-07-09 Thread hongbo.zhang
From: Hongbo Zhang 

This patch moves all CPU realted APIs to the cpu.h, they are:
odp_sys_cpu_hz() and odp_sys_cpu_model_str(), and accordingly rename
them to odp_cpu_hz() and odp_cpu_model_str(),

All the calling functions are updated too.

New APIs for AMP system will be added into this cpu.h too.

Signed-off-by: Hongbo Zhang 
---
 example/classifier/odp_classifier.c  |  4 ++--
 example/generator/odp_generator.c|  2 +-
 example/ipsec/odp_ipsec.c|  2 +-
 example/packet/odp_pktio.c   |  2 +-
 example/timer/odp_timer_test.c   |  6 +++---
 include/odp/api/cpu.h| 14 ++
 include/odp/api/system_info.h| 14 --
 platform/linux-generic/arch/linux/odp_time.c |  3 ++-
 platform/linux-generic/odp_system_info.c |  4 ++--
 platform/linux-generic/odp_time.c|  5 +++--
 test/api_test/odp_common.c   |  4 ++--
 test/performance/odp_atomic.c|  4 ++--
 test/performance/odp_l2fwd.c |  2 +-
 test/performance/odp_scheduling.c|  4 ++--
 test/validation/ver_abt_log_dbg/odp_system.c | 12 ++--
 15 files changed, 42 insertions(+), 40 deletions(-)

diff --git a/example/classifier/odp_classifier.c 
b/example/classifier/odp_classifier.c
index 643e16c..c695741 100644
--- a/example/classifier/odp_classifier.c
+++ b/example/classifier/odp_classifier.c
@@ -727,8 +727,8 @@ static void print_info(char *progname, appl_args_t 
*appl_args)
"Cache line size: %i\n"
"CPU count:   %i\n"
"\n",
-   odp_version_api_str(), odp_sys_cpu_model_str(),
-   odp_sys_cpu_hz(), odp_sys_cache_line_size(),
+   odp_version_api_str(), odp_cpu_model_str(),
+   odp_cpu_hz(), odp_sys_cache_line_size(),
odp_cpu_count());
 
printf("Running ODP appl: \"%s\"\n"
diff --git a/example/generator/odp_generator.c 
b/example/generator/odp_generator.c
index 0ff264c..8920146 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -978,7 +978,7 @@ static void print_info(char *progname, appl_args_t 
*appl_args)
   "Cache line size: %i\n"
   "CPU count:   %i\n"
   "\n",
-  odp_version_api_str(), odp_sys_cpu_model_str(), odp_sys_cpu_hz(),
+  odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(),
   odp_sys_cache_line_size(), odp_cpu_count());
 
printf("Running ODP appl: \"%s\"\n"
diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
index 4928985..5fcc9dd 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -1517,7 +1517,7 @@ static void print_info(char *progname, appl_args_t 
*appl_args)
   "Cache line size: %i\n"
   "CPU count:   %i\n"
   "\n",
-  odp_version_api_str(), odp_sys_cpu_model_str(), odp_sys_cpu_hz(),
+  odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(),
   odp_sys_cache_line_size(), odp_cpu_count());
 
printf("Running ODP appl: \"%s\"\n"
diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
index 0b4a8f1..d0b6e7c 100644
--- a/example/packet/odp_pktio.c
+++ b/example/packet/odp_pktio.c
@@ -626,7 +626,7 @@ static void print_info(char *progname, appl_args_t 
*appl_args)
   "Cache line size: %i\n"
   "CPU count:   %i\n"
   "\n",
-  odp_version_api_str(), odp_sys_cpu_model_str(), odp_sys_cpu_hz(),
+  odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(),
   odp_sys_cache_line_size(), odp_cpu_count());
 
printf("Running ODP appl: \"%s\"\n"
diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index f4af0e2..01abe04 100644
--- a/example/timer/odp_timer_test.c
+++ b/example/timer/odp_timer_test.c
@@ -364,8 +364,8 @@ int main(int argc, char *argv[])
printf("ODP system info\n");
printf("---\n");
printf("ODP API version: %s\n",odp_version_api_str());
-   printf("CPU model:   %s\n",odp_sys_cpu_model_str());
-   printf("CPU freq (hz):   %"PRIu64"\n", odp_sys_cpu_hz());
+   printf("CPU model:   %s\n",odp_cpu_model_str());
+   printf("CPU freq (hz):   %"PRIu64"\n", odp_cpu_hz());
printf("Cache line size: %i\n",odp_sys_cache_line_size());
printf("Max CPU count:   %i\n",odp_cpu_count());
 
@@ -463,7 +463,7 @@ int main(int argc, char *argv[])
return -1;
}
 
-   printf("CPU freq %"PRIu64" Hz\n", odp_sys_cpu_hz());
+   printf("CPU freq %"PRIu64" Hz\n", odp_cpu_hz());
printf("Cycles vs nanoseconds:\n");
ns = 0;
cycles = odp_time_ns_to_cycles(ns);
diff --git a/incl

[lng-odp] [API-NEXT PATCH v3 4/8] linux-generic: sysinfo: clarify the API for max CPU frequency

2015-07-09 Thread hongbo.zhang
From: Hongbo Zhang 

Currently the API to get CPU frequency is vague, it needs to be clarified
whether max or current frequency is returned, and now most use cases want
to get max capacity of CPU in fact, so this patch makes it clear that the
cpu_hz stand for max CPU frequency. (there is no need to store current
instant frequency)

Accordingly the API odp_cpu_hz() is renamed to odp_cpu_hz_max().

While there may still be some use case of acquiring the current CPU
frequency, so the previous odp_cpu_hz() will be re-implemented for this
purpose in the next patch.

As to platforms other than x86, if their cpu_hz's don't stand for max CPU
frequency, they should be changed following up this patch, and then max or
current frequency of CPU should be clear.

Signed-off-by: Hongbo Zhang 
---
 example/classifier/odp_classifier.c  |  2 +-
 example/generator/odp_generator.c|  2 +-
 example/ipsec/odp_ipsec.c|  2 +-
 example/packet/odp_pktio.c   |  2 +-
 example/timer/odp_timer_test.c   |  4 ++--
 include/odp/api/cpu.h|  6 --
 platform/linux-generic/arch/linux/odp_time.c |  2 +-
 platform/linux-generic/odp_system_info.c | 22 +++---
 platform/linux-generic/odp_time.c|  4 ++--
 test/api_test/odp_common.c   |  2 +-
 test/performance/odp_atomic.c|  2 +-
 test/performance/odp_l2fwd.c |  2 +-
 test/performance/odp_scheduling.c|  2 +-
 test/validation/ver_abt_log_dbg/odp_system.c |  6 +++---
 14 files changed, 27 insertions(+), 33 deletions(-)

diff --git a/example/classifier/odp_classifier.c 
b/example/classifier/odp_classifier.c
index c695741..25670b2 100644
--- a/example/classifier/odp_classifier.c
+++ b/example/classifier/odp_classifier.c
@@ -728,7 +728,7 @@ static void print_info(char *progname, appl_args_t 
*appl_args)
"CPU count:   %i\n"
"\n",
odp_version_api_str(), odp_cpu_model_str(),
-   odp_cpu_hz(), odp_sys_cache_line_size(),
+   odp_cpu_hz_max(), odp_sys_cache_line_size(),
odp_cpu_count());
 
printf("Running ODP appl: \"%s\"\n"
diff --git a/example/generator/odp_generator.c 
b/example/generator/odp_generator.c
index 8920146..d847008 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -978,7 +978,7 @@ static void print_info(char *progname, appl_args_t 
*appl_args)
   "Cache line size: %i\n"
   "CPU count:   %i\n"
   "\n",
-  odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(),
+  odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz_max(),
   odp_sys_cache_line_size(), odp_cpu_count());
 
printf("Running ODP appl: \"%s\"\n"
diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
index 5fcc9dd..58ff99a 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -1517,7 +1517,7 @@ static void print_info(char *progname, appl_args_t 
*appl_args)
   "Cache line size: %i\n"
   "CPU count:   %i\n"
   "\n",
-  odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(),
+  odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz_max(),
   odp_sys_cache_line_size(), odp_cpu_count());
 
printf("Running ODP appl: \"%s\"\n"
diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
index d0b6e7c..deaa5a0 100644
--- a/example/packet/odp_pktio.c
+++ b/example/packet/odp_pktio.c
@@ -626,7 +626,7 @@ static void print_info(char *progname, appl_args_t 
*appl_args)
   "Cache line size: %i\n"
   "CPU count:   %i\n"
   "\n",
-  odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz(),
+  odp_version_api_str(), odp_cpu_model_str(), odp_cpu_hz_max(),
   odp_sys_cache_line_size(), odp_cpu_count());
 
printf("Running ODP appl: \"%s\"\n"
diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index 01abe04..0bd1a7e 100644
--- a/example/timer/odp_timer_test.c
+++ b/example/timer/odp_timer_test.c
@@ -365,7 +365,7 @@ int main(int argc, char *argv[])
printf("---\n");
printf("ODP API version: %s\n",odp_version_api_str());
printf("CPU model:   %s\n",odp_cpu_model_str());
-   printf("CPU freq (hz):   %"PRIu64"\n", odp_cpu_hz());
+   printf("CPU freq (hz):   %"PRIu64"\n", odp_cpu_hz_max());
printf("Cache line size: %i\n",odp_sys_cache_line_size());
printf("Max CPU count:   %i\n",odp_cpu_count());
 
@@ -463,7 +463,7 @@ int main(int argc, char *argv[])
return -1;
}
 
-   printf("CPU freq %"PRIu64" Hz\n", odp_cpu_hz());
+   printf("CPU freq %"PRIu64" Hz\n",

[lng-odp] [API-NEXT PATCH v3 7/8] linux-generic: sysinfo: add API to get current CPU frequency

2015-07-09 Thread hongbo.zhang
From: Hongbo Zhang 

Previous CPU frequency API is adapted to return max frequency, now new
APIs are added for getting the current CPU frequency.
odp_cpu_id_hz(int id) returns frequency of the CPU specified by parameter
id, while odp_cpu_hz() returns frequency of the CPU on which the thread
is running.

Signed-off-by: Hongbo Zhang 
---
 include/odp/api/cpu.h| 20 ++
 platform/linux-generic/odp_system_info.c | 63 
 2 files changed, 83 insertions(+)

diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h
index 3ecef1f..8809a46 100644
--- a/include/odp/api/cpu.h
+++ b/include/odp/api/cpu.h
@@ -64,6 +64,26 @@ uint64_t odp_cpu_hz_max(void);
 uint64_t odp_cpu_id_hz_max(int id);
 
 /**
+ * Current CPU frequency in Hz
+ *
+ * Returns current frequency of this CPU
+ *
+ * @return CPU frequency in Hz
+ */
+uint64_t odp_cpu_hz(void);
+
+/**
+ * Current CPU frequency of a CPU (in Hz)
+ *
+ * Returns current frequency of the specified CPU
+ *
+ * @param idCPU ID
+ *
+ * @return CPU frequency in Hz
+ */
+uint64_t odp_cpu_id_hz(int id);
+
+/**
  * CPU model name
  *
  * @return Pointer to CPU model name string
diff --git a/platform/linux-generic/odp_system_info.c 
b/platform/linux-generic/odp_system_info.c
index 00d009c..b780b13 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -145,6 +145,42 @@ static int cpuinfo_x86(FILE *file, odp_system_info_t 
*sysinfo)
return 0;
 }
 
+static uint64_t arch_cpu_hz_current(int id)
+{
+   char str[1024];
+   FILE *file;
+   int cpu;
+   char *pos;
+   double mhz = 0.0;
+
+   file = fopen("/proc/cpuinfo", "rt");
+
+   /* find the correct processor instance */
+   while (fgets(str, sizeof(str), file) != NULL) {
+   pos = strstr(str, "processor");
+   if (pos) {
+   sscanf(pos, "processor : %d", &cpu);
+   if (cpu == id)
+   break;
+   }
+   }
+
+   /* extract the cpu current speed */
+   while (fgets(str, sizeof(str), file) != NULL) {
+   pos = strstr(str, "cpu MHz");
+   if (pos) {
+   sscanf(pos, "cpu MHz : %lf", &mhz);
+   break;
+   }
+   }
+
+   fclose(file);
+   if (mhz)
+   return (uint64_t)(mhz * 100.0);
+
+   return -1;
+}
+
 #elif defined __arm__ || defined __aarch64__
 
 static int cpuinfo_arm(FILE *file ODP_UNUSED,
@@ -153,6 +189,11 @@ odp_system_info_t *sysinfo ODP_UNUSED)
return 0;
 }
 
+static uint64_t arch_cpu_hz_current(int id)
+{
+   return -1;
+}
+
 #elif defined __OCTEON__
 
 static int cpuinfo_octeon(FILE *file, odp_system_info_t *sysinfo)
@@ -195,6 +236,11 @@ static int cpuinfo_octeon(FILE *file, odp_system_info_t 
*sysinfo)
return 0;
 }
 
+static uint64_t arch_cpu_hz_current(int id)
+{
+   return -1;
+}
+
 #elif defined __powerpc__
 static int cpuinfo_powerpc(FILE *file, odp_system_info_t *sysinfo)
 {
@@ -236,6 +282,11 @@ static int cpuinfo_powerpc(FILE *file, odp_system_info_t 
*sysinfo)
return 0;
 }
 
+static uint64_t arch_cpu_hz_current(int id)
+{
+   return -1;
+}
+
 #else
#error GCC target not found
 #endif
@@ -379,6 +430,18 @@ uint64_t odp_cpu_id_hz_max(int id)
return -1;
 }
 
+uint64_t odp_cpu_hz(void)
+{
+   int id = sched_getcpu();
+
+   return arch_cpu_hz_current(id);
+}
+
+uint64_t odp_cpu_id_hz(int id)
+{
+   return arch_cpu_hz_current(id);
+}
+
 uint64_t odp_sys_huge_page_size(void)
 {
return odp_global_data.system_info.huge_page_size;
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [API-NEXT PATCH v3 8/8] validation: add test for new per_CPU system APIs

2015-07-09 Thread hongbo.zhang
From: Hongbo Zhang 

This patch adds test for the newly introduced per-CPU system APIs:
new per-CPU APIs: odp_cpu_id_hz_max(), odp_cpu_id_model_str()
abd new crurrent frequency APIs: odp_cpu_hz(), odp_cpu_id_hz()

Signed-off-by: Hongbo Zhang 

add
---
 test/validation/ver_abt_log_dbg/odp_system.c | 49 
 1 file changed, 49 insertions(+)

diff --git a/test/validation/ver_abt_log_dbg/odp_system.c 
b/test/validation/ver_abt_log_dbg/odp_system.c
index 9058c6c..ab6d07d 100644
--- a/test/validation/ver_abt_log_dbg/odp_system.c
+++ b/test/validation/ver_abt_log_dbg/odp_system.c
@@ -57,6 +57,19 @@ static void test_odp_cpu_model_str(void)
CU_ASSERT(strlen(model) < 127);
 }
 
+static void test_odp_cpu_id_model_str(void)
+{
+   char model[128];
+   int i, cpus;
+
+   cpus = odp_cpu_count();
+   for (i = 0; i < cpus; i++) {
+   snprintf(model, 128, "%s", odp_cpu_id_model_str(i));
+   CU_ASSERT(strlen(model) > 0);
+   CU_ASSERT(strlen(model) < 127);
+   }
+}
+
 static void test_odp_sys_page_size(void)
 {
uint64_t page;
@@ -82,11 +95,47 @@ static void test_odp_cpu_hz_max(void)
CU_ASSERT(0 < hz);
 }
 
+static void test_odp_cpu_id_hz_max(void)
+{
+   uint64_t hz;
+   int i, cpus;
+
+   cpus = odp_cpu_count();
+   for (i = 0; i < cpus; i++) {
+   hz = odp_cpu_id_hz_max(0);
+   CU_ASSERT(0 < hz);
+   }
+}
+
+static void test_odp_cpu_hz(void)
+{
+   uint64_t hz;
+
+   hz = odp_cpu_hz();
+   CU_ASSERT(0 < hz);
+}
+
+static void test_odp_cpu_id_hz(void)
+{
+   uint64_t hz;
+   int i, cpus;
+
+   cpus = odp_cpu_count();
+   for (i = 0; i < cpus; i++) {
+   hz = odp_cpu_id_hz(i);
+   CU_ASSERT(0 < hz);
+   }
+}
+
 CU_TestInfo test_odp_system[] = {
{"odp version",  test_odp_version_numbers},
{"odp_cpu_count",  test_odp_cpu_count},
{"odp_cpu_hz_max",  test_odp_cpu_hz_max},
+   {"odp_cpu_id_hz_max",  test_odp_cpu_id_hz_max},
+   {"odp_cpu_hz",  test_odp_cpu_hz},
+   {"odp_cpu_id_hz",  test_odp_cpu_id_hz},
{"odp_cpu_model_str",  test_odp_cpu_model_str},
+   {"odp_cpu_id_model_str",  test_odp_cpu_id_model_str},
{"odp_sys_cache_line_size",  test_odp_sys_cache_line_size},
{"odp_sys_page_size",  test_odp_sys_page_size},
{"odp_sys_huge_page_size",  test_odp_sys_huge_page_size},
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] linux-generic: Makefile.am: cleanup path

2015-07-09 Thread Maxim Uvarov

Merged,

thanks,
Maxim.

On 07/06/15 22:02, Mike Holmes wrote:



On 6 July 2015 at 14:04, Anders Roxell > wrote:


Signed-off-by: Anders Roxell mailto:anders.rox...@linaro.org>>


Reviewed-by: Mike Holmes >


---
 platform/linux-generic/Makefile.am | 148
++---
 1 file changed, 74 insertions(+), 74 deletions(-)

diff --git a/platform/linux-generic/Makefile.am
b/platform/linux-generic/Makefile.am
index 4f2063f..6f62c5c 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -10,63 +10,63 @@ include_HEADERS = \

 odpincludedir= $(includedir)/odp
 odpinclude_HEADERS = \
-  $(top_srcdir)/platform/linux-generic/include/odp/align.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/atomic.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/barrier.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/buffer.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/byteorder.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/classification.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/compiler.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/config.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/cpu.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/cpumask.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/crypto.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/debug.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/errno.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/event.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/hints.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/init.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/packet_flags.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/packet.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/packet_io.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/pool.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/queue.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/random.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/rwlock.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/schedule.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/shared_memory.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/spinlock.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/std_types.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/sync.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/system_info.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/thread.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/ticketlock.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/time.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/timer.h \
-  $(top_srcdir)/platform/linux-generic/include/odp/version.h
+ $(srcdir)/include/odp/align.h \
+ $(srcdir)/include/odp/atomic.h \
+ $(srcdir)/include/odp/barrier.h \
+ $(srcdir)/include/odp/buffer.h \
+ $(srcdir)/include/odp/byteorder.h \
+ $(srcdir)/include/odp/classification.h \
+ $(srcdir)/include/odp/compiler.h \
+ $(srcdir)/include/odp/config.h \
+ $(srcdir)/include/odp/cpu.h \
+ $(srcdir)/include/odp/cpumask.h \
+ $(srcdir)/include/odp/crypto.h \
+ $(srcdir)/include/odp/debug.h \
+ $(srcdir)/include/odp/errno.h \
+ $(srcdir)/include/odp/event.h \
+ $(srcdir)/include/odp/hints.h \
+ $(srcdir)/include/odp/init.h \
+ $(srcdir)/include/odp/packet_flags.h \
+ $(srcdir)/include/odp/packet.h \
+ $(srcdir)/include/odp/packet_io.h \
+ $(srcdir)/include/odp/pool.h \
+ $(srcdir)/include/odp/queue.h \
+ $(srcdir)/include/odp/random.h \
+ $(srcdir)/include/odp/rwlock.h \
+ $(srcdir)/include/odp/schedule.h \
+ $(srcdir)/include/odp/shared_memory.h \
+ $(srcdir)/include/odp/spinlock.h \
+ $(srcdir)/include/odp/std_types.h \
+ $(srcdir)/include/odp/sync.h \
+ $(srcdir)/include/odp/system_info.h \
+ $(srcdir)/include/odp/thread.h \
+ $(srcdir)/include/odp/ticketlock.h \
+ $(srcdir)/include/odp/time.h \
+ $(srcdir)/include/odp/timer.h \
+ $(srcdir)/include/odp/version.h

 odpplatincludedir= $(includedi

Re: [lng-odp] [PATCH v2] helper: convert to a library

2015-07-09 Thread Maxim Uvarov

Merged,

Thanks,
Maxim.

On 07/06/15 22:13, Mike Holmes wrote:

Remove the need to build helper source files into the linux-generic
library by converting helpers to be their own library.

This removes the need for all other platforms to also build in the
helpers which are optional just to run the tests.

Signed-off-by: Mike Holmes 
---

v2:
use srcdir to shorten paths


  .gitignore |  2 +-
  Makefile.am|  3 ++-
  configure.ac   |  1 +
  debian/libodphelper-dev.dirs   |  2 ++
  debian/libodphelper-dev.install|  4 
  debian/libodphelper.dirs   |  1 +
  debian/libodphelper.install|  1 +
  example/Makefile.inc   |  2 +-
  helper/Makefile.am | 30 +-
  helper/test/Makefile.am|  2 ++
  pkgconfig/libodphelper.pc.in   | 11 +++
  platform/linux-generic/Makefile.am | 16 
  test/Makefile.inc  |  2 +-
  test/validation/Makefile.inc   |  2 +-
  14 files changed, 57 insertions(+), 22 deletions(-)
  create mode 100644 debian/libodphelper-dev.dirs
  create mode 100644 debian/libodphelper-dev.install
  create mode 100644 debian/libodphelper.dirs
  create mode 100644 debian/libodphelper.install
  create mode 100644 pkgconfig/libodphelper.pc.in

diff --git a/.gitignore b/.gitignore
index 6222fd9..4dbf28e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,7 +24,7 @@ missing
  config.log
  config.status
  libtool
-pkgconfig/libodp.pc
+pkgconfig/libodp*.pc
  .deps/
  cscope.out
  tags
diff --git a/Makefile.am b/Makefile.am
index 2c8a9d6..7ce3a3c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,9 +3,10 @@ AUTOMAKE_OPTIONS = foreign
  
  #@with_platform@ works alone in subdir but not as part of a path???

  SUBDIRS = @platform_with_platform@ \
+ helper \
  test \
  @platform_with_platform_test@ \
- helper \
+ helper/test \
  doc \
  example \
  scripts
diff --git a/configure.ac b/configure.ac
index 28dad3b..29fcb18 100644
--- a/configure.ac
+++ b/configure.ac
@@ -296,6 +296,7 @@ AC_CONFIG_FILES([Makefile
 helper/Makefile
 helper/test/Makefile
 pkgconfig/libodp.pc
+pkgconfig/libodphelper.pc
 platform/linux-generic/Makefile
 platform/linux-generic/test/pktio/Makefile
 scripts/Makefile
diff --git a/debian/libodphelper-dev.dirs b/debian/libodphelper-dev.dirs
new file mode 100644
index 000..4418816
--- /dev/null
+++ b/debian/libodphelper-dev.dirs
@@ -0,0 +1,2 @@
+usr/lib
+usr/include
diff --git a/debian/libodphelper-dev.install b/debian/libodphelper-dev.install
new file mode 100644
index 000..b973af4
--- /dev/null
+++ b/debian/libodphelper-dev.install
@@ -0,0 +1,4 @@
+usr/include/*
+usr/lib/*/lib*.so
+usr/lib/*/lib*.a
+usr/lib/*/pkgconfig/*
diff --git a/debian/libodphelper.dirs b/debian/libodphelper.dirs
new file mode 100644
index 000..6845771
--- /dev/null
+++ b/debian/libodphelper.dirs
@@ -0,0 +1 @@
+usr/lib
diff --git a/debian/libodphelper.install b/debian/libodphelper.install
new file mode 100644
index 000..3ddde58
--- /dev/null
+++ b/debian/libodphelper.install
@@ -0,0 +1 @@
+usr/lib/*/lib*.so.*
diff --git a/example/Makefile.inc b/example/Makefile.inc
index b3a9706..e1c1cb7 100644
--- a/example/Makefile.inc
+++ b/example/Makefile.inc
@@ -1,7 +1,7 @@
  include $(top_srcdir)/Makefile.inc
  include $(top_srcdir)/platform/@with_platform@/Makefile.inc
  LIB   = $(top_builddir)/lib
-LDADD = $(LIB)/libodp.la
+LDADD = $(LIB)/libodp.la $(LIB)/libodphelper.la
  AM_CFLAGS += \
-I$(srcdir) \
-I$(top_srcdir)/example \
diff --git a/helper/Makefile.am b/helper/Makefile.am
index 02af5b3..44bcc3d 100644
--- a/helper/Makefile.am
+++ b/helper/Makefile.am
@@ -1 +1,29 @@
-SUBDIRS = test
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = $(top_builddir)/pkgconfig/libodphelper.pc
+
+LIB   = $(top_builddir)/lib
+AM_CFLAGS  = -I$(srcdir)/include
+AM_CFLAGS += -I$(top_srcdir)/platform/@with_platform@/include
+AM_CFLAGS += -I$(top_srcdir)/platform/linux-generic/include
+AM_CFLAGS += -I$(top_srcdir)/include
+
+include_HEADERS = \
+ $(srcdir)/include/odp/helper/ring.h \
+ $(srcdir)/include/odp/helper/linux.h \
+ $(srcdir)/include/odp/helper/chksum.h\
+ $(srcdir)/include/odp/helper/eth.h\
+ $(srcdir)/include/odp/helper/icmp.h\
+ $(srcdir)/include/odp/helper/ip.h\
+ $(srcdir)/include/odp/helper/ipsec.h\
+ $(srcdir)/include/odp/helper/tcp.h\
+ $(srcdir)/include/odp/helper/udp.h
+
+noinst_HEADERS = \
+$(srcdir)/odph_debug.h \
+$(srcdir)/odph_pause.h
+
+__LIB__libodphelper_la_SOURCES = \
+   linux.c \
+   r

Re: [lng-odp] [PATCH] linux-generic: types: increase alignment of odp_handle_t to avoid lint issues

2015-07-09 Thread Bill Fischofer
Good point.  Yes, the circular dependencies are problematic and there's
also the question of casting to different object types which might have
differing alignments.  The simplest solution is the (void *) intermediate
cast in those specific cases.

So please ignore this patch.  I'll post the other one for odp-dpdk.  The
issue in the DPDK code itself is one we can't fix ourselves so I'd ignore
it for now.

On Thu, Jul 9, 2015 at 5:09 AM, Zoltan Kiss  wrote:

> I'm not sure it's sufficient enough. What happens if you cast the type
> into something which is not 8 byte aligned, but bigger? The example Mike
> saw was in ODP-DPDK CI:
>
> 18:50:48 ./include/odp_pool_internal.h:92:9: error: cast from
> 'odp_buffer_t' (aka 'struct (anonymous at
> ./include/odp/plat/buffer_types.h:29:9) *') to 'odp_buffer_hdr_t *' (aka
> 'struct odp_buffer_hdr_t *') increases required alignment from 1 to 64
> [-Werror,-Wcast-align]
> 18:50:48 return (odp_buffer_hdr_t *)buf;
>
> It wouldn't pass with this either, because odp_buffer_hdr_t is 64 byte
> aligned. You can't really find an universal size, because that could force
> unnecessary alignment restrictions to other types using this macro.
> I would still recommend what I wrote in a separate mail chain:
>
> typedef ODP_HANDLE_T(odp_buffer_t, sizeof(odp_buffer_hdr_t));
> ...
> #define odp_handle_t(align) struct { uint8_t unused_dummy_var[align]; } *
> /** C/C++ helper macro for strong typing */
> #define ODP_HANDLE_T(type, align) odp_handle_t(align) type
>
> That would make this flexible: you can use just 1 if your opaque type is
> never casted to a pointer for a different type, or
> sizeof(that_different_type) if it is.
> The only problem I see in case of the above example, that you don't see
> the odp_buffer_hdr_t definition in buffer_types.h
>
> Zoli
>
>
>
>
> On 08/07/15 21:41, Bill Fischofer wrote:
>
>> ODP handles are abstract types however because compilers see their
>> implementation they assume these have alignments that can result in false
>> lint warnings. Increasing the apparent alignment to uint64_t removes
>> these.
>> It has no effect on ODP operation or performance.
>>
>> Signed-off-by: Bill Fischofer 
>> ---
>>   platform/linux-generic/include/odp/plat/strong_types.h | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/platform/linux-generic/include/odp/plat/strong_types.h
>> b/platform/linux-generic/include/odp/plat/strong_types.h
>> index a53d763..3eb4556 100644
>> --- a/platform/linux-generic/include/odp/plat/strong_types.h
>> +++ b/platform/linux-generic/include/odp/plat/strong_types.h
>> @@ -17,9 +17,9 @@
>>
>>   /** Use strong typing for ODP types */
>>   #ifdef __cplusplus
>> -#define ODP_HANDLE_T(type) struct _##type { uint8_t unused_dummy_var; }
>> *type
>> +#define ODP_HANDLE_T(type) struct _##type { uint64_t unused_dummy_var; }
>> *type
>>   #else
>> -#define odp_handle_t struct { uint8_t unused_dummy_var; } *
>> +#define odp_handle_t struct { uint64_t unused_dummy_var; } *
>>   /** C/C++ helper macro for strong typing */
>>   #define ODP_HANDLE_T(type) odp_handle_t type
>>   #endif
>>
>>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH] example:printing correct appl_mode

2015-07-09 Thread Balakrishna.Garapati
Signed-off-by: Balakrishna.Garapati 
---
 example/generator/odp_generator.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/example/generator/odp_generator.c 
b/example/generator/odp_generator.c
index 0ff264c..15de035 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -991,9 +991,11 @@ static void print_info(char *progname, appl_args_t 
*appl_args)
printf("\n"
   "Mode:");
if (appl_args->mode == 0)
-   PRINT_APPL_MODE(0);
+   PRINT_APPL_MODE(APPL_MODE_UDP);
+   else if (appl_args->mode == 1)
+   PRINT_APPL_MODE(APPL_MODE_PING);
else
-   PRINT_APPL_MODE(0);
+   PRINT_APPL_MODE(APPL_MODE_RCV);
printf("\n\n");
fflush(NULL);
 }
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] example:printing correct appl_mode

2015-07-09 Thread Mike Holmes
Subject should localize to the specific example
example: generator: print correct appl_mode

On 9 July 2015 at 09:32, Balakrishna.Garapati <
balakrishna.garap...@linaro.org> wrote:

> Signed-off-by: Balakrishna.Garapati 
>

With fixed subject message
Reviewed-by: Mike Holmes 


> ---
>  example/generator/odp_generator.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/example/generator/odp_generator.c
> b/example/generator/odp_generator.c
> index 0ff264c..15de035 100644
> --- a/example/generator/odp_generator.c
> +++ b/example/generator/odp_generator.c
> @@ -991,9 +991,11 @@ static void print_info(char *progname, appl_args_t
> *appl_args)
> printf("\n"
>"Mode:");
> if (appl_args->mode == 0)
> -   PRINT_APPL_MODE(0);
> +   PRINT_APPL_MODE(APPL_MODE_UDP);
> +   else if (appl_args->mode == 1)
> +   PRINT_APPL_MODE(APPL_MODE_PING);
> else
> -   PRINT_APPL_MODE(0);
> +   PRINT_APPL_MODE(APPL_MODE_RCV);
> printf("\n\n");
> fflush(NULL);
>  }
> --
> 1.9.1
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>



-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org  *│ *Open source software for ARM SoCs
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 00/11] merge api-next to master (odp1.2)

2015-07-09 Thread Maxim Uvarov
Following patches are planned to be merged from api-next to
master to be included for next point release 1.2. The major
reason is to unblock dpdk with creating worker threads and
pool creation without providing shared memory to it.

If no objection in 24 hours I'm going to merge that patches.
Please replay asap if you have something against that merge.


Best regards,
Maxim.


Bill Fischofer (1):
  api: pool: remove shm paramter from odp_pool_create()

Petri Savolainen (10):
  api: thread: added thread type
  api: init: added thread type to local init
  api: cpumask: added cpumask_setall
  api: thrmask: added thread mask
  api: cpumask: added default masks
  api: helper: deleted odph_linux_cpumask_default
  linux-generic: thread: updated thread mask handling
  linux-generic: thread: implemented odp_thread_type
  linux-generic: thread: implemented thrmask_worker and control
  api: doc: doxygen grouping clean up

 example/classifier/odp_classifier.c|  11 +-
 example/generator/odp_generator.c  |  13 +-
 example/ipsec/odp_ipsec.c  |  17 +-
 example/packet/odp_pktio.c |  11 +-
 example/timer/odp_timer_test.c |  11 +-
 helper/include/odp/helper/linux.h  |  11 -
 helper/linux.c |  35 +---
 helper/test/odp_chksum.c   |   4 +-
 helper/test/odp_process.c  |   4 +-
 helper/test/odp_thread.c   |   4 +-
 include/odp.h  |   1 +
 include/odp/api/buffer.h   |  11 -
 include/odp/api/config.h   |   2 +-
 include/odp/api/cpumask.h  |  41 +++-
 include/odp/api/debug.h|  14 +-
 include/odp/api/errno.h|   2 +-
 include/odp/api/init.h |   5 +-
 include/odp/api/pool.h |  37 +---
 include/odp/api/system_info.h  |   2 +-
 include/odp/api/thread.h   |  38 
 include/odp/api/thrmask.h  | 229 +
 include/odp/api/time.h |   2 +-
 include/odp/api/version.h  |   2 +-
 platform/linux-generic/Makefile.am |   4 +
 platform/linux-generic/include/odp/config.h|   8 -
 platform/linux-generic/include/odp/cpumask.h   |   8 -
 platform/linux-generic/include/odp/errno.h |   6 -
 .../linux-generic/include/odp/plat/buffer_types.h  |   9 -
 .../linux-generic/include/odp/plat/cpumask_types.h |   2 +-
 .../linux-generic/include/odp/plat/thrmask_types.h |  48 +
 platform/linux-generic/include/odp/system_info.h   |   7 -
 platform/linux-generic/include/odp/thrmask.h   |  36 
 platform/linux-generic/include/odp/time.h  |   6 -
 platform/linux-generic/include/odp_internal.h  |   3 +-
 platform/linux-generic/odp_cpumask.c   |  46 +
 platform/linux-generic/odp_init.c  |   4 +-
 platform/linux-generic/odp_pool.c  |  54 ++---
 platform/linux-generic/odp_schedule.c  |   2 +-
 platform/linux-generic/odp_thread.c|  94 ++---
 platform/linux-generic/odp_thrmask.c   | 102 +
 test/api_test/odp_common.c |   2 +-
 test/performance/odp_atomic.c  |   2 +-
 test/performance/odp_l2fwd.c   |  11 +-
 test/performance/odp_pktio_perf.c  |  11 +-
 test/performance/odp_scheduling.c  |  11 +-
 test/validation/buffer/buffer.c|   6 +-
 .../classification/odp_classification_tests.c  |   3 +-
 test/validation/common/odp_cunit_common.c  |   4 +-
 test/validation/crypto/crypto.c|   4 +-
 test/validation/packet/packet.c|   4 +-
 test/validation/pktio/pktio.c  |   5 +-
 test/validation/pool/pool.c|  32 +--
 test/validation/queue/queue.c  |   2 +-
 test/validation/scheduler/scheduler.c  |   4 +-
 test/validation/synchronizers/synchronizers.c  |   2 +-
 test/validation/timer/timer.c  |   8 +-
 56 files changed, 714 insertions(+), 343 deletions(-)
 create mode 100644 include/odp/api/thrmask.h
 create mode 100644 platform/linux-generic/include/odp/plat/thrmask_types.h
 create mode 100644 platform/linux-generic/include/odp/thrmask.h
 create mode 100644 platform/linux-generic/odp_thrmask.c

-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 01/11] api: thread: added thread type

2015-07-09 Thread Maxim Uvarov
From: Petri Savolainen 

Two thread types are defined: worker and control threads. API calls from
a worker thread should be throughput and latency optimized, while the
second one is not so sensitive to call overheads and latency.

Signed-off-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 
---
 include/odp/api/thread.h | 38 ++
 1 file changed, 38 insertions(+)

diff --git a/include/odp/api/thread.h b/include/odp/api/thread.h
index a509ef9..89eae2b 100644
--- a/include/odp/api/thread.h
+++ b/include/odp/api/thread.h
@@ -23,6 +23,34 @@ extern "C" {
  */
 
 /**
+ * Thread type
+ */
+typedef enum odp_thread_type_e {
+   /**
+* Worker thread
+*
+* Worker threads do most part of ODP application packet processing.
+* These threads provide high packet and data rates, with low and
+* predictable latency. Typically, worker threads are pinned to isolated
+* CPUs and packets are processed in a run-to-completion loop with very
+* low interference from the operating system.
+*/
+   ODP_THREAD_WORKER = 0,
+
+   /**
+* Control thread
+*
+* Control threads do not participate the main packet flow through the
+* system, but e.g. control or monitor the worker threads, or handle
+* exceptions. These threads may perform general purpose processing,
+* use system calls, share the CPU with other threads and be interrupt
+* driven.
+*/
+   ODP_THREAD_CONTROL
+} odp_thread_type_t;
+
+
+/**
  * Get thread identifier
  *
  * Returns the thread identifier of the current thread. Thread ids range from 0
@@ -47,6 +75,16 @@ int odp_thread_id(void);
 int odp_thread_count(void);
 
 /**
+ * Thread type
+ *
+ * Returns the thread type of the current thread.
+ *
+ * @return Thread type
+ */
+odp_thread_type_t odp_thread_type(void);
+
+
+/**
  * @}
  */
 
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 02/11] api: init: added thread type to local init

2015-07-09 Thread Maxim Uvarov
From: Petri Savolainen 

User needs to select the thread type (worker or control) of
the initialized thread. Implementation may reserve HW direct access
only to worker threads, while control threads share HW access, etc.

Signed-off-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 

Conflicts:
helper/linux.c
---
 example/classifier/odp_classifier.c   | 2 +-
 example/generator/odp_generator.c | 2 +-
 example/ipsec/odp_ipsec.c | 2 +-
 example/packet/odp_pktio.c| 2 +-
 example/timer/odp_timer_test.c| 2 +-
 helper/linux.c| 4 ++--
 helper/test/odp_chksum.c  | 2 +-
 helper/test/odp_process.c | 2 +-
 helper/test/odp_thread.c  | 2 +-
 include/odp/api/init.h| 5 -
 platform/linux-generic/odp_init.c | 2 +-
 test/performance/odp_l2fwd.c  | 2 +-
 test/performance/odp_pktio_perf.c | 2 +-
 test/performance/odp_scheduling.c | 2 +-
 test/validation/common/odp_cunit_common.c | 2 +-
 test/validation/crypto/crypto.c   | 2 +-
 test/validation/synchronizers/synchronizers.c | 2 +-
 17 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/example/classifier/odp_classifier.c 
b/example/classifier/odp_classifier.c
index 643e16c..a716966 100644
--- a/example/classifier/odp_classifier.c
+++ b/example/classifier/odp_classifier.c
@@ -384,7 +384,7 @@ int main(int argc, char *argv[])
}
 
/* Init this thread */
-   if (odp_init_local()) {
+   if (odp_init_local(ODP_THREAD_CONTROL)) {
EXAMPLE_ERR("Error: ODP local init failed.\n");
exit(EXIT_FAILURE);
}
diff --git a/example/generator/odp_generator.c 
b/example/generator/odp_generator.c
index 0ff264c..76b6f42 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -599,7 +599,7 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
 
-   if (odp_init_local()) {
+   if (odp_init_local(ODP_THREAD_CONTROL)) {
EXAMPLE_ERR("Error: ODP local init failed.\n");
exit(EXIT_FAILURE);
}
diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
index 4928985..471a390 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -1239,7 +1239,7 @@ main(int argc, char *argv[])
}
 
/* Init this thread */
-   if (odp_init_local()) {
+   if (odp_init_local(ODP_THREAD_CONTROL)) {
EXAMPLE_ERR("Error: ODP local init failed.\n");
exit(EXIT_FAILURE);
}
diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
index 0b4a8f1..a71b5d4 100644
--- a/example/packet/odp_pktio.c
+++ b/example/packet/odp_pktio.c
@@ -345,7 +345,7 @@ int main(int argc, char *argv[])
}
 
/* Init this thread */
-   if (odp_init_local()) {
+   if (odp_init_local(ODP_THREAD_CONTROL)) {
EXAMPLE_ERR("Error: ODP local init failed.\n");
exit(EXIT_FAILURE);
}
diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index f4af0e2..f184eda 100644
--- a/example/timer/odp_timer_test.c
+++ b/example/timer/odp_timer_test.c
@@ -355,7 +355,7 @@ int main(int argc, char *argv[])
}
 
/* Init this thread. */
-   if (odp_init_local()) {
+   if (odp_init_local(ODP_THREAD_CONTROL)) {
printf("ODP local init failed.\n");
return -1;
}
diff --git a/helper/linux.c b/helper/linux.c
index 46313f4..a2eacc1 100644
--- a/helper/linux.c
+++ b/helper/linux.c
@@ -58,7 +58,7 @@ static void *odp_run_start_routine(void *arg)
odp_start_args_t *start_args = arg;
 
/* ODP thread local init */
-   if (odp_init_local()) {
+   if (odp_init_local(ODP_THREAD_WORKER)) {
ODPH_ERR("Local init failed\n");
return NULL;
}
@@ -203,7 +203,7 @@ int odph_linux_process_fork_n(odph_linux_process_t 
*proc_tbl,
return -2;
}
 
-   if (odp_init_local()) {
+   if (odp_init_local(ODP_THREAD_WORKER)) {
ODPH_ERR("Local init failed\n");
return -2;
}
diff --git a/helper/test/odp_chksum.c b/helper/test/odp_chksum.c
index dae2a5b..830ffe8 100644
--- a/helper/test/odp_chksum.c
+++ b/helper/test/odp_chksum.c
@@ -126,7 +126,7 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED)
exit(EXIT_FAILURE);
}
 
-   if (odp_init_local()) {
+   if (odp_init_local(ODP_THREAD_WORKER)) {
LOG_ERR("Error: ODP local init failed.\n");
exit(EXIT_FAILURE);
}
diff --git a/helper/test/odp_process.c b/helper/test/odp_process.c
index 3483549..97f4669 100644
--- a/helper/test/odp_process.

[lng-odp] [PATCH 03/11] api: cpumask: added cpumask_setall

2015-07-09 Thread Maxim Uvarov
From: Petri Savolainen 

The call sets all possible CPUs in the mask. It's system specific which
CPUs are actually available to the application.

Signed-off-by: Petri Savolainen 
Reviewed-by: Christophe Milard 
Signed-off-by: Maxim Uvarov 
---
 include/odp/api/cpumask.h| 15 +--
 platform/linux-generic/odp_cpumask.c |  8 
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/include/odp/api/cpumask.h b/include/odp/api/cpumask.h
index dbac7b9..1fdbfb4 100644
--- a/include/odp/api/cpumask.h
+++ b/include/odp/api/cpumask.h
@@ -65,6 +65,17 @@ void odp_cpumask_zero(odp_cpumask_t *mask);
 void odp_cpumask_set(odp_cpumask_t *mask, int cpu);
 
 /**
+ * Set all CPUs in mask
+ *
+ * Set all possible CPUs in the mask. All CPUs from 0 to odp_cpumask_count()
+ * minus one are set, regardless of which CPUs are actually available to
+ * the application.
+ *
+ * @param mask  CPU mask to set
+ */
+void odp_cpumask_setall(odp_cpumask_t *mask);
+
+/**
  * Remove CPU from mask
  * @param mask  CPU mask to update
  * @param cpu   CPU number
@@ -82,7 +93,7 @@ void odp_cpumask_clr(odp_cpumask_t *mask, int cpu);
 int odp_cpumask_isset(const odp_cpumask_t *mask, int cpu);
 
 /**
- * Count number of CPU's in mask
+ * Count number of CPUs set in mask
  *
  * @param mask  CPU mask
  * @return population count
@@ -120,7 +131,7 @@ void odp_cpumask_xor(odp_cpumask_t *dest, const 
odp_cpumask_t *src1,
 const odp_cpumask_t *src2);
 
 /**
- * Test if two CPU masks contain the same CPU's
+ * Test if two CPU masks contain the same CPUs
  *
  * @param mask1CPU mask 1
  * @param mask2CPU mask 2
diff --git a/platform/linux-generic/odp_cpumask.c 
b/platform/linux-generic/odp_cpumask.c
index 0ca1071..a89c3b6 100644
--- a/platform/linux-generic/odp_cpumask.c
+++ b/platform/linux-generic/odp_cpumask.c
@@ -125,6 +125,14 @@ void odp_cpumask_set(odp_cpumask_t *mask, int cpu)
CPU_SET(cpu, &mask->set);
 }
 
+void odp_cpumask_setall(odp_cpumask_t *mask)
+{
+   int cpu;
+
+   for (cpu = 0; cpu < CPU_SETSIZE; cpu++)
+   CPU_SET(cpu, &mask->set);
+}
+
 void odp_cpumask_clr(odp_cpumask_t *mask, int cpu)
 {
CPU_CLR(cpu, &mask->set);
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 04/11] api: thrmask: added thread mask

2015-07-09 Thread Maxim Uvarov
From: Petri Savolainen 

Thread IDs and masks are used to control thread access to various
resources. Linux generic implementation reuse cpumask implementation.

Signed-off-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 

Conflicts:
platform/linux-generic/Makefile.am
---
 include/odp.h  |   1 +
 include/odp/api/thrmask.h  | 229 +
 platform/linux-generic/Makefile.am |   4 +
 .../linux-generic/include/odp/plat/thrmask_types.h |  48 +
 platform/linux-generic/include/odp/thrmask.h   |  36 
 platform/linux-generic/odp_thrmask.c   | 102 +
 6 files changed, 420 insertions(+)
 create mode 100644 include/odp/api/thrmask.h
 create mode 100644 platform/linux-generic/include/odp/plat/thrmask_types.h
 create mode 100644 platform/linux-generic/include/odp/thrmask.h
 create mode 100644 platform/linux-generic/odp_thrmask.c

diff --git a/include/odp.h b/include/odp.h
index 2bac510..fe1dc74 100644
--- a/include/odp.h
+++ b/include/odp.h
@@ -53,6 +53,7 @@ extern "C" {
 #include 
 #include 
 #include 
+#include 
 
 #ifdef __cplusplus
 }
diff --git a/include/odp/api/thrmask.h b/include/odp/api/thrmask.h
new file mode 100644
index 000..ebc31f2
--- /dev/null
+++ b/include/odp/api/thrmask.h
@@ -0,0 +1,229 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP thread masks
+ */
+
+#ifndef ODP_API_THRMASK_H_
+#define ODP_API_THRMASK_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+/** @addtogroup odp_thread
+ *  Thread mask operations.
+ *  @{
+ */
+
+/**
+ * @def ODP_THRMASK_STR_SIZE
+ * Minimum size of output buffer for odp_thrmask_to_str()
+ */
+
+/**
+ * Add thread mask bits from a string
+ *
+ * @param[out] mask  Thread mask to modify
+ * @param  str   Hexadecimal digits in a string. Thread ID zero is located
+ *   at the least significant bit (0x1).
+ */
+void odp_thrmask_from_str(odp_thrmask_t *mask, const char *str);
+
+/**
+ * Format Thread mask as a string of hexadecimal digits
+ *
+ * @param mask   Thread mask to format
+ * @param[out] str   Output buffer (use ODP_THRMASK_STR_SIZE)
+ * @param size   Size of output buffer
+ *
+ * @return number of characters written (including terminating null char)
+ * @retval <0 on failure (buffer too small)
+ */
+int32_t odp_thrmask_to_str(const odp_thrmask_t *mask, char *str, int32_t size);
+
+/**
+ * Clear entire thread mask
+ * @param mask   Thread mask to clear
+ */
+void odp_thrmask_zero(odp_thrmask_t *mask);
+
+/**
+ * Add thread to mask
+ * @param mask   Thread mask to update
+ * @param thrThread ID
+ */
+void odp_thrmask_set(odp_thrmask_t *mask, int thr);
+
+/**
+ * Set all threads in mask
+ *
+ * Set all possible threads in the mask. All threads from 0 to
+ * odp_thrmask_count() minus one are set, regardless of which threads are
+ * actually active.
+ *
+ * @param mask   Thread mask to set
+ */
+void odp_thrmask_setall(odp_thrmask_t *mask);
+
+/**
+ * Remove thread from mask
+ * @param mask   Thread mask to update
+ * @param thrThread ID
+ */
+void odp_thrmask_clr(odp_thrmask_t *mask, int thr);
+
+/**
+ * Test if thread is a member of mask
+ *
+ * @param mask   Thread mask to test
+ * @param thrThread ID
+ *
+ * @return non-zero if set
+ * @retval 0 if not set
+ */
+int odp_thrmask_isset(const odp_thrmask_t *mask, int thr);
+
+/**
+ * Count number of threads set in mask
+ *
+ * @param mask   Thread mask
+ *
+ * @return population count
+ */
+int odp_thrmask_count(const odp_thrmask_t *mask);
+
+/**
+ * Member-wise AND over two thread masks
+ *
+ * @param dest   Destination thread mask (may be one of the source masks)
+ * @param src1   Source thread mask 1
+ * @param src2   Source thread mask 2
+ */
+void odp_thrmask_and(odp_thrmask_t *dest, const odp_thrmask_t *src1,
+const odp_thrmask_t *src2);
+
+/**
+ * Member-wise OR over two thread masks
+ *
+ * @param dest   Destination thread mask (may be one of the source masks)
+ * @param src1   Source thread mask 1
+ * @param src2   Source thread mask 2
+ */
+void odp_thrmask_or(odp_thrmask_t *dest, const odp_thrmask_t *src1,
+   const odp_thrmask_t *src2);
+
+/**
+ * Member-wise XOR over two thread masks
+ *
+ * @param dest   Destination thread mask (may be one of the source masks)
+ * @param src1   Source thread mask 1
+ * @param src2   Source thread mask 2
+ */
+void odp_thrmask_xor(odp_thrmask_t *dest, const odp_thrmask_t *src1,
+const odp_thrmask_t *src2);
+
+/**
+ * Test if two thread masks contain the same threads
+ *
+ * @param mask1  Thread mask 1
+ * @param mask2  Thread mask 2
+ *
+ * @retval non-zero if thread masks equal
+ * @retval 0 if thread masks not equal
+ */
+int odp_thrmask_equal(const odp_thr

[lng-odp] [PATCH 05/11] api: cpumask: added default masks

2015-07-09 Thread Maxim Uvarov
From: Petri Savolainen 

Added default cpumask functions for worker and control threads.
These will replace odph_linux_cpumask_default() helper. CPU masks
and IDs are system specific, API is generic.

Signed-off-by: Petri Savolainen 
Reviewed-by: Christophe Milard 
Signed-off-by: Maxim Uvarov 
---
 include/odp/api/cpumask.h| 24 +++
 platform/linux-generic/odp_cpumask.c | 38 
 2 files changed, 62 insertions(+)

diff --git a/include/odp/api/cpumask.h b/include/odp/api/cpumask.h
index 1fdbfb4..02fd131 100644
--- a/include/odp/api/cpumask.h
+++ b/include/odp/api/cpumask.h
@@ -194,6 +194,30 @@ int odp_cpumask_last(const odp_cpumask_t *mask);
 int odp_cpumask_next(const odp_cpumask_t *mask, int cpu);
 
 /**
+ * Default cpumask for worker threads
+ *
+ * Initializes cpumask with CPUs available for worker threads. Sets up to 'num'
+ * CPUs and returns the count actually set. Use zero for all available CPUs.
+ *
+ * @param[out] mask  CPU mask to initialize
+ * @param  num   Number of worker threads, zero for all available CPUs
+ * @return Actual number of CPUs used to create the mask
+ */
+int odp_cpumask_def_worker(odp_cpumask_t *mask, int num);
+
+/**
+ * Default cpumask for control threads
+ *
+ * Initializes cpumask with CPUs available for control threads. Sets up to 
'num'
+ * CPUs and returns the count actually set. Use zero for all available CPUs.
+ *
+ * @param[out] mask  CPU mask to initialize
+ * @param  num   Number of control threads, zero for all available CPUs
+ * @return Actual number of CPUs used to create the mask
+ */
+int odp_cpumask_def_control(odp_cpumask_t *mask, int num);
+
+/**
  * @}
  */
 
diff --git a/platform/linux-generic/odp_cpumask.c 
b/platform/linux-generic/odp_cpumask.c
index a89c3b6..1ea7dcb 100644
--- a/platform/linux-generic/odp_cpumask.c
+++ b/platform/linux-generic/odp_cpumask.c
@@ -8,6 +8,7 @@
 #define _GNU_SOURCE
 #endif
 #include 
+#include 
 
 #include 
 #include 
@@ -204,3 +205,40 @@ int odp_cpumask_next(const odp_cpumask_t *mask, int cpu)
return cpu;
return -1;
 }
+
+int odp_cpumask_def_worker(odp_cpumask_t *mask, int num)
+{
+   int ret, cpu, i;
+   cpu_set_t cpuset;
+
+   ret = pthread_getaffinity_np(pthread_self(),
+sizeof(cpu_set_t), &cpuset);
+   if (ret != 0)
+   ODP_ABORT("failed to read CPU affinity value\n");
+
+   odp_cpumask_zero(mask);
+
+   /*
+* If no user supplied number or it's too large, then attempt
+* to use all CPUs
+*/
+   if (0 == num || CPU_SETSIZE < num)
+   num = CPU_COUNT(&cpuset);
+
+   /* build the mask, allocating down from highest numbered CPU */
+   for (cpu = 0, i = CPU_SETSIZE - 1; i >= 0 && cpu < num; --i) {
+   if (CPU_ISSET(i, &cpuset)) {
+   odp_cpumask_set(mask, i);
+   cpu++;
+   }
+   }
+
+   return cpu;
+}
+
+int odp_cpumask_def_control(odp_cpumask_t *mask, int num ODP_UNUSED)
+{
+   /* By default all control threads on CPU 0 */
+   odp_cpumask_set(mask, 0);
+   return 1;
+}
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 06/11] api: helper: deleted odph_linux_cpumask_default

2015-07-09 Thread Maxim Uvarov
From: Petri Savolainen 

The linux specific helper was replaced by default cpumask
calls (odp_cpumask_def_worker()) in the cpumask API.

Signed-off-by: Petri Savolainen 
Reviewed-by: Christophe Milard 
Signed-off-by: Maxim Uvarov 

Conflicts:
helper/linux.c
---
 example/classifier/odp_classifier.c   |  7 ++-
 example/generator/odp_generator.c |  7 ++-
 example/ipsec/odp_ipsec.c |  7 ++-
 example/packet/odp_pktio.c|  7 ++-
 example/timer/odp_timer_test.c|  7 ++-
 helper/include/odp/helper/linux.h | 11 ---
 helper/linux.c| 31 ---
 helper/test/odp_process.c |  2 +-
 helper/test/odp_thread.c  |  2 +-
 test/api_test/odp_common.c|  2 +-
 test/performance/odp_atomic.c |  2 +-
 test/performance/odp_l2fwd.c  |  7 ++-
 test/performance/odp_pktio_perf.c |  4 ++--
 test/performance/odp_scheduling.c |  7 ++-
 test/validation/common/odp_cunit_common.c |  2 +-
 15 files changed, 21 insertions(+), 84 deletions(-)

diff --git a/example/classifier/odp_classifier.c 
b/example/classifier/odp_classifier.c
index a716966..7b1a1c4 100644
--- a/example/classifier/odp_classifier.c
+++ b/example/classifier/odp_classifier.c
@@ -417,11 +417,8 @@ int main(int argc, char *argv[])
if (args->cpu_count)
num_workers = args->cpu_count;
 
-   /*
-* By default CPU #0 runs Linux kernel background tasks.
-* Start mapping thread from CPU #1
-*/
-   num_workers = odph_linux_cpumask_default(&cpumask, num_workers);
+   /* Get default worker cpumask */
+   num_workers = odp_cpumask_def_worker(&cpumask, num_workers);
(void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr));
 
printf("num worker threads: %i\n", num_workers);
diff --git a/example/generator/odp_generator.c 
b/example/generator/odp_generator.c
index 76b6f42..36219a0 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -636,11 +636,8 @@ int main(int argc, char *argv[])
if (args->appl.mode == APPL_MODE_PING)
num_workers = 2;
 
-   /*
-* By default CPU #0 runs Linux kernel background tasks.
-* Start mapping thread from CPU #1
-*/
-   num_workers = odph_linux_cpumask_default(&cpumask, num_workers);
+   /* Get default worker cpumask */
+   num_workers = odp_cpumask_def_worker(&cpumask, num_workers);
(void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr));
 
printf("num worker threads: %i\n", num_workers);
diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
index 471a390..0206d93 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -1273,11 +1273,8 @@ main(int argc, char *argv[])
if (args->appl.cpu_count)
num_workers = args->appl.cpu_count;
 
-   /*
-* By default CPU #0 runs Linux kernel background tasks.
-* Start mapping thread from CPU #1
-*/
-   num_workers = odph_linux_cpumask_default(&cpumask, num_workers);
+   /* Get default worker cpumask */
+   num_workers = odp_cpumask_def_worker(&cpumask, num_workers);
(void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr));
 
printf("num worker threads: %i\n", num_workers);
diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
index a71b5d4..865996c 100644
--- a/example/packet/odp_pktio.c
+++ b/example/packet/odp_pktio.c
@@ -358,11 +358,8 @@ int main(int argc, char *argv[])
if (args->appl.cpu_count)
num_workers = args->appl.cpu_count;
 
-   /*
-* By default CPU #0 runs Linux kernel background tasks.
-* Start mapping thread from CPU #1
-*/
-   num_workers = odph_linux_cpumask_default(&cpumask, num_workers);
+   /* Get default worker cpumask */
+   num_workers = odp_cpumask_def_worker(&cpumask, num_workers);
(void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr));
 
printf("num worker threads: %i\n", num_workers);
diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index f184eda..f7b1a3f 100644
--- a/example/timer/odp_timer_test.c
+++ b/example/timer/odp_timer_test.c
@@ -395,11 +395,8 @@ int main(int argc, char *argv[])
if (gbls->args.cpu_count)
num_workers = gbls->args.cpu_count;
 
-   /*
-* By default CPU #0 runs Linux kernel background tasks.
-* Start mapping thread from CPU #1
-*/
-   num_workers = odph_linux_cpumask_default(&cpumask, num_workers);
+   /* Get default worker cpumask */
+   num_workers = odp_cpumask_def_worker(&cpumask, num_workers);
(void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr));
 
printf("num worker threads: %i\n", num_

[lng-odp] [PATCH 08/11] linux-generic: thread: implemented odp_thread_type

2015-07-09 Thread Maxim Uvarov
From: Petri Savolainen 

Signed-off-by: Petri Savolainen 
Reviewed-and-tested-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 
---
 platform/linux-generic/odp_thread.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/platform/linux-generic/odp_thread.c 
b/platform/linux-generic/odp_thread.c
index 85ca047..42afc5f 100644
--- a/platform/linux-generic/odp_thread.c
+++ b/platform/linux-generic/odp_thread.c
@@ -183,6 +183,11 @@ int odp_thread_count(void)
return thread_globals->num;
 }
 
+odp_thread_type_t odp_thread_type(void)
+{
+   return this_thread->type;
+}
+
 int odp_cpu_id(void)
 {
return this_thread->cpu;
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 07/11] linux-generic: thread: updated thread mask handling

2015-07-09 Thread Maxim Uvarov
From: Petri Savolainen 

Linux generic thread mask handling uses thrmask API. Added
worker and control masks for easy implementation of functions
returning those masks.

Signed-off-by: Petri Savolainen 
Reviewed-and-tested-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 
---
 platform/linux-generic/include/odp_internal.h |  3 +-
 platform/linux-generic/odp_init.c |  4 +-
 platform/linux-generic/odp_thread.c   | 71 +++
 3 files changed, 43 insertions(+), 35 deletions(-)

diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index 8c5d339..6f0050f 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -19,6 +19,7 @@ extern "C" {
 #endif
 
 #include 
+#include 
 
 extern __thread int __odp_errno;
 
@@ -42,7 +43,7 @@ extern struct odp_global_data_s odp_global_data;
 int odp_system_info_init(void);
 
 int odp_thread_init_global(void);
-int odp_thread_init_local(void);
+int odp_thread_init_local(odp_thread_type_t type);
 int odp_thread_term_local(void);
 int odp_thread_term_global(void);
 
diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index 0b13a6d..9138d37 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -121,14 +121,14 @@ int odp_term_global(void)
return rc;
 }
 
-int odp_init_local(odp_thread_type_t thr_type ODP_UNUSED)
+int odp_init_local(odp_thread_type_t thr_type)
 {
if (odp_shm_init_local()) {
ODP_ERR("ODP shm local init failed.\n");
return -1;
}
 
-   if (odp_thread_init_local()) {
+   if (odp_thread_init_local(thr_type)) {
ODP_ERR("ODP thread local init failed.\n");
return -1;
}
diff --git a/platform/linux-generic/odp_thread.c 
b/platform/linux-generic/odp_thread.c
index e815009..85ca047 100644
--- a/platform/linux-generic/odp_thread.c
+++ b/platform/linux-generic/odp_thread.c
@@ -10,6 +10,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -22,17 +23,18 @@
 #include 
 #include 
 
-#define MASK_SIZE_16 ((ODP_CONFIG_MAX_THREADS+15)/16)
-
 typedef struct {
int thr;
int cpu;
+   odp_thread_type_t type;
 } thread_state_t;
 
 
 typedef struct {
thread_state_t thr[ODP_CONFIG_MAX_THREADS];
-   uint16_t   mask[MASK_SIZE_16];
+   odp_thrmask_t  all;
+   odp_thrmask_t  worker;
+   odp_thrmask_t  control;
uint32_t   num;
odp_spinlock_t lock;
 } thread_globals_t;
@@ -61,6 +63,10 @@ int odp_thread_init_global(void)
 
memset(thread_globals, 0, sizeof(thread_globals_t));
odp_spinlock_init(&thread_globals->lock);
+   odp_thrmask_zero(&thread_globals->all);
+   odp_thrmask_zero(&thread_globals->worker);
+   odp_thrmask_zero(&thread_globals->control);
+
return 0;
 }
 
@@ -75,59 +81,59 @@ int odp_thread_term_global(void)
return ret;
 }
 
-static int alloc_id(void)
+static int alloc_id(odp_thread_type_t type)
 {
-   int i, j;
-   uint16_t *mask = thread_globals->mask;
+   int thr;
+   odp_thrmask_t *all = &thread_globals->all;
 
if (thread_globals->num >= ODP_CONFIG_MAX_THREADS)
return -1;
 
-   for (i = 0; i < MASK_SIZE_16; i++) {
-   if (mask[i] != 0x) {
-   for (j = 0; j < 16; j++) {
-   uint16_t bit = 0x1 << j;
-   if ((bit & mask[i]) == 0) {
-   mask[i] |= bit;
-   thread_globals->num++;
-   return i*16 + j;
-   }
-   }
-   return -2;
+   for (thr = 0; thr < ODP_CONFIG_MAX_THREADS; thr++) {
+   if (odp_thrmask_isset(all, thr) == 0) {
+   odp_thrmask_set(all, thr);
+
+   if (type == ODP_THREAD_WORKER)
+   odp_thrmask_set(&thread_globals->worker, thr);
+   else
+   odp_thrmask_set(&thread_globals->control, thr);
+
+   thread_globals->num++;
+   return thr;
}
}
 
return -2;
 }
 
-static int free_id(int id)
+static int free_id(int thr)
 {
-   int i, j;
-   uint16_t *mask = thread_globals->mask;
-   uint16_t bit;
+   odp_thrmask_t *all = &thread_globals->all;
 
-   if (id < 0 || id >= ODP_CONFIG_MAX_THREADS)
+   if (thr < 0 || thr >= ODP_CONFIG_MAX_THREADS)
return -1;
 
-   i   = id / 16;
-   j   = id - (i * 16);
-   bit = 0x1 << j;
-
-   if ((bit & mask[i]) == 0)
+   if (odp_thrmask_isset(all, thr) == 0)
return -1;
 
-   mask[i] &= ~bit;
+   odp_thrmask_clr(all, thr)

[lng-odp] [PATCH 09/11] linux-generic: thread: implemented thrmask_worker and control

2015-07-09 Thread Maxim Uvarov
From: Petri Savolainen 

Signed-off-by: Petri Savolainen 
Reviewed-and-tested-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 
---
 platform/linux-generic/odp_thread.c | 28 
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/platform/linux-generic/odp_thread.c 
b/platform/linux-generic/odp_thread.c
index 42afc5f..9905c78 100644
--- a/platform/linux-generic/odp_thread.c
+++ b/platform/linux-generic/odp_thread.c
@@ -36,6 +36,8 @@ typedef struct {
odp_thrmask_t  worker;
odp_thrmask_t  control;
uint32_t   num;
+   uint32_t   num_worker;
+   uint32_t   num_control;
odp_spinlock_t lock;
 } thread_globals_t;
 
@@ -93,10 +95,13 @@ static int alloc_id(odp_thread_type_t type)
if (odp_thrmask_isset(all, thr) == 0) {
odp_thrmask_set(all, thr);
 
-   if (type == ODP_THREAD_WORKER)
+   if (type == ODP_THREAD_WORKER) {
odp_thrmask_set(&thread_globals->worker, thr);
-   else
+   thread_globals->num_worker++;
+   } else {
odp_thrmask_set(&thread_globals->control, thr);
+   thread_globals->num_control++;
+   }
 
thread_globals->num++;
return thr;
@@ -118,10 +123,13 @@ static int free_id(int thr)
 
odp_thrmask_clr(all, thr);
 
-   if (thread_globals->thr[thr].type == ODP_THREAD_WORKER)
+   if (thread_globals->thr[thr].type == ODP_THREAD_WORKER) {
odp_thrmask_clr(&thread_globals->worker, thr);
-   else
+   thread_globals->num_worker--;
+   } else {
odp_thrmask_clr(&thread_globals->control, thr);
+   thread_globals->num_control--;
+   }
 
thread_globals->num--;
return thread_globals->num;
@@ -192,3 +200,15 @@ int odp_cpu_id(void)
 {
return this_thread->cpu;
 }
+
+int odp_thrmask_worker(odp_thrmask_t *mask)
+{
+   odp_thrmask_copy(mask, &thread_globals->worker);
+   return thread_globals->num_worker;
+}
+
+int odp_thrmask_control(odp_thrmask_t *mask)
+{
+   odp_thrmask_copy(mask, &thread_globals->control);
+   return thread_globals->num_control;
+}
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 11/11] api: doc: doxygen grouping clean up

2015-07-09 Thread Maxim Uvarov
From: Petri Savolainen 

Cleaned Doxygen documentation grouping. Corrected wrong
groupings and created new groups when needed.

Signed-off-by: Petri Savolainen 
Reviewed-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 
---
 include/odp/api/buffer.h| 11 ---
 include/odp/api/config.h|  2 +-
 include/odp/api/cpumask.h   |  2 +-
 include/odp/api/debug.h | 14 +++---
 include/odp/api/errno.h |  2 +-
 include/odp/api/pool.h  |  2 +-
 include/odp/api/system_info.h   |  2 +-
 include/odp/api/time.h  |  2 +-
 include/odp/api/version.h   |  2 +-
 platform/linux-generic/include/odp/config.h |  8 
 platform/linux-generic/include/odp/cpumask.h|  8 
 platform/linux-generic/include/odp/errno.h  |  6 --
 platform/linux-generic/include/odp/plat/buffer_types.h  |  9 -
 platform/linux-generic/include/odp/plat/cpumask_types.h |  2 +-
 platform/linux-generic/include/odp/system_info.h|  7 ---
 platform/linux-generic/include/odp/time.h   |  6 --
 16 files changed, 11 insertions(+), 74 deletions(-)

diff --git a/include/odp/api/buffer.h b/include/odp/api/buffer.h
index 9ad08ea..aea273f 100644
--- a/include/odp/api/buffer.h
+++ b/include/odp/api/buffer.h
@@ -24,7 +24,6 @@ extern "C" {
  *  @{
  */
 
-
 /**
  * @typedef odp_buffer_t
  * ODP buffer
@@ -36,16 +35,6 @@ extern "C" {
  */
 
 /**
- * @typedef odp_buffer_seg_t
- * ODP buffer segment
- */
-
-/**
- * @def ODP_SEGMENT_INVALID
- * Invalid segment
- */
-
-/**
  * Get buffer handle from event
  *
  * Converts an ODP_EVENT_BUFFER type event to a buffer.
diff --git a/include/odp/api/config.h b/include/odp/api/config.h
index 91ea34e..b5c8fdd 100644
--- a/include/odp/api/config.h
+++ b/include/odp/api/config.h
@@ -18,7 +18,7 @@
 extern "C" {
 #endif
 
-/** @addtogroup odp_compiler_optim
+/** @defgroup odp_config ODP CONFIG
  *  Macro for maximum number of resources in ODP.
  *  @{
  */
diff --git a/include/odp/api/cpumask.h b/include/odp/api/cpumask.h
index 02fd131..2ad7fea 100644
--- a/include/odp/api/cpumask.h
+++ b/include/odp/api/cpumask.h
@@ -20,7 +20,7 @@ extern "C" {
 
 #include 
 
-/** @addtogroup odp_scheduler
+/** @defgroup odp_cpumask ODP CPUMASK
  *  CPU mask operations.
  *  @{
  */
diff --git a/include/odp/api/debug.h b/include/odp/api/debug.h
index 660569f..252a82f 100644
--- a/include/odp/api/debug.h
+++ b/include/odp/api/debug.h
@@ -17,18 +17,13 @@
 extern "C" {
 #endif
 
-/** @addtogroup odp_ver_abt_log_dbg
- *  Macros that allows different messages.
- *  @{
- */
-
 #if defined(__GNUC__) && !defined(__clang__)
 
 
 #if __GNUC__ < 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ < 6))
 
 /**
- * _Static_assert was only added in GCC 4.6. Provide a weak replacement
+ * @internal _Static_assert was only added in GCC 4.6. Provide a weak 
replacement
  * for previous versions.
  */
 #define _Static_assert(e, s) (extern int (*static_assert_checker(void)) \
@@ -42,14 +37,11 @@ extern "C" {
 
 
 /**
- * Compile time assertion-macro - fail compilation if cond is false.
- * @note This macro has zero runtime overhead
+ * @internal Compile time assertion-macro - fail compilation if cond is false.
+ * This macro has zero runtime overhead
  */
 #define _ODP_STATIC_ASSERT(cond, msg)  _Static_assert(cond, msg)
 
-/**
- * @}
- */
 
 #ifdef __cplusplus
 }
diff --git a/include/odp/api/errno.h b/include/odp/api/errno.h
index 527214e..9829807 100644
--- a/include/odp/api/errno.h
+++ b/include/odp/api/errno.h
@@ -17,7 +17,7 @@
 extern "C" {
 #endif
 
-/** @addtogroup odp_ver_abt_log_dbg
+/** @defgroup odp_errno ODP ERRNO
  *  @{
  */
 
diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h
index c679781..a813d33 100644
--- a/include/odp/api/pool.h
+++ b/include/odp/api/pool.h
@@ -22,7 +22,7 @@ extern "C" {
 
 #include 
 
-/** @addtogroup odp_buffer
+/** @defgroup odp_pool ODP POOL
  *  Operations on a pool.
  *  @{
  */
diff --git a/include/odp/api/system_info.h b/include/odp/api/system_info.h
index 1f3294b..e55ff6d 100644
--- a/include/odp/api/system_info.h
+++ b/include/odp/api/system_info.h
@@ -19,7 +19,7 @@ extern "C" {
 #endif
 
 
-/** @addtogroup odp_ver_abt_log_dbg
+/** @defgroup odp_system ODP SYSTEM
  *  @{
  */
 
diff --git a/include/odp/api/time.h b/include/odp/api/time.h
index 836866d..b0072fc 100644
--- a/include/odp/api/time.h
+++ b/include/odp/api/time.h
@@ -19,7 +19,7 @@ extern "C" {
 #endif
 
 
-/** @defgroup odp_system ODP SYSTEM
+/** @defgroup odp_time ODP TIME
  *  @{
  */
 
diff --git a/include/odp/api/version.h b/include/odp/api/version.h
index 5d1abfa..93fbacf 100644
--- a/include/odp/api/version.h
+++ b/include/odp/api/version.h
@@ -18,7 +18,7 @@
 extern "C" {
 #endif
 
-/** @defgroup odp_ver_ab

[lng-odp] [PATCH 10/11] api: pool: remove shm paramter from odp_pool_create()

2015-07-09 Thread Maxim Uvarov
From: Bill Fischofer 

This patch removes the 2nd parameter to odp_pool_create() because it has two
major issues:

1. Applications have no way to know how big a shm area is required for a given
pool since that information is implementation specific. So there's no portable
means of using this parameter.

2. Some implementations (e.g., odp-dpdk) cannot accept an external memory area
for pool creation since they need to control the memory themselves.

Signed-off-by: Bill Fischofer 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 

Conflicts:
test/validation/pktio/pktio.c
test/validation/pool/pool.c
helper/test/odp_chksum.c
---
 example/classifier/odp_classifier.c|  2 +-
 example/generator/odp_generator.c  |  4 +-
 example/ipsec/odp_ipsec.c  |  8 ++--
 example/packet/odp_pktio.c |  2 +-
 example/timer/odp_timer_test.c |  2 +-
 helper/test/odp_chksum.c   |  2 +-
 include/odp/api/pool.h | 35 --
 platform/linux-generic/odp_pool.c  | 54 +-
 platform/linux-generic/odp_schedule.c  |  2 +-
 test/performance/odp_l2fwd.c   |  2 +-
 test/performance/odp_pktio_perf.c  |  5 +-
 test/performance/odp_scheduling.c  |  2 +-
 test/validation/buffer/buffer.c|  6 +--
 .../classification/odp_classification_tests.c  |  3 +-
 test/validation/crypto/crypto.c|  2 +-
 test/validation/packet/packet.c|  4 +-
 test/validation/pktio/pktio.c  |  5 +-
 test/validation/pool/pool.c| 32 +
 test/validation/queue/queue.c  |  2 +-
 test/validation/scheduler/scheduler.c  |  4 +-
 test/validation/timer/timer.c  |  8 ++--
 21 files changed, 54 insertions(+), 132 deletions(-)

diff --git a/example/classifier/odp_classifier.c 
b/example/classifier/odp_classifier.c
index 7b1a1c4..409f016 100644
--- a/example/classifier/odp_classifier.c
+++ b/example/classifier/odp_classifier.c
@@ -432,7 +432,7 @@ int main(int argc, char *argv[])
params.pkt.num = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
params.type= ODP_POOL_PACKET;
 
-   pool = odp_pool_create("packet_pool", ODP_SHM_NULL, ¶ms);
+   pool = odp_pool_create("packet_pool", ¶ms);
 
if (pool == ODP_POOL_INVALID) {
EXAMPLE_ERR("Error: packet pool create failed.\n");
diff --git a/example/generator/odp_generator.c 
b/example/generator/odp_generator.c
index 36219a0..b7ffa07 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -651,7 +651,7 @@ int main(int argc, char *argv[])
params.pkt.num = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
params.type= ODP_POOL_PACKET;
 
-   pool = odp_pool_create("packet_pool", ODP_SHM_NULL, ¶ms);
+   pool = odp_pool_create("packet_pool", ¶ms);
 
if (pool == ODP_POOL_INVALID) {
EXAMPLE_ERR("Error: packet pool create failed.\n");
@@ -678,7 +678,7 @@ int main(int argc, char *argv[])
params.tmo.num = tparams.num_timers; /* One timeout per timer */
params.type= ODP_POOL_TIMEOUT;
 
-   tmop = odp_pool_create("timeout_pool", ODP_SHM_NULL, ¶ms);
+   tmop = odp_pool_create("timeout_pool", ¶ms);
 
if (pool == ODP_POOL_INVALID) {
EXAMPLE_ERR("Error: packet pool create failed.\n");
diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
index 0206d93..04ae35e 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -354,7 +354,7 @@ void ipsec_init_pre(void)
params.pkt.num = SHM_PKT_POOL_BUF_COUNT;
params.type= ODP_POOL_PACKET;
 
-   out_pool = odp_pool_create("out_pool", ODP_SHM_NULL, ¶ms);
+   out_pool = odp_pool_create("out_pool", ¶ms);
 
if (ODP_POOL_INVALID == out_pool) {
EXAMPLE_ERR("Error: message pool create failed.\n");
@@ -1291,8 +1291,7 @@ main(int argc, char *argv[])
params.pkt.num = SHM_PKT_POOL_BUF_COUNT;
params.type= ODP_POOL_PACKET;
 
-   pkt_pool = odp_pool_create("packet_pool", ODP_SHM_NULL,
- ¶ms);
+   pkt_pool = odp_pool_create("packet_pool", ¶ms);
 
if (ODP_POOL_INVALID == pkt_pool) {
EXAMPLE_ERR("Error: packet pool create failed.\n");
@@ -1305,8 +1304,7 @@ main(int argc, char *argv[])
params.buf.num   = SHM_CTX_POOL_BUF_COUNT;
params.type  = ODP_POOL_BUFFER;
 
-   ctx_pool = odp_pool_create("ctx_pool", ODP_SHM_NULL,
- ¶ms);
+   ctx_pool = odp_pool_create("ctx_pool", ¶ms);
 
if (ODP_POOL_INVALID == ctx_pool) {
EXAMPLE_ERR("Erro

Re: [lng-odp] [PATCH] example:printing correct appl_mode

2015-07-09 Thread Maxim Uvarov

On 07/09/15 16:43, Mike Holmes wrote:

Subject should localize to the specific example
example: generator: print correct appl_mode

On 9 July 2015 at 09:32, Balakrishna.Garapati 
> wrote:


Signed-off-by: Balakrishna.Garapati
mailto:balakrishna.garap...@linaro.org>>


With fixed subject message
Reviewed-by: Mike Holmes >


---
 example/generator/odp_generator.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/example/generator/odp_generator.c
b/example/generator/odp_generator.c
index 0ff264c..15de035 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -991,9 +991,11 @@ static void print_info(char *progname,
appl_args_t *appl_args)
printf("\n"
   "Mode:");
if (appl_args->mode == 0)
-   PRINT_APPL_MODE(0);
+   PRINT_APPL_MODE(APPL_MODE_UDP);
+   else if (appl_args->mode == 1)
+   PRINT_APPL_MODE(APPL_MODE_PING);
else
-   PRINT_APPL_MODE(0);
+   PRINT_APPL_MODE(APPL_MODE_RCV);



How about?

PRINT_APPL_MODE(appl_args->mode);

Maxim.


printf("\n\n");
fflush(NULL);
 }
--
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org 
https://lists.linaro.org/mailman/listinfo/lng-odp




--
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org ***│ *Open source software for ARM SoCs



___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT PATCH 2/2] validation: thread: test thrmask

2015-07-09 Thread Mike Holmes
On 9 July 2015 at 02:57, Christophe Milard 
wrote:

>
>
> On 8 July 2015 at 23:20, Mike Holmes  wrote:
>
>> Signed-off-by: Mike Holmes 
>> ---
>>  test/validation/thread/thread.c | 34 ++
>>  1 file changed, 34 insertions(+)
>>
>> diff --git a/test/validation/thread/thread.c
>> b/test/validation/thread/thread.c
>> index d0bd75e..d5609a2 100644
>> --- a/test/validation/thread/thread.c
>> +++ b/test/validation/thread/thread.c
>> @@ -11,6 +11,37 @@
>>  /* Helper macro for CU_TestInfo initialization */
>>  #define _CU_TEST_INFO(test_func) {#test_func, test_func}
>>
>> +static void thread_test_odp_thred_type(void)
>>
>
> I guess you wanted "thread_test_odp_thread_type?" (threAd, not thred)
>

Thanks - will fix


>
>
>> +{
>> +   odp_thread_type_t t_type;
>> +
>> +   t_type = odp_thread_type();
>> +   if ((t_type != ODP_THREAD_WORKER) &&
>> +   (t_type != ODP_THREAD_CONTROL))
>> +   CU_FAIL();
>> +
>> +   CU_PASS();
>> +}
>> +
>> +static void thread_test_odp_thrmask_worker(void)
>> +{
>> +   odp_thrmask_t t_type;
>> +
>> +   (void)odp_thrmask_worker(&t_type);
>> +
>> +   CU_PASS();
>> +}
>> +
>> +
>> +static void thread_test_odp_thrmask_control(void)
>> +{
>> +   odp_thrmask_t t_type;
>> +
>> +   (void)odp_thrmask_control(&t_type);
>> +
>> +   CU_PASS();
>> +}
>> +
>>  static void thread_test_odp_cpu_id(void)
>>  {
>> (void)odp_cpu_id();
>> @@ -33,6 +64,9 @@ static CU_TestInfo thread_suite[] = {
>> _CU_TEST_INFO(thread_test_odp_cpu_id),
>> _CU_TEST_INFO(thread_test_odp_thread_id),
>> _CU_TEST_INFO(thread_test_odp_thread_count),
>> +   _CU_TEST_INFO(thread_test_odp_thred_type),
>>
>
> thread
> Christophe.
>
>
>> +   _CU_TEST_INFO(thread_test_odp_thrmask_worker),
>> +   _CU_TEST_INFO(thread_test_odp_thrmask_control),
>> CU_TEST_INFO_NULL,
>>  };
>>
>> --
>> 2.1.4
>>
>>
>


-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org  *│ *Open source software for ARM SoCs
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] test: pktio_perf: add missing ns to cycle conversion for busy loop

2015-07-09 Thread Bill Fischofer
On Thu, Jul 9, 2015 at 3:56 AM, Nicolas Morey-Chaisemartin  wrote:

> Signed-off-by: Benoît Ganne 
> Reviewed-by: Nicolas Morey-Chaisemartin 
>

Reviewed-by: Bill Fischofer 


> ---
>  test/performance/odp_pktio_perf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/performance/odp_pktio_perf.c
> b/test/performance/odp_pktio_perf.c
> index 3a22f9d..f4d9d2d 100644
> --- a/test/performance/odp_pktio_perf.c
> +++ b/test/performance/odp_pktio_perf.c
> @@ -573,7 +573,7 @@ static int setup_txrx_masks(odp_cpumask_t *thd_mask_tx,
>   */
>  static void busy_loop_ns(uint64_t wait_ns)
>  {
> -   uint64_t end = odp_time_cycles() + wait_ns;
> +   uint64_t end = odp_time_cycles() + odp_time_ns_to_cycles(wait_ns);
> while (odp_time_cycles() < end)
> ;
>  }
> --
> 2.4.5.3.g4915f6f
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] example:printing correct appl_mode

2015-07-09 Thread Krishna Garapati
PRINT_APPL_MODE prints  #mode (string) & mode (0,1 or 2).  if we pass "
appl_args->mode", it prints this as a string instead of ex: APPL_MODE_PING.

On 9 July 2015 at 15:48, Maxim Uvarov  wrote:

> On 07/09/15 16:43, Mike Holmes wrote:
>
>> Subject should localize to the specific example
>> example: generator: print correct appl_mode
>>
>> On 9 July 2015 at 09:32, Balakrishna.Garapati <
>> balakrishna.garap...@linaro.org >
>> wrote:
>>
>> Signed-off-by: Balakrishna.Garapati
>> > >
>>
>>
>> With fixed subject message
>> Reviewed-by: Mike Holmes > mike.hol...@linaro.org>>
>>
>> ---
>>  example/generator/odp_generator.c | 6 --
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/example/generator/odp_generator.c
>> b/example/generator/odp_generator.c
>> index 0ff264c..15de035 100644
>> --- a/example/generator/odp_generator.c
>> +++ b/example/generator/odp_generator.c
>> @@ -991,9 +991,11 @@ static void print_info(char *progname,
>> appl_args_t *appl_args)
>> printf("\n"
>>"Mode:");
>> if (appl_args->mode == 0)
>> -   PRINT_APPL_MODE(0);
>> +   PRINT_APPL_MODE(APPL_MODE_UDP);
>> +   else if (appl_args->mode == 1)
>> +   PRINT_APPL_MODE(APPL_MODE_PING);
>> else
>> -   PRINT_APPL_MODE(0);
>> +   PRINT_APPL_MODE(APPL_MODE_RCV);
>>
>>
> How about?
>
> PRINT_APPL_MODE(appl_args->mode);
>
> Maxim.
>
>>
>> printf("\n\n");
>> fflush(NULL);
>>  }
>> --
>> 1.9.1
>>
>> ___
>> lng-odp mailing list
>> lng-odp@lists.linaro.org 
>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>>
>>
>>
>> --
>> Mike Holmes
>> Technical Manager - Linaro Networking Group
>> Linaro.org ***│ *Open source software for ARM
>> SoCs
>>
>>
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCHV1] example:generator:print correct appl_mode

2015-07-09 Thread Balakrishna.Garapati
Signed-off-by: Balakrishna.Garapati 
---
 example/generator/odp_generator.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/example/generator/odp_generator.c 
b/example/generator/odp_generator.c
index 0ff264c..15de035 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -991,9 +991,11 @@ static void print_info(char *progname, appl_args_t 
*appl_args)
printf("\n"
   "Mode:");
if (appl_args->mode == 0)
-   PRINT_APPL_MODE(0);
+   PRINT_APPL_MODE(APPL_MODE_UDP);
+   else if (appl_args->mode == 1)
+   PRINT_APPL_MODE(APPL_MODE_PING);
else
-   PRINT_APPL_MODE(0);
+   PRINT_APPL_MODE(APPL_MODE_RCV);
printf("\n\n");
fflush(NULL);
 }
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCHv2] example:generator:print correct appl_mode

2015-07-09 Thread Balakrishna.Garapati
Signed-off-by: Balakrishna.Garapati 
---
 since v1: changed the commit message
 example/generator/odp_generator.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/example/generator/odp_generator.c 
b/example/generator/odp_generator.c
index 0ff264c..15de035 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -991,9 +991,11 @@ static void print_info(char *progname, appl_args_t 
*appl_args)
printf("\n"
   "Mode:");
if (appl_args->mode == 0)
-   PRINT_APPL_MODE(0);
+   PRINT_APPL_MODE(APPL_MODE_UDP);
+   else if (appl_args->mode == 1)
+   PRINT_APPL_MODE(APPL_MODE_PING);
else
-   PRINT_APPL_MODE(0);
+   PRINT_APPL_MODE(APPL_MODE_RCV);
printf("\n\n");
fflush(NULL);
 }
-- 
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] test: pktio_perf: add missing ns to cycle conversion for busy loop

2015-07-09 Thread Maxim Uvarov

Merged, thanks,

Maxim.

On 07/09/15 16:56, Bill Fischofer wrote:



On Thu, Jul 9, 2015 at 3:56 AM, Nicolas Morey-Chaisemartin 
mailto:nmo...@kalray.eu>> wrote:


Signed-off-by: Benoît Ganne mailto:benoit.ga...@kalray.eu>>
Reviewed-by: Nicolas Morey-Chaisemartin mailto:nmo...@kalray.eu>>


Reviewed-by: Bill Fischofer >


---
 test/performance/odp_pktio_perf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/performance/odp_pktio_perf.c
b/test/performance/odp_pktio_perf.c
index 3a22f9d..f4d9d2d 100644
--- a/test/performance/odp_pktio_perf.c
+++ b/test/performance/odp_pktio_perf.c
@@ -573,7 +573,7 @@ static int setup_txrx_masks(odp_cpumask_t
*thd_mask_tx,
  */
 static void busy_loop_ns(uint64_t wait_ns)
 {
-   uint64_t end = odp_time_cycles() + wait_ns;
+   uint64_t end = odp_time_cycles() +
odp_time_ns_to_cycles(wait_ns);
while (odp_time_cycles() < end)
;
 }
--
2.4.5.3.g4915f6f

___
lng-odp mailing list
lng-odp@lists.linaro.org 
https://lists.linaro.org/mailman/listinfo/lng-odp




___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCHV1] example:generator:print correct appl_mode

2015-07-09 Thread Krishna Garapati
Wrong version. Sent an other patch with correct version v2. Ignore this
patch.

/Krishna

On 9 July 2015 at 16:00, Balakrishna.Garapati <
balakrishna.garap...@linaro.org> wrote:

> Signed-off-by: Balakrishna.Garapati 
> ---
>  example/generator/odp_generator.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/example/generator/odp_generator.c
> b/example/generator/odp_generator.c
> index 0ff264c..15de035 100644
> --- a/example/generator/odp_generator.c
> +++ b/example/generator/odp_generator.c
> @@ -991,9 +991,11 @@ static void print_info(char *progname, appl_args_t
> *appl_args)
> printf("\n"
>"Mode:");
> if (appl_args->mode == 0)
> -   PRINT_APPL_MODE(0);
> +   PRINT_APPL_MODE(APPL_MODE_UDP);
> +   else if (appl_args->mode == 1)
> +   PRINT_APPL_MODE(APPL_MODE_PING);
> else
> -   PRINT_APPL_MODE(0);
> +   PRINT_APPL_MODE(APPL_MODE_RCV);
> printf("\n\n");
> fflush(NULL);
>  }
> --
> 1.9.1
>
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1670] Segmented packet not supported by socket pktio

2015-07-09 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1670

Mike Holmes  changed:

   What|Removed |Added

 Status|UNCONFIRMED |IN_PROGRESS
 CC||mike.hol...@linaro.org
 Ever confirmed|0   |1

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1337] No means of knowing the size of the CPU mask (odp_cpumask_t)

2015-07-09 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1337

Bill Fischofer  changed:

   What|Removed |Added

 CC||bill.fischo...@linaro.org

--- Comment #4 from Bill Fischofer  ---
Does ODP_CPUMASK_STR_SIZE satisfy this requirement or do we need a new API?

-- 
You are receiving this mail because:
You are the assignee for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1632] validation: pktio test generates invalid UDP packets

2015-07-09 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1632

Mike Holmes  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||mike.hol...@linaro.org
 Resolution|--- |FIXED

--- Comment #3 from Mike Holmes  ---
commit 56d3e13bff23a5306c8d568dac529e002a2c22ec

-- 
You are receiving this mail because:
You are the assignee for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1615] odp_timer fails in CI with Segmentation fault

2015-07-09 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1615

--- Comment #3 from Mike Holmes  ---
Ivan posted patches http://patches.opendataplane.org/patch/2097/

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1615] odp_timer fails in CI with Segmentation fault

2015-07-09 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1615

--- Comment #2 from Mike Holmes  ---
Ivan posted patches http://patches.opendataplane.org/patch/2097/

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1548] Untested API parse_ipv6

2015-07-09 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1548

--- Comment #2 from Bill Fischofer  ---
Bug fixed by commit f4b93abaa3e2ac6af6fe75209a4f6622f5d68e1e by Michael Altizer

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1608] api: add note about odp_pool_destroy

2015-07-09 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1608

Mike Holmes  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Mike Holmes  ---
commit d5f0c396007be841392caf6dbc001f722bad7537

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1001] linux-generic: schedule: priority scheduling broken for one thread

2015-07-09 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1001

Bill Fischofer  changed:

   What|Removed |Added

 CC||bill.fischo...@linaro.org

--- Comment #10 from Bill Fischofer  ---
Has this bug still been verified as current?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1001] linux-generic: schedule: priority scheduling broken for one thread

2015-07-09 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1001

--- Comment #11 from Mike Holmes  ---
Will close this next week if there is no update

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH 0/3] validation: cleaning up in cunit_common

2015-07-09 Thread Stuart Haslam
On Thu, Jul 09, 2015 at 11:25:30AM +0200, Christophe Milard wrote:
> A few things that were needed when old-style modules (called directely
> from the validation side) and new-style modules (lib and platform calls)
> were both in use can now be cleaned up.
> To be applied once all modules have been converted to be called from
> the platform side, i.e. after pull request:
> https://lists.linaro.org/pipermail/lng-odp/2015-July/013121.html
> 
> Christophe Milard (3):
>   validation: remove WEAK def of global_test_init
>   validation: removed main function from cunit_common
>   validation: removal of odp_testsuites
> 

Reviewed-by: Stuart Haslam 

>  test/validation/common/Makefile.am|  8 ++--
>  test/validation/common/odp_cunit_common.c | 16 
>  test/validation/common/odp_cunit_common.h | 13 +
>  test/validation/crypto/crypto.c   |  6 --
>  test/validation/synchronizers/synchronizers.c |  3 ++-
>  5 files changed, 13 insertions(+), 33 deletions(-)
> 
> -- 
> 1.9.1
> 
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCHv2] validation: cleaning up Makefile

2015-07-09 Thread Christophe Milard
Stuart: Can you review that obvious one as well? It belongs to the clean-up
stuff as well...
Thanks

/Christophe.

On 9 July 2015 at 09:30, Christophe Milard 
wrote:

> The validation/Makefile.am is now simply calling the Makefile of
> each module and many older things can be cleaned-up from it.
>
> Signed-off-by: Christophe Milard 
> ---
>
> since v1: rebased.
> To be applied once all modules have been converted to be called from
> the platform side, i.e. after pull request:
> https://lists.linaro.org/pipermail/lng-odp/2015-July/013121.html
>
>  test/validation/Makefile.am | 7 ---
>  1 file changed, 7 deletions(-)
>
> diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
> index 1b40d11..56ddd64 100644
> --- a/test/validation/Makefile.am
> +++ b/test/validation/Makefile.am
> @@ -1,10 +1,3 @@
> -AM_CFLAGS += -I$(srcdir)/common
> -AM_LDFLAGS += -static
> -
> -ODP_CU_COMMON=common/odp_cunit_common.c
> -
> -odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
> -
>  ODP_MODULES = buffer \
>   classification \
>   cpumask \
> --
> 1.9.1
>
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1337] No means of knowing the size of the CPU mask (odp_cpumask_t)

2015-07-09 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1337

--- Comment #5 from Christophe Milard  ---
The function cpumask_setall() (in api-next) now returns a mask with all bit set
in the mask and can therefore be used.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1337] No means of knowing the size of the CPU mask (odp_cpumask_t)

2015-07-09 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1337

Christophe Milard  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|UNCONFIRMED |RESOLVED

-- 
You are receiving this mail because:
You are the assignee for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 00/17] validation: populating libraries

2015-07-09 Thread Christophe Milard
This series of patch populate the module test libraries
with the related test symbols.

Christophe Milard (17):
  validation: synchronizers: lib populated
  validation: crypto: lib populated
  validation: shmem: lib populated
  validation: init: lib populated
  validation: buffer: lib populated
  validation: classification: lib populated
  validation: pktio: lib populated
  validation: packet: lib populated
  validation: cpumask: lib populated
  validation: pool: lib populated
  validation: thread: lib populated
  validation: scheduler: lib populated
  validation: timer: lib populated
  validation: time: lib populated
  validation: queue: lib populated
  validation: system: lib populated
  validation: random: lib populated

 test/validation/buffer/buffer.c| 14 ++---
 test/validation/buffer/buffer.h| 18 ++
 test/validation/classification/classification.c|  2 +-
 test/validation/classification/classification.h| 31 ++
 .../classification/odp_classification_basic.c  | 17 +++---
 .../classification/odp_classification_tests.c  | 13 +++--
 test/validation/cpumask/cpumask.c  | 32 +-
 test/validation/cpumask/cpumask.h  | 25 
 test/validation/crypto/crypto.c|  6 +-
 test/validation/crypto/crypto.h| 24 
 test/validation/crypto/odp_crypto_test_inp.c   | 11 ++--
 test/validation/init/init.c| 18 +++---
 test/validation/init/init.h| 18 ++
 test/validation/packet/packet.c| 44 +++---
 test/validation/packet/packet.h| 33 +++
 test/validation/pktio/pktio.c  | 32 +-
 test/validation/pktio/pktio.h  | 27 +
 test/validation/pool/pool.c| 14 ++---
 test/validation/pool/pool.h| 16 +
 test/validation/queue/queue.c  | 10 ++--
 test/validation/queue/queue.h  | 16 +
 test/validation/random/random.c|  6 +-
 test/validation/random/random.h| 12 
 test/validation/scheduler/scheduler.c  | 68 +++---
 test/validation/scheduler/scheduler.h  | 45 ++
 test/validation/shmem/shmem.c  |  6 +-
 test/validation/shmem/shmem.h  | 12 
 test/validation/synchronizers/synchronizers.c  | 44 +++---
 test/validation/synchronizers/synchronizers.h  | 35 +++
 test/validation/system/system.c| 18 +++---
 test/validation/system/system.h| 18 ++
 test/validation/thread/thread.c| 10 ++--
 test/validation/thread/thread.h| 14 +
 test/validation/time/time.c|  8 +--
 test/validation/time/time.h| 14 +
 test/validation/timer/timer.c  | 12 ++--
 test/validation/timer/timer.h  | 15 +
 37 files changed, 567 insertions(+), 191 deletions(-)

-- 
2.1.0

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 01/17] validation: synchronizers: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/synchronizers/synchronizers.c | 44 +--
 test/validation/synchronizers/synchronizers.h | 35 +
 2 files changed, 57 insertions(+), 22 deletions(-)

diff --git a/test/validation/synchronizers/synchronizers.c 
b/test/validation/synchronizers/synchronizers.c
index fb12a05..d8a69a3 100644
--- a/test/validation/synchronizers/synchronizers.c
+++ b/test/validation/synchronizers/synchronizers.c
@@ -920,7 +920,7 @@ static void test_atomic_validate(void)
 }
 
 /* Barrier tests */
-static void synchronizers_test_no_barrier_functional(void)
+void synchronizers_test_no_barrier_functional(void)
 {
pthrd_arg arg;
 
@@ -930,7 +930,7 @@ static void synchronizers_test_no_barrier_functional(void)
odp_cunit_thread_exit(&arg);
 }
 
-static void synchronizers_test_barrier_functional(void)
+void synchronizers_test_barrier_functional(void)
 {
pthrd_arg arg;
 
@@ -940,14 +940,14 @@ static void synchronizers_test_barrier_functional(void)
odp_cunit_thread_exit(&arg);
 }
 
-static CU_TestInfo synchronizers_suite_barrier[] = {
+CU_TestInfo synchronizers_suite_barrier[] = {
{"no_barrier_functional", synchronizers_test_no_barrier_functional},
{"barrier_functional", synchronizers_test_barrier_functional},
CU_TEST_INFO_NULL
 };
 
 /* Thread-unsafe tests */
-static void synchronizers_test_no_lock_functional(void)
+void synchronizers_test_no_lock_functional(void)
 {
pthrd_arg arg;
 
@@ -956,13 +956,13 @@ static void synchronizers_test_no_lock_functional(void)
odp_cunit_thread_exit(&arg);
 }
 
-static CU_TestInfo synchronizers_suite_no_locking[] = {
+CU_TestInfo synchronizers_suite_no_locking[] = {
{"no_lock_functional", synchronizers_test_no_lock_functional},
CU_TEST_INFO_NULL
 };
 
 /* Spin lock tests */
-static void synchronizers_test_spinlock_api(void)
+void synchronizers_test_spinlock_api(void)
 {
pthrd_arg arg;
 
@@ -971,7 +971,7 @@ static void synchronizers_test_spinlock_api(void)
odp_cunit_thread_exit(&arg);
 }
 
-static void synchronizers_test_spinlock_functional(void)
+void synchronizers_test_spinlock_functional(void)
 {
pthrd_arg arg;
 
@@ -981,14 +981,14 @@ static void synchronizers_test_spinlock_functional(void)
odp_cunit_thread_exit(&arg);
 }
 
-static CU_TestInfo synchronizers_suite_spinlock[] = {
+CU_TestInfo synchronizers_suite_spinlock[] = {
{"spinlock_api", synchronizers_test_spinlock_api},
{"spinlock_functional", synchronizers_test_spinlock_functional},
CU_TEST_INFO_NULL
 };
 
 /* Ticket lock tests */
-static void synchronizers_test_ticketlock_api(void)
+void synchronizers_test_ticketlock_api(void)
 {
pthrd_arg arg;
 
@@ -997,7 +997,7 @@ static void synchronizers_test_ticketlock_api(void)
odp_cunit_thread_exit(&arg);
 }
 
-static void synchronizers_test_ticketlock_functional(void)
+void synchronizers_test_ticketlock_functional(void)
 {
pthrd_arg arg;
 
@@ -1008,14 +1008,14 @@ static void 
synchronizers_test_ticketlock_functional(void)
odp_cunit_thread_exit(&arg);
 }
 
-static CU_TestInfo synchronizers_suite_ticketlock[] = {
+CU_TestInfo synchronizers_suite_ticketlock[] = {
{"ticketlock_api", synchronizers_test_ticketlock_api},
{"ticketlock_functional", synchronizers_test_ticketlock_functional},
CU_TEST_INFO_NULL
 };
 
 /* RW lock tests */
-static void synchronizers_test_rwlock_api(void)
+void synchronizers_test_rwlock_api(void)
 {
pthrd_arg arg;
 
@@ -1024,7 +1024,7 @@ static void synchronizers_test_rwlock_api(void)
odp_cunit_thread_exit(&arg);
 }
 
-static void synchronizers_test_rwlock_functional(void)
+void synchronizers_test_rwlock_functional(void)
 {
pthrd_arg arg;
 
@@ -1034,13 +1034,13 @@ static void synchronizers_test_rwlock_functional(void)
odp_cunit_thread_exit(&arg);
 }
 
-static CU_TestInfo synchronizers_suite_rwlock[] = {
+CU_TestInfo synchronizers_suite_rwlock[] = {
{"rwlock_api", synchronizers_test_rwlock_api},
{"rwlock_functional", synchronizers_test_rwlock_functional},
CU_TEST_INFO_NULL
 };
 
-static int synchronizers_suite_init(void)
+int synchronizers_suite_init(void)
 {
uint32_t num_threads, idx;
 
@@ -1052,7 +1052,7 @@ static int synchronizers_suite_init(void)
return 0;
 }
 
-static int synchronizers_init(void)
+int synchronizers_init(void)
 {
uint32_t core_count, max_threads;
int ret = 0;
@@ -1164,27 +1164,27 @@ static void test_atomic_functional(void *func_ptr(void 
*))
test_atomic_validate();
 }
 
-static void synchronizers_test_atomic_inc_dec(void)
+void synchronizers_test_atomic_inc_dec(void)
 {
test_atomic_functional(test_atomic_inc_dec_thread);
 }
 
-static void synchronizers_test_atomic_add_sub(void)
+void synchronizers_test_atomic_add_sub(void)
 {
  

[lng-odp] [PATCH 03/17] validation: shmem: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/shmem/shmem.c |  6 +++---
 test/validation/shmem/shmem.h | 12 
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/test/validation/shmem/shmem.c b/test/validation/shmem/shmem.c
index 0c713c6..3abba0c 100644
--- a/test/validation/shmem/shmem.c
+++ b/test/validation/shmem/shmem.c
@@ -44,7 +44,7 @@ static void *run_shm_thread(void *arg)
return arg;
 }
 
-static void shmem_test_odp_shm_sunnyday(void)
+void shmem_test_odp_shm_sunnyday(void)
 {
pthrd_arg thrdarg;
odp_shm_t shm;
@@ -76,12 +76,12 @@ static void shmem_test_odp_shm_sunnyday(void)
odp_cunit_thread_exit(&thrdarg);
 }
 
-static CU_TestInfo shmem_suite[] = {
+CU_TestInfo shmem_suite[] = {
{"test_odp_shm_creat",  shmem_test_odp_shm_sunnyday},
CU_TEST_INFO_NULL,
 };
 
-static CU_SuiteInfo shmem_suites[] = {
+CU_SuiteInfo shmem_suites[] = {
{"Shared Memory", NULL, NULL, NULL, NULL, shmem_suite},
CU_SUITE_INFO_NULL,
 };
diff --git a/test/validation/shmem/shmem.h b/test/validation/shmem/shmem.h
index 9b79027..924c796 100644
--- a/test/validation/shmem/shmem.h
+++ b/test/validation/shmem/shmem.h
@@ -4,4 +4,16 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include 
+
+/* test functions: */
+void shmem_test_odp_shm_sunnyday(void);
+
+/* test arrays: */
+extern CU_TestInfo shmem_suite[];
+
+/* test registery: */
+extern CU_SuiteInfo shmem_suites[];
+
+/* main test program: */
 int shmem_main(void);
-- 
2.1.0

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 04/17] validation: init: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/init/init.c | 18 +-
 test/validation/init/init.h | 18 ++
 2 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/test/validation/init/init.c b/test/validation/init/init.c
index 169bd5c..12aa554 100644
--- a/test/validation/init/init.c
+++ b/test/validation/init/init.c
@@ -22,7 +22,7 @@ ODP_PRINTF_FORMAT(2, 3)
 static int odp_init_log(odp_log_level_e level, const char *fmt, ...);
 
 /* test ODP global init, with alternate abort function */
-static void init_test_odp_init_global_replace_abort(void)
+void init_test_odp_init_global_replace_abort(void)
 {
int status;
struct odp_init_t init_data;
@@ -37,12 +37,12 @@ static void init_test_odp_init_global_replace_abort(void)
CU_ASSERT(status == 0);
 }
 
-static CU_TestInfo init_suite_abort[] = {
+CU_TestInfo init_suite_abort[] = {
{"replace abort",  init_test_odp_init_global_replace_abort},
CU_TEST_INFO_NULL,
 };
 
-static CU_SuiteInfo init_suites_abort[] = {
+CU_SuiteInfo init_suites_abort[] = {
{"Init", NULL, NULL, NULL, NULL, init_suite_abort},
CU_SUITE_INFO_NULL,
 };
@@ -63,7 +63,7 @@ int init_main_abort(void)
 }
 
 /* test ODP global init, with alternate log function */
-static void init_test_odp_init_global_replace_log(void)
+void init_test_odp_init_global_replace_log(void)
 {
int status;
struct odp_init_t init_data;
@@ -82,12 +82,12 @@ static void init_test_odp_init_global_replace_log(void)
CU_ASSERT(status == 0);
 }
 
-static CU_TestInfo init_suite_log[] = {
+CU_TestInfo init_suite_log[] = {
{"replace log",  init_test_odp_init_global_replace_log},
CU_TEST_INFO_NULL,
 };
 
-static CU_SuiteInfo init_suites_log[] = {
+CU_SuiteInfo init_suites_log[] = {
{"Init", NULL, NULL, NULL, NULL, init_suite_log},
CU_SUITE_INFO_NULL,
 };
@@ -119,7 +119,7 @@ int init_main_log(void)
 }
 
 /* test normal ODP global init */
-static void init_test_odp_init_global(void)
+void init_test_odp_init_global(void)
 {
int status;
 
@@ -130,12 +130,12 @@ static void init_test_odp_init_global(void)
CU_ASSERT(status == 0);
 }
 
-static CU_TestInfo init_suite_ok[] = {
+CU_TestInfo init_suite_ok[] = {
{"test_odp_init_global",  init_test_odp_init_global},
CU_TEST_INFO_NULL,
 };
 
-static CU_SuiteInfo init_suites_ok[] = {
+CU_SuiteInfo init_suites_ok[] = {
{"Init", NULL, NULL, NULL, NULL, init_suite_ok},
CU_SUITE_INFO_NULL,
 };
diff --git a/test/validation/init/init.h b/test/validation/init/init.h
index ca03994..c94b960 100644
--- a/test/validation/init/init.h
+++ b/test/validation/init/init.h
@@ -4,6 +4,24 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include 
+
+/* test functions: */
+void init_test_odp_init_global_replace_abort(void);
+void init_test_odp_init_global_replace_log(void);
+void init_test_odp_init_global(void);
+
+/* test arrays: */
+extern CU_TestInfo init_suite_abort[];
+extern CU_TestInfo init_suite_log[];
+extern CU_TestInfo init_suite_ok[];
+
+/* test registery: */
+extern CU_SuiteInfo init_suites_abort[];
+extern CU_SuiteInfo init_suites_log[];
+extern CU_SuiteInfo init_suites_ok[];
+
+/* main test program: */
 int init_main_abort(void);
 int init_main_log(void);
 int init_main_ok(void);
-- 
2.1.0

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 02/17] validation: crypto: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/crypto/crypto.c  |  6 +++---
 test/validation/crypto/crypto.h  | 24 
 test/validation/crypto/odp_crypto_test_inp.c | 11 ++-
 3 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/test/validation/crypto/crypto.c b/test/validation/crypto/crypto.c
index 5b06cdc..88b0466 100644
--- a/test/validation/crypto/crypto.c
+++ b/test/validation/crypto/crypto.c
@@ -15,7 +15,7 @@
 #define SHM_COMPL_POOL_SIZE(128 * 1024)
 #define SHM_COMPL_POOL_BUF_SIZE128
 
-static CU_SuiteInfo crypto_suites[] = {
+CU_SuiteInfo crypto_suites[] = {
{ODP_CRYPTO_SYNC_INP, crypto_suite_sync_init, NULL, NULL, NULL,
crypto_suite},
{ODP_CRYPTO_ASYNC_INP, crypto_suite_async_init, NULL, NULL, NULL,
@@ -23,7 +23,7 @@ static CU_SuiteInfo crypto_suites[] = {
CU_SUITE_INFO_NULL,
 };
 
-static int crypto_init(void)
+int crypto_init(void)
 {
odp_pool_param_t params;
odp_pool_t pool;
@@ -60,7 +60,7 @@ static int crypto_init(void)
return 0;
 }
 
-static int crypto_term(void)
+int crypto_term(void)
 {
odp_pool_t pool;
odp_queue_t out_queue;
diff --git a/test/validation/crypto/crypto.h b/test/validation/crypto/crypto.h
index aacb511..747abf2 100644
--- a/test/validation/crypto/crypto.h
+++ b/test/validation/crypto/crypto.h
@@ -4,4 +4,28 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include 
+
+/* test functions: */
+void crypto_test_enc_alg_3des_cbc(void);
+void crypto_test_enc_alg_3des_cbc_ovr_iv(void);
+void crypto_test_dec_alg_3des_cbc(void);
+void crypto_test_dec_alg_3des_cbc_ovr_iv(void);
+void crypto_test_alg_hmac_md5(void);
+
+/* test arrays: */
+extern CU_TestInfo crypto_suite[];
+
+/* test array init/term functions: */
+int crypto_suite_sync_init(void);
+int crypto_suite_async_init(void);
+
+/* test registery: */
+extern CU_SuiteInfo crypto_suites[];
+
+/* executable init/term functions: */
+int crypto_init(void);
+int crypto_term(void);
+
+/* main test program: */
 int crypto_main(void);
diff --git a/test/validation/crypto/odp_crypto_test_inp.c 
b/test/validation/crypto/odp_crypto_test_inp.c
index c1c08af..90fe8d0 100644
--- a/test/validation/crypto/odp_crypto_test_inp.c
+++ b/test/validation/crypto/odp_crypto_test_inp.c
@@ -8,6 +8,7 @@
 #include 
 #include "test_vectors.h"
 #include "odp_crypto_test_inp.h"
+#include "crypto.h"
 
 struct suite_context_s {
enum odp_crypto_op_mode pref_mode;
@@ -132,7 +133,7 @@ cleanup:
  * In addition the test verifies if the implementation can use the
  * packet buffer as completion event buffer.*/
 #define ASYNC_INP_ENC_ALG_3DES_CBC "ENC_ALG_3DES_CBC"
-static void crypto_test_enc_alg_3des_cbc(void)
+void crypto_test_enc_alg_3des_cbc(void)
 {
odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
 auth_key   = { .data = NULL, .length = 0 };
@@ -165,7 +166,7 @@ static void crypto_test_enc_alg_3des_cbc(void)
  * operation for 3DES_CBC algorithm. IV for the operation is the operation IV.
  * */
 #define ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV  "ENC_ALG_3DES_CBC_OVR_IV"
-static void crypto_test_enc_alg_3des_cbc_ovr_iv(void)
+void crypto_test_enc_alg_3des_cbc_ovr_iv(void)
 {
odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
 auth_key   = { .data = NULL, .length = 0 };
@@ -199,7 +200,7 @@ static void crypto_test_enc_alg_3des_cbc_ovr_iv(void)
  * packet buffer as completion event buffer.
  * */
 #define ASYNC_INP_DEC_ALG_3DES_CBC "DEC_ALG_3DES_CBC"
-static void crypto_test_dec_alg_3des_cbc(void)
+void crypto_test_dec_alg_3des_cbc(void)
 {
odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
 auth_key   = { .data = NULL, .length = 0 };
@@ -234,7 +235,7 @@ static void crypto_test_dec_alg_3des_cbc(void)
  * packet buffer as completion event buffer.
  * */
 #define ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV  "DEC_ALG_3DES_CBC_OVR_IV"
-static void crypto_test_dec_alg_3des_cbc_ovr_iv(void)
+void crypto_test_dec_alg_3des_cbc_ovr_iv(void)
 {
odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
 auth_key   = { .data = NULL, .length = 0 };
@@ -270,7 +271,7 @@ static void crypto_test_dec_alg_3des_cbc_ovr_iv(void)
  * packet buffer as completion event buffer.
  * */
 #define ASYNC_INP_ALG_HMAC_MD5 "ALG_HMAC_MD5"
-static void crypto_test_alg_hmac_md5(void)
+void crypto_test_alg_hmac_md5(void)
 {
odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
 auth_key   = { .data = NULL, .length = 0 };
-- 
2.1.0

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 05/17] validation: buffer: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/buffer/buffer.c | 14 +++---
 test/validation/buffer/buffer.h | 18 ++
 2 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/test/validation/buffer/buffer.c b/test/validation/buffer/buffer.c
index d0fd510..fad1f8d 100644
--- a/test/validation/buffer/buffer.c
+++ b/test/validation/buffer/buffer.c
@@ -15,7 +15,7 @@ static odp_pool_t raw_pool;
 static odp_buffer_t raw_buffer = ODP_BUFFER_INVALID;
 static const size_t raw_buffer_size = 1500;
 
-static int buffer_suite_init(void)
+int buffer_suite_init(void)
 {
odp_pool_param_t params = {
.buf = {
@@ -35,7 +35,7 @@ static int buffer_suite_init(void)
return 0;
 }
 
-static int buffer_suite_term(void)
+int buffer_suite_term(void)
 {
odp_buffer_free(raw_buffer);
if (odp_pool_destroy(raw_pool) != 0)
@@ -43,7 +43,7 @@ static int buffer_suite_term(void)
return 0;
 }
 
-static void buffer_test_pool_alloc(void)
+void buffer_test_pool_alloc(void)
 {
odp_pool_t pool;
const int num = 3;
@@ -95,7 +95,7 @@ static void buffer_test_pool_alloc(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
 }
 
-static void buffer_test_pool_free(void)
+void buffer_test_pool_free(void)
 {
odp_pool_t pool;
odp_buffer_t buffer;
@@ -127,7 +127,7 @@ static void buffer_test_pool_free(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
 }
 
-static void buffer_test_management_basic(void)
+void buffer_test_management_basic(void)
 {
odp_event_t ev = odp_buffer_to_event(raw_buffer);
 
@@ -142,14 +142,14 @@ static void buffer_test_management_basic(void)
CU_ASSERT(odp_event_to_u64(ev) != odp_event_to_u64(ODP_EVENT_INVALID));
 }
 
-static CU_TestInfo buffer_suite[] = {
+CU_TestInfo buffer_suite[] = {
_CU_TEST_INFO(buffer_test_pool_alloc),
_CU_TEST_INFO(buffer_test_pool_free),
_CU_TEST_INFO(buffer_test_management_basic),
CU_TEST_INFO_NULL,
 };
 
-static CU_SuiteInfo buffer_suites[] = {
+CU_SuiteInfo buffer_suites[] = {
{ .pName = "buffer tests",
.pTests = buffer_suite,
.pInitFunc = buffer_suite_init,
diff --git a/test/validation/buffer/buffer.h b/test/validation/buffer/buffer.h
index 44d05a2..2fbf1f3 100644
--- a/test/validation/buffer/buffer.h
+++ b/test/validation/buffer/buffer.h
@@ -4,4 +4,22 @@
  * SPDX-License-Identifier:BSD-3-Clause
  */
 
+#include 
+
+/* test functions: */
+void buffer_test_pool_alloc(void);
+void buffer_test_pool_free(void);
+void buffer_test_management_basic(void);
+
+/* test arrays: */
+extern CU_TestInfo buffer_suite[];
+
+/* test array init/term functions: */
+int buffer_suite_init(void);
+int buffer_suite_term(void);
+
+/* test registery: */
+extern CU_SuiteInfo buffer_suites[];
+
+/* main test program: */
 int buffer_main(void);
-- 
2.1.0

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 06/17] validation: classification: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/classification/classification.c|  2 +-
 test/validation/classification/classification.h| 31 ++
 .../classification/odp_classification_basic.c  | 17 ++--
 .../classification/odp_classification_tests.c  | 13 -
 4 files changed, 48 insertions(+), 15 deletions(-)

diff --git a/test/validation/classification/classification.c 
b/test/validation/classification/classification.c
index 2582aaa..d0fef93 100644
--- a/test/validation/classification/classification.c
+++ b/test/validation/classification/classification.c
@@ -9,7 +9,7 @@
 #include "odp_classification_testsuites.h"
 #include "classification.h"
 
-static CU_SuiteInfo classification_suites[] = {
+CU_SuiteInfo classification_suites[] = {
{ .pName = "classification basic",
.pTests = classification_suite_basic,
},
diff --git a/test/validation/classification/classification.h 
b/test/validation/classification/classification.h
index e677343..4cace53 100644
--- a/test/validation/classification/classification.h
+++ b/test/validation/classification/classification.h
@@ -4,4 +4,35 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include 
+
+/* test functions: */
+void classification_test_create_cos(void);
+void classification_test_destroy_cos(void);
+void classification_test_create_pmr_match(void);
+void classification_test_destroy_pmr(void);
+void classification_test_cos_set_queue(void);
+void classification_test_cos_set_drop(void);
+void classification_test_pmr_match_set_create(void);
+void classification_test_pmr_match_set_destroy(void);
+
+void classification_test_pktio_set_skip(void);
+void classification_test_pktio_set_headroom(void);
+void classification_test_pmr_terms_avail(void);
+void classification_test_pmr_terms_cap(void);
+void classification_test_pktio_configure(void);
+void classification_test_pktio_test(void);
+
+/* test arrays: */
+extern CU_TestInfo classification_suite_basic[];
+extern CU_TestInfo classification_suite[];
+
+/* test array init/term functions: */
+int classification_suite_init(void);
+int classification_suite_term(void);
+
+/* test registery: */
+extern CU_SuiteInfo classification_suites[];
+
+/* main test program: */
 int classification_main(void);
diff --git a/test/validation/classification/odp_classification_basic.c 
b/test/validation/classification/odp_classification_basic.c
index 99202ee..79c775e 100644
--- a/test/validation/classification/odp_classification_basic.c
+++ b/test/validation/classification/odp_classification_basic.c
@@ -5,10 +5,11 @@
  */
 
 #include "odp_classification_testsuites.h"
+#include "classification.h"
 
 #define PMR_SET_NUM5
 
-static void classification_test_create_cos(void)
+void classification_test_create_cos(void)
 {
odp_cos_t cos;
char name[ODP_COS_NAME_LEN];
@@ -19,7 +20,7 @@ static void classification_test_create_cos(void)
odp_cos_destroy(cos);
 }
 
-static void classification_test_destroy_cos(void)
+void classification_test_destroy_cos(void)
 {
odp_cos_t cos;
char name[ODP_COS_NAME_LEN];
@@ -33,7 +34,7 @@ static void classification_test_destroy_cos(void)
CU_ASSERT(retval < 0);
 }
 
-static void classification_test_create_pmr_match(void)
+void classification_test_create_pmr_match(void)
 {
odp_pmr_t pmr;
uint16_t val;
@@ -46,7 +47,7 @@ static void classification_test_create_pmr_match(void)
odp_pmr_destroy(pmr);
 }
 
-static void classification_test_destroy_pmr(void)
+void classification_test_destroy_pmr(void)
 {
odp_pmr_t pmr;
uint16_t val;
@@ -62,7 +63,7 @@ static void classification_test_destroy_pmr(void)
CU_ASSERT(retval < 0);
 }
 
-static void classification_test_cos_set_queue(void)
+void classification_test_cos_set_queue(void)
 {
int retval;
char cosname[ODP_COS_NAME_LEN];
@@ -87,7 +88,7 @@ static void classification_test_cos_set_queue(void)
odp_queue_destroy(queue_cos);
 }
 
-static void classification_test_cos_set_drop(void)
+void classification_test_cos_set_drop(void)
 {
int retval;
char cosname[ODP_COS_NAME_LEN];
@@ -103,7 +104,7 @@ static void classification_test_cos_set_drop(void)
odp_cos_destroy(cos_drop);
 }
 
-static void classification_test_pmr_match_set_create(void)
+void classification_test_pmr_match_set_create(void)
 {
odp_pmr_set_t pmr_set;
int retval;
@@ -127,7 +128,7 @@ static void classification_test_pmr_match_set_create(void)
CU_ASSERT(retval == 0);
 }
 
-static void classification_test_pmr_match_set_destroy(void)
+void classification_test_pmr_match_set_destroy(void)
 {
odp_pmr_set_t pmr_set;
int retval;
diff --git a/test/validation/classification/odp_classification_tests.c 
b/test/validation/classification/odp_classification_tests.c
index 502105e..09eca1a 100644
--- a/test/validation/classifi

[lng-odp] [PATCH 07/17] validation: pktio: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/pktio/pktio.c | 32 
 test/validation/pktio/pktio.h | 27 +++
 2 files changed, 43 insertions(+), 16 deletions(-)

diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
index 82ced5c..36c2d1c 100644
--- a/test/validation/pktio/pktio.c
+++ b/test/validation/pktio/pktio.c
@@ -442,34 +442,34 @@ static void test_txrx(odp_queue_type_t q_type, int 
num_pkts)
}
 }
 
-static void pktio_test_poll_queue(void)
+void pktio_test_poll_queue(void)
 {
test_txrx(ODP_QUEUE_TYPE_POLL, 1);
 }
 
-static void pktio_test_poll_multi(void)
+void pktio_test_poll_multi(void)
 {
test_txrx(ODP_QUEUE_TYPE_POLL, 4);
 }
 
-static void pktio_test_sched_queue(void)
+void pktio_test_sched_queue(void)
 {
test_txrx(ODP_QUEUE_TYPE_SCHED, 1);
 }
 
-static void pktio_test_sched_multi(void)
+void pktio_test_sched_multi(void)
 {
test_txrx(ODP_QUEUE_TYPE_SCHED, 4);
 }
 
-static void pktio_test_jumbo(void)
+void pktio_test_jumbo(void)
 {
packet_len = PKT_LEN_JUMBO;
pktio_test_sched_multi();
packet_len = PKT_LEN_NORMAL;
 }
 
-static void pktio_test_mtu(void)
+void pktio_test_mtu(void)
 {
int ret;
int mtu;
@@ -484,7 +484,7 @@ static void pktio_test_mtu(void)
CU_ASSERT(ret == 0);
 }
 
-static void pktio_test_promisc(void)
+void pktio_test_promisc(void)
 {
int ret;
odp_pktio_t pktio = create_pktio(iface_name[0], 0);
@@ -507,7 +507,7 @@ static void pktio_test_promisc(void)
CU_ASSERT(ret == 0);
 }
 
-static void pktio_test_mac(void)
+void pktio_test_mac(void)
 {
unsigned char mac_addr[ODPH_ETHADDR_LEN];
int mac_len;
@@ -531,7 +531,7 @@ static void pktio_test_mac(void)
CU_ASSERT(0 == ret);
 }
 
-static void pktio_test_inq_remdef(void)
+void pktio_test_inq_remdef(void)
 {
odp_pktio_t pktio = create_pktio(iface_name[0], 0);
odp_queue_t inq;
@@ -555,7 +555,7 @@ static void pktio_test_inq_remdef(void)
CU_ASSERT(odp_pktio_close(pktio) == 0);
 }
 
-static void pktio_test_open(void)
+void pktio_test_open(void)
 {
odp_pktio_t pktio;
int i;
@@ -571,7 +571,7 @@ static void pktio_test_open(void)
CU_ASSERT(pktio == ODP_PKTIO_INVALID);
 }
 
-static void pktio_test_lookup(void)
+void pktio_test_lookup(void)
 {
odp_pktio_t pktio, pktio_inval;
 
@@ -589,7 +589,7 @@ static void pktio_test_lookup(void)
CU_ASSERT(odp_pktio_lookup(iface_name[0]) == ODP_PKTIO_INVALID);
 }
 
-static void pktio_test_inq(void)
+void pktio_test_inq(void)
 {
odp_pktio_t pktio;
 
@@ -623,7 +623,7 @@ static int create_pool(const char *iface, int num)
return 0;
 }
 
-static int pktio_suite_init(void)
+int pktio_suite_init(void)
 {
odp_atomic_init_u32(&ip_seq, 0);
iface_name[0] = getenv("ODP_PKTIO_IF0");
@@ -655,7 +655,7 @@ static int pktio_suite_init(void)
return 0;
 }
 
-static int pktio_suite_term(void)
+int pktio_suite_term(void)
 {
char pool_name[ODP_POOL_NAME_LEN];
odp_pool_t pool;
@@ -684,7 +684,7 @@ static int pktio_suite_term(void)
return ret;
 }
 
-static CU_TestInfo pktio_suite[] = {
+CU_TestInfo pktio_suite[] = {
{"pktio open",  pktio_test_open},
{"pktio lookup",pktio_test_lookup},
{"pktio inq",   pktio_test_inq},
@@ -700,7 +700,7 @@ static CU_TestInfo pktio_suite[] = {
CU_TEST_INFO_NULL
 };
 
-static CU_SuiteInfo pktio_suites[] = {
+CU_SuiteInfo pktio_suites[] = {
{"Packet I/O",
pktio_suite_init, pktio_suite_term, NULL, NULL, pktio_suite},
CU_SUITE_INFO_NULL
diff --git a/test/validation/pktio/pktio.h b/test/validation/pktio/pktio.h
index 4b6d512..32feb06 100644
--- a/test/validation/pktio/pktio.h
+++ b/test/validation/pktio/pktio.h
@@ -4,4 +4,31 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include 
+
+/* test functions: */
+void pktio_test_poll_queue(void);
+void pktio_test_poll_multi(void);
+void pktio_test_sched_queue(void);
+void pktio_test_sched_multi(void);
+void pktio_test_jumbo(void);
+void pktio_test_mtu(void);
+void pktio_test_promisc(void);
+void pktio_test_mac(void);
+void pktio_test_inq_remdef(void);
+void pktio_test_open(void);
+void pktio_test_lookup(void);
+void pktio_test_inq(void);
+
+/* test arrays: */
+extern CU_TestInfo pktio_suite[];
+
+/* test array init/term functions: */
+int pktio_suite_term(void);
+int pktio_suite_init(void);
+
+/* test registery: */
+extern CU_SuiteInfo pktio_suites[];
+
+/* main test program: */
 int pktio_main(void);
-- 
2.1.0

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 11/17] validation: thread: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/thread/thread.c | 10 +-
 test/validation/thread/thread.h | 14 ++
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/test/validation/thread/thread.c b/test/validation/thread/thread.c
index d0bd75e..31672a8 100644
--- a/test/validation/thread/thread.c
+++ b/test/validation/thread/thread.c
@@ -11,32 +11,32 @@
 /* Helper macro for CU_TestInfo initialization */
 #define _CU_TEST_INFO(test_func) {#test_func, test_func}
 
-static void thread_test_odp_cpu_id(void)
+void thread_test_odp_cpu_id(void)
 {
(void)odp_cpu_id();
CU_PASS();
 }
 
-static void thread_test_odp_thread_id(void)
+void thread_test_odp_thread_id(void)
 {
(void)odp_thread_id();
CU_PASS();
 }
 
-static void thread_test_odp_thread_count(void)
+void thread_test_odp_thread_count(void)
 {
(void)odp_thread_count();
CU_PASS();
 }
 
-static CU_TestInfo thread_suite[] = {
+CU_TestInfo thread_suite[] = {
_CU_TEST_INFO(thread_test_odp_cpu_id),
_CU_TEST_INFO(thread_test_odp_thread_id),
_CU_TEST_INFO(thread_test_odp_thread_count),
CU_TEST_INFO_NULL,
 };
 
-static CU_SuiteInfo thread_suites[] = {
+CU_SuiteInfo thread_suites[] = {
{"thread", NULL, NULL, NULL, NULL, thread_suite},
CU_SUITE_INFO_NULL,
 };
diff --git a/test/validation/thread/thread.h b/test/validation/thread/thread.h
index 94c288e..432c41c 100644
--- a/test/validation/thread/thread.h
+++ b/test/validation/thread/thread.h
@@ -4,4 +4,18 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include 
+
+/* test functions: */
+void thread_test_odp_cpu_id(void);
+void thread_test_odp_thread_id(void);
+void thread_test_odp_thread_count(void);
+
+/* test arrays: */
+extern CU_TestInfo thread_suite[];
+
+/* test registery: */
+extern CU_SuiteInfo thread_suites[];
+
+/* main test program: */
 int thread_main(void);
-- 
2.1.0

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 09/17] validation: cpumask: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/cpumask/cpumask.c | 32 
 test/validation/cpumask/cpumask.h | 25 +
 2 files changed, 41 insertions(+), 16 deletions(-)

diff --git a/test/validation/cpumask/cpumask.c 
b/test/validation/cpumask/cpumask.c
index 943a8e0..f117242 100644
--- a/test/validation/cpumask/cpumask.c
+++ b/test/validation/cpumask/cpumask.c
@@ -79,7 +79,7 @@ static unsigned int get_max_number_of_cpus_in_a_mask(void)
return odp_cpu_count();
 }
 
-static void cpumask_test_odp_cpumask_to_from_str(void)
+void cpumask_test_odp_cpumask_to_from_str(void)
 {
odp_cpumask_t mask;
int32_t str_sz;
@@ -151,7 +151,7 @@ static void cpumask_test_odp_cpumask_to_from_str(void)
free(buf_in);
 }
 
-static void cpumask_test_odp_cpumask_equal(void)
+void cpumask_test_odp_cpumask_equal(void)
 {
odp_cpumask_t mask1;
odp_cpumask_t mask2;
@@ -182,7 +182,7 @@ static void cpumask_test_odp_cpumask_equal(void)
CU_ASSERT_FALSE(odp_cpumask_equal(&mask1, &mask3));
 }
 
-static void cpumask_test_odp_cpumask_zero(void)
+void cpumask_test_odp_cpumask_zero(void)
 {
odp_cpumask_t mask1;
odp_cpumask_t mask2;
@@ -193,7 +193,7 @@ static void cpumask_test_odp_cpumask_zero(void)
CU_ASSERT(odp_cpumask_equal(&mask1, &mask2));
 }
 
-static void cpumask_test_odp_cpumask_set(void)
+void cpumask_test_odp_cpumask_set(void)
 {
odp_cpumask_t mask1;
odp_cpumask_t mask2;
@@ -215,7 +215,7 @@ static void cpumask_test_odp_cpumask_set(void)
CU_ASSERT(odp_cpumask_equal(&mask1, &mask2));
 }
 
-static void cpumask_test_odp_cpumask_clr(void)
+void cpumask_test_odp_cpumask_clr(void)
 {
odp_cpumask_t mask1;
odp_cpumask_t mask2;
@@ -242,7 +242,7 @@ static void cpumask_test_odp_cpumask_clr(void)
CU_ASSERT(odp_cpumask_equal(&mask1, &mask2));
 }
 
-static void cpumask_test_odp_cpumask_isset(void)
+void cpumask_test_odp_cpumask_isset(void)
 {
odp_cpumask_t mask1;
 
@@ -262,7 +262,7 @@ static void cpumask_test_odp_cpumask_isset(void)
CU_ASSERT_FALSE(odp_cpumask_isset(&mask1, 3));
 }
 
-static void cpumask_test_odp_cpumask_count(void)
+void cpumask_test_odp_cpumask_count(void)
 {
odp_cpumask_t mask1;
 
@@ -279,7 +279,7 @@ static void cpumask_test_odp_cpumask_count(void)
CU_ASSERT(odp_cpumask_count(&mask1) == 2);
 }
 
-static void cpumask_test_odp_cpumask_and(void)
+void cpumask_test_odp_cpumask_and(void)
 {
odp_cpumask_t mask1;
odp_cpumask_t mask2;
@@ -314,7 +314,7 @@ static void cpumask_test_odp_cpumask_and(void)
CU_ASSERT(odp_cpumask_equal(&mask3, &mask4));
 }
 
-static void cpumask_test_odp_cpumask_or(void)
+void cpumask_test_odp_cpumask_or(void)
 {
odp_cpumask_t mask1;
odp_cpumask_t mask2;
@@ -349,7 +349,7 @@ static void cpumask_test_odp_cpumask_or(void)
CU_ASSERT(odp_cpumask_equal(&mask3, &mask4));
 }
 
-static void cpumask_test_odp_cpumask_xor(void)
+void cpumask_test_odp_cpumask_xor(void)
 {
odp_cpumask_t mask1;
odp_cpumask_t mask2;
@@ -384,7 +384,7 @@ static void cpumask_test_odp_cpumask_xor(void)
CU_ASSERT(odp_cpumask_equal(&mask3, &mask4));
 }
 
-static void cpumask_test_odp_cpumask_copy(void)
+void cpumask_test_odp_cpumask_copy(void)
 {
odp_cpumask_t mask1;
odp_cpumask_t mask2;
@@ -394,7 +394,7 @@ static void cpumask_test_odp_cpumask_copy(void)
CU_ASSERT(odp_cpumask_equal(&mask1, &mask2));
 }
 
-static void cpumask_test_odp_cpumask_first(void)
+void cpumask_test_odp_cpumask_first(void)
 {
odp_cpumask_t mask1;
 
@@ -413,7 +413,7 @@ static void cpumask_test_odp_cpumask_first(void)
CU_ASSERT(odp_cpumask_first(&mask1) == 1);
 }
 
-static void cpumask_test_odp_cpumask_last(void)
+void cpumask_test_odp_cpumask_last(void)
 {
odp_cpumask_t mask1;
 
@@ -432,7 +432,7 @@ static void cpumask_test_odp_cpumask_last(void)
CU_ASSERT(odp_cpumask_last(&mask1) == 3);
 }
 
-static void cpumask_test_odp_cpumask_next(void)
+void cpumask_test_odp_cpumask_next(void)
 {
unsigned int i;
int expected[] = {1, 3, 3, -1};
@@ -456,7 +456,7 @@ static void cpumask_test_odp_cpumask_next(void)
CU_ASSERT(odp_cpumask_next(&mask1, i) == expected[i]);
 }
 
-static CU_TestInfo cpumask_suite[] = {
+CU_TestInfo cpumask_suite[] = {
{"odp_cpumask_to/from_str()", cpumask_test_odp_cpumask_to_from_str},
{"odp_cpumask_equal()",   cpumask_test_odp_cpumask_equal},
{"odp_cpumask_zero()",cpumask_test_odp_cpumask_zero},
@@ -474,7 +474,7 @@ static CU_TestInfo cpumask_suite[] = {
CU_TEST_INFO_NULL,
 };
 
-static CU_SuiteInfo cpumask_suites[] = {
+CU_SuiteInfo cpumask_suites[] = {
{"Cpumask", NULL, NULL, NULL, NULL, cpumask_suite},
CU_SUITE_INFO_NULL,
 };
diff --git a/test/validation/cpumask/cpumask.h 
b/test/validatio

[lng-odp] [PATCH 08/17] validation: packet: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/packet/packet.c | 44 -
 test/validation/packet/packet.h | 33 +++
 2 files changed, 55 insertions(+), 22 deletions(-)

diff --git a/test/validation/packet/packet.c b/test/validation/packet/packet.c
index 0bd1666..2d2209a 100644
--- a/test/validation/packet/packet.c
+++ b/test/validation/packet/packet.c
@@ -39,7 +39,7 @@ static struct udata_struct {
"abcdefg",
 };
 
-static int packet_suite_init(void)
+int packet_suite_init(void)
 {
odp_pool_param_t params = {
.pkt = {
@@ -81,7 +81,7 @@ static int packet_suite_init(void)
return 0;
 }
 
-static int packet_suite_term(void)
+int packet_suite_term(void)
 {
odp_packet_free(test_packet);
odp_packet_free(segmented_test_packet);
@@ -90,7 +90,7 @@ static int packet_suite_term(void)
return 0;
 }
 
-static void packet_test_alloc_free(void)
+void packet_test_alloc_free(void)
 {
odp_pool_t pool;
odp_packet_t packet;
@@ -129,7 +129,7 @@ static void packet_test_alloc_free(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
 }
 
-static void packet_test_alloc_segmented(void)
+void packet_test_alloc_segmented(void)
 {
odp_packet_t pkt;
const uint32_t len = ODP_CONFIG_PACKET_BUF_LEN_MAX -
@@ -142,7 +142,7 @@ static void packet_test_alloc_segmented(void)
odp_packet_free(pkt);
 }
 
-static void packet_test_event_conversion(void)
+void packet_test_event_conversion(void)
 {
odp_packet_t pkt = test_packet;
odp_packet_t tmp_pkt;
@@ -157,7 +157,7 @@ static void packet_test_event_conversion(void)
/** @todo: Need an API to compare packets */
 }
 
-static void packet_test_basic_metadata(void)
+void packet_test_basic_metadata(void)
 {
odp_packet_t pkt = test_packet;
 
@@ -169,7 +169,7 @@ static void packet_test_basic_metadata(void)
CU_ASSERT(odp_packet_input(pkt) == ODP_PKTIO_INVALID);
 }
 
-static void packet_test_length(void)
+void packet_test_length(void)
 {
odp_packet_t pkt = test_packet;
uint32_t buf_len, headroom, tailroom;
@@ -188,13 +188,13 @@ static void packet_test_length(void)
CU_ASSERT(buf_len >= packet_len + headroom + tailroom);
 }
 
-static void packet_test_debug(void)
+void packet_test_debug(void)
 {
CU_ASSERT(odp_packet_is_valid(test_packet) == 1);
odp_packet_print(test_packet);
 }
 
-static void packet_test_context(void)
+void packet_test_context(void)
 {
odp_packet_t pkt = test_packet;
char ptr_test_value = 2;
@@ -216,7 +216,7 @@ static void packet_test_context(void)
odp_packet_reset(pkt, packet_len);
 }
 
-static void packet_test_layer_offsets(void)
+void packet_test_layer_offsets(void)
 {
odp_packet_t pkt = test_packet;
uint8_t *l2_addr, *l3_addr, *l4_addr;
@@ -290,7 +290,7 @@ static void _verify_headroom_shift(odp_packet_t packet,
CU_ASSERT(data == data_orig - shift);
 }
 
-static void packet_test_headroom(void)
+void packet_test_headroom(void)
 {
odp_packet_t pkt = test_packet;
uint32_t room;
@@ -362,7 +362,7 @@ static void _verify_tailroom_shift(odp_packet_t pkt,
}
 }
 
-static void packet_test_tailroom(void)
+void packet_test_tailroom(void)
 {
odp_packet_t pkt = test_packet;
odp_packet_seg_t segment;
@@ -389,7 +389,7 @@ static void packet_test_tailroom(void)
_verify_tailroom_shift(pkt, 0);
 }
 
-static void packet_test_segments(void)
+void packet_test_segments(void)
 {
int num_segs, seg_index;
uint32_t data_len, buf_len;
@@ -489,7 +489,7 @@ static void packet_test_segments(void)
CU_ASSERT(seg == ODP_PACKET_SEG_INVALID);
 }
 
-static void packet_test_segment_last(void)
+void packet_test_segment_last(void)
 {
odp_packet_t pkt = test_packet;
odp_packet_seg_t seg;
@@ -509,7 +509,7 @@ do { \
CU_ASSERT(odp_packet_has_##flag(packet) != 0);\
 } while (0)
 
-static void packet_test_in_flags(void)
+void packet_test_in_flags(void)
 {
odp_packet_t pkt = test_packet;
 
@@ -532,7 +532,7 @@ static void packet_test_in_flags(void)
TEST_INFLAG(pkt, icmp);
 }
 
-static void packet_test_error_flags(void)
+void packet_test_error_flags(void)
 {
odp_packet_t pkt = test_packet;
int err;
@@ -554,7 +554,7 @@ struct packet_metadata {
uint64_t usr_u64;
 };
 
-static void packet_test_add_rem_data(void)
+void packet_test_add_rem_data(void)
 {
odp_packet_t pkt, new_pkt;
uint32_t pkt_len, offset, add_len;
@@ -663,7 +663,7 @@ static void _packet_compare_data(odp_packet_t pkt1, 
odp_packet_t pkt2)
}
 }
 
-static void packet_test_copy(void)
+void packet_test_copy(void)
 {
odp_packet_t pkt = test_packet;
odp_packet_t pkt_copy;
@@ -682,7 +682,7 @@ static void packet_test_copy(void)
odp_packet_free(pkt_copy)

[lng-odp] [PATCH 10/17] validation: pool: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/pool/pool.c | 14 +++---
 test/validation/pool/pool.h | 16 
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/test/validation/pool/pool.c b/test/validation/pool/pool.c
index 1b54033..c0dfd5f 100644
--- a/test/validation/pool/pool.c
+++ b/test/validation/pool/pool.c
@@ -27,7 +27,7 @@ static void pool_create_destroy(odp_pool_param_t *params)
CU_ASSERT(odp_pool_destroy(pool) == 0);
 }
 
-static void pool_test_create_destroy_buffer(void)
+void pool_test_create_destroy_buffer(void)
 {
odp_pool_param_t params = {
.buf = {
@@ -41,7 +41,7 @@ static void pool_test_create_destroy_buffer(void)
pool_create_destroy(¶ms);
 }
 
-static void pool_test_create_destroy_packet(void)
+void pool_test_create_destroy_packet(void)
 {
odp_pool_param_t params = {
.pkt = {
@@ -55,7 +55,7 @@ static void pool_test_create_destroy_packet(void)
pool_create_destroy(¶ms);
 }
 
-static void pool_test_create_destroy_timeout(void)
+void pool_test_create_destroy_timeout(void)
 {
odp_pool_param_t params = {
.tmo = {
@@ -67,7 +67,7 @@ static void pool_test_create_destroy_timeout(void)
pool_create_destroy(¶ms);
 }
 
-static void pool_test_create_destroy_buffer_shm(void)
+void pool_test_create_destroy_buffer_shm(void)
 {
odp_pool_t pool;
odp_shm_t test_shm;
@@ -93,7 +93,7 @@ static void pool_test_create_destroy_buffer_shm(void)
CU_ASSERT(odp_shm_free(test_shm) == 0);
 }
 
-static void pool_test_lookup_info_print(void)
+void pool_test_lookup_info_print(void)
 {
odp_pool_t pool;
const char pool_name[] = "pool_for_lookup_test";
@@ -128,7 +128,7 @@ static void pool_test_lookup_info_print(void)
 
 #define _CU_TEST_INFO(test_func) {#test_func, test_func}
 
-static CU_TestInfo pool_suite[] = {
+CU_TestInfo pool_suite[] = {
_CU_TEST_INFO(pool_test_create_destroy_buffer),
_CU_TEST_INFO(pool_test_create_destroy_packet),
_CU_TEST_INFO(pool_test_create_destroy_timeout),
@@ -137,7 +137,7 @@ static CU_TestInfo pool_suite[] = {
CU_TEST_INFO_NULL,
 };
 
-static CU_SuiteInfo pool_suites[] = {
+CU_SuiteInfo pool_suites[] = {
{ .pName = "Pool tests",
.pTests = pool_suite,
},
diff --git a/test/validation/pool/pool.h b/test/validation/pool/pool.h
index 53cd4d1..ad49f1e 100644
--- a/test/validation/pool/pool.h
+++ b/test/validation/pool/pool.h
@@ -4,4 +4,20 @@
  * SPDX-License-Identifier:BSD-3-Clause
  */
 
+#include 
+
+/* test functions: */
+void pool_test_create_destroy_buffer(void);
+void pool_test_create_destroy_packet(void);
+void pool_test_create_destroy_timeout(void);
+void pool_test_create_destroy_buffer_shm(void);
+void pool_test_lookup_info_print(void);
+
+/* test arrays: */
+extern CU_TestInfo pool_suite[];
+
+/* test registery: */
+extern CU_SuiteInfo pool_suites[];
+
+/* main test program: */
 int pool_main(void);
-- 
2.1.0

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 13/17] validation: timer: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/timer/timer.c | 12 ++--
 test/validation/timer/timer.h | 15 +++
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c
index 492d52f..3cda428 100644
--- a/test/validation/timer/timer.c
+++ b/test/validation/timer/timer.c
@@ -50,7 +50,7 @@ struct test_timer {
 
 #define TICK_INVALID (~(uint64_t)0)
 
-static void timer_test_timeout_pool_alloc(void)
+void timer_test_timeout_pool_alloc(void)
 {
odp_pool_t pool;
const int num = 3;
@@ -94,7 +94,7 @@ static void timer_test_timeout_pool_alloc(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
 }
 
-static void timer_test_timeout_pool_free(void)
+void timer_test_timeout_pool_free(void)
 {
odp_pool_t pool;
odp_timeout_t tmo;
@@ -125,7 +125,7 @@ static void timer_test_timeout_pool_free(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
 }
 
-static void timer_test_odp_timer_cancel(void)
+void timer_test_odp_timer_cancel(void)
 {
odp_pool_t pool;
odp_pool_param_t params;
@@ -436,7 +436,7 @@ static void *worker_entrypoint(void *arg TEST_UNUSED)
 }
 
 /* @private Timer test case entrypoint */
-static void timer_test_odp_timer_all(void)
+void timer_test_odp_timer_all(void)
 {
int rc;
odp_pool_param_t params;
@@ -529,7 +529,7 @@ static void timer_test_odp_timer_all(void)
CU_PASS("ODP timer test");
 }
 
-static CU_TestInfo timer_suite[] = {
+CU_TestInfo timer_suite[] = {
{"test_timeout_pool_alloc",  timer_test_timeout_pool_alloc},
{"test_timeout_pool_free",  timer_test_timeout_pool_free},
{"test_odp_timer_cancel",  timer_test_odp_timer_cancel},
@@ -537,7 +537,7 @@ static CU_TestInfo timer_suite[] = {
CU_TEST_INFO_NULL,
 };
 
-static CU_SuiteInfo timer_suites[] = {
+CU_SuiteInfo timer_suites[] = {
{"Timer", NULL, NULL, NULL, NULL, timer_suite},
CU_SUITE_INFO_NULL,
 };
diff --git a/test/validation/timer/timer.h b/test/validation/timer/timer.h
index b18af80..09cd3f7 100644
--- a/test/validation/timer/timer.h
+++ b/test/validation/timer/timer.h
@@ -4,4 +4,19 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include 
+
+/* test functions: */
+void timer_test_timeout_pool_alloc(void);
+void timer_test_timeout_pool_free(void);
+void timer_test_odp_timer_cancel(void);
+void timer_test_odp_timer_all(void);
+
+/* test arrays: */
+extern CU_TestInfo timer_suite[];
+
+/* test registery: */
+extern CU_SuiteInfo timer_suites[];
+
+/* main test program: */
 int timer_main(void);
-- 
2.1.0

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 15/17] validation: queue: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/queue/queue.c | 10 +-
 test/validation/queue/queue.h | 16 
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/test/validation/queue/queue.c b/test/validation/queue/queue.c
index f686b71..5053de1 100644
--- a/test/validation/queue/queue.c
+++ b/test/validation/queue/queue.c
@@ -15,7 +15,7 @@
 static int queue_contest = 0xff;
 static odp_pool_t pool;
 
-static int queue_suite_init(void)
+int queue_suite_init(void)
 {
odp_pool_param_t params;
 
@@ -33,12 +33,12 @@ static int queue_suite_init(void)
return 0;
 }
 
-static int queue_suite_term(void)
+int queue_suite_term(void)
 {
return odp_pool_destroy(pool);
 }
 
-static void queue_test_sunnydays(void)
+void queue_test_sunnydays(void)
 {
odp_queue_t queue_creat_id, queue_id;
odp_event_t enev[MAX_BUFFER_QUEUE];
@@ -107,12 +107,12 @@ static void queue_test_sunnydays(void)
CU_ASSERT(odp_queue_destroy(queue_id) == 0);
 }
 
-static CU_TestInfo queue_suite[] = {
+CU_TestInfo queue_suite[] = {
{"queue sunnyday",  queue_test_sunnydays},
CU_TEST_INFO_NULL,
 };
 
-static CU_SuiteInfo queue_suites[] = {
+CU_SuiteInfo queue_suites[] = {
{"Queue", queue_suite_init, queue_suite_term,
NULL, NULL, queue_suite},
CU_SUITE_INFO_NULL,
diff --git a/test/validation/queue/queue.h b/test/validation/queue/queue.h
index 3e9a9f1..43ae778 100644
--- a/test/validation/queue/queue.h
+++ b/test/validation/queue/queue.h
@@ -4,4 +4,20 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include 
+
+/* test functions: */
+void queue_test_sunnydays(void);
+
+/* test arrays: */
+extern CU_TestInfo queue_suite[];
+
+/* test array init/term functions: */
+int queue_suite_init(void);
+int queue_suite_term(void);
+
+/* test registery: */
+extern CU_SuiteInfo queue_suites[];
+
+/* main test program: */
 int queue_main(void);
-- 
2.1.0

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 14/17] validation: time: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/time/time.c |  8 
 test/validation/time/time.h | 14 ++
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/test/validation/time/time.c b/test/validation/time/time.c
index 0aac599..4fa2eaf 100644
--- a/test/validation/time/time.c
+++ b/test/validation/time/time.c
@@ -12,7 +12,7 @@
 #define BUSY_LOOP_CNT 100
 
 /* check that a cycles difference gives a reasonable result */
-static void time_test_odp_cycles_diff(void)
+void time_test_odp_cycles_diff(void)
 {
/* volatile to stop optimization of busy loop */
volatile int count = 0;
@@ -32,7 +32,7 @@ static void time_test_odp_cycles_diff(void)
 }
 
 /* check that a negative cycles difference gives a reasonable result */
-static void time_test_odp_cycles_negative_diff(void)
+void time_test_odp_cycles_negative_diff(void)
 {
uint64_t diff, cycles1, cycles2;
 
@@ -43,7 +43,7 @@ static void time_test_odp_cycles_negative_diff(void)
 }
 
 /* check that related conversions come back to the same value */
-static void time_test_odp_time_conversion(void)
+void time_test_odp_time_conversion(void)
 {
uint64_t ns1, ns2, cycles;
uint64_t upper_limit, lower_limit;
@@ -68,7 +68,7 @@ CU_TestInfo time_suite_time[] = {
 CU_TEST_INFO_NULL
 };
 
-static CU_SuiteInfo time_suites[] = {
+CU_SuiteInfo time_suites[] = {
{"Time", NULL, NULL, NULL, NULL, time_suite_time},
 CU_SUITE_INFO_NULL
 };
diff --git a/test/validation/time/time.h b/test/validation/time/time.h
index 30c2fdc..376eb87 100644
--- a/test/validation/time/time.h
+++ b/test/validation/time/time.h
@@ -4,4 +4,18 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include 
+
+/* test functions: */
+void time_test_odp_cycles_diff(void);
+void time_test_odp_cycles_negative_diff(void);
+void time_test_odp_time_conversion(void);
+
+/* test arrays: */
+extern CU_TestInfo time_suite_time[];
+
+/* test registery: */
+extern CU_SuiteInfo time_suites[];
+
+/* main test program: */
 int time_main(void);
-- 
2.1.0

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 17/17] validation: random: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/random/random.c |  6 +++---
 test/validation/random/random.h | 12 
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/test/validation/random/random.c b/test/validation/random/random.c
index a42523f..039c7a3 100644
--- a/test/validation/random/random.c
+++ b/test/validation/random/random.c
@@ -11,7 +11,7 @@
 /* Helper macro for CU_TestInfo initialization */
 #define _CU_TEST_INFO(test_func) {#test_func, test_func}
 
-static void random_test_get_size(void)
+void random_test_get_size(void)
 {
int32_t ret;
uint8_t buf[32];
@@ -20,12 +20,12 @@ static void random_test_get_size(void)
CU_ASSERT(ret == sizeof(buf));
 }
 
-static CU_TestInfo random_suite[] = {
+CU_TestInfo random_suite[] = {
_CU_TEST_INFO(random_test_get_size),
CU_TEST_INFO_NULL,
 };
 
-static CU_SuiteInfo random_suites[] = {
+CU_SuiteInfo random_suites[] = {
{"Random", NULL, NULL, NULL, NULL, random_suite},
CU_SUITE_INFO_NULL,
 };
diff --git a/test/validation/random/random.h b/test/validation/random/random.h
index c40ee1f..c83153d 100644
--- a/test/validation/random/random.h
+++ b/test/validation/random/random.h
@@ -4,4 +4,16 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include 
+
+/* test functions: */
+void random_test_get_size(void);
+
+/* test arrays: */
+extern CU_TestInfo random_suite[];
+
+/* test registery: */
+extern CU_SuiteInfo random_suites[];
+
+/* main test program: */
 int random_main(void);
-- 
2.1.0

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 12/17] validation: scheduler: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/scheduler/scheduler.c | 68 +--
 test/validation/scheduler/scheduler.h | 45 +++
 2 files changed, 79 insertions(+), 34 deletions(-)

diff --git a/test/validation/scheduler/scheduler.c 
b/test/validation/scheduler/scheduler.c
index e03af13..87e88fe 100644
--- a/test/validation/scheduler/scheduler.c
+++ b/test/validation/scheduler/scheduler.c
@@ -78,7 +78,7 @@ static int exit_schedule_loop(void)
return ret;
 }
 
-static void scheduler_test_wait_time(void)
+void scheduler_test_wait_time(void)
 {
uint64_t wait_time;
 
@@ -91,7 +91,7 @@ static void scheduler_test_wait_time(void)
CU_ASSERT(wait_time > 0);
 }
 
-static void scheduler_test_num_prio(void)
+void scheduler_test_num_prio(void)
 {
int prio;
 
@@ -101,7 +101,7 @@ static void scheduler_test_num_prio(void)
CU_ASSERT(prio == odp_schedule_num_prio());
 }
 
-static void scheduler_test_queue_destroy(void)
+void scheduler_test_queue_destroy(void)
 {
odp_pool_t p;
odp_pool_param_t params;
@@ -370,25 +370,25 @@ static void parallel_execute(odp_schedule_sync_t sync, 
int num_queues,
 }
 
 /* 1 queue 1 thread ODP_SCHED_SYNC_NONE */
-static void scheduler_test_1q_1t_n(void)
+void scheduler_test_1q_1t_n(void)
 {
schedule_common(ODP_SCHED_SYNC_NONE, ONE_Q, ONE_PRIO, SCHD_ONE);
 }
 
 /* 1 queue 1 thread ODP_SCHED_SYNC_ATOMIC */
-static void scheduler_test_1q_1t_a(void)
+void scheduler_test_1q_1t_a(void)
 {
schedule_common(ODP_SCHED_SYNC_ATOMIC, ONE_Q, ONE_PRIO, SCHD_ONE);
 }
 
 /* 1 queue 1 thread ODP_SCHED_SYNC_ORDERED */
-static void scheduler_test_1q_1t_o(void)
+void scheduler_test_1q_1t_o(void)
 {
schedule_common(ODP_SCHED_SYNC_ORDERED, ONE_Q, ONE_PRIO, SCHD_ONE);
 }
 
 /* Many queues 1 thread ODP_SCHED_SYNC_NONE */
-static void scheduler_test_mq_1t_n(void)
+void scheduler_test_mq_1t_n(void)
 {
/* Only one priority involved in these tests, but use
   the same number of queues the more general case uses */
@@ -396,19 +396,19 @@ static void scheduler_test_mq_1t_n(void)
 }
 
 /* Many queues 1 thread ODP_SCHED_SYNC_ATOMIC */
-static void scheduler_test_mq_1t_a(void)
+void scheduler_test_mq_1t_a(void)
 {
schedule_common(ODP_SCHED_SYNC_ATOMIC, MANY_QS, ONE_PRIO, SCHD_ONE);
 }
 
 /* Many queues 1 thread ODP_SCHED_SYNC_ORDERED */
-static void scheduler_test_mq_1t_o(void)
+void scheduler_test_mq_1t_o(void)
 {
schedule_common(ODP_SCHED_SYNC_ORDERED, MANY_QS, ONE_PRIO, SCHD_ONE);
 }
 
 /* Many queues 1 thread check priority ODP_SCHED_SYNC_NONE */
-static void scheduler_test_mq_1t_prio_n(void)
+void scheduler_test_mq_1t_prio_n(void)
 {
int prio = odp_schedule_num_prio();
 
@@ -416,7 +416,7 @@ static void scheduler_test_mq_1t_prio_n(void)
 }
 
 /* Many queues 1 thread check priority ODP_SCHED_SYNC_ATOMIC */
-static void scheduler_test_mq_1t_prio_a(void)
+void scheduler_test_mq_1t_prio_a(void)
 {
int prio = odp_schedule_num_prio();
 
@@ -424,7 +424,7 @@ static void scheduler_test_mq_1t_prio_a(void)
 }
 
 /* Many queues 1 thread check priority ODP_SCHED_SYNC_ORDERED */
-static void scheduler_test_mq_1t_prio_o(void)
+void scheduler_test_mq_1t_prio_o(void)
 {
int prio = odp_schedule_num_prio();
 
@@ -432,7 +432,7 @@ static void scheduler_test_mq_1t_prio_o(void)
 }
 
 /* Many queues many threads check priority ODP_SCHED_SYNC_NONE */
-static void scheduler_test_mq_mt_prio_n(void)
+void scheduler_test_mq_mt_prio_n(void)
 {
int prio = odp_schedule_num_prio();
 
@@ -441,7 +441,7 @@ static void scheduler_test_mq_mt_prio_n(void)
 }
 
 /* Many queues many threads check priority ODP_SCHED_SYNC_ATOMIC */
-static void scheduler_test_mq_mt_prio_a(void)
+void scheduler_test_mq_mt_prio_a(void)
 {
int prio = odp_schedule_num_prio();
 
@@ -450,7 +450,7 @@ static void scheduler_test_mq_mt_prio_a(void)
 }
 
 /* Many queues many threads check priority ODP_SCHED_SYNC_ORDERED */
-static void scheduler_test_mq_mt_prio_o(void)
+void scheduler_test_mq_mt_prio_o(void)
 {
int prio = odp_schedule_num_prio();
 
@@ -459,32 +459,32 @@ static void scheduler_test_mq_mt_prio_o(void)
 }
 
 /* 1 queue many threads check exclusive access on ATOMIC queues */
-static void scheduler_test_1q_mt_a_excl(void)
+void scheduler_test_1q_mt_a_excl(void)
 {
parallel_execute(ODP_SCHED_SYNC_ATOMIC, ONE_Q, ONE_PRIO, SCHD_ONE,
 ENABLE_EXCL_ATOMIC);
 }
 
 /* 1 queue 1 thread ODP_SCHED_SYNC_NONE multi */
-static void scheduler_test_multi_1q_1t_n(void)
+void scheduler_test_multi_1q_1t_n(void)
 {
schedule_common(ODP_SCHED_SYNC_NONE, ONE_Q, ONE_PRIO, SCHD_MULTI);
 }
 
 /* 1 queue 1 thread ODP_SCHED_SYNC_ATOMIC multi */
-static void scheduler_test_multi_1q_1t_a(void)
+void scheduler_test_multi_1q_1t_a(void)
 {
schedule_common(ODP_SCHED_SYNC_ATOMIC, ONE_Q, ONE_PRIO, SCHD_MULTI);
 }

[lng-odp] [PATCH 16/17] validation: system: lib populated

2015-07-09 Thread Christophe Milard
test symbols are now exported in the module lib.

Signed-off-by: Christophe Milard 
---
 test/validation/system/system.c | 18 +-
 test/validation/system/system.h | 18 ++
 2 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/test/validation/system/system.c b/test/validation/system/system.c
index b80fd39..7687f20 100644
--- a/test/validation/system/system.c
+++ b/test/validation/system/system.c
@@ -10,7 +10,7 @@
 #include "test_debug.h"
 #include "system.h"
 
-static void system_test_odp_version_numbers(void)
+void system_test_odp_version_numbers(void)
 {
int char_ok;
char version_string[128];
@@ -32,7 +32,7 @@ static void system_test_odp_version_numbers(void)
CU_ASSERT(char_ok);
 }
 
-static void system_test_odp_cpu_count(void)
+void system_test_odp_cpu_count(void)
 {
int cpus;
 
@@ -40,7 +40,7 @@ static void system_test_odp_cpu_count(void)
CU_ASSERT(0 < cpus);
 }
 
-static void system_test_odp_sys_cache_line_size(void)
+void system_test_odp_sys_cache_line_size(void)
 {
uint64_t cache_size;
 
@@ -49,7 +49,7 @@ static void system_test_odp_sys_cache_line_size(void)
CU_ASSERT(ODP_CACHE_LINE_SIZE == cache_size);
 }
 
-static void system_test_odp_sys_cpu_model_str(void)
+void system_test_odp_sys_cpu_model_str(void)
 {
char model[128];
 
@@ -58,7 +58,7 @@ static void system_test_odp_sys_cpu_model_str(void)
CU_ASSERT(strlen(model) < 127);
 }
 
-static void system_test_odp_sys_page_size(void)
+void system_test_odp_sys_page_size(void)
 {
uint64_t page;
 
@@ -67,7 +67,7 @@ static void system_test_odp_sys_page_size(void)
CU_ASSERT(ODP_PAGE_SIZE == page);
 }
 
-static void system_test_odp_sys_huge_page_size(void)
+void system_test_odp_sys_huge_page_size(void)
 {
uint64_t page;
 
@@ -75,7 +75,7 @@ static void system_test_odp_sys_huge_page_size(void)
CU_ASSERT(0 < page);
 }
 
-static void system_test_odp_sys_cpu_hz(void)
+void system_test_odp_sys_cpu_hz(void)
 {
uint64_t hz;
 
@@ -83,7 +83,7 @@ static void system_test_odp_sys_cpu_hz(void)
CU_ASSERT(0 < hz);
 }
 
-static CU_TestInfo system_suite[] = {
+CU_TestInfo system_suite[] = {
{"odp version",  system_test_odp_version_numbers},
{"odp_cpu_count",  system_test_odp_cpu_count},
{"odp_sys_cache_line_size",  system_test_odp_sys_cache_line_size},
@@ -94,7 +94,7 @@ static CU_TestInfo system_suite[] = {
CU_TEST_INFO_NULL,
 };
 
-static CU_SuiteInfo system_suites[] = {
+CU_SuiteInfo system_suites[] = {
{"System Info", NULL, NULL, NULL, NULL, system_suite},
CU_SUITE_INFO_NULL,
 };
diff --git a/test/validation/system/system.h b/test/validation/system/system.h
index 92618fb..dc94ca6 100644
--- a/test/validation/system/system.h
+++ b/test/validation/system/system.h
@@ -4,4 +4,22 @@
  * SPDX-License-Identifier:BSD-3-Clause
  */
 
+#include 
+
+/* test functions: */
+void system_test_odp_version_numbers(void);
+void system_test_odp_cpu_count(void);
+void system_test_odp_sys_cache_line_size(void);
+void system_test_odp_sys_cpu_model_str(void);
+void system_test_odp_sys_page_size(void);
+void system_test_odp_sys_huge_page_size(void);
+void system_test_odp_sys_cpu_hz(void);
+
+/* test arrays: */
+extern CU_TestInfo system_suite[];
+
+/* test registery: */
+extern CU_SuiteInfo system_suites[];
+
+/* main test program: */
 int system_main(void);
-- 
2.1.0

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp