[lng-odp] [PATCH v1/1] linux-generic : crypto

2014-10-31 Thread alexandru.badicioiu
From: Alexandru Badicioiu alexandru.badici...@linaro.org

Add missing API functions to crypto implementation.
Required by crypto unit testing.

Signed-off-by: Alexandru Badicioiu alexandru.badici...@linaro.org
---
 platform/linux-generic/odp_crypto.c |   26 ++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/platform/linux-generic/odp_crypto.c 
b/platform/linux-generic/odp_crypto.c
index 1475437..b9dd3e7 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -13,6 +13,7 @@
 #include odp_align.h
 #include odp_shared_memory.h
 #include odp_crypto_internal.h
+#include odp_debug_internal.h
 #include odp_hints.h
 #include odph_packet.h
 
@@ -467,3 +468,28 @@ odp_crypto_get_ses_create_compl_session(odp_buffer_t 
completion_event,
result = odp_buffer_addr(completion_event);
*session = result-session;
 }
+
+void
+odp_crypto_set_operation_compl_ctx(odp_buffer_t completion_event,
+  void *ctx)
+{
+   (void)completion_event;
+   (void)ctx;
+   ODP_UNIMPLEMENTED();
+}
+
+void
+*odp_crypto_get_operation_compl_ctx(odp_buffer_t completion_event)
+{
+   (void)completion_event;
+   ODP_UNIMPLEMENTED();
+   return NULL;
+}
+
+odp_packet_t
+odp_crypto_get_operation_compl_packet(odp_buffer_t completion_event)
+{
+   (void)completion_event;
+   ODP_UNIMPLEMENTED();
+   return ODP_PACKET_INVALID;
+}
-- 
1.7.3.4


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


Re: [lng-odp] Move Typedefs to a new Header File

2014-10-31 Thread Bill Fischofer
Adding the ODP mailing list since this should be a topic of general
interest.

Now that we have separate repositories for each implementation what we'd
ideally like is the following.

   - The API definitions are in .h files in odp.git.  These are the
   function prototypes for all of the public ODP APIs. They reference typedefs
   for ODP APIs but do not define them.


   - Each platform has an odp_api_typedefs.h that defines these typedefs
   for that platform.


   - What applications #include is a file (odp.h) that includes the
   platform-specific odp_api_typedefs.h and the ODP APIs so they compile with
   a version of the prototypes typedef'd appropriate to the platform

Is there a clean way to achieve this and still permit efficient inlining?



On Fri, Oct 31, 2014 at 2:08 AM, Bala Manoharan bala.manoha...@linaro.org
wrote:

 Hi Anders,

 Yesterday in Scheduler meeting we had a discussion regarding moving
 typedefs in ODP API files into a separate file.

 Taras mentioned that you had previously spent some time on the same.
 Can you please update if you have some patch regarding the same.

 Regards,
 Bala

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


[lng-odp] [PATCH v1/1] linux-generic : crypto

2014-10-31 Thread alexandru.badicioiu
From: Alexandru Badicioiu alexandru.badici...@linaro.org

Add missing API functions to crypto implementation.
Required by crypto unit testing.

Signed-off-by: Alexandru Badicioiu alexandru.badici...@linaro.org
---
 platform/linux-generic/odp_crypto.c |   26 ++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/platform/linux-generic/odp_crypto.c 
b/platform/linux-generic/odp_crypto.c
index 1475437..b9dd3e7 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -13,6 +13,7 @@
 #include odp_align.h
 #include odp_shared_memory.h
 #include odp_crypto_internal.h
+#include odp_debug_internal.h
 #include odp_hints.h
 #include odph_packet.h
 
@@ -467,3 +468,28 @@ odp_crypto_get_ses_create_compl_session(odp_buffer_t 
completion_event,
result = odp_buffer_addr(completion_event);
*session = result-session;
 }
+
+void
+odp_crypto_set_operation_compl_ctx(odp_buffer_t completion_event,
+  void *ctx)
+{
+   (void)completion_event;
+   (void)ctx;
+   ODP_UNIMPLEMENTED();
+}
+
+void
+*odp_crypto_get_operation_compl_ctx(odp_buffer_t completion_event)
+{
+   (void)completion_event;
+   ODP_UNIMPLEMENTED();
+   return NULL;
+}
+
+odp_packet_t
+odp_crypto_get_operation_compl_packet(odp_buffer_t completion_event)
+{
+   (void)completion_event;
+   ODP_UNIMPLEMENTED();
+   return ODP_PACKET_INVALID;
+}
-- 
1.7.3.4


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


[lng-odp] [PATCH v2 1/1] cunit : add tests for crypto APIs

2014-10-31 Thread alexandru.badicioiu
From: Alexandru Badicioiu alexandru.badici...@linaro.org

This patch adds a suite for async inplace mode of crypto APIs.
Correctness of crypto operations output is verified with known
test vectors  as well as various options and functionalities:
use session IV or operation IV for ciphering, use input packet
buffer or a separate buffer as the completion event, set and
retrieve the context associated with an operation.

Signed-off-by: Alexandru Badicioiu alexandru.badici...@linaro.org
---
 configure.ac  |1 +
 test/cunit/Makefile.am|2 +
 test/cunit/crypto/Makefile.am |9 +
 test/cunit/crypto/odp_crypto_test.c   |   26 ++
 test/cunit/crypto/odp_crypto_test_async_inp.c |  459 +
 test/cunit/crypto/odp_crypto_test_async_inp.h |   13 +
 test/cunit/crypto/test_vectors.h  |   94 +
 7 files changed, 604 insertions(+), 0 deletions(-)
 create mode 100644 test/cunit/crypto/Makefile.am
 create mode 100644 test/cunit/crypto/odp_crypto_test.c
 create mode 100644 test/cunit/crypto/odp_crypto_test_async_inp.c
 create mode 100644 test/cunit/crypto/odp_crypto_test_async_inp.h
 create mode 100644 test/cunit/crypto/test_vectors.h

diff --git a/configure.ac b/configure.ac
index fd69e85..b1785e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -166,6 +166,7 @@ AC_CONFIG_FILES([Makefile
 test/Makefile
 test/api_test/Makefile
  test/cunit/Makefile
+test/cunit/crypto/Makefile
 pkgconfig/libodp.pc])
 
 AC_SEARCH_LIBS([timer_create],[rt posix4])
diff --git a/test/cunit/Makefile.am b/test/cunit/Makefile.am
index 927a5a5..7611145 100644
--- a/test/cunit/Makefile.am
+++ b/test/cunit/Makefile.am
@@ -3,6 +3,8 @@ include $(top_srcdir)/test/Makefile.inc
 AM_CFLAGS += -I$(CUNIT_PATH)/include
 AM_LDFLAGS += -L$(CUNIT_PATH)/lib
 
+SUBDIRS = crypto
+
 if ODP_CUNIT_ENABLED
 TESTS = ${bin_PROGRAMS}
 check_PROGRAMS = ${bin_PROGRAMS}
diff --git a/test/cunit/crypto/Makefile.am b/test/cunit/crypto/Makefile.am
new file mode 100644
index 000..b984eaa
--- /dev/null
+++ b/test/cunit/crypto/Makefile.am
@@ -0,0 +1,9 @@
+include $(top_srcdir)/test/Makefile.inc
+
+if ODP_CUNIT_ENABLED
+bin_PROGRAMS = odp_crypto
+odp_crypto_LDFLAGS = $(AM_LDFLAGS) -static -lcunit
+endif
+
+dist_odp_crypto_SOURCES = odp_crypto_test_async_inp.c \
+ odp_crypto_test.c
diff --git a/test/cunit/crypto/odp_crypto_test.c 
b/test/cunit/crypto/odp_crypto_test.c
new file mode 100644
index 000..b5d0dea
--- /dev/null
+++ b/test/cunit/crypto/odp_crypto_test.c
@@ -0,0 +1,26 @@
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include odp.h
+#include CUnit/Headers/Basic.h
+#include CUnit/Headers/TestDB.h
+#include odp_crypto_test_async_inp.h
+
+int main(void)
+{
+   /* initialize the CUnit test registry */
+   if (CUE_SUCCESS != CU_initialize_registry())
+   return CU_get_error();
+
+   /* register suites */
+   CU_register_suites(suites);
+   /* Run all tests using the CUnit Basic interface */
+   CU_basic_set_mode(CU_BRM_VERBOSE);
+   CU_basic_run_tests();
+   CU_cleanup_registry();
+
+   return CU_get_error();
+}
diff --git a/test/cunit/crypto/odp_crypto_test_async_inp.c 
b/test/cunit/crypto/odp_crypto_test_async_inp.c
new file mode 100644
index 000..dd5fb5f
--- /dev/null
+++ b/test/cunit/crypto/odp_crypto_test_async_inp.c
@@ -0,0 +1,458 @@
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:BSD-3-Clause
+ */
+
+#include odp.h
+#include odp_crypto.h
+#include CUnit/Headers/Basic.h
+#include CUnit/Headers/TestDB.h
+#include test_vectors.h
+
+/* Suite name */
+#define ODP_CRYPTO_ASYNC_INP   odp_crypto_async_inp
+
+/* Suite init/finalize funcs */
+/* ODP global/local initialization
+ * Packet pool creation
+ * Crypto output queue creation */
+
+#define SHM_PKT_POOL_SIZE  (512*2048*2)
+#define SHM_PKT_POOL_BUF_SIZE  (1024 * 32)
+
+#define SHM_COMPL_POOL_SIZE(128*1024)
+#define SHM_COMPL_POOL_BUF_SIZE 128
+
+static int init(void)
+{
+   odp_shm_t shm;
+   void *pool_base = NULL;
+   odp_buffer_pool_t pool;
+   odp_queue_t out_queue;
+
+   if (odp_init_global(NULL, NULL)) {
+   ODP_ERR(ODP global init failed.\n);
+   return -1;
+   }
+   odp_init_local();
+
+   shm = odp_shm_reserve(shm_packet_pool,
+ SHM_PKT_POOL_SIZE,
+ ODP_CACHE_LINE_SIZE, 0);
+
+   pool_base = odp_shm_addr(shm);
+   if (!pool_base) {
+   ODP_ERR(Packet pool allocation failed.\n);
+   return -1;
+   }
+
+   pool = odp_buffer_pool_create(packet_pool, pool_base,
+ SHM_PKT_POOL_SIZE,
+ 

[lng-odp] [PATCH] Scheduler atomic and ordered definitions

2014-10-31 Thread Petri Savolainen
Improved atomic and ordered synchronisation definitions. Added
order skip function prototype.

Signed-off-by: Petri Savolainen petri.savolai...@linaro.org

---
This is the ordered queue definition (in patch format) promised
in the call yesterday.
---
 platform/linux-generic/include/api/odp_queue.h| 31 +++-
 platform/linux-generic/include/api/odp_schedule.h | 45 ++-
 2 files changed, 64 insertions(+), 12 deletions(-)

diff --git a/platform/linux-generic/include/api/odp_queue.h 
b/platform/linux-generic/include/api/odp_queue.h
index b8ac4bb..c0c3969 100644
--- a/platform/linux-generic/include/api/odp_queue.h
+++ b/platform/linux-generic/include/api/odp_queue.h
@@ -78,8 +78,35 @@ typedef int odp_schedule_prio_t;
 typedef int odp_schedule_sync_t;
 
 #define ODP_SCHED_SYNC_NONE 0  /** Queue not synchronised */
-#define ODP_SCHED_SYNC_ATOMIC   1  /** Atomic queue */
-#define ODP_SCHED_SYNC_ORDERED  2  /** Ordered queue */
+
+/**
+ * Atomic queue synchronisation
+ *
+ * The scheduler gives buffers from a queue to a single core at a time. This
+ * serialises processing of the buffers from the source queue and helps user to
+ * avoid SW locking. Another schedule call will implicitely release the atomic
+ * synchronisation of the source queue and free the scheduler to give buffers
+ * from the queue to other cores.
+ *
+ * User can hint the scheduler to release the atomic synchronisation early with
+ * odp_schedule_release_atomic().
+ */
+#define ODP_SCHED_SYNC_ATOMIC   1
+
+/**
+ * Ordered queue synchronisation
+ *
+ * The scheduler may give out buffers to multiple cores for parallel 
processing.
+ * The original enqueue order of the source queue is maintained when buffers 
are
+ * enqueued to their destination queue(s) before another schedule call. Buffers
+ * from the same ordered (source) queue appear in their original order when
+ * dequeued from a destination queue. The destination queue type (POLL/SCHED) 
or
+ * synchronisation (NONE/ATOMIC/ORDERED) is not limited.
+ *
+ * User can command the scheduler to skip ordering of a buffer with
+ * odp_schedule_skip_order().
+ */
+#define ODP_SCHED_SYNC_ORDERED  2
 
 /** Default queue synchronisation */
 #define ODP_SCHED_SYNC_DEFAULT  ODP_SCHED_SYNC_ATOMIC
diff --git a/platform/linux-generic/include/api/odp_schedule.h 
b/platform/linux-generic/include/api/odp_schedule.h
index 91fec10..2a1a642 100644
--- a/platform/linux-generic/include/api/odp_schedule.h
+++ b/platform/linux-generic/include/api/odp_schedule.h
@@ -52,8 +52,8 @@ uint64_t odp_schedule_wait_time(uint64_t ns);
  * for a buffer according to the wait parameter setting. Returns
  * ODP_BUFFER_INVALID if reaches end of the wait period.
  *
- * @param fromOutput parameter for the source queue (where the buffer was
- *dequeued from). Ignored if NULL.
+ * @param src The source queue (output). Indicates from which queue the
+ *buffer was dequeued. Ignored if NULL.
  * @param waitMinimum time to wait for a buffer. Waits infinitely, if set 
to
  *ODP_SCHED_WAIT. Does not wait, if set to ODP_SCHED_NO_WAIT.
  *Use odp_schedule_wait_time() to convert time to other wait
@@ -61,7 +61,7 @@ uint64_t odp_schedule_wait_time(uint64_t ns);
  *
  * @return Next highest priority buffer, or ODP_BUFFER_INVALID
  */
-odp_buffer_t odp_schedule(odp_queue_t *from, uint64_t wait);
+odp_buffer_t odp_schedule(odp_queue_t *src, uint64_t wait);
 
 /**
  * Schedule one buffer
@@ -76,8 +76,8 @@ odp_buffer_t odp_schedule(odp_queue_t *from, uint64_t wait);
  *
  * User can exit the schedule loop without first calling odp_schedule_pause().
  *
- * @param fromOutput parameter for the source queue (where the buffer was
- *dequeued from). Ignored if NULL.
+ * @param src The source queue (output). Indicates from which queue the
+ *buffer was dequeued. Ignored if NULL.
  * @param waitMinimum time to wait for a buffer. Waits infinitely, if set 
to
  *ODP_SCHED_WAIT. Does not wait, if set to ODP_SCHED_NO_WAIT.
  *Use odp_schedule_wait_time() to convert time to other wait
@@ -85,7 +85,7 @@ odp_buffer_t odp_schedule(odp_queue_t *from, uint64_t wait);
  *
  * @return Next highest priority buffer, or ODP_BUFFER_INVALID
  */
-odp_buffer_t odp_schedule_one(odp_queue_t *from, uint64_t wait);
+odp_buffer_t odp_schedule_one(odp_queue_t *src, uint64_t wait);
 
 
 /**
@@ -93,8 +93,8 @@ odp_buffer_t odp_schedule_one(odp_queue_t *from, uint64_t 
wait);
  *
  * Like odp_schedule(), but returns multiple buffers from a queue.
  *
- * @param fromOutput parameter for the source queue (where the buffer was
- *dequeued from). Ignored if NULL.
+ * @param src The source queue (output). Indicates from which queue the
+ *buffer was dequeued. Ignored if NULL.
  * @param waitMinimum time to wait for a buffer. Waits infinitely, if set 
to
  *  

Re: [lng-odp] [PATCH v1/1] linux-generic : crypto

2014-10-31 Thread Mike Holmes
On 31 October 2014 08:07, alexandru.badici...@linaro.org wrote:

 From: Alexandru Badicioiu alexandru.badici...@linaro.org

 Add missing API functions to crypto implementation.
 Required by crypto unit testing.

 Signed-off-by: Alexandru Badicioiu alexandru.badici...@linaro.org
 ---
  platform/linux-generic/odp_crypto.c |   26 ++
  1 files changed, 26 insertions(+), 0 deletions(-)

 diff --git a/platform/linux-generic/odp_crypto.c
 b/platform/linux-generic/odp_crypto.c
 index 1475437..b9dd3e7 100644
 --- a/platform/linux-generic/odp_crypto.c
 +++ b/platform/linux-generic/odp_crypto.c
 @@ -13,6 +13,7 @@
  #include odp_align.h
  #include odp_shared_memory.h
  #include odp_crypto_internal.h
 +#include odp_debug_internal.h
  #include odp_hints.h
  #include odph_packet.h

 @@ -467,3 +468,28 @@ odp_crypto_get_ses_create_compl_session(odp_buffer_t
 completion_event,
 result = odp_buffer_addr(completion_event);
 *session = result-session;
  }
 +
 +void
 +odp_crypto_set_operation_compl_ctx(odp_buffer_t completion_event,
 +  void *ctx)
 +{
 +   (void)completion_event;


I assume this is to remove the unused error at compile time,  ODP_UNUSED in
the argument list to the function is the way we have handled that else where


 +   (void)ctx;
 +   ODP_UNIMPLEMENTED();
 +}
 +
 +void
 +*odp_crypto_get_operation_compl_ctx(odp_buffer_t completion_event)
 +{
 +   (void)completion_event;
 +   ODP_UNIMPLEMENTED();
 +   return NULL;
 +}
 +
 +odp_packet_t
 +odp_crypto_get_operation_compl_packet(odp_buffer_t completion_event)
 +{
 +   (void)completion_event;
 +   ODP_UNIMPLEMENTED();
 +   return ODP_PACKET_INVALID;
 +}
 --
 1.7.3.4


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




-- 
*Mike Holmes*
Linaro  Sr Technical Manager
LNG - ODP
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] Scheduler atomic and ordered definitions

2014-10-31 Thread Bill Fischofer
I can well imagine the step-by-step order preservation to be simpler to
implement (in SW) but it would also seem to limit performance since the
only way to ensure end-to-end order preservation would be if each
intermediate queue from ingress to egress were an ordered queue.  If there
is a parallel queue anywhere in the chain that would break things.

The question is: Is this restriction needed and/or sufficient for ODP v1.0?


On Fri, Oct 31, 2014 at 7:42 AM, Alexandru Badicioiu 
alexandru.badici...@linaro.org wrote:

 + * The original enqueue order of the source queue is maintained when
 buffers are
 + * enqueued to their destination queue(s) before another schedule call

 Is this assuming that the order will be restored always at the next
 enqueue? I think there should be an option to explicitly indicate if the
 next enqueue is supposed to restore the order or not, especially when
 packets move from queue to queue. Ordered queues are costly compared with
 the ordinary ones.

 Alex

 On 31 October 2014 14:25, Petri Savolainen petri.savolai...@linaro.org
 wrote:

 Improved atomic and ordered synchronisation definitions. Added
 order skip function prototype.

 Signed-off-by: Petri Savolainen petri.savolai...@linaro.org

 ---
 This is the ordered queue definition (in patch format) promised
 in the call yesterday.
 ---
  platform/linux-generic/include/api/odp_queue.h| 31 +++-
  platform/linux-generic/include/api/odp_schedule.h | 45
 ++-
  2 files changed, 64 insertions(+), 12 deletions(-)

 diff --git a/platform/linux-generic/include/api/odp_queue.h
 b/platform/linux-generic/include/api/odp_queue.h
 index b8ac4bb..c0c3969 100644
 --- a/platform/linux-generic/include/api/odp_queue.h
 +++ b/platform/linux-generic/include/api/odp_queue.h
 @@ -78,8 +78,35 @@ typedef int odp_schedule_prio_t;
  typedef int odp_schedule_sync_t;

  #define ODP_SCHED_SYNC_NONE 0  /** Queue not synchronised */
 -#define ODP_SCHED_SYNC_ATOMIC   1  /** Atomic queue */
 -#define ODP_SCHED_SYNC_ORDERED  2  /** Ordered queue */
 +
 +/**
 + * Atomic queue synchronisation
 + *
 + * The scheduler gives buffers from a queue to a single core at a time.
 This
 + * serialises processing of the buffers from the source queue and helps
 user to
 + * avoid SW locking. Another schedule call will implicitely release the
 atomic
 + * synchronisation of the source queue and free the scheduler to give
 buffers
 + * from the queue to other cores.
 + *
 + * User can hint the scheduler to release the atomic synchronisation
 early with
 + * odp_schedule_release_atomic().
 + */
 +#define ODP_SCHED_SYNC_ATOMIC   1
 +
 +/**
 + * Ordered queue synchronisation
 + *
 + * The scheduler may give out buffers to multiple cores for parallel
 processing.
 + * The original enqueue order of the source queue is maintained when
 buffers are
 + * enqueued to their destination queue(s) before another schedule call.
 Buffers
 + * from the same ordered (source) queue appear in their original order
 when
 + * dequeued from a destination queue. The destination queue type
 (POLL/SCHED) or
 + * synchronisation (NONE/ATOMIC/ORDERED) is not limited.
 + *
 + * User can command the scheduler to skip ordering of a buffer with
 + * odp_schedule_skip_order().
 + */
 +#define ODP_SCHED_SYNC_ORDERED  2

  /** Default queue synchronisation */
  #define ODP_SCHED_SYNC_DEFAULT  ODP_SCHED_SYNC_ATOMIC
 diff --git a/platform/linux-generic/include/api/odp_schedule.h
 b/platform/linux-generic/include/api/odp_schedule.h
 index 91fec10..2a1a642 100644
 --- a/platform/linux-generic/include/api/odp_schedule.h
 +++ b/platform/linux-generic/include/api/odp_schedule.h
 @@ -52,8 +52,8 @@ uint64_t odp_schedule_wait_time(uint64_t ns);
   * for a buffer according to the wait parameter setting. Returns
   * ODP_BUFFER_INVALID if reaches end of the wait period.
   *
 - * @param fromOutput parameter for the source queue (where the
 buffer was
 - *dequeued from). Ignored if NULL.
 + * @param src The source queue (output). Indicates from which queue
 the
 + *buffer was dequeued. Ignored if NULL.
   * @param waitMinimum time to wait for a buffer. Waits infinitely,
 if set to
   *ODP_SCHED_WAIT. Does not wait, if set to
 ODP_SCHED_NO_WAIT.
   *Use odp_schedule_wait_time() to convert time to other
 wait
 @@ -61,7 +61,7 @@ uint64_t odp_schedule_wait_time(uint64_t ns);
   *
   * @return Next highest priority buffer, or ODP_BUFFER_INVALID
   */
 -odp_buffer_t odp_schedule(odp_queue_t *from, uint64_t wait);
 +odp_buffer_t odp_schedule(odp_queue_t *src, uint64_t wait);

  /**
   * Schedule one buffer
 @@ -76,8 +76,8 @@ odp_buffer_t odp_schedule(odp_queue_t *from, uint64_t
 wait);
   *
   * User can exit the schedule loop without first calling
 odp_schedule_pause().
   *
 - * @param fromOutput parameter for the source queue (where the
 buffer was
 - *dequeued from). Ignored if NULL.
 + * 

Re: [lng-odp] [PATCH] Scheduler atomic and ordered definitions

2014-10-31 Thread Savolainen, Petri (NSN - FI/Espoo)
Yes, it’s step-by-step and I think it’s the level of ordering we need for v1.0. 
Most SoCs can implement it, even when  the HW scheduler would not have order 
support but only atomic/parallel. This way defined atomic scheduling can be 
used to implement functionality correct ordered queues, the throughput is not 
improved but it functions correctly.

-Petri


From: ext Bill Fischofer [mailto:bill.fischo...@linaro.org]
Sent: Friday, October 31, 2014 2:48 PM
To: Alexandru Badicioiu
Cc: Petri Savolainen; lng-odp@lists.linaro.org
Subject: Re: [lng-odp] [PATCH] Scheduler atomic and ordered definitions

I can well imagine the step-by-step order preservation to be simpler to 
implement (in SW) but it would also seem to limit performance since the only 
way to ensure end-to-end order preservation would be if each intermediate queue 
from ingress to egress were an ordered queue.  If there is a parallel queue 
anywhere in the chain that would break things.

The question is: Is this restriction needed and/or sufficient for ODP v1.0?

On Fri, Oct 31, 2014 at 7:42 AM, Alexandru Badicioiu 
alexandru.badici...@linaro.orgmailto:alexandru.badici...@linaro.org wrote:
+ * The original enqueue order of the source queue is maintained when buffers 
are
+ * enqueued to their destination queue(s) before another schedule call

Is this assuming that the order will be restored always at the next enqueue? I 
think there should be an option to explicitly indicate if the next enqueue is 
supposed to restore the order or not, especially when packets move from queue 
to queue. Ordered queues are costly compared with the ordinary ones.

Alex

On 31 October 2014 14:25, Petri Savolainen 
petri.savolai...@linaro.orgmailto:petri.savolai...@linaro.org wrote:
Improved atomic and ordered synchronisation definitions. Added
order skip function prototype.

Signed-off-by: Petri Savolainen 
petri.savolai...@linaro.orgmailto:petri.savolai...@linaro.org

---
This is the ordered queue definition (in patch format) promised
in the call yesterday.
---
 platform/linux-generic/include/api/odp_queue.h| 31 +++-
 platform/linux-generic/include/api/odp_schedule.h | 45 ++-
 2 files changed, 64 insertions(+), 12 deletions(-)

diff --git a/platform/linux-generic/include/api/odp_queue.h 
b/platform/linux-generic/include/api/odp_queue.h
index b8ac4bb..c0c3969 100644
--- a/platform/linux-generic/include/api/odp_queue.h
+++ b/platform/linux-generic/include/api/odp_queue.h
@@ -78,8 +78,35 @@ typedef int odp_schedule_prio_t;
 typedef int odp_schedule_sync_t;

 #define ODP_SCHED_SYNC_NONE 0  /** Queue not synchronised */
-#define ODP_SCHED_SYNC_ATOMIC   1  /** Atomic queue */
-#define ODP_SCHED_SYNC_ORDERED  2  /** Ordered queue */
+
+/**
+ * Atomic queue synchronisation
+ *
+ * The scheduler gives buffers from a queue to a single core at a time. This
+ * serialises processing of the buffers from the source queue and helps user to
+ * avoid SW locking. Another schedule call will implicitely release the atomic
+ * synchronisation of the source queue and free the scheduler to give buffers
+ * from the queue to other cores.
+ *
+ * User can hint the scheduler to release the atomic synchronisation early with
+ * odp_schedule_release_atomic().
+ */
+#define ODP_SCHED_SYNC_ATOMIC   1
+
+/**
+ * Ordered queue synchronisation
+ *
+ * The scheduler may give out buffers to multiple cores for parallel 
processing.
+ * The original enqueue order of the source queue is maintained when buffers 
are
+ * enqueued to their destination queue(s) before another schedule call. Buffers
+ * from the same ordered (source) queue appear in their original order when
+ * dequeued from a destination queue. The destination queue type (POLL/SCHED) 
or
+ * synchronisation (NONE/ATOMIC/ORDERED) is not limited.
+ *
+ * User can command the scheduler to skip ordering of a buffer with
+ * odp_schedule_skip_order().
+ */
+#define ODP_SCHED_SYNC_ORDERED  2

 /** Default queue synchronisation */
 #define ODP_SCHED_SYNC_DEFAULT  ODP_SCHED_SYNC_ATOMIC
diff --git a/platform/linux-generic/include/api/odp_schedule.h 
b/platform/linux-generic/include/api/odp_schedule.h
index 91fec10..2a1a642 100644
--- a/platform/linux-generic/include/api/odp_schedule.h
+++ b/platform/linux-generic/include/api/odp_schedule.h
@@ -52,8 +52,8 @@ uint64_t odp_schedule_wait_time(uint64_t ns);
  * for a buffer according to the wait parameter setting. Returns
  * ODP_BUFFER_INVALID if reaches end of the wait period.
  *
- * @param fromOutput parameter for the source queue (where the buffer was
- *dequeued from). Ignored if NULL.
+ * @param src The source queue (output). Indicates from which queue the
+ *buffer was dequeued. Ignored if NULL.
  * @param waitMinimum time to wait for a buffer. Waits infinitely, if set 
to
  *ODP_SCHED_WAIT. Does not wait, if set to ODP_SCHED_NO_WAIT.
  *Use odp_schedule_wait_time() to convert 

Re: [lng-odp] [PATCH] Scheduler atomic and ordered definitions

2014-10-31 Thread Bill Fischofer
This may well be a reasonable restriction for ODP v1.0 but I believe it's
something we need to put on the list for production grade improvements
for 2015.

Bill

On Fri, Oct 31, 2014 at 7:57 AM, Savolainen, Petri (NSN - FI/Espoo) 
petri.savolai...@nsn.com wrote:

  Yes, it’s step-by-step and I think it’s the level of ordering we need
 for v1.0. Most SoCs can implement it, even when  the HW scheduler would not
 have order support but only atomic/parallel. This way defined atomic
 scheduling can be used to implement functionality correct ordered queues,
 the throughput is not improved but it functions correctly.



 -Petri





 *From:* ext Bill Fischofer [mailto:bill.fischo...@linaro.org]
 *Sent:* Friday, October 31, 2014 2:48 PM
 *To:* Alexandru Badicioiu
 *Cc:* Petri Savolainen; lng-odp@lists.linaro.org
 *Subject:* Re: [lng-odp] [PATCH] Scheduler atomic and ordered definitions



 I can well imagine the step-by-step order preservation to be simpler to
 implement (in SW) but it would also seem to limit performance since the
 only way to ensure end-to-end order preservation would be if each
 intermediate queue from ingress to egress were an ordered queue.  If there
 is a parallel queue anywhere in the chain that would break things.



 The question is: Is this restriction needed and/or sufficient for ODP
 v1.0?



 On Fri, Oct 31, 2014 at 7:42 AM, Alexandru Badicioiu 
 alexandru.badici...@linaro.org wrote:

 + * The original enqueue order of the source queue is maintained when
 buffers are
 + * enqueued to their destination queue(s) before another schedule call



 Is this assuming that the order will be restored always at the next
 enqueue? I think there should be an option to explicitly indicate if the
 next enqueue is supposed to restore the order or not, especially when
 packets move from queue to queue. Ordered queues are costly compared with
 the ordinary ones.



 Alex



 On 31 October 2014 14:25, Petri Savolainen petri.savolai...@linaro.org
 wrote:

 Improved atomic and ordered synchronisation definitions. Added
 order skip function prototype.

 Signed-off-by: Petri Savolainen petri.savolai...@linaro.org

 ---
 This is the ordered queue definition (in patch format) promised
 in the call yesterday.
 ---
  platform/linux-generic/include/api/odp_queue.h| 31 +++-
  platform/linux-generic/include/api/odp_schedule.h | 45
 ++-
  2 files changed, 64 insertions(+), 12 deletions(-)

 diff --git a/platform/linux-generic/include/api/odp_queue.h
 b/platform/linux-generic/include/api/odp_queue.h
 index b8ac4bb..c0c3969 100644
 --- a/platform/linux-generic/include/api/odp_queue.h
 +++ b/platform/linux-generic/include/api/odp_queue.h
 @@ -78,8 +78,35 @@ typedef int odp_schedule_prio_t;
  typedef int odp_schedule_sync_t;

  #define ODP_SCHED_SYNC_NONE 0  /** Queue not synchronised */
 -#define ODP_SCHED_SYNC_ATOMIC   1  /** Atomic queue */
 -#define ODP_SCHED_SYNC_ORDERED  2  /** Ordered queue */
 +
 +/**
 + * Atomic queue synchronisation
 + *
 + * The scheduler gives buffers from a queue to a single core at a time.
 This
 + * serialises processing of the buffers from the source queue and helps
 user to
 + * avoid SW locking. Another schedule call will implicitely release the
 atomic
 + * synchronisation of the source queue and free the scheduler to give
 buffers
 + * from the queue to other cores.
 + *
 + * User can hint the scheduler to release the atomic synchronisation
 early with
 + * odp_schedule_release_atomic().
 + */
 +#define ODP_SCHED_SYNC_ATOMIC   1
 +
 +/**
 + * Ordered queue synchronisation
 + *
 + * The scheduler may give out buffers to multiple cores for parallel
 processing.
 + * The original enqueue order of the source queue is maintained when
 buffers are
 + * enqueued to their destination queue(s) before another schedule call.
 Buffers
 + * from the same ordered (source) queue appear in their original order
 when
 + * dequeued from a destination queue. The destination queue type
 (POLL/SCHED) or
 + * synchronisation (NONE/ATOMIC/ORDERED) is not limited.
 + *
 + * User can command the scheduler to skip ordering of a buffer with
 + * odp_schedule_skip_order().
 + */
 +#define ODP_SCHED_SYNC_ORDERED  2

  /** Default queue synchronisation */
  #define ODP_SCHED_SYNC_DEFAULT  ODP_SCHED_SYNC_ATOMIC
 diff --git a/platform/linux-generic/include/api/odp_schedule.h
 b/platform/linux-generic/include/api/odp_schedule.h
 index 91fec10..2a1a642 100644
 --- a/platform/linux-generic/include/api/odp_schedule.h
 +++ b/platform/linux-generic/include/api/odp_schedule.h
 @@ -52,8 +52,8 @@ uint64_t odp_schedule_wait_time(uint64_t ns);
   * for a buffer according to the wait parameter setting. Returns
   * ODP_BUFFER_INVALID if reaches end of the wait period.
   *
 - * @param fromOutput parameter for the source queue (where the buffer
 was
 - *dequeued from). Ignored if NULL.
 + * @param src The source queue (output). Indicates from which queue
 the
 + 

Re: [lng-odp] [PATCH] Scheduler atomic and ordered definitions

2014-10-31 Thread Bill Fischofer
It would be documentation in v1.0 but worth keeping since if the
step-by-step restriction is relaxed next year it would mean we wouldn't
have to change the API.

On Fri, Oct 31, 2014 at 8:10 AM, Alexandru Badicioiu 
alexandru.badici...@linaro.org wrote:

 In this case the dest argument in the following function:
 +void odp_schedule_skip_order(odp_queue_t dest, odp_buffer_t buf);
 looses it's meaning.

 Alex



 On 31 October 2014 14:59, Bill Fischofer bill.fischo...@linaro.org
 wrote:

 This may well be a reasonable restriction for ODP v1.0 but I believe it's
 something we need to put on the list for production grade improvements
 for 2015.

 Bill

 On Fri, Oct 31, 2014 at 7:57 AM, Savolainen, Petri (NSN - FI/Espoo) 
 petri.savolai...@nsn.com wrote:

  Yes, it’s step-by-step and I think it’s the level of ordering we need
 for v1.0. Most SoCs can implement it, even when  the HW scheduler would not
 have order support but only atomic/parallel. This way defined atomic
 scheduling can be used to implement functionality correct ordered queues,
 the throughput is not improved but it functions correctly.



 -Petri





 *From:* ext Bill Fischofer [mailto:bill.fischo...@linaro.org]
 *Sent:* Friday, October 31, 2014 2:48 PM
 *To:* Alexandru Badicioiu
 *Cc:* Petri Savolainen; lng-odp@lists.linaro.org
 *Subject:* Re: [lng-odp] [PATCH] Scheduler atomic and ordered
 definitions



 I can well imagine the step-by-step order preservation to be simpler to
 implement (in SW) but it would also seem to limit performance since the
 only way to ensure end-to-end order preservation would be if each
 intermediate queue from ingress to egress were an ordered queue.  If there
 is a parallel queue anywhere in the chain that would break things.



 The question is: Is this restriction needed and/or sufficient for ODP
 v1.0?



 On Fri, Oct 31, 2014 at 7:42 AM, Alexandru Badicioiu 
 alexandru.badici...@linaro.org wrote:

 + * The original enqueue order of the source queue is maintained when
 buffers are
 + * enqueued to their destination queue(s) before another schedule call



 Is this assuming that the order will be restored always at the next
 enqueue? I think there should be an option to explicitly indicate if the
 next enqueue is supposed to restore the order or not, especially when
 packets move from queue to queue. Ordered queues are costly compared with
 the ordinary ones.



 Alex



 On 31 October 2014 14:25, Petri Savolainen petri.savolai...@linaro.org
 wrote:

 Improved atomic and ordered synchronisation definitions. Added
 order skip function prototype.

 Signed-off-by: Petri Savolainen petri.savolai...@linaro.org

 ---
 This is the ordered queue definition (in patch format) promised
 in the call yesterday.
 ---
  platform/linux-generic/include/api/odp_queue.h| 31 +++-
  platform/linux-generic/include/api/odp_schedule.h | 45
 ++-
  2 files changed, 64 insertions(+), 12 deletions(-)

 diff --git a/platform/linux-generic/include/api/odp_queue.h
 b/platform/linux-generic/include/api/odp_queue.h
 index b8ac4bb..c0c3969 100644
 --- a/platform/linux-generic/include/api/odp_queue.h
 +++ b/platform/linux-generic/include/api/odp_queue.h
 @@ -78,8 +78,35 @@ typedef int odp_schedule_prio_t;
  typedef int odp_schedule_sync_t;

  #define ODP_SCHED_SYNC_NONE 0  /** Queue not synchronised */
 -#define ODP_SCHED_SYNC_ATOMIC   1  /** Atomic queue */
 -#define ODP_SCHED_SYNC_ORDERED  2  /** Ordered queue */
 +
 +/**
 + * Atomic queue synchronisation
 + *
 + * The scheduler gives buffers from a queue to a single core at a time.
 This
 + * serialises processing of the buffers from the source queue and helps
 user to
 + * avoid SW locking. Another schedule call will implicitely release the
 atomic
 + * synchronisation of the source queue and free the scheduler to give
 buffers
 + * from the queue to other cores.
 + *
 + * User can hint the scheduler to release the atomic synchronisation
 early with
 + * odp_schedule_release_atomic().
 + */
 +#define ODP_SCHED_SYNC_ATOMIC   1
 +
 +/**
 + * Ordered queue synchronisation
 + *
 + * The scheduler may give out buffers to multiple cores for parallel
 processing.
 + * The original enqueue order of the source queue is maintained when
 buffers are
 + * enqueued to their destination queue(s) before another schedule call.
 Buffers
 + * from the same ordered (source) queue appear in their original order
 when
 + * dequeued from a destination queue. The destination queue type
 (POLL/SCHED) or
 + * synchronisation (NONE/ATOMIC/ORDERED) is not limited.
 + *
 + * User can command the scheduler to skip ordering of a buffer with
 + * odp_schedule_skip_order().
 + */
 +#define ODP_SCHED_SYNC_ORDERED  2

  /** Default queue synchronisation */
  #define ODP_SCHED_SYNC_DEFAULT  ODP_SCHED_SYNC_ATOMIC
 diff --git a/platform/linux-generic/include/api/odp_schedule.h
 b/platform/linux-generic/include/api/odp_schedule.h
 index 91fec10..2a1a642 100644
 --- 

[lng-odp] [PATCH] Removed odp_atomic_int_t

2014-10-31 Thread Petri Savolainen
Integer version is not needed. Unsigned 32 and 64 bit atomics
are used instead. If signed 32/64 bits can be added later
on need basis.

Signed-off-by: Petri Savolainen petri.savolai...@linaro.org
---
 platform/linux-generic/include/api/odp_atomic.h| 115 -
 platform/linux-generic/include/api/odp_barrier.h   |   4 +-
 .../linux-generic/include/odp_buffer_internal.h|   2 +-
 platform/linux-generic/odp_barrier.c   |   6 +-
 platform/linux-generic/odp_thread.c|   6 +-
 test/api_test/odp_atomic_test.c|  80 ++
 test/api_test/odp_atomic_test.h|   9 --
 7 files changed, 16 insertions(+), 206 deletions(-)

diff --git a/platform/linux-generic/include/api/odp_atomic.h 
b/platform/linux-generic/include/api/odp_atomic.h
index 213c81f..5c83b39 100644
--- a/platform/linux-generic/include/api/odp_atomic.h
+++ b/platform/linux-generic/include/api/odp_atomic.h
@@ -26,10 +26,6 @@ extern C {
  *  @{
  */
 
-/**
- * Atomic integer
- */
-typedef volatile int32_t odp_atomic_int_t;
 
 /**
  * Atomic unsigned integer 64 bits
@@ -43,117 +39,6 @@ typedef volatile uint32_t odp_atomic_u32_t;
 
 
 /**
- * Initialize atomic integer
- *
- * @param ptrAn integer atomic variable
- *
- * @note The operation is not synchronized with other threads
- */
-static inline void odp_atomic_init_int(odp_atomic_int_t *ptr)
-{
-   *ptr = 0;
-}
-
-/**
- * Load value of atomic integer
- *
- * @param ptrAn atomic variable
- *
- * @return atomic integer value
- *
- * @note The operation is not synchronized with other threads
- */
-static inline int odp_atomic_load_int(odp_atomic_int_t *ptr)
-{
-   return *ptr;
-}
-
-/**
- * Store value to atomic integer
- *
- * @param ptrAn atomic variable
- * @param new_value  Store new_value to a variable
- *
- * @note The operation is not synchronized with other threads
- */
-static inline void odp_atomic_store_int(odp_atomic_int_t *ptr, int new_value)
-{
-   *ptr = new_value;
-}
-
-/**
- * Fetch and add atomic integer
- *
- * @param ptrAn atomic variable
- * @param value  A value to be added to the variable
- *
- * @return Value of the variable before the operation
- */
-static inline int odp_atomic_fetch_add_int(odp_atomic_int_t *ptr, int value)
-{
-   return __sync_fetch_and_add(ptr, value);
-}
-
-/**
- * Fetch and subtract atomic integer
- *
- * @param ptrAn atomic integer variable
- * @param value  A value to be subtracted from the variable
- *
- * @return Value of the variable before the operation
- */
-static inline int odp_atomic_fetch_sub_int(odp_atomic_int_t *ptr, int value)
-{
-   return __sync_fetch_and_sub(ptr, value);
-}
-
-/**
- * Fetch and increment atomic integer by 1
- *
- * @param ptrAn atomic variable
- *
- * @return Value of the variable before the operation
- */
-static inline int odp_atomic_fetch_inc_int(odp_atomic_int_t *ptr)
-{
-   return odp_atomic_fetch_add_int(ptr, 1);
-}
-
-/**
- * Increment atomic integer by 1
- *
- * @param ptrAn atomic variable
- *
- */
-static inline void odp_atomic_inc_int(odp_atomic_int_t *ptr)
-{
-   odp_atomic_fetch_add_int(ptr, 1);
-}
-
-/**
- * Fetch and decrement atomic integer by 1
- *
- * @param ptrAn atomic int variable
- *
- * @return Value of the variable before the operation
- */
-static inline int odp_atomic_fetch_dec_int(odp_atomic_int_t *ptr)
-{
-   return odp_atomic_fetch_sub_int(ptr, 1);
-}
-
-/**
- * Decrement atomic integer by 1
- *
- * @param ptrAn atomic variable
- *
- */
-static inline void odp_atomic_dec_int(odp_atomic_int_t *ptr)
-{
-   odp_atomic_fetch_sub_int(ptr, 1);
-}
-
-/**
  * Initialize atomic uint32
  *
  * @param ptrAn atomic variable
diff --git a/platform/linux-generic/include/api/odp_barrier.h 
b/platform/linux-generic/include/api/odp_barrier.h
index 866648f..fb02a9d 100644
--- a/platform/linux-generic/include/api/odp_barrier.h
+++ b/platform/linux-generic/include/api/odp_barrier.h
@@ -31,8 +31,8 @@ extern C {
  * ODP execution barrier
  */
 typedef struct odp_barrier_t {
-   int  count;  /** @private Thread count */
-   odp_atomic_int_t bar;/** @private Barrier counter */
+   uint32_t count;  /** @private Thread count */
+   odp_atomic_u32_t bar;/** @private Barrier counter */
 } odp_barrier_t;
 
 
diff --git a/platform/linux-generic/include/odp_buffer_internal.h 
b/platform/linux-generic/include/odp_buffer_internal.h
index 2002b51..0027bfc 100644
--- a/platform/linux-generic/include/odp_buffer_internal.h
+++ b/platform/linux-generic/include/odp_buffer_internal.h
@@ -88,7 +88,7 @@ typedef struct odp_buffer_hdr_t {
uint32_t index;  /* buf index in the pool */
size_t   size;   /* max data size */
size_t   cur_offset; /* current offset */
-   odp_atomic_int_t ref_count;  /* reference count */
+   odp_atomic_u32_t   

Re: [lng-odp] [PATCH v2 1/1] cunit : add tests for crypto APIs

2014-10-31 Thread Jerin Jacob
On Fri, Oct 31, 2014 at 02:08:47PM +0200, alexandru.badici...@linaro.org wrote:
 From: Alexandru Badicioiu alexandru.badici...@linaro.org
 
 This patch adds a suite for async inplace mode of crypto APIs.
 Correctness of crypto operations output is verified with known
 test vectors  as well as various options and functionalities:
 use session IV or operation IV for ciphering, use input packet
 buffer or a separate buffer as the completion event, set and
 retrieve the context associated with an operation.

IMO crypto functionality unit tests should be capable of running on both sync 
and async modes.
Platform like octeon supports only sync crypto mode.
We can introduce a command-line option to select the mode for functional 
testcases.
We can have separate  dedicated test to verify async/sync operation but crypto 
functional tests
should cater both.

Jerin

 
 Signed-off-by: Alexandru Badicioiu alexandru.badici...@linaro.org
 ---
  configure.ac  |1 +
  test/cunit/Makefile.am|2 +
  test/cunit/crypto/Makefile.am |9 +
  test/cunit/crypto/odp_crypto_test.c   |   26 ++
  test/cunit/crypto/odp_crypto_test_async_inp.c |  459 
 +
  test/cunit/crypto/odp_crypto_test_async_inp.h |   13 +
  test/cunit/crypto/test_vectors.h  |   94 +
  7 files changed, 604 insertions(+), 0 deletions(-)
  create mode 100644 test/cunit/crypto/Makefile.am
  create mode 100644 test/cunit/crypto/odp_crypto_test.c
  create mode 100644 test/cunit/crypto/odp_crypto_test_async_inp.c
  create mode 100644 test/cunit/crypto/odp_crypto_test_async_inp.h
  create mode 100644 test/cunit/crypto/test_vectors.h
 
 diff --git a/configure.ac b/configure.ac
 index fd69e85..b1785e9 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -166,6 +166,7 @@ AC_CONFIG_FILES([Makefile
test/Makefile
test/api_test/Makefile
   test/cunit/Makefile
 +  test/cunit/crypto/Makefile
pkgconfig/libodp.pc])
  
  AC_SEARCH_LIBS([timer_create],[rt posix4])
 diff --git a/test/cunit/Makefile.am b/test/cunit/Makefile.am
 index 927a5a5..7611145 100644
 --- a/test/cunit/Makefile.am
 +++ b/test/cunit/Makefile.am
 @@ -3,6 +3,8 @@ include $(top_srcdir)/test/Makefile.inc
  AM_CFLAGS += -I$(CUNIT_PATH)/include
  AM_LDFLAGS += -L$(CUNIT_PATH)/lib
  
 +SUBDIRS = crypto
 +
  if ODP_CUNIT_ENABLED
  TESTS = ${bin_PROGRAMS}
  check_PROGRAMS = ${bin_PROGRAMS}
 diff --git a/test/cunit/crypto/Makefile.am b/test/cunit/crypto/Makefile.am
 new file mode 100644
 index 000..b984eaa
 --- /dev/null
 +++ b/test/cunit/crypto/Makefile.am
 @@ -0,0 +1,9 @@
 +include $(top_srcdir)/test/Makefile.inc
 +
 +if ODP_CUNIT_ENABLED
 +bin_PROGRAMS = odp_crypto
 +odp_crypto_LDFLAGS = $(AM_LDFLAGS) -static -lcunit
 +endif
 +
 +dist_odp_crypto_SOURCES = odp_crypto_test_async_inp.c \
 +   odp_crypto_test.c
 diff --git a/test/cunit/crypto/odp_crypto_test.c 
 b/test/cunit/crypto/odp_crypto_test.c
 new file mode 100644
 index 000..b5d0dea
 --- /dev/null
 +++ b/test/cunit/crypto/odp_crypto_test.c
 @@ -0,0 +1,26 @@
 +/* Copyright (c) 2014, Linaro Limited
 + * All rights reserved.
 + *
 + * SPDX-License-Identifier: BSD-3-Clause
 + */
 +
 +#include odp.h
 +#include CUnit/Headers/Basic.h
 +#include CUnit/Headers/TestDB.h
 +#include odp_crypto_test_async_inp.h
 +
 +int main(void)
 +{
 + /* initialize the CUnit test registry */
 + if (CUE_SUCCESS != CU_initialize_registry())
 + return CU_get_error();
 +
 + /* register suites */
 + CU_register_suites(suites);
 + /* Run all tests using the CUnit Basic interface */
 + CU_basic_set_mode(CU_BRM_VERBOSE);
 + CU_basic_run_tests();
 + CU_cleanup_registry();
 +
 + return CU_get_error();
 +}
 diff --git a/test/cunit/crypto/odp_crypto_test_async_inp.c 
 b/test/cunit/crypto/odp_crypto_test_async_inp.c
 new file mode 100644
 index 000..dd5fb5f
 --- /dev/null
 +++ b/test/cunit/crypto/odp_crypto_test_async_inp.c
 @@ -0,0 +1,458 @@
 +/* Copyright (c) 2014, Linaro Limited
 + * All rights reserved.
 + *
 + * SPDX-License-Identifier:  BSD-3-Clause
 + */
 +
 +#include odp.h
 +#include odp_crypto.h
 +#include CUnit/Headers/Basic.h
 +#include CUnit/Headers/TestDB.h
 +#include test_vectors.h
 +
 +/* Suite name */
 +#define ODP_CRYPTO_ASYNC_INP odp_crypto_async_inp
 +
 +/* Suite init/finalize funcs */
 +/* ODP global/local initialization
 + * Packet pool creation
 + * Crypto output queue creation */
 +
 +#define SHM_PKT_POOL_SIZE  (512*2048*2)
 +#define SHM_PKT_POOL_BUF_SIZE  (1024 * 32)
 +
 +#define SHM_COMPL_POOL_SIZE  (128*1024)
 +#define SHM_COMPL_POOL_BUF_SIZE 128
 +
 +static int init(void)
 +{
 + odp_shm_t shm;
 + void *pool_base = NULL;
 + odp_buffer_pool_t pool;
 + odp_queue_t out_queue;
 +
 + if (odp_init_global(NULL, NULL)) {
 + ODP_ERR(ODP global init failed.\n);
 + 

Re: [lng-odp] [ODP/PATCH v1] ODP Buffer Segment Support API

2014-10-31 Thread Bill Fischofer
This patch does not apply to the current repository.  Is there a revised
version available?

Thanks.

Bill

On Wed, Oct 22, 2014 at 8:47 AM, Bill Fischofer bill.fischo...@linaro.org
wrote:

 I had previously detailed some of the problems that arise if we remove
 segmentation support from buffers while trying to keep it as part of
 packets.  I'd still like to see a response to these questions.  Given that
 we support unsegmented buffers I don't see what the objection is here.
 Those that don't want to deal with segments need not deal with them at
 all.  That may limit the platforms they can run on, but applications will
 always choose which implementations are best suited to their needs.

 Bill

 On Wed, Oct 22, 2014 at 7:27 AM, Savolainen, Petri (NSN - FI/Espoo) 
 petri.savolai...@nsn.com wrote:

 Hi,

 In short, I think we must not bring segmentation support to the buffer
 level just in case someone would need it there. Real use cases for
 segmentation are on packet level (large packets, packet
 fragmentation/reassembly, etc), so the feature should be implemented there.

 -Petri

  -Original Message-
  From: ext Ciprian Barbu [mailto:ciprian.ba...@linaro.org]
  Sent: Wednesday, October 22, 2014 3:00 PM
  To: Bill Fischofer
  Cc: Ola Liljedahl; Savolainen, Petri (NSN - FI/Espoo); lng-
  o...@lists.linaro.org
  Subject: Re: [lng-odp] [ODP/PATCH v1] ODP Buffer Segment Support API
 
  On Wed, Oct 22, 2014 at 2:47 PM, Ciprian Barbu 
 ciprian.ba...@linaro.org
  wrote:
   This thread has been cold for 5 days, so the assumption is that we can
   go forward with the design right now. This patch series proposed by
   Bala updates some part of the API to the final form of the Buffer
   Design Document, we should have it merged if there are no more
   objections. For that more people with the right expertise should have
   a look at it and get the thread back on track.
  
   I for example have observed the following issue. All the examples
   create buffer pools over shared memory, which doesn't make sense for
   some platforms, linux-dpdk for example, which ignores the base_addr
   argument altogether. I think we need more clarity on this subject, for
   sure the creation of buffer pools will differ from platform to
   platform, which migrates to the application responsibility.
  
   I think we should have a helper function to easily create buffer pools
   without worrying too much about the difference in buffer management
   between platforms, so that one can write a simple portable application
   with no sweat. For the hardcore programmers the API still gives fine
   control to buffer management that depending on the platform could
   involve additional prerequisites, like creating a shared memory
   segment to hold the buffer pool.
 
  Ok, so I had another look at the Buffer Management final design. I now
  see that the option of creating buffer pools from regions has been
  removed, so in this case things will be simpler for the applications.
  In other words we should really start working on the full
  implementation of the API because from there the problem I just stated
  above (having to create shared memory segments) will disappear.
 
  
   On Fri, Oct 17, 2014 at 4:33 PM, Bill Fischofer
   bill.fischo...@linaro.org wrote:
   Let's consider the implications of removing segmentation support from
   buffers and only having that concept be part of packets.
  
   The first question that arises is what is the relationship between
 the
   abstract types odp_packet_t and odp_buffer_t? This is important
 because
   currently we say that packets are allocated from ODP buffer pools,
 not
  from
   packet pools.  Do we need a separate odp_packet_pool_t that is used
 for
   packets?
  
   Today, when I allocate a packet I'm allocating a single object that
  happens
   to be a single buffer object of type ODP_BUFFER_TYPE_PACKET.  But
 that
  only
   works if the two objects have compatible semantics (including
  segmentation).
   If the semantics are not compatible, then an odp_packet_t may in fact
  be
   composed of multiple odp_buffer_t's because the packet may consist of
   multiple segments and buffers no longer recognize the concept of
  segments so
   a single buffer can only be a single segment.
  
   So now an odp_packet_segment_t may be an odp_buffer_t but an
  odp_packet_t in
   fact is some meta-object that is constructed (by whom?) from multiple
   odp_packet_segment_ts that are themselves odp_buffer_ts.  So
   odp_packet_to_buffer() no longer makes sense since there is no
 longer a
   one-to-one correspondence between packets and buffers.  We could have
  an
   odp_packet_segment_to_buffer() routine instead.
  
   Next question: What about meta data?  If an odp_packet_t is a type of
  an
   odp_buffer_t then this is very straightforward since all buffer meta
  data is
   reusable as packet meta data and the packet type can just add its own
   specific meta data to this set.  But if an odp_packet_t 

Re: [lng-odp] [PATCH v2 1/1] cunit : add tests for crypto APIs

2014-10-31 Thread Jerin Jacob
On Fri, Oct 31, 2014 at 04:35:21PM +0200, Alexandru Badicioiu wrote:
 This suite is only for async inplace mode.The tests can be reused, with
 some modifications, for other modes too (sync/inplace/outplace/). Command
 line argument to select the the suite(s) or separate test programs could
 work too.

Introducing an abstraction for sync/async mode for functional test-case is very 
straight forward.
Most of the platforms don't support both async and sync together.
and its very difficult to maintain parallel tests suites for the same 
functionality which can be abstracted.
If you need any help in defining/reviewing the abstraction and/or testing the 
sync mode then I can help you with that.
I would like avoid the duplicate effort of writing parallel ODP crypto Cunit 
testcases.

Let me know your views on the proposal.

 
 On 31 October 2014 16:28, Jerin Jacob jerin.ja...@caviumnetworks.com
 wrote:
 
  On Fri, Oct 31, 2014 at 02:08:47PM +0200, alexandru.badici...@linaro.org
  wrote:
   From: Alexandru Badicioiu alexandru.badici...@linaro.org
  
   This patch adds a suite for async inplace mode of crypto APIs.
   Correctness of crypto operations output is verified with known
   test vectors  as well as various options and functionalities:
   use session IV or operation IV for ciphering, use input packet
   buffer or a separate buffer as the completion event, set and
   retrieve the context associated with an operation.
 
  IMO crypto functionality unit tests should be capable of running on both
  sync and async modes.
  Platform like octeon supports only sync crypto mode.
  We can introduce a command-line option to select the mode for functional
  testcases.
  We can have separate  dedicated test to verify async/sync operation but
  crypto functional tests
  should cater both.
 
  Jerin
 
  
   Signed-off-by: Alexandru Badicioiu alexandru.badici...@linaro.org
   ---
configure.ac  |1 +
test/cunit/Makefile.am|2 +
test/cunit/crypto/Makefile.am |9 +
test/cunit/crypto/odp_crypto_test.c   |   26 ++
test/cunit/crypto/odp_crypto_test_async_inp.c |  459
  +
test/cunit/crypto/odp_crypto_test_async_inp.h |   13 +
test/cunit/crypto/test_vectors.h  |   94 +
7 files changed, 604 insertions(+), 0 deletions(-)
create mode 100644 test/cunit/crypto/Makefile.am
create mode 100644 test/cunit/crypto/odp_crypto_test.c
create mode 100644 test/cunit/crypto/odp_crypto_test_async_inp.c
create mode 100644 test/cunit/crypto/odp_crypto_test_async_inp.h
create mode 100644 test/cunit/crypto/test_vectors.h
  
   diff --git a/configure.ac b/configure.ac
   index fd69e85..b1785e9 100644
   --- a/configure.ac
   +++ b/configure.ac
   @@ -166,6 +166,7 @@ AC_CONFIG_FILES([Makefile
  test/Makefile
  test/api_test/Makefile
 test/cunit/Makefile
   +  test/cunit/crypto/Makefile
  pkgconfig/libodp.pc])
  
AC_SEARCH_LIBS([timer_create],[rt posix4])
   diff --git a/test/cunit/Makefile.am b/test/cunit/Makefile.am
   index 927a5a5..7611145 100644
   --- a/test/cunit/Makefile.am
   +++ b/test/cunit/Makefile.am
   @@ -3,6 +3,8 @@ include $(top_srcdir)/test/Makefile.inc
AM_CFLAGS += -I$(CUNIT_PATH)/include
AM_LDFLAGS += -L$(CUNIT_PATH)/lib
  
   +SUBDIRS = crypto
   +
if ODP_CUNIT_ENABLED
TESTS = ${bin_PROGRAMS}
check_PROGRAMS = ${bin_PROGRAMS}
   diff --git a/test/cunit/crypto/Makefile.am
  b/test/cunit/crypto/Makefile.am
   new file mode 100644
   index 000..b984eaa
   --- /dev/null
   +++ b/test/cunit/crypto/Makefile.am
   @@ -0,0 +1,9 @@
   +include $(top_srcdir)/test/Makefile.inc
   +
   +if ODP_CUNIT_ENABLED
   +bin_PROGRAMS = odp_crypto
   +odp_crypto_LDFLAGS = $(AM_LDFLAGS) -static -lcunit
   +endif
   +
   +dist_odp_crypto_SOURCES = odp_crypto_test_async_inp.c \
   +   odp_crypto_test.c
   diff --git a/test/cunit/crypto/odp_crypto_test.c
  b/test/cunit/crypto/odp_crypto_test.c
   new file mode 100644
   index 000..b5d0dea
   --- /dev/null
   +++ b/test/cunit/crypto/odp_crypto_test.c
   @@ -0,0 +1,26 @@
   +/* Copyright (c) 2014, Linaro Limited
   + * All rights reserved.
   + *
   + * SPDX-License-Identifier: BSD-3-Clause
   + */
   +
   +#include odp.h
   +#include CUnit/Headers/Basic.h
   +#include CUnit/Headers/TestDB.h
   +#include odp_crypto_test_async_inp.h
   +
   +int main(void)
   +{
   + /* initialize the CUnit test registry */
   + if (CUE_SUCCESS != CU_initialize_registry())
   + return CU_get_error();
   +
   + /* register suites */
   + CU_register_suites(suites);
   + /* Run all tests using the CUnit Basic interface */
   + CU_basic_set_mode(CU_BRM_VERBOSE);
   + CU_basic_run_tests();
   + CU_cleanup_registry();
   +
   + return CU_get_error();
   +}
   diff --git 

[lng-odp] [PATCH] odp_example.c: Fix doxygen warnings

2014-10-31 Thread Mike Holmes
Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 example/odp_example/odp_example.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/example/odp_example/odp_example.c 
b/example/odp_example/odp_example.c
index 5f25f89..4459cb0 100644
--- a/example/odp_example/odp_example.c
+++ b/example/odp_example/odp_example.c
@@ -317,6 +317,7 @@ static int test_poll_queue(int thr, odp_buffer_pool_t 
msg_pool)
  * @param thr  Thread
  * @param msg_pool Buffer pool
  * @param prio Priority
+ * @param barrier  Bareier
  *
  * @return 0 if successful
  */
@@ -379,6 +380,7 @@ static int test_schedule_one_single(const char *str, int 
thr,
  * @param thr  Thread
  * @param msg_pool Buffer pool
  * @param prio Priority
+ * @param barrier  Barrier
  *
  * @return 0 if successful
  */
@@ -439,6 +441,7 @@ static int test_schedule_one_many(const char *str, int thr,
  * @param thr  Thread
  * @param msg_pool Buffer pool
  * @param prio Priority
+ * @param barrier  Bareier
  *
  * @return 0 if successful
  */
@@ -514,6 +517,7 @@ static int test_schedule_single(const char *str, int thr,
  * @param thr  Thread
  * @param msg_pool Buffer pool
  * @param prio Priority
+ * @param barrier  Bareier
  *
  * @return 0 if successful
  */
@@ -588,6 +592,7 @@ static int test_schedule_many(const char *str, int thr,
  * @param thr  Thread
  * @param msg_pool Buffer pool
  * @param prio Priority
+ * @param barrier  Bareier
  *
  * @return 0 if successful
  */
-- 
2.1.0


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


Re: [lng-odp] [PATCH] odp_example.c: Fix doxygen warnings

2014-10-31 Thread Bill Fischofer
s/Bareier/Barrier/

On Fri, Oct 31, 2014 at 10:20 AM, Mike Holmes mike.hol...@linaro.org
wrote:

 Signed-off-by: Mike Holmes mike.hol...@linaro.org
 ---
  example/odp_example/odp_example.c | 5 +
  1 file changed, 5 insertions(+)

 diff --git a/example/odp_example/odp_example.c
 b/example/odp_example/odp_example.c
 index 5f25f89..4459cb0 100644
 --- a/example/odp_example/odp_example.c
 +++ b/example/odp_example/odp_example.c
 @@ -317,6 +317,7 @@ static int test_poll_queue(int thr, odp_buffer_pool_t
 msg_pool)
   * @param thr  Thread
   * @param msg_pool Buffer pool
   * @param prio Priority
 + * @param barrier  Bareier
   *
   * @return 0 if successful
   */
 @@ -379,6 +380,7 @@ static int test_schedule_one_single(const char *str,
 int thr,
   * @param thr  Thread
   * @param msg_pool Buffer pool
   * @param prio Priority
 + * @param barrier  Barrier
   *
   * @return 0 if successful
   */
 @@ -439,6 +441,7 @@ static int test_schedule_one_many(const char *str, int
 thr,
   * @param thr  Thread
   * @param msg_pool Buffer pool
   * @param prio Priority
 + * @param barrier  Bareier
   *
   * @return 0 if successful
   */
 @@ -514,6 +517,7 @@ static int test_schedule_single(const char *str, int
 thr,
   * @param thr  Thread
   * @param msg_pool Buffer pool
   * @param prio Priority
 + * @param barrier  Bareier
   *
   * @return 0 if successful
   */
 @@ -588,6 +592,7 @@ static int test_schedule_many(const char *str, int thr,
   * @param thr  Thread
   * @param msg_pool Buffer pool
   * @param prio Priority
 + * @param barrier  Bareier
   *
   * @return 0 if successful
   */
 --
 2.1.0


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

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


[lng-odp] [PATCH v2] odp_example.c: Fix doxygen warnings

2014-10-31 Thread Mike Holmes
Signed-off-by: Mike Holmes mike.hol...@linaro.org
---

Sent version prior to spell check, fix spelling.

 example/odp_example/odp_example.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/example/odp_example/odp_example.c 
b/example/odp_example/odp_example.c
index 5f25f89..4f74916 100644
--- a/example/odp_example/odp_example.c
+++ b/example/odp_example/odp_example.c
@@ -317,6 +317,7 @@ static int test_poll_queue(int thr, odp_buffer_pool_t 
msg_pool)
  * @param thr  Thread
  * @param msg_pool Buffer pool
  * @param prio Priority
+ * @param barrier  Barrier
  *
  * @return 0 if successful
  */
@@ -379,6 +380,7 @@ static int test_schedule_one_single(const char *str, int 
thr,
  * @param thr  Thread
  * @param msg_pool Buffer pool
  * @param prio Priority
+ * @param barrier  Barrier
  *
  * @return 0 if successful
  */
@@ -439,6 +441,7 @@ static int test_schedule_one_many(const char *str, int thr,
  * @param thr  Thread
  * @param msg_pool Buffer pool
  * @param prio Priority
+ * @param barrier  Barrier
  *
  * @return 0 if successful
  */
@@ -514,6 +517,7 @@ static int test_schedule_single(const char *str, int thr,
  * @param thr  Thread
  * @param msg_pool Buffer pool
  * @param prio Priority
+ * @param barrier  Barrier
  *
  * @return 0 if successful
  */
@@ -588,6 +592,7 @@ static int test_schedule_many(const char *str, int thr,
  * @param thr  Thread
  * @param msg_pool Buffer pool
  * @param prio Priority
+ * @param barrier  Barrier
  *
  * @return 0 if successful
  */
-- 
2.1.0


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


Re: [lng-odp] [PATCH] odp_example.c: Fix doxygen warnings

2014-10-31 Thread Mike Holmes
Thanks, already saw that :)

On 31 October 2014 11:33, Bill Fischofer bill.fischo...@linaro.org wrote:

 s/Bareier/Barrier/

 On Fri, Oct 31, 2014 at 10:20 AM, Mike Holmes mike.hol...@linaro.org
 wrote:

 Signed-off-by: Mike Holmes mike.hol...@linaro.org
 ---
  example/odp_example/odp_example.c | 5 +
  1 file changed, 5 insertions(+)

 diff --git a/example/odp_example/odp_example.c
 b/example/odp_example/odp_example.c
 index 5f25f89..4459cb0 100644
 --- a/example/odp_example/odp_example.c
 +++ b/example/odp_example/odp_example.c
 @@ -317,6 +317,7 @@ static int test_poll_queue(int thr, odp_buffer_pool_t
 msg_pool)
   * @param thr  Thread
   * @param msg_pool Buffer pool
   * @param prio Priority
 + * @param barrier  Bareier
   *
   * @return 0 if successful
   */
 @@ -379,6 +380,7 @@ static int test_schedule_one_single(const char *str,
 int thr,
   * @param thr  Thread
   * @param msg_pool Buffer pool
   * @param prio Priority
 + * @param barrier  Barrier
   *
   * @return 0 if successful
   */
 @@ -439,6 +441,7 @@ static int test_schedule_one_many(const char *str,
 int thr,
   * @param thr  Thread
   * @param msg_pool Buffer pool
   * @param prio Priority
 + * @param barrier  Bareier
   *
   * @return 0 if successful
   */
 @@ -514,6 +517,7 @@ static int test_schedule_single(const char *str, int
 thr,
   * @param thr  Thread
   * @param msg_pool Buffer pool
   * @param prio Priority
 + * @param barrier  Bareier
   *
   * @return 0 if successful
   */
 @@ -588,6 +592,7 @@ static int test_schedule_many(const char *str, int
 thr,
   * @param thr  Thread
   * @param msg_pool Buffer pool
   * @param prio Priority
 + * @param barrier  Bareier
   *
   * @return 0 if successful
   */
 --
 2.1.0


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





-- 
*Mike Holmes*
Linaro  Sr Technical Manager
LNG - ODP
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH 1/4] odp_debug_internal.h: move to include dir from API dir

2014-10-31 Thread Mike Holmes
On 30 October 2014 16:47, Anders Roxell anders.rox...@linaro.org wrote:

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


Reviewed-and-Tested-by:MIke Holmes mike.hol...@linaro.org


 ---
  platform/linux-generic/include/{api = }/odp_debug_internal.h | 0
  1 file changed, 0 insertions(+), 0 deletions(-)
  rename platform/linux-generic/include/{api = }/odp_debug_internal.h
 (100%)

 diff --git a/platform/linux-generic/include/api/odp_debug_internal.h
 b/platform/linux-generic/include/odp_debug_internal.h
 similarity index 100%
 rename from platform/linux-generic/include/api/odp_debug_internal.h
 rename to platform/linux-generic/include/odp_debug_internal.h
 --
 2.1.0


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




-- 
*Mike Holmes*
Linaro  Sr Technical Manager
LNG - ODP
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH 2/4] configure.ac: accurately name compile option

2014-10-31 Thread Mike Holmes
On 30 October 2014 16:47, Anders Roxell anders.rox...@linaro.org wrote:

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


Reviewed-and-Tested-by:Mike Holmes mike.hol...@linaro.org


 ---
  configure.ac | 10 +-
  1 file changed, 5 insertions(+), 5 deletions(-)

 diff --git a/configure.ac b/configure.ac
 index fd69e85..42a3fed 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -90,13 +90,13 @@ AM_CONDITIONAL([ODP_CUNIT_ENABLED], [test
 x$cunit_support = xyes ])
  ##
  # Enable/disable ODP_DEBUG_PRINT
  ##
 -ODP_DEBUG=1
 -AC_ARG_ENABLE([debug],
 -[  --enable-debug Enable/disable debug],
 +ODP_DEBUG_PRINT=1
 +AC_ARG_ENABLE([debug-print],
 +[  --enable-debug-print Enable/disable debug print],
  [if ! test x$enableval = xyes; then
 -ODP_DEBUG=0
 +ODP_DEBUG_PRINT=0
  fi])
 -ODP_CFLAGS=$ODP_CFLAGS -DODP_DEBUG_PRINT=$ODP_DEBUG
 +ODP_CFLAGS=$ODP_CFLAGS -DODP_DEBUG_PRINT=$ODP_DEBUG_PRINT

  ##
  # Check for pthreads availability
 --
 2.1.0


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




-- 
*Mike Holmes*
Linaro  Sr Technical Manager
LNG - ODP
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH 4/4] configure.ac: add configure option to enable ODP_DEBUG

2014-10-31 Thread Mike Holmes
On 30 October 2014 16:47, Anders Roxell anders.rox...@linaro.org wrote:

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


Reviewed-and-Tested-by:Mike Holmes mike.hol...@linaro.org

---
  configure.ac | 11 +++
  1 file changed, 11 insertions(+)

 diff --git a/configure.ac b/configure.ac
 index 42a3fed..1c061e9 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -99,6 +99,17 @@ AC_ARG_ENABLE([debug-print],
  ODP_CFLAGS=$ODP_CFLAGS -DODP_DEBUG_PRINT=$ODP_DEBUG_PRINT

  ##
 +# Enable/disable ODP_DEBUG
 +##
 +ODP_DEBUG=1
 +AC_ARG_ENABLE([debug],
 +[  --enable-debug Enable/disable debug],
 +[if ! test x$enableval = xyes; then
 +ODP_DEBUG=0
 +fi])
 +ODP_CFLAGS=$ODP_CFLAGS -DODP_DEBUG=$ODP_DEBUG
 +
 +##
  # Check for pthreads availability
  ##

 --
 2.1.0


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




-- 
*Mike Holmes*
Linaro  Sr Technical Manager
LNG - ODP
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 638] linux-dpdk specific header files not installed

2014-10-31 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=638

--- Comment #5 from Ciprian Barbu ciprian.ba...@linaro.org ---
The problem that needs to be solved is that currently linux-dpdk does not
install odp_pktio_socket.h. I tested this manually with openvswitch_odp,
because that's how I spotted this issue.

To solve this bug I could send a patch that adds the missing file in
platform/linux-dpdk/Makefile.am, but since the pktio type awareness has been
removed from the ODP API, the best choice right now would be to wait for Venky
to update his linux-dpdk repo with at least the patch series that remove pktio
type awareness, because that's where odp_pktio_socket.h is deleted anyway. It
also makes sense to wait given the lack of time Venky has, he will most likely
update to odp.git before applying any new patches that will be in the end
useless.

Here are the two patches that need to be applied:
https://git.linaro.org/lng/odp.git/commit/e968af6c153700149d1516c733766478e3b52006
https://git.linaro.org/lng/odp.git/commit/0ecee33aefdb002d0014b12ef962abe32cca0a8b

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


Re: [lng-odp] [PATCH v2 1/1] cunit : add tests for crypto APIs

2014-10-31 Thread Mike Holmes
I had thought that in this case it might be something like below using the
cunit ability to organise tests into different suites.
The code can then be organized and reused as needed, but it is all built
together as a suite that can be run for async only, sync only or both, with
the main entry point just taking an commandline argument as to which suites
to run.

crypto
|
 --
 ||
  async  . . . . sync
 ||
   --- ---
   | | | |
Test '11' ... Test '1M' Test 'N1' ... Test 'NM'


On 31 October 2014 11:10, Jerin Jacob jerin.ja...@caviumnetworks.com
wrote:

 On Fri, Oct 31, 2014 at 04:35:21PM +0200, Alexandru Badicioiu wrote:
  This suite is only for async inplace mode.The tests can be reused, with
  some modifications, for other modes too (sync/inplace/outplace/). Command
  line argument to select the the suite(s) or separate test programs could
  work too.

 Introducing an abstraction for sync/async mode for functional test-case is
 very straight forward.
 Most of the platforms don't support both async and sync together.
 and its very difficult to maintain parallel tests suites for the same
 functionality which can be abstracted.
 If you need any help in defining/reviewing the abstraction and/or testing
 the sync mode then I can help you with that.
 I would like avoid the duplicate effort of writing parallel ODP crypto
 Cunit testcases.

 Let me know your views on the proposal.

 
  On 31 October 2014 16:28, Jerin Jacob jerin.ja...@caviumnetworks.com
  wrote:
 
   On Fri, Oct 31, 2014 at 02:08:47PM +0200,
 alexandru.badici...@linaro.org
   wrote:
From: Alexandru Badicioiu alexandru.badici...@linaro.org
   
This patch adds a suite for async inplace mode of crypto APIs.
Correctness of crypto operations output is verified with known
test vectors  as well as various options and functionalities:
use session IV or operation IV for ciphering, use input packet
buffer or a separate buffer as the completion event, set and
retrieve the context associated with an operation.
  
   IMO crypto functionality unit tests should be capable of running on
 both
   sync and async modes.
   Platform like octeon supports only sync crypto mode.
   We can introduce a command-line option to select the mode for
 functional
   testcases.
   We can have separate  dedicated test to verify async/sync operation but
   crypto functional tests
   should cater both.
  
   Jerin
  
   
Signed-off-by: Alexandru Badicioiu alexandru.badici...@linaro.org
---
 configure.ac  |1 +
 test/cunit/Makefile.am|2 +
 test/cunit/crypto/Makefile.am |9 +
 test/cunit/crypto/odp_crypto_test.c   |   26 ++
 test/cunit/crypto/odp_crypto_test_async_inp.c |  459
   +
 test/cunit/crypto/odp_crypto_test_async_inp.h |   13 +
 test/cunit/crypto/test_vectors.h  |   94 +
 7 files changed, 604 insertions(+), 0 deletions(-)
 create mode 100644 test/cunit/crypto/Makefile.am
 create mode 100644 test/cunit/crypto/odp_crypto_test.c
 create mode 100644 test/cunit/crypto/odp_crypto_test_async_inp.c
 create mode 100644 test/cunit/crypto/odp_crypto_test_async_inp.h
 create mode 100644 test/cunit/crypto/test_vectors.h
   
diff --git a/configure.ac b/configure.ac
index fd69e85..b1785e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -166,6 +166,7 @@ AC_CONFIG_FILES([Makefile
   test/Makefile
   test/api_test/Makefile
  test/cunit/Makefile
+  test/cunit/crypto/Makefile
   pkgconfig/libodp.pc])
   
 AC_SEARCH_LIBS([timer_create],[rt posix4])
diff --git a/test/cunit/Makefile.am b/test/cunit/Makefile.am
index 927a5a5..7611145 100644
--- a/test/cunit/Makefile.am
+++ b/test/cunit/Makefile.am
@@ -3,6 +3,8 @@ include $(top_srcdir)/test/Makefile.inc
 AM_CFLAGS += -I$(CUNIT_PATH)/include
 AM_LDFLAGS += -L$(CUNIT_PATH)/lib
   
+SUBDIRS = crypto
+
 if ODP_CUNIT_ENABLED
 TESTS = ${bin_PROGRAMS}
 check_PROGRAMS = ${bin_PROGRAMS}
diff --git a/test/cunit/crypto/Makefile.am
   b/test/cunit/crypto/Makefile.am
new file mode 100644
index 000..b984eaa
--- /dev/null
+++ b/test/cunit/crypto/Makefile.am
@@ -0,0 +1,9 @@
+include $(top_srcdir)/test/Makefile.inc
+
+if ODP_CUNIT_ENABLED
+bin_PROGRAMS = odp_crypto
+odp_crypto_LDFLAGS = $(AM_LDFLAGS) -static -lcunit
+endif
+
+dist_odp_crypto_SOURCES = odp_crypto_test_async_inp.c \
+   odp_crypto_test.c
diff --git 

[lng-odp] [PATCH 2/2] linux-generic: clean unnecessary includes

2014-10-31 Thread Mike Holmes
With the system headers cleaned up linux-generic no longer needs so many
system includes

Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 platform/linux-generic/odp_buffer.c| 1 -
 platform/linux-generic/odp_buffer_pool.c   | 3 ---
 platform/linux-generic/odp_coremask.c  | 1 -
 platform/linux-generic/odp_linux.c | 2 --
 platform/linux-generic/odp_packet.c| 1 -
 platform/linux-generic/odp_packet_socket.c | 2 --
 platform/linux-generic/odp_ring.c  | 1 -
 platform/linux-generic/odp_shared_memory.c | 1 -
 platform/linux-generic/odp_system_info.c   | 1 -
 platform/linux-generic/odp_thread.c| 2 --
 platform/linux-generic/odp_time.c  | 1 -
 11 files changed, 16 deletions(-)

diff --git a/platform/linux-generic/odp_buffer.c 
b/platform/linux-generic/odp_buffer.c
index e54e0e7..a46543d 100644
--- a/platform/linux-generic/odp_buffer.c
+++ b/platform/linux-generic/odp_buffer.c
@@ -9,7 +9,6 @@
 #include odp_buffer_pool_internal.h
 
 #include string.h
-#include stdio.h
 
 
 void *odp_buffer_addr(odp_buffer_t buf)
diff --git a/platform/linux-generic/odp_buffer_pool.c 
b/platform/linux-generic/odp_buffer_pool.c
index a48d7d6..f25aa67 100644
--- a/platform/linux-generic/odp_buffer_pool.c
+++ b/platform/linux-generic/odp_buffer_pool.c
@@ -16,10 +16,7 @@
 #include odp_config.h
 #include odp_hints.h
 #include odp_debug.h
-
 #include string.h
-#include stdlib.h
-
 
 #ifdef POOL_USE_TICKETLOCK
 #include odp_ticketlock.h
diff --git a/platform/linux-generic/odp_coremask.c 
b/platform/linux-generic/odp_coremask.c
index c7438cc..d378aad 100644
--- a/platform/linux-generic/odp_coremask.c
+++ b/platform/linux-generic/odp_coremask.c
@@ -7,7 +7,6 @@
 #include odp_coremask.h
 #include odp_debug.h
 
-#include stdlib.h
 #include string.h
 
 #define MAX_CORE_NUM   64
diff --git a/platform/linux-generic/odp_linux.c 
b/platform/linux-generic/odp_linux.c
index 11f76c9..356d628 100644
--- a/platform/linux-generic/odp_linux.c
+++ b/platform/linux-generic/odp_linux.c
@@ -12,9 +12,7 @@
 #include sys/types.h
 #include sys/wait.h
 
-#include stdlib.h
 #include string.h
-#include stdio.h
 #include assert.h
 
 
diff --git a/platform/linux-generic/odp_packet.c 
b/platform/linux-generic/odp_packet.c
index 82ea879..6bac23e 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -13,7 +13,6 @@
 #include odph_ip.h
 
 #include string.h
-#include stdio.h
 
 static inline uint8_t parse_ipv4(odp_packet_hdr_t *pkt_hdr,
 odph_ipv4hdr_t *ipv4, size_t *offset_out);
diff --git a/platform/linux-generic/odp_packet_socket.c 
b/platform/linux-generic/odp_packet_socket.c
index 0492d1e..18f6e9d 100644
--- a/platform/linux-generic/odp_packet_socket.c
+++ b/platform/linux-generic/odp_packet_socket.c
@@ -10,8 +10,6 @@
 #endif
 
 #include sys/socket.h
-#include stdio.h
-#include stdlib.h
 #include sys/types.h
 #include sys/stat.h
 #include sys/mman.h
diff --git a/platform/linux-generic/odp_ring.c 
b/platform/linux-generic/odp_ring.c
index 632aa66..8466d90 100644
--- a/platform/linux-generic/odp_ring.c
+++ b/platform/linux-generic/odp_ring.c
@@ -76,7 +76,6 @@
 #include odp_align.h
 #include sys/mman.h
 #include fcntl.h
-#include stdio.h
 #include string.h
 #include odp_debug.h
 #include odp_rwlock.h
diff --git a/platform/linux-generic/odp_shared_memory.c 
b/platform/linux-generic/odp_shared_memory.c
index 60a868b..c770a80 100644
--- a/platform/linux-generic/odp_shared_memory.c
+++ b/platform/linux-generic/odp_shared_memory.c
@@ -17,7 +17,6 @@
 #include asm/mman.h
 #include fcntl.h
 
-#include stdio.h
 #include string.h
 
 
diff --git a/platform/linux-generic/odp_system_info.c 
b/platform/linux-generic/odp_system_info.c
index 10665bb..90deb80 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -9,7 +9,6 @@
 #include odp_debug.h
 #include odp_align.h
 #include string.h
-#include stdio.h
 
 /* sysconf */
 #include unistd.h
diff --git a/platform/linux-generic/odp_thread.c 
b/platform/linux-generic/odp_thread.c
index b869b27..8acbfe2 100644
--- a/platform/linux-generic/odp_thread.c
+++ b/platform/linux-generic/odp_thread.c
@@ -18,8 +18,6 @@
 #include odp_align.h
 
 #include string.h
-#include stdio.h
-#include stdlib.h
 
 
 typedef struct {
diff --git a/platform/linux-generic/odp_time.c 
b/platform/linux-generic/odp_time.c
index faece0e..eac60e3 100644
--- a/platform/linux-generic/odp_time.c
+++ b/platform/linux-generic/odp_time.c
@@ -48,7 +48,6 @@ uint64_t odp_time_get_cycles(void)
 #else
 
 #include time.h
-#include stdlib.h
 
 uint64_t odp_time_get_cycles(void)
 {
-- 
2.1.0


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


[lng-odp] [PATCH 1/2] fix including odp_std_types.h

2014-10-31 Thread Mike Holmes
The public ODP API should not directly call Linux system  headers

Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 platform/linux-generic/include/api/odp_byteorder.h | 1 -
 platform/linux-generic/include/api/odp_debug.h | 3 +--
 platform/linux-generic/include/api/odp_std_types.h | 4 +++-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/platform/linux-generic/include/api/odp_byteorder.h 
b/platform/linux-generic/include/api/odp_byteorder.h
index 79ddd75..6834ad9 100644
--- a/platform/linux-generic/include/api/odp_byteorder.h
+++ b/platform/linux-generic/include/api/odp_byteorder.h
@@ -18,7 +18,6 @@
 extern C {
 #endif
 
-#include endian.h
 #include odp_std_types.h
 #include odp_compiler.h
 
diff --git a/platform/linux-generic/include/api/odp_debug.h 
b/platform/linux-generic/include/api/odp_debug.h
index 0a20430..dad57a8 100644
--- a/platform/linux-generic/include/api/odp_debug.h
+++ b/platform/linux-generic/include/api/odp_debug.h
@@ -12,8 +12,7 @@
 #ifndef ODP_DEBUG_H_
 #define ODP_DEBUG_H_
 
-#include stdio.h
-#include stdlib.h
+#include odp_std_types.h
 
 #ifdef __cplusplus
 extern C {
diff --git a/platform/linux-generic/include/api/odp_std_types.h 
b/platform/linux-generic/include/api/odp_std_types.h
index b12a2f3..af8c35d 100644
--- a/platform/linux-generic/include/api/odp_std_types.h
+++ b/platform/linux-generic/include/api/odp_std_types.h
@@ -26,7 +26,9 @@ extern C {
 #include stdint.h
 #include inttypes.h
 #include limits.h
-
+#include endian.h
+#include stdio.h
+#include stdlib.h
 
 
 
-- 
2.1.0


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


[lng-odp] [PATCH v2] add odp_buffer_pool_destroy

2014-10-31 Thread Mike Holmes
Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 platform/linux-generic/include/api/odp_buffer_pool.h | 18 ++
 platform/linux-generic/odp_buffer_pool.c |  7 +++
 2 files changed, 25 insertions(+)

diff --git a/platform/linux-generic/include/api/odp_buffer_pool.h 
b/platform/linux-generic/include/api/odp_buffer_pool.h
index d04abf0..7225fb7 100644
--- a/platform/linux-generic/include/api/odp_buffer_pool.h
+++ b/platform/linux-generic/include/api/odp_buffer_pool.h
@@ -55,6 +55,24 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name,
 size_t buf_size, size_t buf_align,
 int buf_type);
 
+/**
+ * Destroy a buffer pool
+ *
+ * This routine destroys a previously created buffer pool.
+ * @note Attempts to destroy a predefined buffer pool will be rejected.
+ * @warning The result is undefined if an attempt is made to destroy a buffer 
pool that
+ * contains allocated buffers.
+ *
+ * @sa odp_buffer_free
+ *
+ * @param pool[in]  Buffer pool handle
+ *
+ * @retval 0 for success
+ * @retval 1 on failure
+ */
+int odp_buffer_pool_destroy(odp_buffer_pool_t pool);
+
+
 
 /**
  * Find a buffer pool by name
diff --git a/platform/linux-generic/odp_buffer_pool.c 
b/platform/linux-generic/odp_buffer_pool.c
index a48d7d6..d205f25 100644
--- a/platform/linux-generic/odp_buffer_pool.c
+++ b/platform/linux-generic/odp_buffer_pool.c
@@ -16,6 +16,7 @@
 #include odp_config.h
 #include odp_hints.h
 #include odp_debug.h
+#include odp_debug_internal.h
 
 #include string.h
 #include stdlib.h
@@ -410,6 +411,12 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name,
return pool_hdl;
 }
 
+/** @todo bug 619 */
+int odp_buffer_pool_destroy(odp_buffer_pool_t pool ODP_UNUSED)
+{
+   ODP_UNIMPLEMENTED();
+   return 0;
+}
 
 odp_buffer_pool_t odp_buffer_pool_lookup(const char *name)
 {
-- 
2.1.0


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


Re: [lng-odp] [PATCH OVS v2 3/4] Config option to enable ODP debug

2014-10-31 Thread Anders Roxell
On 2014-10-29 13:24, Zoltan Kiss wrote:
 Signed-off-by: Zoltan Kiss zoltan.k...@linaro.org
 ---
  acinclude.m4 | 31 ++-
  configure.ac |  1 +
  2 files changed, 31 insertions(+), 1 deletion(-)
 
 diff --git a/acinclude.m4 b/acinclude.m4
 index 1579286..5e9f3ee 100644
 --- a/acinclude.m4
 +++ b/acinclude.m4
 @@ -218,6 +218,35 @@ AC_DEFUN([OVS_CHECK_DPDK], [
AM_CONDITIONAL([DPDK_NETDEV], test -n $RTE_SDK)
  ])
  
 +dnl OVS_CHECK_ODP_DEBUG
 +dnl
 +dnl Configure ODP debug flag
 +AC_DEFUN([OVS_CHECK_ODP_DEBUG], [
 +  AC_MSG_CHECKING([for ODP Debug])
 +
 +  ODP_DEBUG=0
 +
 +  AC_ARG_WITH([odp-debug],
 +  [AC_HELP_STRING([--with-odp-debug=[@:@yes | no@:@]],
 +  [ODP debug flag; default is false])],
 +  [
 + case $withval in
 +  |  n | no)
 + ODP_DEBUG=0
 + AC_MSG_RESULT([no])
 + ;;
 + y | ye | yes)
 + ODP_DEBUG=1
 + AC_MSG_RESULT([yes])
 + ;;
 + *)
 + AC_MSG_ERROR([invalid config option])
 + ;;
 + esac
 +  ]
 + )
 +])
 +
  dnl OVS_CHECK_ODP_PLATFORM
  dnl
  dnl Configure ODP platform
 @@ -272,7 +301,7 @@ AC_DEFUN([OVS_CHECK_ODP], [
  
   AC_SUBST([ODP_INCLUDE])
   AC_SUBST([ODP_LIB_DIR])
 - CFLAGS=$CFLAGS -I$ODP_INCLUDE -I$ODPH_INCLUDE
 + CFLAGS=$CFLAGS -I$ODP_INCLUDE -I$ODPH_INCLUDE 
 -DODP_DEBUG_PRINT=$ODP_DEBUG

Sorry for the late reply.

To have two different variables to set only one feels odd.

and no application should use ODP_DEBUG_PRINT that should be used to get
out debug information from ODP library.

Cheers,
Anders

   LDFLAGS=$LDFLAGS $SSL_LDFLAGS -L$ODP_LIB_DIR
 ;;
   esac
 diff --git a/configure.ac b/configure.ac
 index e7be627..4cdbd75 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -120,6 +120,7 @@ AC_ARG_VAR(KARCH, [Kernel Architecture String])
  AC_SUBST(KARCH)
  OVS_CHECK_LINUX
  OVS_CHECK_DPDK
 +OVS_CHECK_ODP_DEBUG
  OVS_CHECK_ODP_PLATFORM
  OVS_CHECK_ODP
  
 -- 
 1.9.1
 
 
 ___
 lng-odp mailing list
 lng-odp@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/lng-odp

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


Re: [lng-odp] [PATCH OVS v2 4/4] netdev, ofpbuf: Adjust OVS implementation to the latest ODP

2014-10-31 Thread Anders Roxell
On 2014-10-29 13:24, Zoltan Kiss wrote:
 ---
  lib/netdev-odp.c | 32 +---
  1 file changed, 17 insertions(+), 15 deletions(-)
 
 diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
 index 74fbac9..59de46d 100644
 --- a/lib/netdev-odp.c
 +++ b/lib/netdev-odp.c
 @@ -102,7 +102,6 @@ int
  odp_init(int argc, char *argv[])
  {
  int result;
 -int thr_id;
  
  if (strcmp(argv[1], --odp))
  return 0;
 @@ -110,14 +109,17 @@ odp_init(int argc, char *argv[])
  argc--;
  argv++;
  
 -result = odp_init_global();
 +result = odp_init_global(NULL, NULL);
  if (result) {
  ODP_ERR(Error: ODP global init failed\n);
  return result;
  }
  
 -thr_id = odp_thread_create(0);
 -odp_init_local(thr_id);
 +/* Init this thread */
 +if (odp_init_local()) {
 +ODP_ERR(Error: ODP local init failed.\n);

This should be some OVS specific error call.
This goes for the reset of the instances in the file.

Cheers,
Anders

 +exit(EXIT_FAILURE);
 +}
  
  odp_initialized = 1;
  
 @@ -128,11 +130,13 @@ static int
  odp_class_init(void)
  {
  void *pool_base;
 +odp_shm_t shm;
  int result = 0;
  
  /* create packet pool */
 -pool_base = odp_shm_reserve(shm_packet_pool, SHM_PKT_POOL_SIZE,
 -ODP_CACHE_LINE_SIZE);
 +shm = odp_shm_reserve(shm_packet_pool, SHM_PKT_POOL_SIZE,
 +  ODP_CACHE_LINE_SIZE, 0);
 +pool_base = odp_shm_addr(shm);
  
  if (odp_unlikely(pool_base == NULL)) {
  ODP_ERR(Error: ODP packet pool mem alloc failed\n);
 @@ -153,8 +157,9 @@ odp_class_init(void)
  odp_buffer_pool_print(pool);
  
  /* create ofpbuf pool */
 -pool_base = odp_shm_reserve(shm_ofpbuf_pool, SHM_OFPBUF_POOL_SIZE,
 -ODP_CACHE_LINE_SIZE);
 +shm = odp_shm_reserve(shm_ofpbuf_pool, SHM_OFPBUF_POOL_SIZE,
 +  ODP_CACHE_LINE_SIZE, 0);
 +pool_base = odp_shm_addr(shm);
  
  if (odp_unlikely(pool_base == NULL)) {
  ODP_ERR(Error: ODP packet pool mem alloc failed\n);
 @@ -175,8 +180,9 @@ odp_class_init(void)
  odp_buffer_pool_print(ofpbuf_pool);
  
  /* create pool for structures */
 -pool_base = odp_shm_reserve(shm_struct_pool, SHM_STRUCT_POOL_SIZE,
 -ODP_CACHE_LINE_SIZE);
 +shm = odp_shm_reserve(shm_struct_pool, SHM_STRUCT_POOL_SIZE,
 +  ODP_CACHE_LINE_SIZE, 0);
 +pool_base = odp_shm_addr(shm);
  
  if (odp_unlikely(pool_base == NULL)) {
  ODP_ERR(Error: ODP packet pool mem alloc failed\n);
 @@ -222,8 +228,6 @@ netdev_odp_construct(struct netdev *netdev_)
  {
  int err = 0;
  char *odp_if;
 -odp_pktio_params_t params;
 -socket_params_t *sock_params = params.sock_params;
  struct netdev_odp *netdev = netdev_odp_cast(netdev_);
  odp_packet_t pkt;
  
 @@ -234,9 +238,7 @@ netdev_odp_construct(struct netdev *netdev_)
  goto out_err;
  }
  
 -sock_params-type = ODP_PKTIO_TYPE_SOCKET_BASIC;
 -
 -netdev-pktio = odp_pktio_open(odp_if, pool, params);
 +netdev-pktio = odp_pktio_open(odp_if, pool);
  
  if (netdev-pktio == ODP_PKTIO_INVALID) {
  ODP_ERR(Error: odp pktio failed\n);
 -- 
 1.9.1
 
 
 ___
 lng-odp mailing list
 lng-odp@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/lng-odp

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


Re: [lng-odp] [PATCH 0/4] cleanup debug

2014-10-31 Thread Maxim Uvarov

Please in next time set up proper tag:

WARNING: 'Reviewed-and-tested-by:' is the preferred signature form
#7:
Reviewed-and-Tested-by: Mike Holmes mike.hol...@linaro.org

Patch set is merged.

Maxim.


On 10/30/2014 11:47 PM, Anders Roxell wrote:

Hi,

This patch set cleans up debug and
lets us turn them on via configure.

Cheers,
Anders

Anders Roxell (4):
   odp_debug_internal.h: move to include dir from API dir
   configure.ac: accurately name compile option
   odp_debug.h: ensure the macro is always compiled
   configure.ac: add configure option to enable ODP_DEBUG

  configure.ac| 13 -
  platform/linux-generic/include/api/odp_debug.h  |  9 -
  .../linux-generic/include/{api = }/odp_debug_internal.h|  0
  3 files changed, 16 insertions(+), 6 deletions(-)
  rename platform/linux-generic/include/{api = }/odp_debug_internal.h (100%)




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


[lng-odp] [PATCH] gitignore: ignore test-driver

2014-10-31 Thread Anders Roxell
Signed-off-by: Anders Roxell anders.rox...@linaro.org
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index a721904..57b47ea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,3 +45,4 @@ odp_l2fwd
 odp_ipsec
 odp_init
 doxygen-doc
+test-driver
-- 
2.1.0


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


[lng-odp] [PATCH v2] add tests for queue

2014-10-31 Thread yan.songming
From: yan.songming yan.songm...@linaro.org

Fix spelling problem. Add term_local and term_global. Move cunit queue test to 
test_odp_queue_base for none syn queue.

Signed-off-by: Yan Songming yan.songm...@linaro.org
---
 test/cunit/Makefile.am  |   4 +-
 test/cunit/odp_queue_test.c | 168 
 2 files changed, 171 insertions(+), 1 deletion(-)
 create mode 100644 test/cunit/odp_queue_test.c

diff --git a/test/cunit/Makefile.am b/test/cunit/Makefile.am
index 927a5a5..46f46c9 100644
--- a/test/cunit/Makefile.am
+++ b/test/cunit/Makefile.am
@@ -6,8 +6,10 @@ AM_LDFLAGS += -L$(CUNIT_PATH)/lib
 if ODP_CUNIT_ENABLED
 TESTS = ${bin_PROGRAMS}
 check_PROGRAMS = ${bin_PROGRAMS}
-bin_PROGRAMS = odp_init
+bin_PROGRAMS = odp_init odp_queue
 odp_init_LDFLAGS = $(AM_LDFLAGS) -static -lcunit
+odp_queue_LDFLAGS = $(AM_LDFLAGS) -static -lcunit
 endif
 
+dist_odp_queue_SOURCES = odp_queue_test.c
 dist_odp_init_SOURCES = odp_init_test.c
diff --git a/test/cunit/odp_queue_test.c b/test/cunit/odp_queue_test.c
new file mode 100644
index 000..04342a6
--- /dev/null
+++ b/test/cunit/odp_queue_test.c
@@ -0,0 +1,168 @@
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include odp.h
+#include CUnit/Basic.h
+
+#define MAX_BUFFER_QUEUE(8) /** Max enqueue buf num */
+#define MSG_POOL_SIZE   (4*1024*1024)   /** Message pool size */
+
+static int Queue_Contest = 0xff;
+
+static int test_odp_buffer_pool_init(void)
+{
+odp_buffer_pool_t pool;
+void *pool_base;
+odp_shm_t shm;
+
+shm = odp_shm_reserve(msg_pool,
+  MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
+
+pool_base = odp_shm_addr(shm);
+
+if (pool_base == NULL) {
+printf(Shared memory reserve failed.\n);
+return -1;
+}
+
+pool = odp_buffer_pool_create(msg_pool, pool_base, MSG_POOL_SIZE,
+  0,
+  ODP_CACHE_LINE_SIZE, ODP_BUFFER_TYPE_RAW);
+
+if (pool == ODP_BUFFER_POOL_INVALID) {
+printf(Pool create failed.\n);
+return -1;
+}
+return 0;
+}
+
+static void test_odp_queue_base(void)
+{
+odp_queue_t   queue_creat_id;
+odp_queue_t   queue_id;
+odp_buffer_t  Enbuf[MAX_BUFFER_QUEUE];
+odp_buffer_t  Debuf[MAX_BUFFER_QUEUE];
+odp_buffer_pool_t msg_pool;
+odp_queue_param_t param;
+
+int  i;
+odp_buffer_t buf;
+void *pRtn = NULL;
+
+/* test odp_queue_create */
+memset(param, 0, sizeof(param));
+param.sched.sync  = ODP_SCHED_SYNC_NONE;
+
+queue_creat_id = odp_queue_create(test_queue, ODP_QUEUE_TYPE_POLL, 
param);
+CU_ASSERT(ODP_QUEUE_INVALID != queue_creat_id);
+
+/* test odp_queue_type */
+CU_ASSERT_EQUAL(ODP_QUEUE_TYPE_POLL, odp_queue_type(queue_creat_id));
+
+/* test odp_queue_type */
+CU_ASSERT_EQUAL(ODP_SCHED_SYNC_NONE, odp_queue_sched_type(queue_creat_id));
+
+/* test odp_queue_lookup */
+queue_id = odp_queue_lookup(test_queue);
+CU_ASSERT_EQUAL(queue_creat_id, queue_id); 
+
+/* test odp_queue_set_context */
+CU_ASSERT(0 == odp_queue_set_context(queue_id, Queue_Contest));
+
+/* test  odp_queue_get_context*/
+pRtn = odp_queue_get_context(queue_id);
+CU_ASSERT(Queue_Contest == (int *)pRtn);
+
+/* apply for buffer */
+msg_pool = odp_buffer_pool_lookup(msg_pool);
+buf = odp_buffer_alloc(msg_pool);
+
+/* test  odp_queue_enq and odp_queue_deq */
+odp_queue_enq(queue_id, buf);
+CU_ASSERT_EQUAL(buf, odp_queue_deq(queue_id));
+odp_buffer_free(buf);
+
+/* apply for mutili buffer */
+for(i=0; iMAX_BUFFER_QUEUE; i++) {
+Enbuf[i] = odp_buffer_alloc(msg_pool);
+}
+
+/* test odp_queue_enq_multi  and odp_queue_enq_multi */
+odp_queue_enq_multi(queue_id, Enbuf, MAX_BUFFER_QUEUE);
+odp_queue_deq_multi(queue_id, Debuf, MAX_BUFFER_QUEUE);
+
+for(i=0; iMAX_BUFFER_QUEUE; i++) {
+/* test odp_queue_deq_multi */
+CU_ASSERT_EQUAL(Enbuf[i], Debuf[i]);
+/*  buffer free */
+odp_buffer_free(Enbuf[i]);
+}
+return;
+
+}
+
+static void test_odp_queue(void)
+{
+
+int status;
+status = odp_init_global(NULL, NULL);
+CU_ASSERT_FATAL(0 == status);
+
+CU_ASSERT(0 == odp_init_local())
+
+/* initialize  buffer pool */
+CU_ASSERT_FATAL(0 == test_odp_buffer_pool_init());
+
+/* test odp none syne queue   */
+test_odp_queue_base();
+
+status = odp_term_local();
+CU_ASSERT(0 == status);
+
+status = odp_term_global();
+CU_ASSERT(0 == status);
+return;
+}
+
+
+
+static int init(void)
+{
+printf(\tODP version: %s\n, odp_version_api_str());
+return 0;
+}
+
+static int finalize(void)
+{
+return 0;
+}
+
+int main(void)
+{
+CU_pSuite ptr_suite = NULL;
+/* initialize the CUnit test registry */
+if (CUE_SUCCESS != 

[lng-odp] [PATCH v2] add tests for queue

2014-10-31 Thread yan.songm...@linaro.org
Fix spelling problem. Add term_local and term_global. Move cunit queue test to 
test_odp_queue_base for none syn queue.
 
Signed-off-by: Yan Songming yan.songm...@linaro.org
---
test/cunit/Makefile.am  |   4 +-
test/cunit/odp_queue_test.c | 168 
2 files changed, 171 insertions(+), 1 deletion(-)
create mode 100644 test/cunit/odp_queue_test.c
 
diff --git a/test/cunit/Makefile.am b/test/cunit/Makefile.am
index 927a5a5..46f46c9 100644
--- a/test/cunit/Makefile.am
+++ b/test/cunit/Makefile.am
@@ -6,8 +6,10 @@ AM_LDFLAGS += -L$(CUNIT_PATH)/lib
if ODP_CUNIT_ENABLED
TESTS = ${bin_PROGRAMS}
check_PROGRAMS = ${bin_PROGRAMS}
-bin_PROGRAMS = odp_init
+bin_PROGRAMS = odp_init odp_queue
odp_init_LDFLAGS = $(AM_LDFLAGS) -static -lcunit
+odp_queue_LDFLAGS = $(AM_LDFLAGS) -static -lcunit
endif
+dist_odp_queue_SOURCES = odp_queue_test.c
dist_odp_init_SOURCES = odp_init_test.c
diff --git a/test/cunit/odp_queue_test.c b/test/cunit/odp_queue_test.c
new file mode 100644
index 000..04342a6
--- /dev/null
+++ b/test/cunit/odp_queue_test.c
@@ -0,0 +1,168 @@
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include odp.h
+#include CUnit/Basic.h
+
+#define MAX_BUFFER_QUEUE(8) /** Max enqueue buf num */
+#define MSG_POOL_SIZE   (4*1024*1024)   /** Message pool size */
+
+static int Queue_Contest = 0xff;
+
+static int test_odp_buffer_pool_init(void)
+{
+odp_buffer_pool_t pool;
+void *pool_base;
+odp_shm_t shm;
+
+shm = odp_shm_reserve(msg_pool,
+  MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
+
+pool_base = odp_shm_addr(shm);
+
+if (pool_base == NULL) {
+printf(Shared memory reserve failed.\n);
+return -1;
+}
+
+pool = odp_buffer_pool_create(msg_pool, pool_base, MSG_POOL_SIZE,
+  0,
+  ODP_CACHE_LINE_SIZE, ODP_BUFFER_TYPE_RAW);
+
+if (pool == ODP_BUFFER_POOL_INVALID) {
+printf(Pool create failed.\n);
+return -1;
+}
+return 0;
+}
+
+static void test_odp_queue_base(void)
+{
+odp_queue_t   queue_creat_id;
+odp_queue_t   queue_id;
+odp_buffer_t  Enbuf[MAX_BUFFER_QUEUE];
+odp_buffer_t  Debuf[MAX_BUFFER_QUEUE];
+odp_buffer_pool_t msg_pool;
+odp_queue_param_t param;
+
+int  i;
+odp_buffer_t buf;
+void *pRtn = NULL;
+
+/* test odp_queue_create */
+memset(param, 0, sizeof(param));
+param.sched.sync  = ODP_SCHED_SYNC_NONE;
+
+queue_creat_id = odp_queue_create(test_queue, ODP_QUEUE_TYPE_POLL, 
param);
+CU_ASSERT(ODP_QUEUE_INVALID != queue_creat_id);
+
+/* test odp_queue_type */
+CU_ASSERT_EQUAL(ODP_QUEUE_TYPE_POLL, odp_queue_type(queue_creat_id));
+
+/* test odp_queue_type */
+CU_ASSERT_EQUAL(ODP_SCHED_SYNC_NONE, odp_queue_sched_type(queue_creat_id));
+
+/* test odp_queue_lookup */
+queue_id = odp_queue_lookup(test_queue);
+CU_ASSERT_EQUAL(queue_creat_id, queue_id); 
+
+/* test odp_queue_set_context */
+CU_ASSERT(0 == odp_queue_set_context(queue_id, Queue_Contest));
+
+/* test  odp_queue_get_context*/
+pRtn = odp_queue_get_context(queue_id);
+CU_ASSERT(Queue_Contest == (int *)pRtn);
+
+/* apply for buffer */
+msg_pool = odp_buffer_pool_lookup(msg_pool);
+buf = odp_buffer_alloc(msg_pool);
+
+/* test  odp_queue_enq and odp_queue_deq */
+odp_queue_enq(queue_id, buf);
+CU_ASSERT_EQUAL(buf, odp_queue_deq(queue_id));
+odp_buffer_free(buf);
+
+/* apply for mutili buffer */
+for(i=0; iMAX_BUFFER_QUEUE; i++) {
+Enbuf[i] = odp_buffer_alloc(msg_pool);
+}
+
+/* test odp_queue_enq_multi  and odp_queue_enq_multi */
+odp_queue_enq_multi(queue_id, Enbuf, MAX_BUFFER_QUEUE);
+odp_queue_deq_multi(queue_id, Debuf, MAX_BUFFER_QUEUE);
+
+for(i=0; iMAX_BUFFER_QUEUE; i++) {
+/* test odp_queue_deq_multi */
+CU_ASSERT_EQUAL(Enbuf[i], Debuf[i]);
+/*  buffer free */
+odp_buffer_free(Enbuf[i]);
+}
+return;
+
+}
+
+static void test_odp_queue(void)
+{
+
+int status;
+status = odp_init_global(NULL, NULL);
+CU_ASSERT_FATAL(0 == status);
+
+CU_ASSERT(0 == odp_init_local())
+
+/* initialize  buffer pool */
+CU_ASSERT_FATAL(0 == test_odp_buffer_pool_init());
+
+/* test odp none syne queue   */
+test_odp_queue_base();
+
+status = odp_term_local();
+CU_ASSERT(0 == status);
+
+status = odp_term_global();
+CU_ASSERT(0 == status);
+return;
+}
+
+
+
+static int init(void)
+{
+printf(\tODP version: %s\n, odp_version_api_str());
+return 0;
+}
+
+static int finalize(void)
+{
+return 0;
+}
+
+int main(void)
+{
+CU_pSuite ptr_suite = NULL;
+/* initialize the CUnit test registry */
+if (CUE_SUCCESS != CU_initialize_registry())
+return CU_get_error();
+

[lng-odp] [PATCH v2] add tests for queue

2014-10-31 Thread yan.songm...@linaro.org
Fix spelling problem. Add term_local and term_global. Move cunit queue test to 
test_odp_queue_base for none syn queue.
 
Signed-off-by: Yan Songming yan.songm...@linaro.org
---
test/cunit/Makefile.am  |   4 +-
test/cunit/odp_queue_test.c | 168 
2 files changed, 171 insertions(+), 1 deletion(-)
create mode 100644 test/cunit/odp_queue_test.c
 
diff --git a/test/cunit/Makefile.am b/test/cunit/Makefile.am
index 927a5a5..46f46c9 100644
--- a/test/cunit/Makefile.am
+++ b/test/cunit/Makefile.am
@@ -6,8 +6,10 @@ AM_LDFLAGS += -L$(CUNIT_PATH)/lib
if ODP_CUNIT_ENABLED
TESTS = ${bin_PROGRAMS}
check_PROGRAMS = ${bin_PROGRAMS}
-bin_PROGRAMS = odp_init
+bin_PROGRAMS = odp_init odp_queue
odp_init_LDFLAGS = $(AM_LDFLAGS) -static -lcunit
+odp_queue_LDFLAGS = $(AM_LDFLAGS) -static -lcunit
endif
+dist_odp_queue_SOURCES = odp_queue_test.c
dist_odp_init_SOURCES = odp_init_test.c
diff --git a/test/cunit/odp_queue_test.c b/test/cunit/odp_queue_test.c
new file mode 100644
index 000..04342a6
--- /dev/null
+++ b/test/cunit/odp_queue_test.c
@@ -0,0 +1,168 @@
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include odp.h
+#include CUnit/Basic.h
+
+#define MAX_BUFFER_QUEUE(8) /** Max enqueue buf num */
+#define MSG_POOL_SIZE   (4*1024*1024)   /** Message pool size */
+
+static int Queue_Contest = 0xff;
+
+static int test_odp_buffer_pool_init(void)
+{
+odp_buffer_pool_t pool;
+void *pool_base;
+odp_shm_t shm;
+
+shm = odp_shm_reserve(msg_pool,
+  MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
+
+pool_base = odp_shm_addr(shm);
+
+if (pool_base == NULL) {
+printf(Shared memory reserve failed.\n);
+return -1;
+}
+
+pool = odp_buffer_pool_create(msg_pool, pool_base, MSG_POOL_SIZE,
+  0,
+  ODP_CACHE_LINE_SIZE, ODP_BUFFER_TYPE_RAW);
+
+if (pool == ODP_BUFFER_POOL_INVALID) {
+printf(Pool create failed.\n);
+return -1;
+}
+return 0;
+}
+
+static void test_odp_queue_base(void)
+{
+odp_queue_t   queue_creat_id;
+odp_queue_t   queue_id;
+odp_buffer_t  Enbuf[MAX_BUFFER_QUEUE];
+odp_buffer_t  Debuf[MAX_BUFFER_QUEUE];
+odp_buffer_pool_t msg_pool;
+odp_queue_param_t param;
+
+int  i;
+odp_buffer_t buf;
+void *pRtn = NULL;
+
+/* test odp_queue_create */
+memset(param, 0, sizeof(param));
+param.sched.sync  = ODP_SCHED_SYNC_NONE;
+
+queue_creat_id = odp_queue_create(test_queue, ODP_QUEUE_TYPE_POLL, 
param);
+CU_ASSERT(ODP_QUEUE_INVALID != queue_creat_id);
+
+/* test odp_queue_type */
+CU_ASSERT_EQUAL(ODP_QUEUE_TYPE_POLL, odp_queue_type(queue_creat_id));
+
+/* test odp_queue_type */
+CU_ASSERT_EQUAL(ODP_SCHED_SYNC_NONE, odp_queue_sched_type(queue_creat_id));
+
+/* test odp_queue_lookup */
+queue_id = odp_queue_lookup(test_queue);
+CU_ASSERT_EQUAL(queue_creat_id, queue_id); 
+
+/* test odp_queue_set_context */
+CU_ASSERT(0 == odp_queue_set_context(queue_id, Queue_Contest));
+
+/* test  odp_queue_get_context*/
+pRtn = odp_queue_get_context(queue_id);
+CU_ASSERT(Queue_Contest == (int *)pRtn);
+
+/* apply for buffer */
+msg_pool = odp_buffer_pool_lookup(msg_pool);
+buf = odp_buffer_alloc(msg_pool);
+
+/* test  odp_queue_enq and odp_queue_deq */
+odp_queue_enq(queue_id, buf);
+CU_ASSERT_EQUAL(buf, odp_queue_deq(queue_id));
+odp_buffer_free(buf);
+
+/* apply for mutili buffer */
+for(i=0; iMAX_BUFFER_QUEUE; i++) {
+Enbuf[i] = odp_buffer_alloc(msg_pool);
+}
+
+/* test odp_queue_enq_multi  and odp_queue_enq_multi */
+odp_queue_enq_multi(queue_id, Enbuf, MAX_BUFFER_QUEUE);
+odp_queue_deq_multi(queue_id, Debuf, MAX_BUFFER_QUEUE);
+
+for(i=0; iMAX_BUFFER_QUEUE; i++) {
+/* test odp_queue_deq_multi */
+CU_ASSERT_EQUAL(Enbuf[i], Debuf[i]);
+/*  buffer free */
+odp_buffer_free(Enbuf[i]);
+}
+return;
+
+}
+
+static void test_odp_queue(void)
+{
+
+int status;
+status = odp_init_global(NULL, NULL);
+CU_ASSERT_FATAL(0 == status);
+
+CU_ASSERT(0 == odp_init_local())
+
+/* initialize  buffer pool */
+CU_ASSERT_FATAL(0 == test_odp_buffer_pool_init());
+
+/* test odp none syne queue   */
+test_odp_queue_base();
+
+status = odp_term_local();
+CU_ASSERT(0 == status);
+
+status = odp_term_global();
+CU_ASSERT(0 == status);
+return;
+}
+
+
+
+static int init(void)
+{
+printf(\tODP version: %s\n, odp_version_api_str());
+return 0;
+}
+
+static int finalize(void)
+{
+return 0;
+}
+
+int main(void)
+{
+CU_pSuite ptr_suite = NULL;
+/* initialize the CUnit test registry */
+if (CUE_SUCCESS != CU_initialize_registry())
+return CU_get_error();
+