Re: [lng-odp] [API-NEXT PATCHv2] api: pktio: Clarify doc on default pool usage on odp_pktio_open

2015-04-24 Thread Savolainen, Petri (Nokia - FI/Espoo)


 -Original Message-
 From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of ext
 Maxim Uvarov
 Sent: Friday, April 24, 2015 1:55 PM
 To: lng-odp@lists.linaro.org
 Subject: Re: [lng-odp] [API-NEXT PATCHv2] api: pktio: Clarify doc on
 default pool usage on odp_pktio_open
 
 On 04/24/15 13:21, Savolainen, Petri (Nokia - FI/Espoo) wrote:
  This is not a v2, since the original patch was already merged. Also my
 patches change the same lines, so need to rebase this after those are
 merged.
 
  -Petri
 Petri I will revert original patch and apply that v2. After merge back
 to master v1 and it's revert will be removed on rebase.
 
 Will fix your lines if there will be any reject.
 
 Maxim.

Is revert the right thing to do? Could you merge those two/three patches 
together during apply to mainline? E.g. my patches changes word instance - 
interface and this text has instance still/again. There will be conflicts 
when v2 is not based on my patches, which are based on v1.

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


Re: [lng-odp] [API-NEXT PATCH v2] timer: Add missing platform handles to u64 conversion functions

2015-04-24 Thread Jerin Jacob
On Fri, Apr 24, 2015 at 11:46:53AM +0300, Maxim Uvarov wrote:
 Hi Jerin,
 
 you you only removed RFC and Petri added sign-off to that patch you should
 include it to patch without rfc.
 
 also v1..v2... should go after --- line in patch. In that case git am just
 skips that comment.

Thanks for pointing it out.

 
 Patch merged to api-next.
 
 Thanks,
 Maxim.
 
 On 04/24/15 09:14, Jerin Jacob wrote:
 On Mon, Apr 20, 2015 at 04:22:15PM +0530, Jerin Jacob wrote:
 
 ping
 
 v1..v2 Removed RFC
 
 
 Signed-off-by: Jerin Jacob jerin.ja...@caviumnetworks.com
 ---
   include/odp/api/timer.h | 39 +++
   1 file changed, 39 insertions(+)
 
 diff --git a/include/odp/api/timer.h b/include/odp/api/timer.h
 index 0dc9415..435c004 100644
 --- a/include/odp/api/timer.h
 +++ b/include/odp/api/timer.h
 @@ -366,6 +366,45 @@ odp_timeout_t odp_timeout_alloc(odp_pool_t pool);
   void odp_timeout_free(odp_timeout_t tmo);
   /**
 + * Get printable value for an odp_timer_pool_t
 + *
 + * @param hdl  odp_timer_pool_t handle to be printed
 + * @return uint64_t value that can be used to print/display this
 + * handle
 + *
 + * @note This routine is intended to be used for diagnostic purposes
 + * to enable applications to generate a printable value that represents
 + * an odp_timer_pool_t handle.
 + */
 +uint64_t odp_timer_pool_to_u64(odp_timer_pool_t hdl);
 +
 +/**
 + * Get printable value for an odp_timer_t
 + *
 + * @param hdl  odp_timer_t handle to be printed
 + * @return uint64_t value that can be used to print/display this
 + * handle
 + *
 + * @note This routine is intended to be used for diagnostic purposes
 + * to enable applications to generate a printable value that represents
 + * an odp_timer_t handle.
 + */
 +uint64_t odp_timer_to_u64(odp_timer_t hdl);
 +
 +/**
 + * Get printable value for an odp_timeout_t
 + *
 + * @param hdl  odp_timeout_t handle to be printed
 + * @return uint64_t value that can be used to print/display this
 + * handle
 + *
 + * @note This routine is intended to be used for diagnostic purposes
 + * to enable applications to generate a printable value that represents
 + * an odp_timeout_t handle.
 + */
 +uint64_t odp_timeout_to_u64(odp_timeout_t hdl);
 +
 +/**
* @}
*/
 -- 
 2.1.0
 
 ___
 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] [API-NEXT PATCHv2] api: pktio: Clarify doc on default pool usage on odp_pktio_open

2015-04-24 Thread Savolainen, Petri (Nokia - FI/Espoo)
This is not a v2, since the original patch was already merged. Also my patches 
change the same lines, so need to rebase this after those are merged.

-Petri

 -Original Message-
 From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of ext
 Bill Fischofer
 Sent: Thursday, April 23, 2015 11:37 PM
 To: lng-odp@lists.linaro.org
 Subject: [lng-odp] [API-NEXT PATCHv2] api: pktio: Clarify doc on default
 pool usage on odp_pktio_open
 
 Signed-off-by: Bill Fischofer bill.fischo...@linaro.org
 ---
 
 Changes for v2: Correct grammatical ambiguities throughout doc for
 odp_pktio_open().
 
  include/odp/api/packet_io.h | 22 +++---
  1 file changed, 15 insertions(+), 7 deletions(-)
 
 diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
 index 6d31aeb..89356a6 100644
 --- a/include/odp/api/packet_io.h
 +++ b/include/odp/api/packet_io.h
 @@ -47,20 +47,28 @@ extern C {
  /**
   * Open an ODP packet IO instance
   *
 - * Packet IO handles are single instance per device, attempts to open an
 already
 - * open device will fail, returning ODP_PKTIO_INVALID with errno set.
 - * odp_pktio_lookup() may be used to obtain a handle to an already open
 device.
 + * Packet IO handles are a single instance per device. Attempts to open
 an
 + * already open device will fail, returning ODP_PKTIO_INVALID with errno
 set.
 + * odp_pktio_lookup() may be used to obtain a handle to an already open
 + * device.
   *
   * @param devPacket IO device name
 - * @param pool   Pool from which to allocate buffers for storing packets
 + * @param pool   Default pool from which to allocate buffers for storing
 packets
   *   received over this packet IO
   *
   * @return ODP packet IO handle
   * @retval ODP_PKTIO_INVALID on failure
   *
 - * @note dev name loop is specially pktio reserved name for
 - *device used for testing. Usually it's loop back
 - *interface.
 + * @note The device name loop is a reserved name for a loopback device
 used
 + *for testing purposes.
 + *
 + * @note Packets arriving via this interface assigned to a CoS by the
 + *classifier are received into the pool associated with that CoS.
 This
 + *will occur either becuase this pktio is assigned a default CoS via
 + *the odp_pktio_default_cos_set() routine, or because a matching PMR
 + *assigned the packet to a specific CoS. The default pool specified
 + *here is applicable only for those packets that are not assigned to
 a
 + *more specific CoS.
   */
  odp_pktio_t odp_pktio_open(const char *dev, odp_pool_t pool);
 
 --
 2.1.0
 
 ___
 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: timer: remove global variables to share the data between workers

2015-04-24 Thread Maxim Uvarov

On 04/20/15 11:28, Jerin Jacob wrote:

+   /* Reserve memory for test_globals_t from shared mem */
+   shm = odp_shm_reserve(shm_test_globals, sizeof(test_globals_t),
+ ODP_CACHE_LINE_SIZE, 0);


if (ODP_SHM_INVALID == shm)
return -1;


+   gbls = odp_shm_addr(shm);
+
+   if (gbls == NULL) {
+   EXAMPLE_ERR(Error: shared mem alloc failed.\n);
+   return -1;
+   }

that is not needed.


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


Re: [lng-odp] [API-NEXT PATCHv2] api: pktio: Clarify doc on default pool usage on odp_pktio_open

2015-04-24 Thread Maxim Uvarov

On 04/24/15 14:04, Savolainen, Petri (Nokia - FI/Espoo) wrote:



-Original Message-
From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of ext
Maxim Uvarov
Sent: Friday, April 24, 2015 1:55 PM
To: lng-odp@lists.linaro.org
Subject: Re: [lng-odp] [API-NEXT PATCHv2] api: pktio: Clarify doc on
default pool usage on odp_pktio_open

On 04/24/15 13:21, Savolainen, Petri (Nokia - FI/Espoo) wrote:

This is not a v2, since the original patch was already merged. Also my

patches change the same lines, so need to rebase this after those are
merged.

-Petri

Petri I will revert original patch and apply that v2. After merge back
to master v1 and it's revert will be removed on rebase.

Will fix your lines if there will be any reject.

Maxim.

Is revert the right thing to do? Could you merge those two/three patches together during apply to mainline? E.g. my patches changes 
word instance - interface and this text has instance still/again. There will be conflicts 
when v2 is not based on my patches, which are based on v1.

-Petri
Yes, revert is ok for api-next,  but it's not needed for master. In 
master I prefer to have plain history without bunch of reverts and 
merges from different branches.  That will be usual git merge / rebase 
conflict and I will fix it on final rebase. I don't think that we can 
lost something.


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


Re: [lng-odp] [PATCHv4] example: ODP classifier example

2015-04-24 Thread Maxim Uvarov

Merged,
Maxim.

On 04/23/15 21:59, Mike Holmes wrote:



On 23 April 2015 at 06:37, bala.manoha...@linaro.org 
mailto:bala.manoha...@linaro.org wrote:


From: Balasubramanian Manoharan bala.manoha...@linaro.org
mailto:bala.manoha...@linaro.org

ODP Classifier example



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


Re: [lng-odp] [API-NEXT PATCH v2] timer: Add missing platform handles to u64 conversion functions

2015-04-24 Thread Maxim Uvarov

Hi Jerin,

you you only removed RFC and Petri added sign-off to that patch you 
should include it to patch without rfc.


also v1..v2... should go after --- line in patch. In that case git am 
just skips that comment.


Patch merged to api-next.

Thanks,
Maxim.

On 04/24/15 09:14, Jerin Jacob wrote:

On Mon, Apr 20, 2015 at 04:22:15PM +0530, Jerin Jacob wrote:

ping


v1..v2 Removed RFC


Signed-off-by: Jerin Jacob jerin.ja...@caviumnetworks.com
---
  include/odp/api/timer.h | 39 +++
  1 file changed, 39 insertions(+)

diff --git a/include/odp/api/timer.h b/include/odp/api/timer.h
index 0dc9415..435c004 100644
--- a/include/odp/api/timer.h
+++ b/include/odp/api/timer.h
@@ -366,6 +366,45 @@ odp_timeout_t odp_timeout_alloc(odp_pool_t pool);
  void odp_timeout_free(odp_timeout_t tmo);
  
  /**

+ * Get printable value for an odp_timer_pool_t
+ *
+ * @param hdl  odp_timer_pool_t handle to be printed
+ * @return uint64_t value that can be used to print/display this
+ * handle
+ *
+ * @note This routine is intended to be used for diagnostic purposes
+ * to enable applications to generate a printable value that represents
+ * an odp_timer_pool_t handle.
+ */
+uint64_t odp_timer_pool_to_u64(odp_timer_pool_t hdl);
+
+/**
+ * Get printable value for an odp_timer_t
+ *
+ * @param hdl  odp_timer_t handle to be printed
+ * @return uint64_t value that can be used to print/display this
+ * handle
+ *
+ * @note This routine is intended to be used for diagnostic purposes
+ * to enable applications to generate a printable value that represents
+ * an odp_timer_t handle.
+ */
+uint64_t odp_timer_to_u64(odp_timer_t hdl);
+
+/**
+ * Get printable value for an odp_timeout_t
+ *
+ * @param hdl  odp_timeout_t handle to be printed
+ * @return uint64_t value that can be used to print/display this
+ * handle
+ *
+ * @note This routine is intended to be used for diagnostic purposes
+ * to enable applications to generate a printable value that represents
+ * an odp_timeout_t handle.
+ */
+uint64_t odp_timeout_to_u64(odp_timeout_t hdl);
+
+/**
   * @}
   */
  
--

2.1.0


___
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: timer: remove global variables to share the data between workers

2015-04-24 Thread Maxim Uvarov

On 04/24/15 12:19, Jerin Jacob wrote:

On Fri, Apr 24, 2015 at 11:39:58AM +0300, Maxim Uvarov wrote:

On 04/20/15 11:28, Jerin Jacob wrote:

+   /* Reserve memory for test_globals_t from shared mem */
+   shm = odp_shm_reserve(shm_test_globals, sizeof(test_globals_t),
+ ODP_CACHE_LINE_SIZE, 0);

if (ODP_SHM_INVALID == shm)
 return -1;


+   gbls = odp_shm_addr(shm);
+
+   if (gbls == NULL) {
+   EXAMPLE_ERR(Error: shared mem alloc failed.\n);
+   return -1;
+   }

that is not needed.

This check should be required. odp_shm_addr() can return NULL.
Above proposed ODP_SHM_INVALID == shm check
may not be required as odp_shm_addr() function will return NULL if shm == 
ODP_SHM_INVALID

yes, but at least for linux-generic it does not check.

Maxim.




Thanks,
Maxim.
___
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] [API-NEXT PATCH v2] timer: Add missing platform handles to u64 conversion functions

2015-04-24 Thread Mike Holmes
Hi Jerin

Before this is merged with mainline I think we should have a linux-generic
implementation and a test case for it.
Do you have the cycles to add those to api-next so that this can be part of
1.2.0 ?

I think tentatively that 1.2.0 will be in August at this point, although if
we can start gathering more complete new API work in api-next there is no
reason to wait that long.

Mike

On 24 April 2015 at 05:13, Jerin Jacob jerin.ja...@caviumnetworks.com
wrote:

 On Fri, Apr 24, 2015 at 11:46:53AM +0300, Maxim Uvarov wrote:
  Hi Jerin,
 
  you you only removed RFC and Petri added sign-off to that patch you
 should
  include it to patch without rfc.
 
  also v1..v2... should go after --- line in patch. In that case git am
 just
  skips that comment.

 Thanks for pointing it out.

 
  Patch merged to api-next.
 
  Thanks,
  Maxim.
 
  On 04/24/15 09:14, Jerin Jacob wrote:
  On Mon, Apr 20, 2015 at 04:22:15PM +0530, Jerin Jacob wrote:
  
  ping
  
  v1..v2 Removed RFC
  
  
  Signed-off-by: Jerin Jacob jerin.ja...@caviumnetworks.com
  ---
include/odp/api/timer.h | 39 +++
1 file changed, 39 insertions(+)
  
  diff --git a/include/odp/api/timer.h b/include/odp/api/timer.h
  index 0dc9415..435c004 100644
  --- a/include/odp/api/timer.h
  +++ b/include/odp/api/timer.h
  @@ -366,6 +366,45 @@ odp_timeout_t odp_timeout_alloc(odp_pool_t pool);
void odp_timeout_free(odp_timeout_t tmo);
/**
  + * Get printable value for an odp_timer_pool_t
  + *
  + * @param hdl  odp_timer_pool_t handle to be printed
  + * @return uint64_t value that can be used to print/display this
  + * handle
  + *
  + * @note This routine is intended to be used for diagnostic purposes
  + * to enable applications to generate a printable value that
 represents
  + * an odp_timer_pool_t handle.
  + */
  +uint64_t odp_timer_pool_to_u64(odp_timer_pool_t hdl);
  +
  +/**
  + * Get printable value for an odp_timer_t
  + *
  + * @param hdl  odp_timer_t handle to be printed
  + * @return uint64_t value that can be used to print/display this
  + * handle
  + *
  + * @note This routine is intended to be used for diagnostic purposes
  + * to enable applications to generate a printable value that
 represents
  + * an odp_timer_t handle.
  + */
  +uint64_t odp_timer_to_u64(odp_timer_t hdl);
  +
  +/**
  + * Get printable value for an odp_timeout_t
  + *
  + * @param hdl  odp_timeout_t handle to be printed
  + * @return uint64_t value that can be used to print/display this
  + * handle
  + *
  + * @note This routine is intended to be used for diagnostic purposes
  + * to enable applications to generate a printable value that
 represents
  + * an odp_timeout_t handle.
  + */
  +uint64_t odp_timeout_to_u64(odp_timeout_t hdl);
  +
  +/**
 * @}
 */
  --
  2.1.0
  
  ___
  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




-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org http://www.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] example: timer: remove global variables to share the data between workers

2015-04-24 Thread Jerin Jacob
On Fri, Apr 24, 2015 at 11:39:58AM +0300, Maxim Uvarov wrote:
 On 04/20/15 11:28, Jerin Jacob wrote:
 +/* Reserve memory for test_globals_t from shared mem */
 +shm = odp_shm_reserve(shm_test_globals, sizeof(test_globals_t),
 +  ODP_CACHE_LINE_SIZE, 0);
 
 if (ODP_SHM_INVALID == shm)
 return -1;
 
 +gbls = odp_shm_addr(shm);
 +
 +if (gbls == NULL) {
 +EXAMPLE_ERR(Error: shared mem alloc failed.\n);
 +return -1;
 +}
 that is not needed.

This check should be required. odp_shm_addr() can return NULL. 
Above proposed ODP_SHM_INVALID == shm check
may not be required as odp_shm_addr() function will return NULL if shm == 
ODP_SHM_INVALID


 
 
 Thanks,
 Maxim.
 ___
 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] Atomics

2015-04-24 Thread Savolainen, Petri (Nokia - FI/Espoo)


From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of ext Ola 
Liljedahl
Sent: Thursday, April 23, 2015 8:40 PM
To: Maxim Uvarov
Cc: LNG ODP Mailman List
Subject: Re: [lng-odp] Atomics

On 22 April 2015 at 13:24, Maxim Uvarov 
maxim.uva...@linaro.orgmailto:maxim.uva...@linaro.org wrote:
On 04/22/15 14:20, Maxim Uvarov wrote:
On 04/22/15 13:34, Nicolas Morey-Chaisemartin wrote:

On 04/22/2015 11:39 AM, Maxim Uvarov wrote:
In that case what you need is.

That is odp API:
./include/odp/api/atomic.h

That is platfrom implementation (linux-generic):
./platform/linux-generic/include/odp/atomic.h

That is some internal functions which linux-generic platfrom does.
./platform/linux-generic/include/odp_atomic_internal.h

So that what you need is move
./platform/linux-generic/include/odp/atomic.h to 
./platform/your-platfrom/include/odp/atomic.h
and re implement functions there.

Is that original question?

Best regards,
Maxim.



That's what I did. But our implementation is mostly based on the linux-generic 
now. And as I had to implement almost the same atomic functions twice, I was 
thinking it would make sense to refactor this code in the linux-generic tree 
too.

Nicolas
Ok, got it now.

Ola, I think that it can be reworked and because all odp_timer.c, 
odp_ticketlock.c and odp_rwlock.c use _ODP_MEMMODEL_RLX they can also use api 
function, not _internal.h right?
The implementation of synchronization operations  (locks, barriers etc) use all 
kind of memory orderings, especially acquire and release.

I don't know and really don't care exactly how the final solution will look 
like, the person who does the work will have to find something that works. But 
we should agree on some prerequisites. Should the atomic operations in 
linux-generic/include/odp_atomic_internal.h become public (that would be the 
simplest solution me thinks) or stay private?

If stay private, is there some way for the public operations in 
include/odp/api/atomic.h to use the operations in odp_atomic_internal.h which 
are not considered public? I.e. can you implement a public API using non-public 
(private) definitions?

Those should stay private. If the compiler does not support __atomic_xxx, but 
supports __sync_xxx, linux-generic/include/odp/atomic.h could be modified to 
#ifdef between __atomic and __sync. That would narrow the problem to 
re-implement only those linux-generic internal atomics that are really used and 
cannot be changed to API atomics. It seems most _odp_atomic_ calls are really 
needed, but only these combinations are actually used. Some of these (in timer) 
are behind #ifdefs. It would be better to pick only one implementation  (e.g. 
32, 64 or 128 bit) and remove #ifdefs, otherwise the code will be not tested 
and thus rotten…

_odp_atomic_u32_load_mm(…, _ODP_MEMMODEL_RLX)
_odp_atomic_u32_load_mm(…, _ODP_MEMMODEL_ACQ)
_odp_atomic_u32_cmp_xchg_strong_mm(…, _ODP_MEMMODEL_ACQ, _ODP_MEMMODEL_RLX)
_odp_atomic_u32_sub_mm(…, _ODP_MEMMODEL_RLS)
_odp_atomic_u32_store_mm(…, _ODP_MEMMODEL_RLS)

_odp_atomic_u64_store_mm(…, _ODP_MEMMODEL_RLS)
_odp_atomic_u64_load_mm(…, _ODP_MEMMODEL_RLX)
_odp_atomic_u64_xchg_mm(…, _ODP_MEMMODEL_RLX)
_odp_atomic_u64_cmp_xchg_strong_mm(…, _ODP_MEMMODEL_RLX, _ODP_MEMMODEL_RLX)

_odp_atomic_u128_cmp_xchg_mm(…, _ODP_MEMMODEL_RLS, _ODP_MEMMODEL_RLX)
_odp_atomic_u128_xchg_mm(…,  _ODP_MEMMODEL_ACQ_RLS)
_odp_atomic_u128_xchg_mm(…,  _ODP_MEMMODEL_RLX)

_odp_atomic_flag_xxx()

Could this list be shrunken to by e.g. removing 128 bit and flag … or even 
further always use only 32 or only 64 bit? Trade-off e.g. 32 bits more memory 
used per lock to half (or quarter) the porting effort?

-Petri

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


Re: [lng-odp] [API-NEXT PATCH v2] timer: Add missing platform handles to u64 conversion functions

2015-04-24 Thread Mike Holmes
On 24 April 2015 at 08:31, Savolainen, Petri (Nokia - FI/Espoo) 
petri.savolai...@nokia.com wrote:

  These are trivial enough to get into v1.1. I was thinking that we freeze
 the v1.1 API next week, and then work on the missing
 implementation/validation code before labeling the official 1.1.0 release .


1.1 is fine I assumed there would not be an implementation in time. If it
is simple that is good, but we still need to identify some one to do the
work.

To be in for 1.1 which freezes on Wednesday we need an implementation to
already be in api-next by Wednesday so that CI runs the tests.

Is there any strong reason to hold up 1.1.0 for this ? If it is critical we
can hold 1.1 for a few days assuming the work is about to land, but why not
add it to 1.2.0 and release that early with the next crop of work and keep
an even pace to development ?





 -Petri



 *From:* lng-odp [mailto:lng-odp-boun...@lists.linaro.org] *On Behalf Of *ext
 Mike Holmes
 *Sent:* Friday, April 24, 2015 2:55 PM
 *To:* Jerin Jacob
 *Cc:* lng-odp
 *Subject:* Re: [lng-odp] [API-NEXT PATCH v2] timer: Add missing platform
 handles to u64 conversion functions



 Hi Jerin



 Before this is merged with mainline I think we should have a linux-generic
 implementation and a test case for it.

 Do you have the cycles to add those to api-next so that this can be part
 of 1.2.0 ?



 I think tentatively that 1.2.0 will be in August at this point, although
 if we can start gathering more complete new API work in api-next there is
 no reason to wait that long.



 Mike



 On 24 April 2015 at 05:13, Jerin Jacob jerin.ja...@caviumnetworks.com
 wrote:

 On Fri, Apr 24, 2015 at 11:46:53AM +0300, Maxim Uvarov wrote:
  Hi Jerin,
 
  you you only removed RFC and Petri added sign-off to that patch you
 should
  include it to patch without rfc.
 
  also v1..v2... should go after --- line in patch. In that case git am
 just
  skips that comment.

 Thanks for pointing it out.


 
  Patch merged to api-next.
 
  Thanks,
  Maxim.
 
  On 04/24/15 09:14, Jerin Jacob wrote:
  On Mon, Apr 20, 2015 at 04:22:15PM +0530, Jerin Jacob wrote:
  
  ping
  
  v1..v2 Removed RFC
  
  
  Signed-off-by: Jerin Jacob jerin.ja...@caviumnetworks.com
  ---
include/odp/api/timer.h | 39 +++
1 file changed, 39 insertions(+)
  
  diff --git a/include/odp/api/timer.h b/include/odp/api/timer.h
  index 0dc9415..435c004 100644
  --- a/include/odp/api/timer.h
  +++ b/include/odp/api/timer.h
  @@ -366,6 +366,45 @@ odp_timeout_t odp_timeout_alloc(odp_pool_t pool);
void odp_timeout_free(odp_timeout_t tmo);
/**
  + * Get printable value for an odp_timer_pool_t
  + *
  + * @param hdl  odp_timer_pool_t handle to be printed
  + * @return uint64_t value that can be used to print/display this
  + * handle
  + *
  + * @note This routine is intended to be used for diagnostic purposes
  + * to enable applications to generate a printable value that
 represents
  + * an odp_timer_pool_t handle.
  + */
  +uint64_t odp_timer_pool_to_u64(odp_timer_pool_t hdl);
  +
  +/**
  + * Get printable value for an odp_timer_t
  + *
  + * @param hdl  odp_timer_t handle to be printed
  + * @return uint64_t value that can be used to print/display this
  + * handle
  + *
  + * @note This routine is intended to be used for diagnostic purposes
  + * to enable applications to generate a printable value that
 represents
  + * an odp_timer_t handle.
  + */
  +uint64_t odp_timer_to_u64(odp_timer_t hdl);
  +
  +/**
  + * Get printable value for an odp_timeout_t
  + *
  + * @param hdl  odp_timeout_t handle to be printed
  + * @return uint64_t value that can be used to print/display this
  + * handle
  + *
  + * @note This routine is intended to be used for diagnostic purposes
  + * to enable applications to generate a printable value that
 represents
  + * an odp_timeout_t handle.
  + */
  +uint64_t odp_timeout_to_u64(odp_timeout_t hdl);
  +
  +/**
 * @}
 */
  --
  2.1.0
  
  ___
  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





 --

 Mike Holmes

 Technical Manager - Linaro Networking Group

 Linaro.org http://www.linaro.org/ *│ *Open source software for ARM SoCs






-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org http://www.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] [PATCHv3 2/2] validation: tests for module odp_ver_abt_log_dbg

2015-04-24 Thread Christophe Milard
Created directory for module odp_ver_abt_log_dbg, populated
with file odp_errno.c and odp_system.c which, despite its
confusing name is not testing the system module but the sys*
function of the odp_ver_abt_log_dbg module.

Signed-off-by: Christophe Milard christophe.mil...@linaro.org
---

 same as before. just rebased.

 test/validation/.gitignore|  3 +--
 test/validation/Makefile.am   |  9 ++---
 test/validation/{ = ver_abt_log_dbg}/odp_errno.c |  5 -
 test/validation/ver_abt_log_dbg/odp_errno.h   |  9 +
 test/validation/{ = ver_abt_log_dbg}/odp_system.c|  7 ---
 test/validation/ver_abt_log_dbg/odp_system.h  |  9 +
 test/validation/ver_abt_log_dbg/odp_ver_abt_log_dbg.c | 16 
 7 files changed, 41 insertions(+), 17 deletions(-)
 rename test/validation/{ = ver_abt_log_dbg}/odp_errno.c (81%)
 create mode 100644 test/validation/ver_abt_log_dbg/odp_errno.h
 rename test/validation/{ = ver_abt_log_dbg}/odp_system.c (93%)
 create mode 100644 test/validation/ver_abt_log_dbg/odp_system.h
 create mode 100644 test/validation/ver_abt_log_dbg/odp_ver_abt_log_dbg.c

diff --git a/test/validation/.gitignore b/test/validation/.gitignore
index 05a7424..4bbcea3 100644
--- a/test/validation/.gitignore
+++ b/test/validation/.gitignore
@@ -1,10 +1,10 @@
 *.log
 *.trs
+odp_ver_abt_log_dbg
 odp_buffer
 odp_classification
 odp_cpumask
 odp_crypto
-odp_errno
 odp_init
 odp_init_abort
 odp_init_log
@@ -16,7 +16,6 @@ odp_random
 odp_scheduler
 odp_shared_memory
 odp_synchronizers
-odp_system
 odp_time
 odp_timer
 odp_thread
diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 36b0ba8..fe1fd65 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -18,12 +18,11 @@ EXECUTABLES = odp_buffer \
  odp_random \
  odp_scheduler \
  odp_shared_memory \
- odp_system \
  odp_synchronizers \
  odp_time \
  odp_timer \
- odp_errno \
- odp_thread
+ odp_thread \
+ odp_ver_abt_log_dbg
 
 COMPILE_ONLY = odp_packet_io
 
@@ -65,3 +64,7 @@ dist_odp_pool_SOURCES = odp_pool.c $(ODP_CU_COMMON)
 dist_odp_errno_SOURCES = odp_errno.c $(ODP_CU_COMMON)
 dist_odp_cpumask_SOURCES = odp_cpumask.c $(ODP_CU_COMMON)
 dist_odp_thread_SOURCES = odp_thread.c $(ODP_CU_COMMON)
+odp_ver_abt_log_dbg_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/ver_abt_log_dbg
+dist_odp_ver_abt_log_dbg_SOURCES  = ver_abt_log_dbg/odp_system.c \
+   ver_abt_log_dbg/odp_errno.c \
+ver_abt_log_dbg/odp_ver_abt_log_dbg.c 
$(ODP_CU_COMMON)
diff --git a/test/validation/odp_errno.c 
b/test/validation/ver_abt_log_dbg/odp_errno.c
similarity index 81%
rename from test/validation/odp_errno.c
rename to test/validation/ver_abt_log_dbg/odp_errno.c
index 89b99d7..368f26e 100644
--- a/test/validation/odp_errno.c
+++ b/test/validation/ver_abt_log_dbg/odp_errno.c
@@ -21,8 +21,3 @@ CU_TestInfo test_odp_errno[] = {
{sunny day, test_odp_errno_sunny_day},
CU_TEST_INFO_NULL,
 };
-
-CU_SuiteInfo odp_testsuites[] = {
-   {Errno, NULL, NULL, NULL, NULL, test_odp_errno},
-   CU_SUITE_INFO_NULL,
-};
diff --git a/test/validation/ver_abt_log_dbg/odp_errno.h 
b/test/validation/ver_abt_log_dbg/odp_errno.h
new file mode 100644
index 000..80507fa
--- /dev/null
+++ b/test/validation/ver_abt_log_dbg/odp_errno.h
@@ -0,0 +1,9 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:BSD-3-Clause
+ */
+
+#include odp_cunit_common.h
+
+extern CU_TestInfo test_odp_errno[];
diff --git a/test/validation/odp_system.c 
b/test/validation/ver_abt_log_dbg/odp_system.c
similarity index 93%
rename from test/validation/odp_system.c
rename to test/validation/ver_abt_log_dbg/odp_system.c
index 94ee712..1a40957 100644
--- a/test/validation/odp_system.c
+++ b/test/validation/ver_abt_log_dbg/odp_system.c
@@ -92,10 +92,3 @@ CU_TestInfo test_odp_system[] = {
{odp_sys_cpu_hz,  test_odp_sys_cpu_hz},
CU_TEST_INFO_NULL,
 };
-
-CU_SuiteInfo odp_testsuites[] = {
-   {System Info, NULL, NULL, NULL, NULL,
-test_odp_system},
-CU_SUITE_INFO_NULL,
-};
-
diff --git a/test/validation/ver_abt_log_dbg/odp_system.h 
b/test/validation/ver_abt_log_dbg/odp_system.h
new file mode 100644
index 000..ce99bed
--- /dev/null
+++ b/test/validation/ver_abt_log_dbg/odp_system.h
@@ -0,0 +1,9 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:BSD-3-Clause
+ */
+
+#include odp_cunit_common.h
+
+extern CU_TestInfo test_odp_system[];
diff --git a/test/validation/ver_abt_log_dbg/odp_ver_abt_log_dbg.c 
b/test/validation/ver_abt_log_dbg/odp_ver_abt_log_dbg.c
new file mode 100644
index 000..39a632e
--- /dev/null
+++ 

[lng-odp] [PATCH 1/3] test: classification: add missing init of atomic variable

2015-04-24 Thread Nicolas Morey-Chaisemartin
Signed-off-by: Nicolas Morey-Chaisemartin nmo...@kalray.eu
---
 test/validation/classification/odp_classification_tests.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test/validation/classification/odp_classification_tests.c 
b/test/validation/classification/odp_classification_tests.c
index 1bf080f..b44bc62 100644
--- a/test/validation/classification/odp_classification_tests.c
+++ b/test/validation/classification/odp_classification_tests.c
@@ -319,6 +319,7 @@ int classification_tests_init(void)
for (i = 0; i  CLS_ENTRIES; i++)
queue_list[i] = ODP_QUEUE_INVALID;
 
+   odp_atomic_init_u32(seq, 0);
return 0;
 }
 
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH] linux-generic: timer: use plain buffers for timeouts

2015-04-24 Thread Ola Liljedahl
Use plain buffers for timeouts. Store the timeout header in the buffer
data area. This simplifies re-use on other platforms where the event
header cannot be arbitrarily defined.

Signed-off-by: Ola Liljedahl ola.liljed...@linaro.org
---
(This document/code contribution attached is provided under the terms of
agreement LES-LTM-21309)

 platform/linux-generic/include/odp_timer_internal.h | 15 ---
 platform/linux-generic/odp_pool.c   |  7 ---
 platform/linux-generic/odp_timer.c  | 15 +--
 3 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/platform/linux-generic/include/odp_timer_internal.h 
b/platform/linux-generic/include/odp_timer_internal.h
index 90af62c..a631bd0 100644
--- a/platform/linux-generic/include/odp_timer_internal.h
+++ b/platform/linux-generic/include/odp_timer_internal.h
@@ -16,36 +16,45 @@
 
 #include odp/align.h
 #include odp/debug.h
+#include odp_debug_internal.h
 #include odp_buffer_internal.h
 #include odp_pool_internal.h
 #include odp/timer.h
 
 /**
  * Internal Timeout header
+ * For compatibility with buffers, we use the buffer_hdr here and nothing else
  */
 typedef struct {
/* common buffer header */
odp_buffer_hdr_t buf_hdr;
+} odp_timeout_fakehdr_t;
 
+/* The real timeout header is in a separate struct in a separate location */
+typedef struct {
/* Requested expiration time */
uint64_t expiration;
/* User ptr inherited from parent timer */
void *user_ptr;
+   /* Handle of buffer we are located in */
+   odp_buffer_t buf;
/* Parent timer */
odp_timer_t timer;
 } odp_timeout_hdr_t;
 
 typedef struct odp_timeout_hdr_stride {
-   uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(odp_timeout_hdr_t))];
+   uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(odp_timeout_fakehdr_t))];
 } odp_timeout_hdr_stride;
 
 
 /**
  * Return the timeout header
  */
-static inline odp_timeout_hdr_t *odp_timeout_hdr(odp_buffer_t buf)
+static inline odp_timeout_hdr_t *odp_timeout_hdr_from_buf(odp_buffer_t buf)
 {
-   return (odp_timeout_hdr_t *)odp_buf_to_hdr(buf);
+   /* The real timeout header is stored in the buffer data */
+   ODP_ASSERT(odp_buffer_size(buf) == sizeof(odp_timeout_hdr_t));
+   return (odp_timeout_hdr_t *)odp_buffer_addr(buf);
 }
 
 #endif
diff --git a/platform/linux-generic/odp_pool.c 
b/platform/linux-generic/odp_pool.c
index bf49623..fc10aa4 100644
--- a/platform/linux-generic/odp_pool.c
+++ b/platform/linux-generic/odp_pool.c
@@ -32,7 +32,7 @@
 typedef union buffer_type_any_u {
odp_buffer_hdr_t  buf;
odp_packet_hdr_t  pkt;
-   odp_timeout_hdr_t tmo;
+   odp_timeout_fakehdr_t tmo;
 } odp_anybuf_t;
 
 _ODP_STATIC_ASSERT((sizeof(union buffer_type_any_u) % 8) == 0,
@@ -148,7 +148,8 @@ odp_pool_t odp_pool_create(const char *name,
 
/* Default size and align for timeouts */
if (params-type == ODP_POOL_TIMEOUT) {
-   params-buf.size  = 0; /* tmo.__res1 */
+   /* The real timeout header is stored in the buffer */
+   params-buf.size  = sizeof(odp_timeout_hdr_t); /* tmo.__res1 */
params-buf.align = 0; /* tmo.__res2 */
}
 
@@ -226,7 +227,7 @@ odp_pool_t odp_pool_create(const char *name,
break;
 
case ODP_POOL_TIMEOUT:
-   blk_size = 0;
+   blk_size = params-buf.size;
buf_num = params-tmo.num;
buf_stride = sizeof(odp_timeout_hdr_stride);
break;
diff --git a/platform/linux-generic/odp_timer.c 
b/platform/linux-generic/odp_timer.c
index e5391dc..1922f94 100644
--- a/platform/linux-generic/odp_timer.c
+++ b/platform/linux-generic/odp_timer.c
@@ -78,7 +78,7 @@ static _odp_atomic_flag_t locks[NUM_LOCKS]; /* Multiple locks 
per cache line! */
 
 static odp_timeout_hdr_t *timeout_hdr_from_buf(odp_buffer_t buf)
 {
-   return (odp_timeout_hdr_t *)odp_buf_to_hdr(buf);
+   return odp_timeout_hdr_from_buf(buf);
 }
 
 /**
@@ -820,8 +820,7 @@ odp_timeout_t odp_timeout_from_event(odp_event_t ev)
 odp_event_t odp_timeout_to_event(odp_timeout_t tmo)
 {
odp_timeout_hdr_t *tmo_hdr = (odp_timeout_hdr_t *)tmo;
-   odp_buffer_t buf = odp_hdr_to_buf(tmo_hdr-buf_hdr);
-   return odp_buffer_to_event(buf);
+   return odp_buffer_to_event(tmo_hdr-buf);
 }
 
 int odp_timeout_fresh(odp_timeout_t tmo)
@@ -857,16 +856,20 @@ void *odp_timeout_user_ptr(odp_timeout_t tmo)
 
 odp_timeout_t odp_timeout_alloc(odp_pool_t pool)
 {
+   odp_timeout_hdr_t *tmo_hdr;
odp_buffer_t buf = odp_buffer_alloc(pool);
if (odp_unlikely(buf == ODP_BUFFER_INVALID))
return ODP_TIMEOUT_INVALID;
-   return odp_timeout_from_event(odp_buffer_to_event(buf));
+   tmo_hdr = timeout_hdr_from_buf(buf);
+   /* Must save buffer handle in timeout header for 

[lng-odp] Threads Thread Safety

2015-04-24 Thread Nicolas Morey-Chaisemartin
Hi everyone,

I'm currently trying to get all the ODP validation tests running on our MPPA 
platform and ran across an issue:
It appears CUnit (2.1-3) is *not* thread safe !

It isn't a very big issue but it creates unexpected behaviour (and warnings in 
our simulators) in the odp_shm test for example.
In this test, each thread runs several CU_ASSERT which internally trigger non 
atomic increment in CUnit...
I added a tiny lock within our build of CUnit that fixes the issue but it is 
something you should definitly have a look at.


On a mostly unrelated note, several tests (odp_schedule, odp_shm, 
odp_synchronizers), spawn odp_cpu_count() threads.
This means in the end that we have odp_cpu_count() + 1 thread running (couting 
the main). Is this something wanted?

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


[lng-odp] [PATCH 2/3] linux-generic: packet_io: init l2 and l3 cos table spinlocks

2015-04-24 Thread Nicolas Morey-Chaisemartin
Signed-off-by: Nicolas Morey-Chaisemartin nmo...@kalray.eu
---
 platform/linux-generic/odp_packet_io.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/platform/linux-generic/odp_packet_io.c 
b/platform/linux-generic/odp_packet_io.c
index cfe5b71..f16685d 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -61,6 +61,8 @@ int odp_pktio_init_global(void)
 
odp_spinlock_init(pktio_entry-s.lock);
odp_spinlock_init(pktio_entry-s.cls.lock);
+   odp_spinlock_init(pktio_entry-s.cls.l2_cos_table.lock);
+   odp_spinlock_init(pktio_entry-s.cls.l3_cos_table.lock);
 
pktio_entry_ptr[id - 1] = pktio_entry;
/* Create a default output queue for each pktio resource */
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 3/3] validation: synchronizers: fix init of custom barrier atomic

2015-04-24 Thread Nicolas Morey-Chaisemartin
Signed-off-by: Nicolas Morey-Chaisemartin nmo...@kalray.eu
---
 test/validation/odp_synchronizers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/validation/odp_synchronizers.c 
b/test/validation/odp_synchronizers.c
index edb6bf1..a9be1c5 100644
--- a/test/validation/odp_synchronizers.c
+++ b/test/validation/odp_synchronizers.c
@@ -138,7 +138,7 @@ static void thread_finalize(per_thread_mem_t 
*per_thread_mem)
 static void custom_barrier_init(custom_barrier_t *custom_barrier,
uint32_t num_threads)
 {
-   odp_atomic_store_u32(custom_barrier-wait_cnt, num_threads);
+   odp_atomic_init_u32(custom_barrier-wait_cnt, num_threads);
 }
 
 static void custom_barrier_wait(custom_barrier_t *custom_barrier)
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 2/2] validation: init tests using common main

2015-04-24 Thread Christophe Milard
The 3 init tests (init, abort,log) now links with common/odp_cunit_common,
as other tests. In main, ODP init is now performed via weak functions
which are overloaded (to do nothing) by the 3 init tests.

Signed-off-by: Christophe Milard christophe.mil...@linaro.org
---
 test/validation/Makefile.am   |  6 ++---
 test/validation/common/odp_cunit_common.c | 41 +--
 test/validation/common/odp_cunit_common.h | 20 ++-
 test/validation/init/odp_init.c   | 34 ++---
 test/validation/init/odp_init_abort.c | 35 +++---
 test/validation/init/odp_init_log.c   | 35 +++---
 6 files changed, 91 insertions(+), 80 deletions(-)

diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 7ea86c4..ba622c3 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -48,9 +48,9 @@ dist_odp_classification_SOURCES = 
classification/odp_classification_tests.c \
 odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
 dist_odp_crypto_SOURCES = crypto/odp_crypto_test_inp.c \
  odp_crypto.c $(ODP_CU_COMMON)
-dist_odp_init_SOURCES  = init/odp_init.c
-dist_odp_init_abort_SOURCES = init/odp_init_abort.c
-dist_odp_init_log_SOURCES = init/odp_init_log.c
+dist_odp_init_SOURCES  = init/odp_init.c $(ODP_CU_COMMON)
+dist_odp_init_abort_SOURCES = init/odp_init_abort.c $(ODP_CU_COMMON)
+dist_odp_init_log_SOURCES = init/odp_init_log.c $(ODP_CU_COMMON)
 dist_odp_queue_SOURCES = odp_queue.c $(ODP_CU_COMMON)
 dist_odp_random_SOURCES = odp_random.c $(ODP_CU_COMMON)
 dist_odp_schedule_SOURCES = odp_schedule.c $(ODP_CU_COMMON)
diff --git a/test/validation/common/odp_cunit_common.c 
b/test/validation/common/odp_cunit_common.c
index 2af4410..7eca422 100644
--- a/test/validation/common/odp_cunit_common.c
+++ b/test/validation/common/odp_cunit_common.c
@@ -49,12 +49,8 @@ __attribute__((__weak__)) int tests_global_term(void)
return 0;
 }
 
-int main(void)
+__attribute__((__weak__)) int tests_odp_init(void)
 {
-   int ret;
-
-   printf(\tODP API version: %s\n, odp_version_api_str());
-   printf(\tODP implementation version: %s\n, odp_version_impl_str());
 
if (0 != odp_init_global(NULL, NULL)) {
fprintf(stderr, error: odp_init_global() failed.\n);
@@ -64,6 +60,32 @@ int main(void)
fprintf(stderr, error: odp_init_local() failed.\n);
return -1;
}
+   return 0;
+}
+
+__attribute__((__weak__)) int tests_odp_term(void)
+{
+   if (0 != odp_term_local()) {
+   fprintf(stderr, error: odp_term_local() failed.\n);
+   return -1;
+   }
+
+   if (0 != odp_term_global()) {
+   fprintf(stderr, error: odp_term_global() failed.\n);
+   return -1;
+   }
+   return 0;
+}
+
+int main(void)
+{
+   int ret;
+
+   printf(\tODP API version: %s\n, odp_version_api_str());
+   printf(\tODP implementation version: %s\n, odp_version_impl_str());
+
+   if (0 != tests_odp_init())
+   return -1;
 
ret = tests_global_init();
if (ret)
@@ -83,15 +105,8 @@ int main(void)
if (0 != tests_global_term())
return -1;
 
-   if (0 != odp_term_local()) {
-   fprintf(stderr, error: odp_term_local() failed.\n);
+   if (0 != tests_odp_term())
return -1;
-   }
-
-   if (0 != odp_term_global()) {
-   fprintf(stderr, error: odp_term_global() failed.\n);
-   return -1;
-   }
 
return (ret) ? -1 : 0;
 }
diff --git a/test/validation/common/odp_cunit_common.h 
b/test/validation/common/odp_cunit_common.h
index 127020d..852d9ba 100644
--- a/test/validation/common/odp_cunit_common.h
+++ b/test/validation/common/odp_cunit_common.h
@@ -37,9 +37,27 @@ typedef struct {
int numthrds; /** no of pthreads to create */
 } pthrd_arg;
 
-/** create thread fro start_routine function */
+/** create thread for start_routine function */
 extern int odp_cunit_thread_create(void *func_ptr(void *), pthrd_arg *arg);
 extern int odp_cunit_thread_exit(pthrd_arg *);
+
+/**
+ * Global tests ODP initialization.
+ *
+ * ODP initialization/terminaison functions used by this main program.
+ * Default weak definition does both global and local ODP init/terminaison,
+ * (which is what most of the test cases want). Override it by defining
+ * a strong version.
+ *
+ * @note: This function is a workaround for Init tests and other applications
+ *should try not to use it, because it will complicate migration to a
+ *single test application in future. Normally each testsuite have to
+ *prepare its environment in its own init function.
+ */
+extern int tests_odp_init(void);
+
+extern int tests_odp_term(void);
+
 /**
  * Global tests initialization.
  *
diff --git a/test/validation/init/odp_init.c b/test/validation/init/odp_init.c
index 

[lng-odp] [PATCH 1/2] validation: init src files in single directory

2015-04-24 Thread Christophe Milard
The 3 tests for initialisation still generate 3 executables,
but their sources are simply gathered in a single directory called as
the module itself, init.

Signed-off-by: Christophe Milard christophe.mil...@linaro.org
---
 test/validation/Makefile.am | 6 +++---
 test/validation/{ = init}/odp_init.c   | 0
 test/validation/{ = init}/odp_init_abort.c | 0
 test/validation/{ = init}/odp_init_log.c   | 0
 4 files changed, 3 insertions(+), 3 deletions(-)
 rename test/validation/{ = init}/odp_init.c (100%)
 rename test/validation/{ = init}/odp_init_abort.c (100%)
 rename test/validation/{ = init}/odp_init_log.c (100%)

diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
index 6bac101..7ea86c4 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -48,9 +48,9 @@ dist_odp_classification_SOURCES = 
classification/odp_classification_tests.c \
 odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
 dist_odp_crypto_SOURCES = crypto/odp_crypto_test_inp.c \
  odp_crypto.c $(ODP_CU_COMMON)
-dist_odp_init_SOURCES  = odp_init.c
-dist_odp_init_abort_SOURCES = odp_init_abort.c
-dist_odp_init_log_SOURCES = odp_init_log.c
+dist_odp_init_SOURCES  = init/odp_init.c
+dist_odp_init_abort_SOURCES = init/odp_init_abort.c
+dist_odp_init_log_SOURCES = init/odp_init_log.c
 dist_odp_queue_SOURCES = odp_queue.c $(ODP_CU_COMMON)
 dist_odp_random_SOURCES = odp_random.c $(ODP_CU_COMMON)
 dist_odp_schedule_SOURCES = odp_schedule.c $(ODP_CU_COMMON)
diff --git a/test/validation/odp_init.c b/test/validation/init/odp_init.c
similarity index 100%
rename from test/validation/odp_init.c
rename to test/validation/init/odp_init.c
diff --git a/test/validation/odp_init_abort.c 
b/test/validation/init/odp_init_abort.c
similarity index 100%
rename from test/validation/odp_init_abort.c
rename to test/validation/init/odp_init_abort.c
diff --git a/test/validation/odp_init_log.c 
b/test/validation/init/odp_init_log.c
similarity index 100%
rename from test/validation/odp_init_log.c
rename to test/validation/init/odp_init_log.c
-- 
1.9.1

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


[lng-odp] [PATCH] api: time: force time defines as ULL to avoid computation overflows on 32bits systems

2015-04-24 Thread Nicolas Morey-Chaisemartin
For example the odp_timer validation tests computes 10 * ODP_TIME_SEC and 
stores it into an uint64_t, but the computation overflows on 32b systems and 
the test fails

Signed-off-by: Nicolas Morey-Chaisemartin nmo...@kalray.eu
---
 include/odp/api/time.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/odp/api/time.h b/include/odp/api/time.h
index 6b811d0..836866d 100644
--- a/include/odp/api/time.h
+++ b/include/odp/api/time.h
@@ -24,9 +24,9 @@ extern C {
  */
 
 /* Time in nanoseconds */
-#define ODP_TIME_USEC 1000UL   /** Microsecond in nsec */
-#define ODP_TIME_MSEC 100UL/** Millisecond in nsec */
-#define ODP_TIME_SEC  10UL /** Second in nsec */
+#define ODP_TIME_USEC 1000ULL   /** Microsecond in nsec */
+#define ODP_TIME_MSEC 100ULL/** Millisecond in nsec */
+#define ODP_TIME_SEC  10ULL /** Second in nsec */
 
 
 /**
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT PATCH v2] timer: Add missing platform handles to u64 conversion functions

2015-04-24 Thread Savolainen, Petri (Nokia - FI/Espoo)
These are trivial enough to get into v1.1. I was thinking that we freeze the 
v1.1 API next week, and then work on the missing implementation/validation code 
before labeling the official 1.1.0 release .

-Petri

From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of ext Mike 
Holmes
Sent: Friday, April 24, 2015 2:55 PM
To: Jerin Jacob
Cc: lng-odp
Subject: Re: [lng-odp] [API-NEXT PATCH v2] timer: Add missing platform handles 
to u64 conversion functions

Hi Jerin

Before this is merged with mainline I think we should have a linux-generic 
implementation and a test case for it.
Do you have the cycles to add those to api-next so that this can be part of 
1.2.0 ?

I think tentatively that 1.2.0 will be in August at this point, although if we 
can start gathering more complete new API work in api-next there is no reason 
to wait that long.

Mike

On 24 April 2015 at 05:13, Jerin Jacob 
jerin.ja...@caviumnetworks.commailto:jerin.ja...@caviumnetworks.com wrote:
On Fri, Apr 24, 2015 at 11:46:53AM +0300, Maxim Uvarov wrote:
 Hi Jerin,

 you you only removed RFC and Petri added sign-off to that patch you should
 include it to patch without rfc.

 also v1..v2... should go after --- line in patch. In that case git am just
 skips that comment.

Thanks for pointing it out.


 Patch merged to api-next.

 Thanks,
 Maxim.

 On 04/24/15 09:14, Jerin Jacob wrote:
 On Mon, Apr 20, 2015 at 04:22:15PM +0530, Jerin Jacob wrote:
 
 ping
 
 v1..v2 Removed RFC
 
 
 Signed-off-by: Jerin Jacob 
 jerin.ja...@caviumnetworks.commailto:jerin.ja...@caviumnetworks.com
 ---
   include/odp/api/timer.h | 39 +++
   1 file changed, 39 insertions(+)
 
 diff --git a/include/odp/api/timer.h b/include/odp/api/timer.h
 index 0dc9415..435c004 100644
 --- a/include/odp/api/timer.h
 +++ b/include/odp/api/timer.h
 @@ -366,6 +366,45 @@ odp_timeout_t odp_timeout_alloc(odp_pool_t pool);
   void odp_timeout_free(odp_timeout_t tmo);
   /**
 + * Get printable value for an odp_timer_pool_t
 + *
 + * @param hdl  odp_timer_pool_t handle to be printed
 + * @return uint64_t value that can be used to print/display this
 + * handle
 + *
 + * @note This routine is intended to be used for diagnostic purposes
 + * to enable applications to generate a printable value that represents
 + * an odp_timer_pool_t handle.
 + */
 +uint64_t odp_timer_pool_to_u64(odp_timer_pool_t hdl);
 +
 +/**
 + * Get printable value for an odp_timer_t
 + *
 + * @param hdl  odp_timer_t handle to be printed
 + * @return uint64_t value that can be used to print/display this
 + * handle
 + *
 + * @note This routine is intended to be used for diagnostic purposes
 + * to enable applications to generate a printable value that represents
 + * an odp_timer_t handle.
 + */
 +uint64_t odp_timer_to_u64(odp_timer_t hdl);
 +
 +/**
 + * Get printable value for an odp_timeout_t
 + *
 + * @param hdl  odp_timeout_t handle to be printed
 + * @return uint64_t value that can be used to print/display this
 + * handle
 + *
 + * @note This routine is intended to be used for diagnostic purposes
 + * to enable applications to generate a printable value that represents
 + * an odp_timeout_t handle.
 + */
 +uint64_t odp_timeout_to_u64(odp_timeout_t hdl);
 +
 +/**
* @}
*/
 --
 2.1.0
 
 ___
 lng-odp mailing list
 lng-odp@lists.linaro.orgmailto:lng-odp@lists.linaro.org
 https://lists.linaro.org/mailman/listinfo/lng-odp

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



--
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.orghttp://www.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 v2] timer: Add missing platform handles to u64 conversion functions

2015-04-24 Thread Savolainen, Petri (Nokia - FI/Espoo)
Also packet_user_area (metadata) and my pktio API changes are missing 
implementation. The delta between API 1.0 and 1.1 is pretty slim if those are 
left out also.

-Petri


From: ext Mike Holmes [mailto:mike.hol...@linaro.org]
Sent: Friday, April 24, 2015 3:45 PM
To: Savolainen, Petri (Nokia - FI/Espoo)
Cc: Jerin Jacob; lng-odp
Subject: Re: [lng-odp] [API-NEXT PATCH v2] timer: Add missing platform handles 
to u64 conversion functions



On 24 April 2015 at 08:31, Savolainen, Petri (Nokia - FI/Espoo) 
petri.savolai...@nokia.commailto:petri.savolai...@nokia.com wrote:
These are trivial enough to get into v1.1. I was thinking that we freeze the 
v1.1 API next week, and then work on the missing implementation/validation code 
before labeling the official 1.1.0 release .

1.1 is fine I assumed there would not be an implementation in time. If it is 
simple that is good, but we still need to identify some one to do the work.

To be in for 1.1 which freezes on Wednesday we need an implementation to 
already be in api-next by Wednesday so that CI runs the tests.

Is there any strong reason to hold up 1.1.0 for this ? If it is critical we can 
hold 1.1 for a few days assuming the work is about to land, but why not add it 
to 1.2.0 and release that early with the next crop of work and keep an even 
pace to development ?



-Petri

From: lng-odp 
[mailto:lng-odp-boun...@lists.linaro.orgmailto:lng-odp-boun...@lists.linaro.org]
 On Behalf Of ext Mike Holmes
Sent: Friday, April 24, 2015 2:55 PM
To: Jerin Jacob
Cc: lng-odp
Subject: Re: [lng-odp] [API-NEXT PATCH v2] timer: Add missing platform handles 
to u64 conversion functions

Hi Jerin

Before this is merged with mainline I think we should have a linux-generic 
implementation and a test case for it.
Do you have the cycles to add those to api-next so that this can be part of 
1.2.0 ?

I think tentatively that 1.2.0 will be in August at this point, although if we 
can start gathering more complete new API work in api-next there is no reason 
to wait that long.

Mike

On 24 April 2015 at 05:13, Jerin Jacob 
jerin.ja...@caviumnetworks.commailto:jerin.ja...@caviumnetworks.com wrote:
On Fri, Apr 24, 2015 at 11:46:53AM +0300, Maxim Uvarov wrote:
 Hi Jerin,

 you you only removed RFC and Petri added sign-off to that patch you should
 include it to patch without rfc.

 also v1..v2... should go after --- line in patch. In that case git am just
 skips that comment.

Thanks for pointing it out.


 Patch merged to api-next.

 Thanks,
 Maxim.

 On 04/24/15 09:14, Jerin Jacob wrote:
 On Mon, Apr 20, 2015 at 04:22:15PM +0530, Jerin Jacob wrote:
 
 ping
 
 v1..v2 Removed RFC
 
 
 Signed-off-by: Jerin Jacob 
 jerin.ja...@caviumnetworks.commailto:jerin.ja...@caviumnetworks.com
 ---
   include/odp/api/timer.h | 39 +++
   1 file changed, 39 insertions(+)
 
 diff --git a/include/odp/api/timer.h b/include/odp/api/timer.h
 index 0dc9415..435c004 100644
 --- a/include/odp/api/timer.h
 +++ b/include/odp/api/timer.h
 @@ -366,6 +366,45 @@ odp_timeout_t odp_timeout_alloc(odp_pool_t pool);
   void odp_timeout_free(odp_timeout_t tmo);
   /**
 + * Get printable value for an odp_timer_pool_t
 + *
 + * @param hdl  odp_timer_pool_t handle to be printed
 + * @return uint64_t value that can be used to print/display this
 + * handle
 + *
 + * @note This routine is intended to be used for diagnostic purposes
 + * to enable applications to generate a printable value that represents
 + * an odp_timer_pool_t handle.
 + */
 +uint64_t odp_timer_pool_to_u64(odp_timer_pool_t hdl);
 +
 +/**
 + * Get printable value for an odp_timer_t
 + *
 + * @param hdl  odp_timer_t handle to be printed
 + * @return uint64_t value that can be used to print/display this
 + * handle
 + *
 + * @note This routine is intended to be used for diagnostic purposes
 + * to enable applications to generate a printable value that represents
 + * an odp_timer_t handle.
 + */
 +uint64_t odp_timer_to_u64(odp_timer_t hdl);
 +
 +/**
 + * Get printable value for an odp_timeout_t
 + *
 + * @param hdl  odp_timeout_t handle to be printed
 + * @return uint64_t value that can be used to print/display this
 + * handle
 + *
 + * @note This routine is intended to be used for diagnostic purposes
 + * to enable applications to generate a printable value that represents
 + * an odp_timeout_t handle.
 + */
 +uint64_t odp_timeout_to_u64(odp_timeout_t hdl);
 +
 +/**
* @}
*/
 --
 2.1.0
 
 ___
 lng-odp mailing list
 lng-odp@lists.linaro.orgmailto:lng-odp@lists.linaro.org
 https://lists.linaro.org/mailman/listinfo/lng-odp

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

Re: [lng-odp] [API-NEXT PATCH v2] timer: Add missing platform handles to u64 conversion functions

2015-04-24 Thread Bill Fischofer
The user metadata patch I submitted is complete.  If you rename the APIs
you just need to also rename the implementations and then that will be
complete as well.

On Fri, Apr 24, 2015 at 8:00 AM, Savolainen, Petri (Nokia - FI/Espoo) 
petri.savolai...@nokia.com wrote:

  Also packet_user_area (metadata) and my pktio API changes are missing
 implementation. The delta between API 1.0 and 1.1 is pretty slim if those
 are left out also.



 -Petri





 *From:* ext Mike Holmes [mailto:mike.hol...@linaro.org]
 *Sent:* Friday, April 24, 2015 3:45 PM
 *To:* Savolainen, Petri (Nokia - FI/Espoo)
 *Cc:* Jerin Jacob; lng-odp

 *Subject:* Re: [lng-odp] [API-NEXT PATCH v2] timer: Add missing platform
 handles to u64 conversion functions







 On 24 April 2015 at 08:31, Savolainen, Petri (Nokia - FI/Espoo) 
 petri.savolai...@nokia.com wrote:

 These are trivial enough to get into v1.1. I was thinking that we freeze
 the v1.1 API next week, and then work on the missing
 implementation/validation code before labeling the official 1.1.0 release .



 1.1 is fine I assumed there would not be an implementation in time. If it
 is simple that is good, but we still need to identify some one to do the
 work.



 To be in for 1.1 which freezes on Wednesday we need an implementation to
 already be in api-next by Wednesday so that CI runs the tests.



 Is there any strong reason to hold up 1.1.0 for this ? If it is critical
 we can hold 1.1 for a few days assuming the work is about to land, but why
 not add it to 1.2.0 and release that early with the next crop of work and
 keep an even pace to development ?







 -Petri



 *From:* lng-odp [mailto:lng-odp-boun...@lists.linaro.org] *On Behalf Of *ext
 Mike Holmes
 *Sent:* Friday, April 24, 2015 2:55 PM
 *To:* Jerin Jacob
 *Cc:* lng-odp
 *Subject:* Re: [lng-odp] [API-NEXT PATCH v2] timer: Add missing platform
 handles to u64 conversion functions



 Hi Jerin



 Before this is merged with mainline I think we should have a linux-generic
 implementation and a test case for it.

 Do you have the cycles to add those to api-next so that this can be part
 of 1.2.0 ?



 I think tentatively that 1.2.0 will be in August at this point, although
 if we can start gathering more complete new API work in api-next there is
 no reason to wait that long.



 Mike



 On 24 April 2015 at 05:13, Jerin Jacob jerin.ja...@caviumnetworks.com
 wrote:

 On Fri, Apr 24, 2015 at 11:46:53AM +0300, Maxim Uvarov wrote:
  Hi Jerin,
 
  you you only removed RFC and Petri added sign-off to that patch you
 should
  include it to patch without rfc.
 
  also v1..v2... should go after --- line in patch. In that case git am
 just
  skips that comment.

 Thanks for pointing it out.


 
  Patch merged to api-next.
 
  Thanks,
  Maxim.
 
  On 04/24/15 09:14, Jerin Jacob wrote:
  On Mon, Apr 20, 2015 at 04:22:15PM +0530, Jerin Jacob wrote:
  
  ping
  
  v1..v2 Removed RFC
  
  
  Signed-off-by: Jerin Jacob jerin.ja...@caviumnetworks.com
  ---
include/odp/api/timer.h | 39 +++
1 file changed, 39 insertions(+)
  
  diff --git a/include/odp/api/timer.h b/include/odp/api/timer.h
  index 0dc9415..435c004 100644
  --- a/include/odp/api/timer.h
  +++ b/include/odp/api/timer.h
  @@ -366,6 +366,45 @@ odp_timeout_t odp_timeout_alloc(odp_pool_t pool);
void odp_timeout_free(odp_timeout_t tmo);
/**
  + * Get printable value for an odp_timer_pool_t
  + *
  + * @param hdl  odp_timer_pool_t handle to be printed
  + * @return uint64_t value that can be used to print/display this
  + * handle
  + *
  + * @note This routine is intended to be used for diagnostic purposes
  + * to enable applications to generate a printable value that
 represents
  + * an odp_timer_pool_t handle.
  + */
  +uint64_t odp_timer_pool_to_u64(odp_timer_pool_t hdl);
  +
  +/**
  + * Get printable value for an odp_timer_t
  + *
  + * @param hdl  odp_timer_t handle to be printed
  + * @return uint64_t value that can be used to print/display this
  + * handle
  + *
  + * @note This routine is intended to be used for diagnostic purposes
  + * to enable applications to generate a printable value that
 represents
  + * an odp_timer_t handle.
  + */
  +uint64_t odp_timer_to_u64(odp_timer_t hdl);
  +
  +/**
  + * Get printable value for an odp_timeout_t
  + *
  + * @param hdl  odp_timeout_t handle to be printed
  + * @return uint64_t value that can be used to print/display this
  + * handle
  + *
  + * @note This routine is intended to be used for diagnostic purposes
  + * to enable applications to generate a printable value that
 represents
  + * an odp_timeout_t handle.
  + */
  +uint64_t odp_timeout_to_u64(odp_timeout_t hdl);
  +
  +/**
 * @}
 */
  --
  2.1.0
  
  ___
  lng-odp mailing list
  lng-odp@lists.linaro.org
  https://lists.linaro.org/mailman/listinfo/lng-odp
 
  ___

Re: [lng-odp] [PATCH 2/2] validation: init tests using common main

2015-04-24 Thread Mike Holmes
On 24 April 2015 at 08:54, Christophe Milard christophe.mil...@linaro.org
wrote:

 The 3 init tests (init, abort,log) now links with common/odp_cunit_common,
 as other tests. In main, ODP init is now performed via weak functions
 which are overloaded (to do nothing) by the 3 init tests.

 Signed-off-by: Christophe Milard christophe.mil...@linaro.org
 ---
  test/validation/Makefile.am   |  6 ++---
  test/validation/common/odp_cunit_common.c | 41
 +--
  test/validation/common/odp_cunit_common.h | 20 ++-
  test/validation/init/odp_init.c   | 34 ++---
  test/validation/init/odp_init_abort.c | 35 +++---
  test/validation/init/odp_init_log.c   | 35 +++---
  6 files changed, 91 insertions(+), 80 deletions(-)

 diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
 index 7ea86c4..ba622c3 100644
 --- a/test/validation/Makefile.am
 +++ b/test/validation/Makefile.am
 @@ -48,9 +48,9 @@ dist_odp_classification_SOURCES =
 classification/odp_classification_tests.c \
  odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
  dist_odp_crypto_SOURCES = crypto/odp_crypto_test_inp.c \
   odp_crypto.c $(ODP_CU_COMMON)
 -dist_odp_init_SOURCES  = init/odp_init.c
 -dist_odp_init_abort_SOURCES = init/odp_init_abort.c
 -dist_odp_init_log_SOURCES = init/odp_init_log.c
 +dist_odp_init_SOURCES  = init/odp_init.c $(ODP_CU_COMMON)
 +dist_odp_init_abort_SOURCES = init/odp_init_abort.c $(ODP_CU_COMMON)
 +dist_odp_init_log_SOURCES = init/odp_init_log.c $(ODP_CU_COMMON)
  dist_odp_queue_SOURCES = odp_queue.c $(ODP_CU_COMMON)
  dist_odp_random_SOURCES = odp_random.c $(ODP_CU_COMMON)
  dist_odp_schedule_SOURCES = odp_schedule.c $(ODP_CU_COMMON)
 diff --git a/test/validation/common/odp_cunit_common.c
 b/test/validation/common/odp_cunit_common.c
 index 2af4410..7eca422 100644
 --- a/test/validation/common/odp_cunit_common.c
 +++ b/test/validation/common/odp_cunit_common.c
 @@ -49,12 +49,8 @@ __attribute__((__weak__)) int tests_global_term(void)
 return 0;
  }

 -int main(void)
 +__attribute__((__weak__)) int tests_odp_init(void)


Elsewhere in ODP to avoid compiler lock in we define attributes with
macros, see test/test_debug.h
Consider creating in that file the following.
#define TEST_WEAK_SYMBOL __attribute__((__weak__))


  {
 -   int ret;
 -
 -   printf(\tODP API version: %s\n, odp_version_api_str());
 -   printf(\tODP implementation version: %s\n,
 odp_version_impl_str());

 if (0 != odp_init_global(NULL, NULL)) {
 fprintf(stderr, error: odp_init_global() failed.\n);
 @@ -64,6 +60,32 @@ int main(void)
 fprintf(stderr, error: odp_init_local() failed.\n);
 return -1;
 }
 +   return 0;
 +}
 +
 +__attribute__((__weak__)) int tests_odp_term(void)
 +{
 +   if (0 != odp_term_local()) {
 +   fprintf(stderr, error: odp_term_local() failed.\n);
 +   return -1;
 +   }
 +
 +   if (0 != odp_term_global()) {
 +   fprintf(stderr, error: odp_term_global() failed.\n);
 +   return -1;
 +   }
 +   return 0;
 +}
 +
 +int main(void)
 +{
 +   int ret;
 +
 +   printf(\tODP API version: %s\n, odp_version_api_str());
 +   printf(\tODP implementation version: %s\n,
 odp_version_impl_str());
 +
 +   if (0 != tests_odp_init())
 +   return -1;


Inconsistent coding for tests_global_init - all the other init / term
functions test the call  and dont assign to a ret value so it might be nice
to make them uniform now.


 ret = tests_global_init();
 if (ret)


It appears as if tests_odp_init  and tests_global_init can be merged if
odp_crypto and odp_syncronizers pick up the trivial addition of the the
call to odp_init_global  and odp_init_local.  In that way a test clearly
takes ownership of all the init process or it does nothing at all - same
comment for terminate.


 @@ -83,15 +105,8 @@ int main(void)
 if (0 != tests_global_term())
 return -1;

 -   if (0 != odp_term_local()) {
 -   fprintf(stderr, error: odp_term_local() failed.\n);
 +   if (0 != tests_odp_term())
 return -1;
 -   }
 -
 -   if (0 != odp_term_global()) {
 -   fprintf(stderr, error: odp_term_global() failed.\n);
 -   return -1;
 -   }

 return (ret) ? -1 : 0;
  }
 diff --git a/test/validation/common/odp_cunit_common.h
 b/test/validation/common/odp_cunit_common.h
 index 127020d..852d9ba 100644
 --- a/test/validation/common/odp_cunit_common.h
 +++ b/test/validation/common/odp_cunit_common.h
 @@ -37,9 +37,27 @@ typedef struct {
 int numthrds; /** no of pthreads to create */
  } pthrd_arg;

 -/** create thread fro start_routine function */
 +/** create thread for start_routine function */
  extern int odp_cunit_thread_create(void 

Re: [lng-odp] [API-NEXT PATCH v2] timer: Add missing platform handles to u64 conversion functions

2015-04-24 Thread Mike Holmes
On 24 April 2015 at 10:14, Bill Fischofer bill.fischo...@linaro.org wrote:

 The user metadata patch I submitted is complete.  If you rename the APIs
 you just need to also rename the implementations and then that will be
 complete as well.



We specifically need the packet parsing switch and metadata for odp-dpdk to
perform well so there is a need driving those for 1.1.0.

I think we should strive to have tests and an implementation in before we
merge any new API. I wonder how we specify who has the correct
implementation unless that reference is present and agreed to first.
In some cases I agree it should be obvious, but if so then some one with an
interest should find it fairly easily to implement for linux-generic as
well to speed its move to main line.

Given that api-next follows mainline, implementations can start work with
an API in its expected final form before the complete reference is in place
without sacrificing anything.



 On Fri, Apr 24, 2015 at 8:00 AM, Savolainen, Petri (Nokia - FI/Espoo) 
 petri.savolai...@nokia.com wrote:

  Also packet_user_area (metadata) and my pktio API changes are missing
 implementation. The delta between API 1.0 and 1.1 is pretty slim if those
 are left out also.



 -Petri





 *From:* ext Mike Holmes [mailto:mike.hol...@linaro.org]
 *Sent:* Friday, April 24, 2015 3:45 PM
 *To:* Savolainen, Petri (Nokia - FI/Espoo)
 *Cc:* Jerin Jacob; lng-odp

 *Subject:* Re: [lng-odp] [API-NEXT PATCH v2] timer: Add missing platform
 handles to u64 conversion functions







 On 24 April 2015 at 08:31, Savolainen, Petri (Nokia - FI/Espoo) 
 petri.savolai...@nokia.com wrote:

 These are trivial enough to get into v1.1. I was thinking that we freeze
 the v1.1 API next week, and then work on the missing
 implementation/validation code before labeling the official 1.1.0 release .



 1.1 is fine I assumed there would not be an implementation in time. If it
 is simple that is good, but we still need to identify some one to do the
 work.



 To be in for 1.1 which freezes on Wednesday we need an implementation to
 already be in api-next by Wednesday so that CI runs the tests.



 Is there any strong reason to hold up 1.1.0 for this ? If it is critical
 we can hold 1.1 for a few days assuming the work is about to land, but why
 not add it to 1.2.0 and release that early with the next crop of work and
 keep an even pace to development ?







 -Petri



 *From:* lng-odp [mailto:lng-odp-boun...@lists.linaro.org] *On Behalf Of *ext
 Mike Holmes
 *Sent:* Friday, April 24, 2015 2:55 PM
 *To:* Jerin Jacob
 *Cc:* lng-odp
 *Subject:* Re: [lng-odp] [API-NEXT PATCH v2] timer: Add missing platform
 handles to u64 conversion functions



 Hi Jerin



 Before this is merged with mainline I think we should have a
 linux-generic implementation and a test case for it.

 Do you have the cycles to add those to api-next so that this can be part
 of 1.2.0 ?



 I think tentatively that 1.2.0 will be in August at this point, although
 if we can start gathering more complete new API work in api-next there is
 no reason to wait that long.



 Mike



 On 24 April 2015 at 05:13, Jerin Jacob jerin.ja...@caviumnetworks.com
 wrote:

 On Fri, Apr 24, 2015 at 11:46:53AM +0300, Maxim Uvarov wrote:
  Hi Jerin,
 
  you you only removed RFC and Petri added sign-off to that patch you
 should
  include it to patch without rfc.
 
  also v1..v2... should go after --- line in patch. In that case git am
 just
  skips that comment.

 Thanks for pointing it out.


 
  Patch merged to api-next.
 
  Thanks,
  Maxim.
 
  On 04/24/15 09:14, Jerin Jacob wrote:
  On Mon, Apr 20, 2015 at 04:22:15PM +0530, Jerin Jacob wrote:
  
  ping
  
  v1..v2 Removed RFC
  
  
  Signed-off-by: Jerin Jacob jerin.ja...@caviumnetworks.com
  ---
include/odp/api/timer.h | 39 +++
1 file changed, 39 insertions(+)
  
  diff --git a/include/odp/api/timer.h b/include/odp/api/timer.h
  index 0dc9415..435c004 100644
  --- a/include/odp/api/timer.h
  +++ b/include/odp/api/timer.h
  @@ -366,6 +366,45 @@ odp_timeout_t odp_timeout_alloc(odp_pool_t pool);
void odp_timeout_free(odp_timeout_t tmo);
/**
  + * Get printable value for an odp_timer_pool_t
  + *
  + * @param hdl  odp_timer_pool_t handle to be printed
  + * @return uint64_t value that can be used to print/display this
  + * handle
  + *
  + * @note This routine is intended to be used for diagnostic purposes
  + * to enable applications to generate a printable value that
 represents
  + * an odp_timer_pool_t handle.
  + */
  +uint64_t odp_timer_pool_to_u64(odp_timer_pool_t hdl);
  +
  +/**
  + * Get printable value for an odp_timer_t
  + *
  + * @param hdl  odp_timer_t handle to be printed
  + * @return uint64_t value that can be used to print/display this
  + * handle
  + *
  + * @note This routine is intended to be used for diagnostic purposes
  + * to enable applications to generate a printable value that
 

Re: [lng-odp] [PATCHv3 1/2] validation: rename executable to match modules

2015-04-24 Thread Mike Holmes
apply-and-build https://git.linaro.org/lng/check-odp.git- gives

WARNING: braces {} are not necessary for single statement blocks
#3328: FILE: test/validation/odp_scheduler.c:760:
+ if (odp_pool_destroy(pool) != 0) {
+ fprintf(stderr, error: failed to destroy pool\n);
+ }





On 24 April 2015 at 09:41, Christophe Milard christophe.mil...@linaro.org
wrote:

 Just the executables whose contents already matched a module have been
 renamed. Module names are taken from doxygens defgroup

 Signed-off-by: Christophe Milard christophe.mil...@linaro.org
 ---

  same as before. just rebased.

  test/validation/.gitignore   |  6 +++---
  test/validation/Makefile.am  | 16 
  test/validation/{odp_pktio.c = odp_packet_io.c} |  0
  test/validation/{odp_pktio_run = odp_packet_io_run} |  4 ++--
  test/validation/{odp_schedule.c = odp_scheduler.c}  |  0
  test/validation/{odp_shm.c = odp_shared_memory.c}   |  0
  6 files changed, 13 insertions(+), 13 deletions(-)
  rename test/validation/{odp_pktio.c = odp_packet_io.c} (100%)
  rename test/validation/{odp_pktio_run = odp_packet_io_run} (98%)
  rename test/validation/{odp_schedule.c = odp_scheduler.c} (100%)
  rename test/validation/{odp_shm.c = odp_shared_memory.c} (100%)

 diff --git a/test/validation/.gitignore b/test/validation/.gitignore
 index cd27c92..05a7424 100644
 --- a/test/validation/.gitignore
 +++ b/test/validation/.gitignore
 @@ -9,12 +9,12 @@ odp_init
  odp_init_abort
  odp_init_log
  odp_packet
 -odp_pktio
 +odp_packet_io
  odp_pool
  odp_queue
  odp_random
 -odp_schedule
 -odp_shm
 +odp_scheduler
 +odp_shared_memory
  odp_synchronizers
  odp_system
  odp_time
 diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
 index 6bac101..36b0ba8 100644
 --- a/test/validation/Makefile.am
 +++ b/test/validation/Makefile.am
 @@ -16,8 +16,8 @@ EXECUTABLES = odp_buffer \
   odp_pool \
   odp_queue \
   odp_random \
 - odp_schedule \
 - odp_shm \
 + odp_scheduler \
 + odp_shared_memory \
   odp_system \
   odp_synchronizers \
   odp_time \
 @@ -25,15 +25,15 @@ EXECUTABLES = odp_buffer \
   odp_errno \
   odp_thread

 -COMPILE_ONLY = odp_pktio
 +COMPILE_ONLY = odp_packet_io

 -TESTSCRIPTS = odp_pktio_run
 +TESTSCRIPTS = odp_packet_io_run

  if test_vald
  TESTS = $(EXECUTABLES) $(TESTSCRIPTS)
  endif

 -dist_bin_SCRIPTS = odp_pktio_run
 +dist_bin_SCRIPTS = odp_packet_io_run

  bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)

 @@ -53,13 +53,13 @@ dist_odp_init_abort_SOURCES = odp_init_abort.c
  dist_odp_init_log_SOURCES = odp_init_log.c
  dist_odp_queue_SOURCES = odp_queue.c $(ODP_CU_COMMON)
  dist_odp_random_SOURCES = odp_random.c $(ODP_CU_COMMON)
 -dist_odp_schedule_SOURCES = odp_schedule.c $(ODP_CU_COMMON)
 -dist_odp_shm_SOURCES   = odp_shm.c $(ODP_CU_COMMON)
 +dist_odp_scheduler_SOURCES = odp_scheduler.c $(ODP_CU_COMMON)
 +dist_odp_shared_memory_SOURCES = odp_shared_memory.c $(ODP_CU_COMMON)
  dist_odp_system_SOURCES = odp_system.c $(ODP_CU_COMMON)
  dist_odp_synchronizers_SOURCES = odp_synchronizers.c $(ODP_CU_COMMON)
  dist_odp_time_SOURCES   = odp_time.c $(ODP_CU_COMMON)
  dist_odp_timer_SOURCES  = odp_timer.c $(ODP_CU_COMMON)
 -dist_odp_pktio_SOURCES = odp_pktio.c $(ODP_CU_COMMON)
 +dist_odp_packet_io_SOURCES = odp_packet_io.c $(ODP_CU_COMMON)
  dist_odp_packet_SOURCES = odp_packet.c $(ODP_CU_COMMON)
  dist_odp_pool_SOURCES = odp_pool.c $(ODP_CU_COMMON)
  dist_odp_errno_SOURCES = odp_errno.c $(ODP_CU_COMMON)
 diff --git a/test/validation/odp_pktio.c b/test/validation/odp_packet_io.c
 similarity index 100%
 rename from test/validation/odp_pktio.c
 rename to test/validation/odp_packet_io.c
 diff --git a/test/validation/odp_pktio_run
 b/test/validation/odp_packet_io_run
 similarity index 98%
 rename from test/validation/odp_pktio_run
 rename to test/validation/odp_packet_io_run
 index b6a72c7..73efdca 100755
 --- a/test/validation/odp_pktio_run
 +++ b/test/validation/odp_packet_io_run
 @@ -61,7 +61,7 @@ run_test()
 if [ $disabletype != SKIP ]; then
 export ODP_PKTIO_DISABLE_SOCKET_${distype}=y
 fi
 -   odp_pktio
 +   odp_packet_io
 if [ $? -ne 0 ]; then
 ret=1
 fi
 @@ -78,7 +78,7 @@ run()
  {
 if [ $ODP_PLATFORM != linux-generic -o $(id -u) != 0 ];
 then
 echo pktio: using 'loop' device
 -   odp_pktio
 +   odp_packet_io
 exit $?
 fi

 diff --git a/test/validation/odp_schedule.c
 b/test/validation/odp_scheduler.c
 similarity index 100%
 rename from test/validation/odp_schedule.c
 rename to test/validation/odp_scheduler.c
 diff --git a/test/validation/odp_shm.c
 b/test/validation/odp_shared_memory.c
 similarity index 100%
 rename from 

Re: [lng-odp] [API-NEXT PATCHv4 0/6] Add packet user metadata support

2015-04-24 Thread Savolainen, Petri (Nokia - FI/Espoo)


From: ext Ola Liljedahl [mailto:ola.liljed...@linaro.org]
Sent: Thursday, April 23, 2015 8:29 PM
To: Savolainen, Petri (Nokia - FI/Espoo)
Cc: ext Bill Fischofer; lng-odp@lists.linaro.org
Subject: Re: [lng-odp] [API-NEXT PATCHv4 0/6] Add packet user metadata support

On 22 April 2015 at 15:01, Savolainen, Petri (Nokia - FI/Espoo) 
petri.savolai...@nokia.commailto:petri.savolai...@nokia.com wrote:
There is queue level context (odp_queue_get_context() / 
odp_queue_set_context()), which is (close to) flow level (depending on flow to 
queue mapping).
Shouldn't these calls also follow the get/set conventions previously defined 
and implemented?
E.g. call the functions odp_queue_context() and odp_queue_context_set()?


Yes. Those should be renamed.

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


Re: [lng-odp] [PATCH v2 2/2] linux-generic: pool: fix initialization of odp_buffer_hdr ref_count

2015-04-24 Thread Nicolas Morey-Chaisemartin
All good now. Thanks!

On 04/23/2015 10:53 PM, Bill Fischofer wrote:
 Both parts should be applied.  

 On Thu, Apr 23, 2015 at 8:02 AM, Nicolas Morey-Chaisemartin nmo...@kalray.eu 
 mailto:nmo...@kalray.eu wrote:

 Thanks.
 Is there a reason why you did not apply the first patch of the serie?

 Nicolas

 On 04/23/2015 10:33 AM, Maxim Uvarov wrote:
  Merged,
  Maxim.
 
  On 04/22/15 11:01, Nicolas Morey-Chaisemartin wrote:
  Signed-off-by: Nicolas Morey-Chaisemartin nmo...@kalray.eu 
 mailto:nmo...@kalray.eu
  ---
platform/linux-generic/odp_pool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
 
  diff --git a/platform/linux-generic/odp_pool.c 
 b/platform/linux-generic/odp_pool.c
  index ea993bb..a3d80b5 100644
  --- a/platform/linux-generic/odp_pool.c
  +++ b/platform/linux-generic/odp_pool.c
  @@ -371,7 +371,7 @@ odp_pool_t odp_pool_create(const char *name,
tmp-flags.all = 0;
tmp-flags.zeroized = zeroized;
tmp-size = 0;
  -odp_atomic_store_u32(tmp-ref_count, 0);
  +odp_atomic_init_u32(tmp-ref_count, 0);
tmp-type = params-type;
tmp-pool_hdl = pool-s.pool_hdl;
tmp-udata_addr = (void *)udat;
  ___
  lng-odp mailing list
  lng-odp@lists.linaro.org mailto:lng-odp@lists.linaro.org
  https://lists.linaro.org/mailman/listinfo/lng-odp
 
  ___
  lng-odp mailing list
  lng-odp@lists.linaro.org mailto:lng-odp@lists.linaro.org
  https://lists.linaro.org/mailman/listinfo/lng-odp


 ___
 lng-odp mailing list
 lng-odp@lists.linaro.org mailto: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] validation: thread: add odp_thread sunnyday tests

2015-04-24 Thread Anders Roxell
On 2015-04-21 17:26, Mike Holmes wrote:
 Add test cases for APIs in the logical ODP THREAD grouping
 
 Signed-off-by: Mike Holmes mike.hol...@linaro.org

Reviewed-by: Anders Roxell anders.rox...@linaro.org

 ---
  test/validation/.gitignore   |  1 +
  test/validation/Makefile.am  |  4 +++-
  test/validation/odp_thread.c | 41 +
  3 files changed, 45 insertions(+), 1 deletion(-)
  create mode 100644 test/validation/odp_thread.c
 
 diff --git a/test/validation/.gitignore b/test/validation/.gitignore
 index 01092d1..cd27c92 100644
 --- a/test/validation/.gitignore
 +++ b/test/validation/.gitignore
 @@ -19,3 +19,4 @@ odp_synchronizers
  odp_system
  odp_time
  odp_timer
 +odp_thread

nit: alphabetic order

Cheers,
Anders

 diff --git a/test/validation/Makefile.am b/test/validation/Makefile.am
 index 4c28325..6bac101 100644
 --- a/test/validation/Makefile.am
 +++ b/test/validation/Makefile.am
 @@ -22,7 +22,8 @@ EXECUTABLES = odp_buffer \
 odp_synchronizers \
 odp_time \
 odp_timer \
 -   odp_errno
 +   odp_errno \
 +   odp_thread
  
  COMPILE_ONLY = odp_pktio
  
 @@ -63,3 +64,4 @@ dist_odp_packet_SOURCES = odp_packet.c $(ODP_CU_COMMON)
  dist_odp_pool_SOURCES = odp_pool.c $(ODP_CU_COMMON)
  dist_odp_errno_SOURCES = odp_errno.c $(ODP_CU_COMMON)
  dist_odp_cpumask_SOURCES = odp_cpumask.c $(ODP_CU_COMMON)
 +dist_odp_thread_SOURCES = odp_thread.c $(ODP_CU_COMMON)
 diff --git a/test/validation/odp_thread.c b/test/validation/odp_thread.c
 new file mode 100644
 index 000..84db1e7
 --- /dev/null
 +++ b/test/validation/odp_thread.c
 @@ -0,0 +1,41 @@
 +/* Copyright (c) 2015, Linaro Limited
 + * All rights reserved.
 + *
 + * SPDX-License-Identifier: BSD-3-Clause
 + */
 +
 +#include odp.h
 +#include odp_cunit_common.h
 +
 +/* Helper macro for CU_TestInfo initialization */
 +#define _CU_TEST_INFO(test_func) {#test_func, test_func}
 +
 +static void test_odp_cpu_id(void)
 +{
 + (void) odp_cpu_id();
 + CU_PASS();
 +}
 +
 +static void test_odp_thread_id(void)
 +{
 + (void) odp_thread_id();
 + CU_PASS();
 +}
 +
 +static void test_odp_thread_count(void)
 +{
 + (void) odp_thread_count();
 + CU_PASS();
 +}
 +
 +CU_TestInfo test_odp_thread[] = {
 + _CU_TEST_INFO(test_odp_cpu_id),
 + _CU_TEST_INFO(test_odp_thread_id),
 + _CU_TEST_INFO(test_odp_thread_count),
 + CU_TEST_INFO_NULL,
 +};
 +
 +CU_SuiteInfo odp_testsuites[] = {
 + {thread, NULL, NULL, NULL, NULL, test_odp_thread},
 + CU_SUITE_INFO_NULL,
 +};
 -- 
 2.1.0
 
 ___
 lng-odp mailing list
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT PATCH v2] timer: Add missing platform handles to u64 conversion functions

2015-04-24 Thread Jerin Jacob
On Mon, Apr 20, 2015 at 04:22:15PM +0530, Jerin Jacob wrote:

ping

 v1..v2 Removed RFC
 
 
 Signed-off-by: Jerin Jacob jerin.ja...@caviumnetworks.com
 ---
  include/odp/api/timer.h | 39 +++
  1 file changed, 39 insertions(+)
 
 diff --git a/include/odp/api/timer.h b/include/odp/api/timer.h
 index 0dc9415..435c004 100644
 --- a/include/odp/api/timer.h
 +++ b/include/odp/api/timer.h
 @@ -366,6 +366,45 @@ odp_timeout_t odp_timeout_alloc(odp_pool_t pool);
  void odp_timeout_free(odp_timeout_t tmo);
  
  /**
 + * Get printable value for an odp_timer_pool_t
 + *
 + * @param hdl  odp_timer_pool_t handle to be printed
 + * @return uint64_t value that can be used to print/display this
 + * handle
 + *
 + * @note This routine is intended to be used for diagnostic purposes
 + * to enable applications to generate a printable value that represents
 + * an odp_timer_pool_t handle.
 + */
 +uint64_t odp_timer_pool_to_u64(odp_timer_pool_t hdl);
 +
 +/**
 + * Get printable value for an odp_timer_t
 + *
 + * @param hdl  odp_timer_t handle to be printed
 + * @return uint64_t value that can be used to print/display this
 + * handle
 + *
 + * @note This routine is intended to be used for diagnostic purposes
 + * to enable applications to generate a printable value that represents
 + * an odp_timer_t handle.
 + */
 +uint64_t odp_timer_to_u64(odp_timer_t hdl);
 +
 +/**
 + * Get printable value for an odp_timeout_t
 + *
 + * @param hdl  odp_timeout_t handle to be printed
 + * @return uint64_t value that can be used to print/display this
 + * handle
 + *
 + * @note This routine is intended to be used for diagnostic purposes
 + * to enable applications to generate a printable value that represents
 + * an odp_timeout_t handle.
 + */
 +uint64_t odp_timeout_to_u64(odp_timeout_t hdl);
 +
 +/**
   * @}
   */
  
 -- 
 2.1.0
 
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] example: timer: remove global variables to share the data between workers

2015-04-24 Thread Jerin Jacob
On Mon, Apr 20, 2015 at 02:05:50PM +0530, Jerin Jacob wrote:

ping

 Adding the the complete git commit log for the commit
 
 example: timer: remove global variables to share the data between workers.
 use the odp_shared_memory allocater instead to enable the timer example
 to run on baremetal/linux process execution environments.
 
 
 On Mon, Apr 20, 2015 at 01:58:01PM +0530, Jerin Jacob wrote:
  Signed-off-by: Jerin Jacob jerin.ja...@caviumnetworks.com
  ---
   example/timer/odp_timer_test.c | 124 
  +
   1 file changed, 65 insertions(+), 59 deletions(-)
  
  diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
  index 6b60ec4..876bf33 100644
  --- a/example/timer/odp_timer_test.c
  +++ b/example/timer/odp_timer_test.c
  @@ -39,18 +39,21 @@ typedef struct {
  int tmo_count; /** Timeout count*/
   } test_args_t;
   
  -
  -/** @private Barrier for test synchronisation */
  -static odp_barrier_t test_barrier;
  -
  -/** @private Pool handle */
  -static odp_pool_t pool;
  -
  -/** @private Timer pool handle */
  -static odp_timer_pool_t tp;
  -
  -/** @private Number of timeouts to receive */
  -static odp_atomic_u32_t remain;
  +/** @private Helper struct for timers */
  +struct test_timer {
  +   odp_timer_t tim;
  +   odp_event_t ev;
  +};
  +
  +/** Test global variables */
  +typedef struct {
  +   test_args_t args;   /** Test argunments*/
  +   odp_barrier_t test_barrier; /** Barrier for test synchronisation*/
  +   odp_pool_t pool;/** pool handle*/
  +   odp_timer_pool_t tp;/** Timer pool handle*/
  +   odp_atomic_u32_t remain;/** Number of timeouts to receive*/
  +   struct test_timer tt[256];  /** Array of all timer helper structs*/
  +} test_globals_t;
   
   /** @private Timer set status ASCII strings */
   static const char *timerset2str(odp_timer_set_t val)
  @@ -69,17 +72,9 @@ static const char *timerset2str(odp_timer_set_t val)
  }
   };
   
  -/** @private Helper struct for timers */
  -struct test_timer {
  -   odp_timer_t tim;
  -   odp_event_t ev;
  -};
  -
  -/** @private Array of all timer helper structs */
  -static struct test_timer tt[256];
   
   /** @private test timeout */
  -static void test_abs_timeouts(int thr, test_args_t *args)
  +static void test_abs_timeouts(int thr, test_globals_t *gbls)
   {
  uint64_t period;
  uint64_t period_ns;
  @@ -92,30 +87,30 @@ static void test_abs_timeouts(int thr, test_args_t 
  *args)
   
  queue = odp_queue_lookup(timer_queue);
   
  -   period_ns = args-period_us*ODP_TIME_USEC;
  -   period= odp_timer_ns_to_tick(tp, period_ns);
  +   period_ns = gbls-args.period_us*ODP_TIME_USEC;
  +   period= odp_timer_ns_to_tick(gbls-tp, period_ns);
   
  EXAMPLE_DBG(  [%i] period %PRIu64 ticks,  %PRIu64 ns\n, thr,
  period, period_ns);
   
  EXAMPLE_DBG(  [%i] current tick %PRIu64\n, thr,
  -   odp_timer_current_tick(tp));
  +   odp_timer_current_tick(gbls-tp));
   
  -   ttp = tt[thr - 1]; /* Thread starts at 1 */
  -   ttp-tim = odp_timer_alloc(tp, queue, ttp);
  +   ttp = gbls-tt[thr];
  +   ttp-tim = odp_timer_alloc(gbls-tp, queue, ttp);
  if (ttp-tim == ODP_TIMER_INVALID) {
  EXAMPLE_ERR(Failed to allocate timer\n);
  return;
  }
  -   tmo = odp_timeout_alloc(pool);
  +   tmo = odp_timeout_alloc(gbls-pool);
  if (tmo == ODP_TIMEOUT_INVALID) {
  EXAMPLE_ERR(Failed to allocate timeout\n);
  return;
  }
  ttp-ev = odp_timeout_to_event(tmo);
  -   tick = odp_timer_current_tick(tp);
  +   tick = odp_timer_current_tick(gbls-tp);
   
  -   while ((int)odp_atomic_load_u32(remain)  0) {
  +   while ((int)odp_atomic_load_u32(gbls-remain)  0) {
  odp_event_t ev;
  odp_timer_set_t rc;
   
  @@ -140,7 +135,7 @@ static void test_abs_timeouts(int thr, test_args_t 
  *args)
  /* Check if odp_schedule() timed out, possibly there
   * are no remaining timeouts to receive */
  } while (ev == ODP_EVENT_INVALID 
  -(int)odp_atomic_load_u32(remain)  0);
  +(int)odp_atomic_load_u32(gbls-remain)  0);
   
  if (ev == ODP_EVENT_INVALID)
  break; /* No more timeouts */
  @@ -161,7 +156,7 @@ static void test_abs_timeouts(int thr, test_args_t 
  *args)
  }
  EXAMPLE_DBG(  [%i] timeout, tick %PRIu64\n, thr, tick);
   
  -   odp_atomic_dec_u32(remain);
  +   odp_atomic_dec_u32(gbls-remain);
  }
   
  /* Cancel and free last timer used */
  @@ -187,9 +182,9 @@ static void *run_thread(void *ptr)
   {
  int thr;
  odp_pool_t msg_pool;
  -   test_args_t *args;
  +   test_globals_t *gbls;
   
  -   args = ptr;
  +   gbls = ptr;
  thr  = odp_thread_id();
   
  printf(Thread %i starts on cpu %i\n, thr,