Re: [lng-odp] [PATCH] linux-generic: remove forward declarations of cos_t and pmr_t

2015-02-18 Thread Taras Kondratiuk

On 02/17/2015 11:35 PM, Maxim Uvarov wrote:

On 02/17/2015 11:28 PM, Bala wrote:

Reviewed-by: Bala Manoharan  bala.manoha...@linaro.org
mailto:bala.manoha...@linaro.org
P.S: A similar patch was proposed earlier by Taras also.


Yes, somehow everybody skipped review of Tarases patch set.


Yes, please review that series if we still need Clang support.


In current patch there is small difference, Taras left:

+union cos_u;
+union pmr_u;

And I don't. That is not needed.


I used to explicitly forward define structures or unions if they are 
used before definition, but in this case it seems to be redundant.


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


[lng-odp] [PATCH V2] api: timer: Don't use private as struct member name (C++)

2015-02-18 Thread Mike Holmes
From: Simon Kagstrom simon.kagst...@netinsight.net

Signed-off-by: Simon Kagstrom simon.kagst...@netinsight.net
Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
V2
Fixed compile

 example/timer/odp_timer_test.c | 2 +-
 include/odp/api/timer.h| 2 +-
 test/validation/odp_timer.c| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index fbadf8c..6b60ec4 100644
--- a/example/timer/odp_timer_test.c
+++ b/example/timer/odp_timer_test.c
@@ -387,7 +387,7 @@ int main(int argc, char *argv[])
tparams.min_tmo = args.min_us*ODP_TIME_USEC;
tparams.max_tmo = args.max_us*ODP_TIME_USEC;
tparams.num_timers = num_workers; /* One timer per worker */
-   tparams.private = 0; /* Shared */
+   tparams.priv = 0; /* Shared */
tparams.clk_src = ODP_CLOCK_CPU;
tp = odp_timer_pool_create(timer_pool, tparams);
if (tp == ODP_TIMER_POOL_INVALID) {
diff --git a/include/odp/api/timer.h b/include/odp/api/timer.h
index 5b1490e..0dc9415 100644
--- a/include/odp/api/timer.h
+++ b/include/odp/api/timer.h
@@ -100,7 +100,7 @@ typedef struct {
uint64_t min_tmo; /** Minimum relative timeout in nanoseconds */
uint64_t max_tmo; /** Maximum relative timeout in nanoseconds */
uint32_t num_timers; /** (Minimum) number of supported timers */
-   int private; /** Shared (false) or private (true) timer pool */
+   int priv; /** Shared (false) or private (true) timer pool */
odp_timer_clk_src_t clk_src; /** Clock source for timers */
 } odp_timer_pool_param_t;
 
diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c
index 57db959..b24c2c5 100644
--- a/test/validation/odp_timer.c
+++ b/test/validation/odp_timer.c
@@ -294,7 +294,7 @@ static void test_odp_timer_all(void)
tparam.min_tmo = MIN;
tparam.max_tmo = MAX;
tparam.num_timers = num_workers * NTIMERS;
-   tparam.private = 0;
+   tparam.priv = 0;
tparam.clk_src = ODP_CLOCK_CPU;
tp = odp_timer_pool_create(NAME, tparam);
if (tp == ODP_TIMER_POOL_INVALID)
-- 
2.1.0


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


[lng-odp] [Bug 805] ODP-OVS:virtual memory exhausted problem

2015-02-18 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=805

Mike Holmes mike.hol...@linaro.org changed:

   What|Removed |Added

   Assignee|zoltan.k...@linaro.org  |weilong.c...@linaro.org

-- 
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


[lng-odp] [Bug 805] ODP-OVS:virtual memory exhausted problem

2015-02-18 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=805

--- Comment #5 from Mike Holmes mike.hol...@linaro.org ---
Issue has only been reported on D01, probably best tracked by D01 maintainer

-- 
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


[lng-odp] [PATCH] test: miscellaneous: Add CPP test

2015-02-18 Thread Mike Holmes
From: Simon Kagstrom simon.kagst...@netinsight.net

Add conditional test to link and run ODP from a cpp application.

Signed-off-by: Simon Kagstrom simon.kagst...@netinsight.net
Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 configure.ac| 16 
 test/Makefile.am|  2 +-
 test/Makefile.inc   |  5 +++--
 test/miscellaneous/.gitignore   |  2 ++
 test/miscellaneous/Makefile.am  | 12 
 test/miscellaneous/gitignore|  1 +
 test/miscellaneous/odp_api_from_cpp.cpp | 12 
 7 files changed, 47 insertions(+), 3 deletions(-)
 create mode 100644 test/miscellaneous/.gitignore
 create mode 100644 test/miscellaneous/Makefile.am
 create mode 100644 test/miscellaneous/gitignore
 create mode 100644 test/miscellaneous/odp_api_from_cpp.cpp

diff --git a/configure.ac b/configure.ac
index e5c1c56..68841b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,6 +13,8 @@ AM_SILENT_RULES([yes])
 AC_PROG_CC
 AM_PROG_CC_C_O
 
+AC_PROG_CXX
+
 AC_PROG_INSTALL
 AC_PROG_MAKE_SET
 
@@ -114,6 +116,18 @@ AC_ARG_ENABLE([test-perf],
 AM_CONDITIONAL([test_perf], [test x$test_perf = xyes ])
 
 ##
+# Enable/disable test-cpp
+##
+test_cpp=no
+AC_ARG_ENABLE([test-cpp],
+[  --enable-test-cpp   run basic test aginast cpp],
+[if test x$enableval = xyes; then
+test_cpp=yes
+fi])
+
+AM_CONDITIONAL([test_cpp], [test x$test_cpp = xyes ])
+
+##
 # Set optional CUnit path
 ##
 AC_ARG_WITH([cunit-path],
@@ -244,6 +258,7 @@ AC_CONFIG_FILES([Makefile
 test/api_test/Makefile
 test/performance/Makefile
 test/validation/Makefile
+test/miscellaneous/Makefile
 ])
 
 AC_SEARCH_LIBS([timer_create],[rt posix4])
@@ -284,4 +299,5 @@ AC_MSG_RESULT([
cunit:  ${cunit_support}
test_vald:  ${test_vald}
test_perf:  ${test_perf}
+   test_cpp:   ${test_cpp}
 ])
diff --git a/test/Makefile.am b/test/Makefile.am
index ec2b248..2ba8008 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = api_test performance
+SUBDIRS = api_test performance miscellaneous
 
 if cunit_support
 SUBDIRS += validation
diff --git a/test/Makefile.inc b/test/Makefile.inc
index ebee80a..93ead25 100644
--- a/test/Makefile.inc
+++ b/test/Makefile.inc
@@ -2,12 +2,13 @@ include $(top_srcdir)/Makefile.inc
 include $(top_srcdir)/platform/@with_platform@/Makefile.inc
 LIB   = $(top_builddir)/lib
 LDADD = $(LIB)/libodp.la
-AM_CFLAGS += \
-   -I$(srcdir) \
+INCFLAGS = -I$(srcdir) \
-I$(top_srcdir)/test \
-I$(top_srcdir)/platform/@with_platform@/include \
-I$(top_srcdir)/platform/linux-generic/include \
-I$(top_srcdir)/include \
-I$(top_srcdir)/helper/include
+AM_CFLAGS += $(INCFLAGS)
+AM_CXXFLAGS = $(INCFLAGS)
 
 AM_LDFLAGS += -L$(LIB)
diff --git a/test/miscellaneous/.gitignore b/test/miscellaneous/.gitignore
new file mode 100644
index 000..328331d
--- /dev/null
+++ b/test/miscellaneous/.gitignore
@@ -0,0 +1,2 @@
+odp_api_from_cpp
+
diff --git a/test/miscellaneous/Makefile.am b/test/miscellaneous/Makefile.am
new file mode 100644
index 000..110b63c
--- /dev/null
+++ b/test/miscellaneous/Makefile.am
@@ -0,0 +1,12 @@
+include $(top_srcdir)/test/Makefile.inc
+
+if test_cpp
+bin_PROGRAMS =  odp_api_from_cpp
+TESTS = odp_api_from_cpp
+endif
+
+odp_api_from_cpp_CFLAGS = $(AM_CFLAGS)
+
+odp_api_from_cpp_LDFLAGS = $(AM_LDFLAGS) -static
+
+dist_odp_api_from_cpp_SOURCES = odp_api_from_cpp.cpp
diff --git a/test/miscellaneous/gitignore b/test/miscellaneous/gitignore
new file mode 100644
index 000..134df38
--- /dev/null
+++ b/test/miscellaneous/gitignore
@@ -0,0 +1 @@
+odp_api_from_cpp
diff --git a/test/miscellaneous/odp_api_from_cpp.cpp 
b/test/miscellaneous/odp_api_from_cpp.cpp
new file mode 100644
index 000..e62ef8d
--- /dev/null
+++ b/test/miscellaneous/odp_api_from_cpp.cpp
@@ -0,0 +1,12 @@
+#include cstdio
+#include odp.h
+#include odp/helper/linux.h
+
+int main(int argc, const char *argv[])
+{
+
+   printf(\tODP API version: %s\n, odp_version_api_str());
+   printf(\tODP implementation version: %s\n, odp_version_impl_str());
+
+   return 0;
+}
-- 
2.1.0


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


[lng-odp] [PATCHv3 5/5] api: config: simplify packet configuration

2015-02-18 Thread Bill Fischofer
Remove headroom/tailroom from ODP_CONFIG_PACKET_SEG_LEN_MIN and
clarify meaning of ODP_CONFIG_PACKET_SEG_LEN_MAX.

Signed-off-by: Bill Fischofer bill.fischo...@linaro.org
---
 include/odp/api/config.h | 14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/include/odp/api/config.h b/include/odp/api/config.h
index 3ac9e2c..5f211f3 100644
--- a/include/odp/api/config.h
+++ b/include/odp/api/config.h
@@ -95,25 +95,17 @@ extern C {
  * This defines the minimum packet segment buffer length in bytes. The user
  * defined segment length (seg_len in odp_pool_param_t) will be rounded up into
  * this value.
- *
- * @internal In linux-generic implementation:
- * - The value MUST be a multiple of 8.
- * - The value MUST be a multiple of ODP_CACHE_LINE_SIZE
- * - The default value (1664) is large enough to support 1536-byte packets
- *   with the default headroom shown above and is a multiple of both 64 and 
128,
- *   which are the most common cache line sizes.
  */
-#define ODP_CONFIG_PACKET_SEG_LEN_MIN (1664)
+#define ODP_CONFIG_PACKET_SEG_LEN_MIN (1598)
 
 /**
  * Maximum packet segment length
  *
  * This defines the maximum packet segment buffer length in bytes. The user
  * defined segment length (seg_len in odp_pool_param_t) must not be larger than
- * this.
- *
+ * this. A value of 0 indicates no upper limit.
  */
-#define ODP_CONFIG_PACKET_SEG_LEN_MAX ODP_CONFIG_PACKET_SEG_LEN_MIN
+#define ODP_CONFIG_PACKET_SEG_LEN_MAX 0
 
 /**
  * Maximum packet buffer length
-- 
2.1.0


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


[lng-odp] [PATCHv3 4/5] linux-generic: pools: cleanup to reflect new pool parameters

2015-02-18 Thread Bill Fischofer
Signed-off-by: Bill Fischofer bill.fischo...@linaro.org
---
 .../linux-generic/include/odp_buffer_internal.h|  3 -
 platform/linux-generic/include/odp_pool_internal.h |  1 +
 platform/linux-generic/odp_pool.c  | 83 +++---
 3 files changed, 42 insertions(+), 45 deletions(-)

diff --git a/platform/linux-generic/include/odp_buffer_internal.h 
b/platform/linux-generic/include/odp_buffer_internal.h
index c532e35..3a3d2a2 100644
--- a/platform/linux-generic/include/odp_buffer_internal.h
+++ b/platform/linux-generic/include/odp_buffer_internal.h
@@ -53,9 +53,6 @@ extern C {
 _ODP_STATIC_ASSERT(ODP_CONFIG_PACKET_SEG_LEN_MIN = 256,
   ODP Segment size must be a minimum of 256 bytes);
 
-_ODP_STATIC_ASSERT((ODP_CONFIG_PACKET_SEG_LEN_MIN % ODP_CACHE_LINE_SIZE) == 0,
-  ODP Segment size must be a multiple of cache line size);
-
 _ODP_STATIC_ASSERT((ODP_CONFIG_PACKET_BUF_LEN_MAX %
   ODP_CONFIG_PACKET_SEG_LEN_MIN) == 0,
  Packet max size must be a multiple of segment size);
diff --git a/platform/linux-generic/include/odp_pool_internal.h 
b/platform/linux-generic/include/odp_pool_internal.h
index 46c2961..da22abe 100644
--- a/platform/linux-generic/include/odp_pool_internal.h
+++ b/platform/linux-generic/include/odp_pool_internal.h
@@ -119,6 +119,7 @@ struct pool_entry_s {
odp_atomic_u64_tblkempty;
odp_atomic_u64_thigh_wm_count;
odp_atomic_u64_tlow_wm_count;
+   uint32_tbuf_num;
uint32_tseg_size;
uint32_thigh_wm;
uint32_tlow_wm;
diff --git a/platform/linux-generic/odp_pool.c 
b/platform/linux-generic/odp_pool.c
index c07392f..6f56043 100644
--- a/platform/linux-generic/odp_pool.c
+++ b/platform/linux-generic/odp_pool.c
@@ -136,13 +136,9 @@ odp_pool_t odp_pool_create(const char *name,
ODP_CACHE_LINE_SIZE_ROUNDUP(init_params-udata_size) :
0;
 
-   uint32_t blk_size, buf_stride;
-   uint32_t buf_align;
-
-   if (params-type == ODP_POOL_PACKET)
-   buf_align = 0;
-   else
-   buf_align = params-buf.align;
+   uint32_t blk_size, buf_stride, buf_num, seg_len;
+   uint32_t buf_align =
+   params-type == ODP_POOL_BUFFER ? params-buf.align : 0;
 
/* Validate requested buffer alignment */
if (buf_align  ODP_CONFIG_BUFFER_ALIGN_MAX ||
@@ -158,35 +154,42 @@ odp_pool_t odp_pool_create(const char *name,
/* Calculate space needed for buffer blocks and metadata */
switch (params-type) {
case ODP_POOL_BUFFER:
-   case ODP_POOL_TIMEOUT:
+   buf_num  = params-buf.num;
blk_size = params-buf.size;
 
/* Optimize small raw buffers */
if (blk_size  ODP_MAX_INLINE_BUF || params-buf.align != 0)
blk_size = ODP_ALIGN_ROUNDUP(blk_size, buf_align);
 
-   buf_stride = params-type == ODP_POOL_BUFFER ?
-   sizeof(odp_buffer_hdr_stride) :
-   sizeof(odp_timeout_hdr_stride);
+   buf_stride = sizeof(odp_buffer_hdr_stride);
break;
 
case ODP_POOL_PACKET:
+   unseg = 0; /* Packets are always segmented */
headroom = ODP_CONFIG_PACKET_HEADROOM;
tailroom = ODP_CONFIG_PACKET_TAILROOM;
-   unseg = params-pkt.seg_len  ODP_CONFIG_PACKET_BUF_LEN_MAX;
-
-   if (unseg)
-   blk_size = ODP_ALIGN_ROUNDUP(
-   headroom + params-pkt.seg_len + tailroom,
-   buf_align);
-   else
-   blk_size = ODP_ALIGN_ROUNDUP(
-   headroom + params-pkt.seg_len + tailroom,
-   ODP_CONFIG_PACKET_SEG_LEN_MIN);
-
-   buf_stride = params-type == ODP_POOL_PACKET ?
-   sizeof(odp_packet_hdr_stride) :
-   sizeof(odp_any_hdr_stride);
+   buf_num = params-pkt.num;
+
+   seg_len = params-pkt.seg_len == 0 ?
+   ODP_CONFIG_PACKET_SEG_LEN_MIN : params-pkt.seg_len;
+
+   seg_len = ODP_ALIGN_ROUNDUP(
+   headroom + seg_len + tailroom,
+   ODP_CONFIG_BUFFER_ALIGN_MIN);
+
+   blk_size = ODP_ALIGN_ROUNDUP(params-pkt.len, seg_len);
+
+   /* Reject create if pkt.len needs too many segments */
+   if (blk_size / seg_len  ODP_BUFFER_MAX_SEG)
+   return ODP_POOL_INVALID;
+
+   buf_stride = sizeof(odp_packet_hdr_stride);
+   break;
+
+   case ODP_POOL_TIMEOUT:
+   blk_size = 0;
+   buf_num = params-tmo.num;
+   buf_stride = sizeof(odp_timeout_hdr_stride);
break;
 
 

[lng-odp] [PATCHv3 1/5] linux-generic: pools: rename odp_buffer_pool files to odp_pool

2015-02-18 Thread Bill Fischofer
Signed-off-by: Bill Fischofer bill.fischo...@linaro.org
---
 platform/linux-generic/Makefile.am |   4 +-
 .../linux-generic/include/odp_buffer_inlines.h |   2 +-
 .../include/odp_buffer_pool_internal.h | 380 -
 .../include/odp_classification_datamodel.h |   2 +-
 .../linux-generic/include/odp_packet_internal.h|   2 +-
 platform/linux-generic/include/odp_pool_internal.h | 380 +
 .../linux-generic/include/odp_timer_internal.h |   2 +-
 platform/linux-generic/odp_buffer.c|   2 +-
 platform/linux-generic/odp_buffer_pool.c   | 617 -
 platform/linux-generic/odp_classification.c|   2 +-
 platform/linux-generic/odp_pool.c  | 617 +
 platform/linux-generic/odp_queue.c |   2 +-
 platform/linux-generic/odp_timer.c |   2 +-
 13 files changed, 1007 insertions(+), 1007 deletions(-)
 delete mode 100644 platform/linux-generic/include/odp_buffer_pool_internal.h
 create mode 100644 platform/linux-generic/include/odp_pool_internal.h
 delete mode 100644 platform/linux-generic/odp_buffer_pool.c
 create mode 100644 platform/linux-generic/odp_pool.c

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 16adccc..eac8fec 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -105,7 +105,6 @@ noinst_HEADERS = \
  
${top_srcdir}/platform/linux-generic/include/odp_atomic_internal.h \
  
${top_srcdir}/platform/linux-generic/include/odp_buffer_inlines.h \
  
${top_srcdir}/platform/linux-generic/include/odp_buffer_internal.h \
- 
${top_srcdir}/platform/linux-generic/include/odp_buffer_pool_internal.h \
  
${top_srcdir}/platform/linux-generic/include/odp_classification_datamodel.h \
  
${top_srcdir}/platform/linux-generic/include/odp_classification_inlines.h \
  
${top_srcdir}/platform/linux-generic/include/odp_classification_internal.h \
@@ -116,6 +115,7 @@ noinst_HEADERS = \
  
${top_srcdir}/platform/linux-generic/include/odp_packet_io_internal.h \
  
${top_srcdir}/platform/linux-generic/include/odp_packet_io_queue.h \
  
${top_srcdir}/platform/linux-generic/include/odp_packet_socket.h \
+ 
${top_srcdir}/platform/linux-generic/include/odp_pool_internal.h \
  
${top_srcdir}/platform/linux-generic/include/odp_queue_internal.h \
  
${top_srcdir}/platform/linux-generic/include/odp_schedule_internal.h \
  
${top_srcdir}/platform/linux-generic/include/odp_spin_internal.h \
@@ -137,7 +137,6 @@ subdirheaders_HEADERS = \
 __LIB__libodp_la_SOURCES = \
   odp_barrier.c \
   odp_buffer.c \
-  odp_buffer_pool.c \
   odp_classification.c \
   odp_cpumask.c \
   odp_crypto.c \
@@ -150,6 +149,7 @@ __LIB__libodp_la_SOURCES = \
   odp_packet_flags.c \
   odp_packet_io.c \
   odp_packet_socket.c \
+  odp_pool.c \
   odp_queue.c \
   odp_ring.c \
   odp_rwlock.c \
diff --git a/platform/linux-generic/include/odp_buffer_inlines.h 
b/platform/linux-generic/include/odp_buffer_inlines.h
index f6eef3d..3ba3941 100644
--- a/platform/linux-generic/include/odp_buffer_inlines.h
+++ b/platform/linux-generic/include/odp_buffer_inlines.h
@@ -18,7 +18,7 @@ extern C {
 #endif
 
 #include odp_buffer_internal.h
-#include odp_buffer_pool_internal.h
+#include odp_pool_internal.h
 
 static inline odp_buffer_t odp_buffer_encode_handle(odp_buffer_hdr_t *hdr)
 {
diff --git a/platform/linux-generic/include/odp_buffer_pool_internal.h 
b/platform/linux-generic/include/odp_buffer_pool_internal.h
deleted file mode 100644
index c5354e5..000
--- a/platform/linux-generic/include/odp_buffer_pool_internal.h
+++ /dev/null
@@ -1,380 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-/**
- * @file
- *
- * ODP buffer pool - internal header
- */
-
-#ifndef ODP_BUFFER_POOL_INTERNAL_H_
-#define ODP_BUFFER_POOL_INTERNAL_H_
-
-#ifdef __cplusplus
-extern C {
-#endif
-
-#include odp/std_types.h
-#include odp/align.h
-#include odp_align_internal.h
-#include odp/pool.h
-#include odp_buffer_internal.h
-#include odp/hints.h
-#include odp/config.h
-#include odp/debug.h
-#include odp/shared_memory.h
-#include odp/atomic.h
-#include odp_atomic_internal.h
-#include string.h
-
-/**
- * Buffer initialization routine prototype
- *
- * @note Routines of this type MAY be passed as part of the
- * _odp_buffer_pool_init_t structure to be 

[lng-odp] [PATCHv3 2/5] linux-generic: pools: rename odp_buffer_pool_init_global to odp_pool_init_global

2015-02-18 Thread Bill Fischofer
Signed-off-by: Bill Fischofer bill.fischo...@linaro.org
---
 platform/linux-generic/include/odp_internal.h | 2 +-
 platform/linux-generic/odp_init.c | 4 ++--
 platform/linux-generic/odp_pool.c | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index cd1adeb..b250ed6 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -38,7 +38,7 @@ int odp_thread_term_local(void);
 int odp_shm_init_global(void);
 int odp_shm_init_local(void);
 
-int odp_buffer_pool_init_global(void);
+int odp_pool_init_global(void);
 
 int odp_pktio_init_global(void);
 int odp_pktio_init_local(void);
diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index cd8dc46..b00506d 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -37,8 +37,8 @@ int odp_init_global(odp_init_t *params  ODP_UNUSED,
return -1;
}
 
-   if (odp_buffer_pool_init_global()) {
-   ODP_ERR(ODP buffer pool init failed.\n);
+   if (odp_pool_init_global()) {
+   ODP_ERR(ODP pool init failed.\n);
return -1;
}
 
diff --git a/platform/linux-generic/odp_pool.c 
b/platform/linux-generic/odp_pool.c
index 6bcb777..c07392f 100644
--- a/platform/linux-generic/odp_pool.c
+++ b/platform/linux-generic/odp_pool.c
@@ -62,12 +62,12 @@ void *pool_entry_ptr[ODP_CONFIG_POOLS];
 /* Local cache for buffer alloc/free acceleration */
 static __thread local_cache_t local_cache[ODP_CONFIG_POOLS];
 
-int odp_buffer_pool_init_global(void)
+int odp_pool_init_global(void)
 {
uint32_t i;
odp_shm_t shm;
 
-   shm = odp_shm_reserve(odp_buffer_pools,
+   shm = odp_shm_reserve(odp_pools,
  sizeof(pool_table_t),
  sizeof(pool_entry_t), 0);
 
@@ -87,7 +87,7 @@ int odp_buffer_pool_init_global(void)
pool_entry_ptr[i] = pool;
}
 
-   ODP_DBG(\nBuffer pool init global\n);
+   ODP_DBG(\nPool init global\n);
ODP_DBG(  pool_entry_s size %zu\n, sizeof(struct pool_entry_s));
ODP_DBG(  pool_entry_t size %zu\n, sizeof(pool_entry_t));
ODP_DBG(  odp_buffer_hdr_t size %zu\n, sizeof(odp_buffer_hdr_t));
-- 
2.1.0


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


[lng-odp] [PATCHv3 3/5] api: pools: normalize odp_pool_param_t layout

2015-02-18 Thread Bill Fischofer
Remove placeholders and standardize struct parameter layout.

Signed-off-by: Bill Fischofer bill.fischo...@linaro.org
---
 include/odp/api/pool.h | 21 -
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h
index 66dc70e..6fe52fa 100644
--- a/include/odp/api/pool.h
+++ b/include/odp/api/pool.h
@@ -49,6 +49,7 @@ extern C {
 typedef struct odp_pool_param_t {
union {
struct {
+   uint32_t num;   /** Number of buffers in the pool */
uint32_t size;  /** Buffer size in bytes.  The
 maximum number of bytes
 application will store in each
@@ -58,20 +59,11 @@ typedef struct odp_pool_param_t {
 Use 0 for default alignment.
 Default will always be a multiple
 of 8. */
-   uint32_t num;   /** Number of buffers in the pool */
} buf;
struct {
-   uint32_t seg_len;   /** Minimum number of packet data
-bytes that are stored in the
-first segment of a packet.
-The maximum value is defined by
-ODP_CONFIG_PACKET_SEG_LEN_MAX.
-Use 0 for default. */
-   uint32_t __res1;/* Keep struct identical to buf,
-  until implementation is fixed */
uint32_t num;   /** The number of packets that the
 pool must provide that are
-packet lenght 'len' bytes or
+packet length 'len' bytes or
 smaller. */
uint32_t len;   /** Minimum packet length that the
 pool must provide 'num'
@@ -80,16 +72,19 @@ typedef struct odp_pool_param_t {
 packets are larger than 'len'.
 Use 0 for default.
 */
+   uint32_t seg_len;   /** Minimum number of packet data
+bytes that are stored in the
+first segment of a packet.
+The maximum value is defined by
+ODP_CONFIG_PACKET_SEG_LEN_MAX.
+Use 0 for default. */
} pkt;
struct {
-   uint32_t __res1; /* Keep struct identical to buf, */
-   uint32_t __res2; /* until pool implementation is fixed*/
uint32_t num;/** Number of timeouts in the pool */
} tmo;
};
 
int type;  /** Pool type */
-
 } odp_pool_param_t;
 
 /** Packet pool*/
-- 
2.1.0


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


Re: [lng-odp] [PATCH V2] api: timer: Don't use private as struct member name (C++)

2015-02-18 Thread Bill Fischofer
On Wed, Feb 18, 2015 at 11:36 AM, Mike Holmes mike.hol...@linaro.org
wrote:

 From: Simon Kagstrom simon.kagst...@netinsight.net

 Signed-off-by: Simon Kagstrom simon.kagst...@netinsight.net
 Signed-off-by: Mike Holmes mike.hol...@linaro.org


Reviewed-by: Bill Fischofer bill.fischo...@linaro.org


 ---

V2
 Fixed compile

  example/timer/odp_timer_test.c | 2 +-
  include/odp/api/timer.h| 2 +-
  test/validation/odp_timer.c| 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)

 diff --git a/example/timer/odp_timer_test.c
 b/example/timer/odp_timer_test.c
 index fbadf8c..6b60ec4 100644
 --- a/example/timer/odp_timer_test.c
 +++ b/example/timer/odp_timer_test.c
 @@ -387,7 +387,7 @@ int main(int argc, char *argv[])
 tparams.min_tmo = args.min_us*ODP_TIME_USEC;
 tparams.max_tmo = args.max_us*ODP_TIME_USEC;
 tparams.num_timers = num_workers; /* One timer per worker */
 -   tparams.private = 0; /* Shared */
 +   tparams.priv = 0; /* Shared */
 tparams.clk_src = ODP_CLOCK_CPU;
 tp = odp_timer_pool_create(timer_pool, tparams);
 if (tp == ODP_TIMER_POOL_INVALID) {
 diff --git a/include/odp/api/timer.h b/include/odp/api/timer.h
 index 5b1490e..0dc9415 100644
 --- a/include/odp/api/timer.h
 +++ b/include/odp/api/timer.h
 @@ -100,7 +100,7 @@ typedef struct {
 uint64_t min_tmo; /** Minimum relative timeout in nanoseconds */
 uint64_t max_tmo; /** Maximum relative timeout in nanoseconds */
 uint32_t num_timers; /** (Minimum) number of supported timers */
 -   int private; /** Shared (false) or private (true) timer pool */
 +   int priv; /** Shared (false) or private (true) timer pool */
 odp_timer_clk_src_t clk_src; /** Clock source for timers */
  } odp_timer_pool_param_t;

 diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c
 index 57db959..b24c2c5 100644
 --- a/test/validation/odp_timer.c
 +++ b/test/validation/odp_timer.c
 @@ -294,7 +294,7 @@ static void test_odp_timer_all(void)
 tparam.min_tmo = MIN;
 tparam.max_tmo = MAX;
 tparam.num_timers = num_workers * NTIMERS;
 -   tparam.private = 0;
 +   tparam.priv = 0;
 tparam.clk_src = ODP_CLOCK_CPU;
 tp = odp_timer_pool_create(NAME, tparam);
 if (tp == ODP_TIMER_POOL_INVALID)
 --
 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


Re: [lng-odp] [PATCH 2/2] test: Add compile-under-C++ test (currently failing)

2015-02-18 Thread Simon Kågström
On 2015-02-16 14:00, Maxim Uvarov wrote:
 On 02/13/2015 02:37 PM, Simon Kagstrom wrote:
 To make the C++ test more complete, it should include a larger set of
 the header files. I just saw that including odp/helper/eth.h will
 trigger another C++ build failure (with _Static_assert, can be replaced
 with static_assert() for C++ code).

 In my eyes, a C++-clean API should be a blocker for 1.0. It's not
 difficult to fix, and having it in the CI infrastructure means that
 it will stay fixed :-)

 That is interesting. You might be first person who links odp with C++
 application.
 Simon would you like to do clean up and test for C++ and send it to
 mailing list?

I can forward-port my minimal C++ test suite when the api_tests have
been moved, but I'm not familiar enough with ODP to fix all the build
issues.

// Simon


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


Re: [lng-odp] [PATCHv2 3/4] api: pools: normalize odp_pool_param_t layout

2015-02-18 Thread Bill Fischofer
That would make trying to create an that contains any structs ABI
problematic, however I'm not sure it's relevant here since v1.0 only has an
API and each compiler will be consistent with itself. in its choice of
mappings.

On Wed, Feb 18, 2015 at 2:00 AM, Savolainen, Petri (NSN - FI/Espoo) 
petri.savolai...@nsn.com wrote:

  Structure alignment and padding is compiler specific. I remember seeing
 compiler aligning all structs into 8-byte alignment, also when all members
 are 8 bytes.



 -Petri







 *From:* ext Bill Fischofer [mailto:bill.fischo...@linaro.org]
 *Sent:* Tuesday, February 17, 2015 8:44 PM
 *To:* Savolainen, Petri (NSN - FI/Espoo)
 *Cc:* lng-odp@lists.linaro.org
 *Subject:* Re: [lng-odp] [PATCHv2 3/4] api: pools: normalize
 odp_pool_param_t layout



 V1 had it this way but I changed that in V2 to put type first as the rest
 is a variable-length structure (depending on type) so it seemed to make
 more sense to have the key for decoding the rest first.  Alignment is not
 an issue here.  It's not a may have since the actual structure layouts
 we're defining here are part of the ODP API and are not subject to
 per-implementation differences.



 On Tue, Feb 17, 2015 at 7:32 PM, Savolainen, Petri (NSN - FI/Espoo) 
 petri.savolai...@nsn.com wrote:



  -Original Message-
  From: lng-odp-boun...@lists.linaro.org [mailto:lng-odp-
  boun...@lists.linaro.org] On Behalf Of ext Bill Fischofer
  Sent: Saturday, February 14, 2015 1:14 AM
  To: lng-odp@lists.linaro.org
  Subject: [lng-odp] [PATCHv2 3/4] api: pools: normalize odp_pool_param_t
  layout
 
  Signed-off-by: Bill Fischofer bill.fischo...@linaro.org
  ---
   include/odp/api/pool.h | 24 +---
   1 file changed, 9 insertions(+), 15 deletions(-)
 
  diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h
  index 66dc70e..b15ddd5 100644
  --- a/include/odp/api/pool.h
  +++ b/include/odp/api/pool.h
  @@ -47,8 +47,10 @@ extern C {
* Used to communicate pool creation options.
*/
   typedef struct odp_pool_param_t {
  + int type;  /** Pool type */

 A minor thing. I'd keep type after the union in this struct. The
 union may have larger alignment requirement than int (depending on
 compiler)
 and in that case would force padding here (between int and union).

 Otherwise OK.

 -Petri



union {
struct {
  + uint32_t num;   /** Number of buffers in the pool
 */
uint32_t size;  /** Buffer size in bytes.  The
 maximum number of bytes
 application will store in each
  @@ -58,20 +60,11 @@ typedef struct odp_pool_param_t {
 Use 0 for default alignment.
 Default will always be a
 multiple
 of 8. */
  - uint32_t num;   /** Number of buffers in the pool
 */
} buf;
struct {
  - uint32_t seg_len;   /** Minimum number of packet
 data
  -  bytes that are stored in
 the
  -  first segment of a packet.
  -  The maximum value is
 defined by
  -
 ODP_CONFIG_PACKET_SEG_LEN_MAX.
  -  Use 0 for default. */
  - uint32_t __res1;/* Keep struct identical to
 buf,
  -until implementation is
 fixed */
uint32_t num;   /** The number of packets
 that the
 pool must provide that are
  -  packet lenght 'len' bytes
 or
  +  packet length 'len' bytes
 or
 smaller. */
uint32_t len;   /** Minimum packet length
 that the
 pool must provide 'num'
  @@ -80,16 +73,17 @@ typedef struct odp_pool_param_t {
 packets are larger than
 'len'.
 Use 0 for default.
 */
  + uint32_t seg_len;   /** Minimum number of packet
 data
  +  bytes that are stored in
 the
  +  first segment of a packet.
  +  The maximum value is
 defined by
  +
 ODP_CONFIG_PACKET_SEG_LEN_MAX.
  +  Use 0 for default. */
} pkt;
struct {
  - uint32_t __res1; /* Keep struct identical to buf,
 */
  - uint32_t 

[lng-odp] [Bug 1224] CID 87297: Integer handling issues

2015-02-18 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1224

Bala Manoharan bala.manoha...@linaro.org changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|UNCONFIRMED |RESOLVED

--- Comment #10 from Bala Manoharan bala.manoha...@linaro.org ---
This is a false positive issue and the bug is in Coverity.

-- 
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


[lng-odp] [Bug 1231] Classification Validation: Incorrect ipv4 checksum update

2015-02-18 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1231

Ola Liljedahl ola.liljed...@linaro.org changed:

   What|Removed |Added

 CC||ola.liljed...@linaro.org

--- Comment #2 from Ola Liljedahl ola.liljed...@linaro.org ---
Could be useful to provide a link to the patch on patches.linaro.org.

-- 
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


[lng-odp] odp_generator example

2015-02-18 Thread Ola Liljedahl
The odp_generator example uses sleep and usleep system calls to block
periodically. There is an idea to replace this with use of the ODP
timer.

The code could request timeouts for the same amount of time as
specified in the sleep and usleep calls. In order to achieve the
blocking behavior, we would have to invoke odp_schedule() from the TX
thread. But odp_schedule is already used from the RX thread in order
to receive packets. But as we currently only support global
scheduling, RX and TX threads would randomly receive packets and
timeouts (they would all schedule from the same shared set of queues).
We would need local scheduling where a subset of queues could be
associated with the RX thread(s) and another subset of queues
associated with the TX thread(s).

With global scheduling, we cannot separate some threads for RX
processing and other for TX processing. All threads will receive and
process all types of events. Doing this amounts to a redesign of the
generator example and I am not sure we want to do this.

The alternative is to let the TX threads use polled queues for the
timeouts. We would have to achieve blocking behavior by busy waiting
in the application. This would be the least intrusive modification. Is
this OK?

Hopefully I can get my rfc2544 generator/benchmark running with ODP
and using only scheduled queues and no separation between RX and TX
threads. That would show the proper use of the ODP API.

-- Ola

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


Re: [lng-odp] [PATCH v2] api: scheduler: atomic and ordered definitions

2015-02-18 Thread Ola Liljedahl
On 18 February 2015 at 14:38, Petri Savolainen
petri.savolai...@linaro.org wrote:
 Improved documentation and definition of atomic and ordered
 queue synchronisation.

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

 ---
 This is the ordered queue definition (in patch format) promised
 in the call yesterday.
 ---
  include/odp/api/queue.h| 25 +++--
  include/odp/api/schedule.h | 15 ---
  2 files changed, 35 insertions(+), 5 deletions(-)

 diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h
 index 9519edf..85b0fd7 100644
 --- a/include/odp/api/queue.h
 +++ b/include/odp/api/queue.h
 @@ -104,16 +104,37 @@ extern C {
  /**
   * @def ODP_SCHED_SYNC_NONE
   * Queue not synchronised
 + *
 + * The scheduler does not provide event synchronisation or ordering, only 
 load
 + * balancing. Events can be scheduled freely to multiple threads for 
 concurrent
 + * processing.
   */

  /**
   * @def ODP_SCHED_SYNC_ATOMIC
 - * Atomic queue
 + * Atomic queue synchronisation
 + *
 + * Events from an atomic queue can be scheduled only to a single thread at a
 + * time. The thread is guaranteed to have exclusive (atomic) access to the
 + * associated queue context and event ordering is maintained. This enables 
 the
 + * user to avoid SW synchronisation for the same.
for the same should be dropped, I wrote this in a follow up message.

 + *
 + * The atomic queue is dedicated to the thread until it requests another 
 event
 + * from the scheduler (which implicitly releases the queue) or calls
 + * odp_schedule_release_atomic(), which allows the scheduler to release the
 + * queue immediately.
   */

  /**
   * @def ODP_SCHED_SYNC_ORDERED
 - * Ordered queue
 + * Ordered queue synchronisation
 + *
 + * Events from an ordered queue can be scheduled to multiple threads for
 + * concurrent processing. The source queue (dequeue) ordering is maintained 
 when
 + * events are enqueued to their destination queue(s) before another schedule
 + * call. Events from the same (source) queue appear in their original order
 + * when dequeued from a destination queue. The destination queue type or
 + * synchronisation is not limited.
I commented on is not limited, the sentence seems truncated. I don't
know if I suggested some other wording but one could write is of no
consequence.


   */

  /**
 diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h
 index 5c08357..3bf0578 100644
 --- a/include/odp/api/schedule.h
 +++ b/include/odp/api/schedule.h
 @@ -93,9 +93,9 @@ int odp_schedule_multi(odp_queue_t *from, uint64_t wait, 
 odp_event_t events[],
   * Pause scheduling
   *
   * Pause global scheduling for this thread. After this call, all schedule 
 calls
 - * will return only locally reserved buffers (if any). User can exit the
 + * will return only locally pre-scheduled events (if any). User can exit the
   * schedule loop only after the schedule function indicates that there's no 
 more
 - * buffers (no more locally reserved buffers).
 + * (pre-scheduled) events.
   *
   * Must be used with odp_schedule() and odp_schedule_multi() before exiting 
 (or
   * stalling) the schedule loop.
 @@ -111,7 +111,16 @@ void odp_schedule_pause(void);
  void odp_schedule_resume(void);

  /**
 - * Release currently hold atomic context
 + * Release the current atomic context
 + *
 + * This call is valid only for source queues with atomic synchronisation. It
 + * hints the scheduler that the user has completed processing of the critical
 + * section (which depends on the atomic synchronisation). The scheduler is 
 now
 + * allowed to schedule events from the same queue to some other thread.
 + *
 + * Early atomic context release may increase parallelism and thus system
 + * performance, but user needs to design carefully the split into critical 
 vs.
 + * non-critical sections.
   */
  void odp_schedule_release_atomic(void);

 --
 2.3.0


 ___
 lng-odp mailing list
 lng-odp@lists.linaro.org
 http://lists.linaro.org/mailman/listinfo/lng-odp
Otherwise I am OK with the wording. I haven't tested the patch (i.e.
merged it and compiled).

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


Re: [lng-odp] [PATCH 2/2] test: Add compile-under-C++ test (currently failing)

2015-02-18 Thread Simon Kågström
(I don't remember if I actually sent this messages, sorry if it's a
duplicate!)

On 2015-02-16 14:00, Maxim Uvarov wrote:
 On 02/13/2015 02:37 PM, Simon Kagstrom wrote:
 To make the C++ test more complete, it should include a larger set of
 the header files. I just saw that including odp/helper/eth.h will
 trigger another C++ build failure (with _Static_assert, can be replaced
 with static_assert() for C++ code).

 In my eyes, a C++-clean API should be a blocker for 1.0. It's not
 difficult to fix, and having it in the CI infrastructure means that
 it will stay fixed :-)

 That is interesting. You might be first person who links odp with C++
 application.
 Simon would you like to do clean up and test for C++ and send it to
 mailing list?

I can forward-port my minimal C++ test suite when the api_tests have
been moved, but I'm not familiar enough with ODP to fix all the build
issues.

// Simon


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


Re: [lng-odp] [PATCH 2/2] test: Add compile-under-C++ test (currently failing)

2015-02-18 Thread Maxim Uvarov

On 02/18/2015 05:31 PM, Simon Kågström wrote:

(I don't remember if I actually sent this messages, sorry if it's a
duplicate!)

On 2015-02-16 14:00, Maxim Uvarov wrote:

On 02/13/2015 02:37 PM, Simon Kagstrom wrote:

To make the C++ test more complete, it should include a larger set of
the header files. I just saw that including odp/helper/eth.h will
trigger another C++ build failure (with _Static_assert, can be replaced
with static_assert() for C++ code).

In my eyes, a C++-clean API should be a blocker for 1.0. It's not
difficult to fix, and having it in the CI infrastructure means that
it will stay fixed :-)


That is interesting. You might be first person who links odp with C++
application.
Simon would you like to do clean up and test for C++ and send it to
mailing list?

I can forward-port my minimal C++ test suite when the api_tests have
been moved, but I'm not familiar enough with ODP to fix all the build
issues.

// Simon

That is ok.



___
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 1/2] api: scheduler: atomic and ordered definitions

2015-02-18 Thread Bill Fischofer
+1 for Ola's suggested wording, except the last.  The wording to design
carefully is grammatically correct English.  The alternative to carefully
design although common is technically a split infinitive which is
considered incorrect.

Bill

On Tue, Feb 17, 2015 at 8:51 AM, Ola Liljedahl ola.liljed...@linaro.org
wrote:

 On 17 February 2015 at 15:49, Ola Liljedahl ola.liljed...@linaro.org
 wrote:
  On 17 February 2015 at 11:49, Petri Savolainen
  petri.savolai...@linaro.org wrote:
  Improved documentation and definition of atomic and ordered
  queue synchronisation.
 
  Signed-off-by: Petri Savolainen petri.savolai...@linaro.org
 
  ---
  This is the ordered queue definition (in patch format) promised
  in the call yesterday.
  ---
   include/odp/api/queue.h| 21 +++--
   include/odp/api/schedule.h | 15 ---
   2 files changed, 31 insertions(+), 5 deletions(-)
 
  diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h
  index 9519edf..1d67a3c 100644
  --- a/include/odp/api/queue.h
  +++ b/include/odp/api/queue.h
  @@ -108,12 +108,29 @@ extern C {
 
   /**
* @def ODP_SCHED_SYNC_ATOMIC
  - * Atomic queue
  + * Atomic queue synchronisation
  + *
  + * Events from an atomic queue can be scheduled only to a single
 thread at a
  I question the use of schedule to, is this really proper language?
  Events are scheduled but the events selected are then 'dispatched' to a
 thread.
  Suggestion: Events from an atomic queue can be dispatched only to a
  single thread at a time, this  avoids .
 Should have been: Events from an atomic queue can be dispatched only
 to a single thread at a time.
 The avoid stuff is below.

 
  + * time. This quarantees atomic access to the queue context and
 maintains event
  Spelling error, should be guarantees.
  Suggestion: Atomic scheduling provides mutual exclusion and atomic
  access to the associated queue context and maintains event ordering.
  This enables the user to avoid synchronization and event reordering in
  software.
 
  + * ordering, which helps the user to avoid SW locking.
  + *
  + * The atomic queue is dedicated to the thread until it requests
 another event
  Suggestion: The selected atomic queue is dedicated to the thread
  until the thread requests another event from the scheduler (which
  implicitly releases the queue) or the thread calls
  odp_schedule_release_atomic() (which allows the scheduler to release
  the queue immediately).
 
  + * from the scheduler (implicitly requests to release the current
 queue) or
  + * calls odp_schedule_release_atomic(), which hints the scheduler to
 release the
  + * queue early.
*/
 
   /**
* @def ODP_SCHED_SYNC_ORDERED
  - * Ordered queue
  + * Ordered queue synchronisation
  + *
  + * Events from an ordered queue can be scheduled to multiple threads
 for
  + * parallel processing.
  The phrase parallel processing indicates that *one* piece of work is
  being processed in parallel by multiple processors. But we are not
  talking about one event being processed in parallel, it is different
  events (from the same queue) that may be processed concurrently (by
  different processors). It's borderline but I suggest we avoid the use
  of parallel in order to minimize the risk for confusion.
 
  Suggestion: Events from an ordered queue can be scheduled and
  dispatched to multiple threads for concurrent processing.
 
  The original enqueue order of the source queue is
  Isn't it the event dequeue order of the source queue that is being
  maintained? Yes this might be the same as the enqueue order to the
  source queue (since queues supposedly are FIFO) but if enqueueing is
  done from another ordered queue, threads may call odp_queue_enq() in a
  different order and the events will be reordered. It is this enqueue
  order the software sees but it is not this order ordered queues are
  maintaining.
 
  Suggestion: The (dequeue) event order of the source queue is
  maintained when events are enqueued to their destination queue(s)
  (before another call to the scheduler). Maybe drop the parentheses
  from the last phrase.
 
  + * maintained when events are enqueued to their destination queue(s)
 before
  + * another schedule call. Events from the same (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.
  What about packet input and packet output queues?
 
  Suggestion: The destination queue type (polled, scheduled or packet
  input/output) or synchronization model (none, ordered or atomic) is of
  no concern.
 
*/
 
   /**
  diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h
  index 5c08357..378ca19 100644
  --- a/include/odp/api/schedule.h
  +++ b/include/odp/api/schedule.h
  @@ -93,9 +93,9 @@ int odp_schedule_multi(odp_queue_t *from, uint64_t
 wait, odp_event_t events[],
* Pause scheduling
*
* Pause 

[lng-odp] Fwd: [PATCH v1] validation: classification: fix incorrect ipv4 checksum update

2015-02-18 Thread Balasubramanian Manoharan

Ping


 Forwarded Message 
Subject: 	[PATCH v1] validation: classification: fix incorrect ipv4 
checksum update

Date:   Fri, 13 Feb 2015 15:31:56 +0800
From:   bala.manoha...@linaro.org
To: lng-odp@lists.linaro.org
CC: Balasubramanian Manoharan bala.manoha...@linaro.org



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

Fixes an issue where ipv4 checksum field was not updated after modifying the src
addr of the packet.

Signed-off-by: Balasubramanian Manoharan bala.manoha...@linaro.org
---
 test/validation/classification/odp_classification_tests.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/test/validation/classification/odp_classification_tests.c 
b/test/validation/classification/odp_classification_tests.c
index 45822d3..a47ad1f 100644
--- a/test/validation/classification/odp_classification_tests.c
+++ b/test/validation/classification/odp_classification_tests.c
@@ -221,7 +221,7 @@ odp_packet_t create_packet(bool vlan)
seqno = odp_atomic_fetch_inc_u32(seq);
ip-id = odp_cpu_to_be_16(seqno);
ip-chksum = 0;
-   odph_ipv4_csum_update(pkt);
+   ip-chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));
offset += ODPH_IPV4HDR_LEN;
 
 	/* udp */

@@ -403,6 +403,9 @@ void test_cls_pmr_chain(void)
ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
parse_ipv4_string(CLS_PMR_CHAIN_SADDR, addr, mask);
ip-src_addr = odp_cpu_to_be_32(addr);
+   ip-chksum = 0;
+   ip-chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));
+
udp = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL);
udp-src_port = odp_cpu_to_be_16(CLS_PMR_CHAIN_SPORT);
 
@@ -418,6 +421,8 @@ void test_cls_pmr_chain(void)

ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
parse_ipv4_string(CLS_PMR_CHAIN_SADDR, addr, mask);
ip-src_addr = odp_cpu_to_be_32(addr);
+   ip-chksum = 0;
+   ip-chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));
 
 	enqueue_loop_interface(pkt);

pkt = receive_packet(queue, ODP_TIME_SEC);
@@ -728,6 +733,9 @@ void test_pktio_pmr_match_set_cos(void)
ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
parse_ipv4_string(CLS_PMR_SET_SADDR, addr, mask);
ip-src_addr = odp_cpu_to_be_32(addr);
+   ip-chksum = 0;
+   ip-chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));
+
udp = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL);
udp-src_port = odp_cpu_to_be_16(CLS_PMR_SET_SPORT);
enqueue_loop_interface(pkt);
--
2.0.1.472.g6f92e5f



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


Re: [lng-odp] [PATCHv2 3/4] api: pools: normalize odp_pool_param_t layout

2015-02-18 Thread Ola Liljedahl
On 18 February 2015 at 12:56, Bill Fischofer bill.fischo...@linaro.org wrote:
 That would make trying to create an that contains any structs ABI
 problematic, however I'm not sure it's relevant here since v1.0 only has an
 API and each compiler will be consistent with itself. in its choice of
 mappings.
When is the ODP deb package supposed to come live? With the deb
package, you have no idea how the ODP library was built.

And what's in the deb package? Header files + linux-generic?

Maybe we should only have deb source packages.


 On Wed, Feb 18, 2015 at 2:00 AM, Savolainen, Petri (NSN - FI/Espoo)
 petri.savolai...@nsn.com wrote:

 Structure alignment and padding is compiler specific. I remember seeing
 compiler aligning all structs into 8-byte alignment, also when all members
 are 8 bytes.



 -Petri







 From: ext Bill Fischofer [mailto:bill.fischo...@linaro.org]
 Sent: Tuesday, February 17, 2015 8:44 PM
 To: Savolainen, Petri (NSN - FI/Espoo)
 Cc: lng-odp@lists.linaro.org
 Subject: Re: [lng-odp] [PATCHv2 3/4] api: pools: normalize
 odp_pool_param_t layout



 V1 had it this way but I changed that in V2 to put type first as the rest
 is a variable-length structure (depending on type) so it seemed to make more
 sense to have the key for decoding the rest first.  Alignment is not an
 issue here.  It's not a may have since the actual structure layouts we're
 defining here are part of the ODP API and are not subject to
 per-implementation differences.



 On Tue, Feb 17, 2015 at 7:32 PM, Savolainen, Petri (NSN - FI/Espoo)
 petri.savolai...@nsn.com wrote:



  -Original Message-
  From: lng-odp-boun...@lists.linaro.org [mailto:lng-odp-
  boun...@lists.linaro.org] On Behalf Of ext Bill Fischofer
  Sent: Saturday, February 14, 2015 1:14 AM
  To: lng-odp@lists.linaro.org
  Subject: [lng-odp] [PATCHv2 3/4] api: pools: normalize odp_pool_param_t
  layout
 
  Signed-off-by: Bill Fischofer bill.fischo...@linaro.org
  ---
   include/odp/api/pool.h | 24 +---
   1 file changed, 9 insertions(+), 15 deletions(-)
 
  diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h
  index 66dc70e..b15ddd5 100644
  --- a/include/odp/api/pool.h
  +++ b/include/odp/api/pool.h
  @@ -47,8 +47,10 @@ extern C {
* Used to communicate pool creation options.
*/
   typedef struct odp_pool_param_t {
  + int type;  /** Pool type */

 A minor thing. I'd keep type after the union in this struct. The
 union may have larger alignment requirement than int (depending on
 compiler)
 and in that case would force padding here (between int and union).

 Otherwise OK.

 -Petri



union {
struct {
  + uint32_t num;   /** Number of buffers in the pool
  */
uint32_t size;  /** Buffer size in bytes.  The
 maximum number of bytes
 application will store in
  each
  @@ -58,20 +60,11 @@ typedef struct odp_pool_param_t {
 Use 0 for default alignment.
 Default will always be a
  multiple
 of 8. */
  - uint32_t num;   /** Number of buffers in the pool
  */
} buf;
struct {
  - uint32_t seg_len;   /** Minimum number of packet
  data
  -  bytes that are stored in
  the
  -  first segment of a
  packet.
  -  The maximum value is
  defined by
  -
  ODP_CONFIG_PACKET_SEG_LEN_MAX.
  -  Use 0 for default. */
  - uint32_t __res1;/* Keep struct identical to
  buf,
  -until implementation is
  fixed */
uint32_t num;   /** The number of packets
  that the
 pool must provide that
  are
  -  packet lenght 'len' bytes
  or
  +  packet length 'len' bytes
  or
 smaller. */
uint32_t len;   /** Minimum packet length
  that the
 pool must provide 'num'
  @@ -80,16 +73,17 @@ typedef struct odp_pool_param_t {
 packets are larger than
  'len'.
 Use 0 for default.
 */
  + uint32_t seg_len;   /** Minimum number of packet
  data
  +  bytes that are stored in
  the
  +  first segment of a
  packet.
  +  

Re: [lng-odp] Fwd: [PATCH v1] validation: classification: fix incorrect ipv4 checksum update

2015-02-18 Thread Mike Holmes
Thanks, can you put the URL to the bug in the body of the patch

https://bugs.linaro.org/show_bug.cgi?id=1231



On 18 February 2015 at 09:07, Balasubramanian Manoharan 
bala.manoha...@linaro.org wrote:


 On 18/02/15 7:16 pm, Mike Holmes wrote:

 Bala does this fix a specific bug in bugzilla ?

  Is there a unit test that I can run to see this fixes the issue ?

 This patch fixes the following Bug:
 Bug 1231 https://bugs.linaro.org/show_bug.cgi?id=1231 - Classification
 Validation: Incorrect ipv4 checksum update.


 On 18 February 2015 at 08:02, Balasubramanian Manoharan 
 bala.manoha...@linaro.org wrote:

  Ping


  Forwarded Message   Subject: [PATCH v1] validation:
 classification: fix incorrect ipv4 checksum update  Date: Fri, 13 Feb
 2015 15:31:56 +0800  From: bala.manoha...@linaro.org  To:
 lng-odp@lists.linaro.org  CC: Balasubramanian Manoharan
 bala.manoha...@linaro.org bala.manoha...@linaro.org


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

 Fixes an issue where ipv4 checksum field was not updated after modifying the 
 src
 addr of the packet.

 Signed-off-by: Balasubramanian Manoharan bala.manoha...@linaro.org 
 bala.manoha...@linaro.org
 ---
  test/validation/classification/odp_classification_tests.c | 10 +-
  1 file changed, 9 insertions(+), 1 deletion(-)

 diff --git a/test/validation/classification/odp_classification_tests.c 
 b/test/validation/classification/odp_classification_tests.c
 index 45822d3..a47ad1f 100644
 --- a/test/validation/classification/odp_classification_tests.c
 +++ b/test/validation/classification/odp_classification_tests.c
 @@ -221,7 +221,7 @@ odp_packet_t create_packet(bool vlan)
  seqno = odp_atomic_fetch_inc_u32(seq);
  ip-id = odp_cpu_to_be_16(seqno);
  ip-chksum = 0;
 -odph_ipv4_csum_update(pkt);
 +ip-chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));
  offset += ODPH_IPV4HDR_LEN;

  /* udp */
 @@ -403,6 +403,9 @@ void test_cls_pmr_chain(void)
  ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
  parse_ipv4_string(CLS_PMR_CHAIN_SADDR, addr, mask);
  ip-src_addr = odp_cpu_to_be_32(addr);
 +ip-chksum = 0;
 +ip-chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));
 +
  udp = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL);
  udp-src_port = odp_cpu_to_be_16(CLS_PMR_CHAIN_SPORT);

 @@ -418,6 +421,8 @@ void test_cls_pmr_chain(void)
  ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
  parse_ipv4_string(CLS_PMR_CHAIN_SADDR, addr, mask);
  ip-src_addr = odp_cpu_to_be_32(addr);
 +ip-chksum = 0;
 +ip-chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));

  enqueue_loop_interface(pkt);
  pkt = receive_packet(queue, ODP_TIME_SEC);
 @@ -728,6 +733,9 @@ void test_pktio_pmr_match_set_cos(void)
  ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
  parse_ipv4_string(CLS_PMR_SET_SADDR, addr, mask);
  ip-src_addr = odp_cpu_to_be_32(addr);
 +ip-chksum = 0;
 +ip-chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));
 +
  udp = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL);
  udp-src_port = odp_cpu_to_be_16(CLS_PMR_SET_SPORT);
  enqueue_loop_interface(pkt);
 --
 2.0.1.472.g6f92e5f





 ___
 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





-- 
*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] Fwd: [PATCH v1] validation: classification: fix incorrect ipv4 checksum update

2015-02-18 Thread Mike Holmes
Bala does this fix a specific bug in bugzilla ?

Is there a unit test that I can run to see this fixes the issue ?

On 18 February 2015 at 08:02, Balasubramanian Manoharan 
bala.manoha...@linaro.org wrote:

  Ping


  Forwarded Message   Subject: [PATCH v1] validation:
 classification: fix incorrect ipv4 checksum update  Date: Fri, 13 Feb
 2015 15:31:56 +0800  From: bala.manoha...@linaro.org  To:
 lng-odp@lists.linaro.org  CC: Balasubramanian Manoharan
 bala.manoha...@linaro.org bala.manoha...@linaro.org


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

 Fixes an issue where ipv4 checksum field was not updated after modifying the 
 src
 addr of the packet.

 Signed-off-by: Balasubramanian Manoharan bala.manoha...@linaro.org 
 bala.manoha...@linaro.org
 ---
  test/validation/classification/odp_classification_tests.c | 10 +-
  1 file changed, 9 insertions(+), 1 deletion(-)

 diff --git a/test/validation/classification/odp_classification_tests.c 
 b/test/validation/classification/odp_classification_tests.c
 index 45822d3..a47ad1f 100644
 --- a/test/validation/classification/odp_classification_tests.c
 +++ b/test/validation/classification/odp_classification_tests.c
 @@ -221,7 +221,7 @@ odp_packet_t create_packet(bool vlan)
   seqno = odp_atomic_fetch_inc_u32(seq);
   ip-id = odp_cpu_to_be_16(seqno);
   ip-chksum = 0;
 - odph_ipv4_csum_update(pkt);
 + ip-chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));
   offset += ODPH_IPV4HDR_LEN;

   /* udp */
 @@ -403,6 +403,9 @@ void test_cls_pmr_chain(void)
   ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
   parse_ipv4_string(CLS_PMR_CHAIN_SADDR, addr, mask);
   ip-src_addr = odp_cpu_to_be_32(addr);
 + ip-chksum = 0;
 + ip-chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));
 +
   udp = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL);
   udp-src_port = odp_cpu_to_be_16(CLS_PMR_CHAIN_SPORT);

 @@ -418,6 +421,8 @@ void test_cls_pmr_chain(void)
   ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
   parse_ipv4_string(CLS_PMR_CHAIN_SADDR, addr, mask);
   ip-src_addr = odp_cpu_to_be_32(addr);
 + ip-chksum = 0;
 + ip-chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));

   enqueue_loop_interface(pkt);
   pkt = receive_packet(queue, ODP_TIME_SEC);
 @@ -728,6 +733,9 @@ void test_pktio_pmr_match_set_cos(void)
   ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
   parse_ipv4_string(CLS_PMR_SET_SADDR, addr, mask);
   ip-src_addr = odp_cpu_to_be_32(addr);
 + ip-chksum = 0;
 + ip-chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));
 +
   udp = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL);
   udp-src_port = odp_cpu_to_be_16(CLS_PMR_SET_SPORT);
   enqueue_loop_interface(pkt);
 --
 2.0.1.472.g6f92e5f





 ___
 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 v2 00/10] add global and local termination

2015-02-18 Thread Robbie King (robking)
Hey Mike (and everyone else),

I noticed this code is replicated throughout the patch:

cos_shm = odp_shm_lookup(shm_odp_cos_tbl);
if (cos_shm == ODP_SHM_INVALID)
return -1;
ret = odp_shm_free(cos_shm);

As I was looking to make the changes we discussed (continue
on versus returning -1) it seemed instead of replicating
even more code it would be better to have some cleaner way
of doing this.

One possibility is to simply nest the calls (shm_free just
returns -1 if passed SHM_INVALID).

  ret = odp_shm_free(odp_shm_lookup(shm_odp_cos_tbl));

Another option is to create a helper function, something like:

  ret = odp_shm_free_by_name(shm_odp_cos_tbl);

If the helper is the way to go, then it could either be internal
or published API.  Any thoughts on the correct solution?

1) nested calls
2) internal API
3) published API

Thanks,
Robbie  

-Original Message-
From: lng-odp-boun...@lists.linaro.org 
[mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of Mike Holmes
Sent: Monday, February 16, 2015 2:55 PM
To: lng-odp@lists.linaro.org
Subject: [lng-odp] [PATCH v2 00/10] add global and local termination

v2:
Addresses the only comment to replace
static const char shm_name[] 
with
const char SHM_DEFAULT_NAME[]

Yan Sonming (10):
  linux-generic: classification: add term_global
  linux-generic: odp_crypto: add term_global
  linux-generic: packet_io: add term_global
  linux-generic: schedule: add term_global
  linux-generic: queue: add term_global
  linux-generic: buffer_pool: add term_global
  linux-generic: thread: add term_global
  linux-generic: shm: add term_global
  linux-generic: schedule: add term_local
  linux-generic: buffer pool: add term_local

 platform/linux-generic/include/odp_internal.h | 10 ++
 platform/linux-generic/odp_buffer_pool.c  | 37 ++-
 platform/linux-generic/odp_classification.c   | 25 +
 platform/linux-generic/odp_crypto.c   | 13 +++
 platform/linux-generic/odp_init.c | 51 ++-
 platform/linux-generic/odp_packet_io.c| 20 +++
 platform/linux-generic/odp_queue.c| 25 +
 platform/linux-generic/odp_schedule.c | 31 
 platform/linux-generic/odp_shared_memory.c|  8 +
 platform/linux-generic/odp_thread.c   | 13 +++
 10 files changed, 231 insertions(+), 2 deletions(-)

-- 
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


Re: [lng-odp] [PATCH v2 00/10] add global and local termination

2015-02-18 Thread Taras Kondratiuk

On 02/18/2015 05:53 PM, Robbie King (robking) wrote:

Hey Mike (and everyone else),

I noticed this code is replicated throughout the patch:

cos_shm = odp_shm_lookup(shm_odp_cos_tbl);
if (cos_shm == ODP_SHM_INVALID)
return -1;
ret = odp_shm_free(cos_shm);

As I was looking to make the changes we discussed (continue
on versus returning -1) it seemed instead of replicating
even more code it would be better to have some cleaner way
of doing this.

One possibility is to simply nest the calls (shm_free just
returns -1 if passed SHM_INVALID).

   ret = odp_shm_free(odp_shm_lookup(shm_odp_cos_tbl));

Another option is to create a helper function, something like:

   ret = odp_shm_free_by_name(shm_odp_cos_tbl);

If the helper is the way to go, then it could either be internal
or published API.  Any thoughts on the correct solution?

1) nested calls
2) internal API
3) published API


I prefer a forth option :)
Save allocated odp_shm_t handle and don't lookup it.

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


Re: [lng-odp] [PATCH v3] api: scheduler: atomic and ordered definitions

2015-02-18 Thread Ola Liljedahl
On 18 February 2015 at 16:19, Petri Savolainen
petri.savolai...@linaro.org wrote:
 Improved documentation and definition of atomic and ordered
 queue synchronisation.

 Signed-off-by: Petri Savolainen petri.savolai...@linaro.org
Wording only:
Reviewed-by: Ola Liljedahl ola.liljed...@linaro.org


 ---
 This is the ordered queue definition (in patch format) promised
 in the call yesterday.
 ---
  include/odp/api/queue.h| 25 +++--
  include/odp/api/schedule.h | 15 ---
  2 files changed, 35 insertions(+), 5 deletions(-)

 diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h
 index 9519edf..6a8b15f 100644
 --- a/include/odp/api/queue.h
 +++ b/include/odp/api/queue.h
 @@ -104,16 +104,37 @@ extern C {
  /**
   * @def ODP_SCHED_SYNC_NONE
   * Queue not synchronised
 + *
 + * The scheduler does not provide event synchronisation or ordering, only 
 load
 + * balancing. Events can be scheduled freely to multiple threads for 
 concurrent
 + * processing.
   */

  /**
   * @def ODP_SCHED_SYNC_ATOMIC
 - * Atomic queue
 + * Atomic queue synchronisation
 + *
 + * Events from an atomic queue can be scheduled only to a single thread at a
 + * time. The thread is guaranteed to have exclusive (atomic) access to the
 + * associated queue context and event ordering is maintained. This enables 
 the
 + * user to avoid SW synchronisation for those two.
 + *
 + * The atomic queue is dedicated to the thread until it requests another 
 event
 + * from the scheduler (which implicitly releases the queue) or calls
 + * odp_schedule_release_atomic(), which allows the scheduler to release the
 + * queue immediately.
   */

  /**
   * @def ODP_SCHED_SYNC_ORDERED
 - * Ordered queue
 + * Ordered queue synchronisation
 + *
 + * Events from an ordered queue can be scheduled to multiple threads for
 + * concurrent processing. The source queue (dequeue) ordering is maintained 
 when
 + * events are enqueued to their destination queue(s) before another schedule
 + * call. Events from the same (source) queue appear in their original order
 + * when dequeued from a destination queue. The destination queue can have any
 + * queue type and synchronisation method.
   */

  /**
 diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h
 index 5c08357..3bf0578 100644
 --- a/include/odp/api/schedule.h
 +++ b/include/odp/api/schedule.h
 @@ -93,9 +93,9 @@ int odp_schedule_multi(odp_queue_t *from, uint64_t wait, 
 odp_event_t events[],
   * Pause scheduling
   *
   * Pause global scheduling for this thread. After this call, all schedule 
 calls
 - * will return only locally reserved buffers (if any). User can exit the
 + * will return only locally pre-scheduled events (if any). User can exit the
   * schedule loop only after the schedule function indicates that there's no 
 more
 - * buffers (no more locally reserved buffers).
 + * (pre-scheduled) events.
   *
   * Must be used with odp_schedule() and odp_schedule_multi() before exiting 
 (or
   * stalling) the schedule loop.
 @@ -111,7 +111,16 @@ void odp_schedule_pause(void);
  void odp_schedule_resume(void);

  /**
 - * Release currently hold atomic context
 + * Release the current atomic context
 + *
 + * This call is valid only for source queues with atomic synchronisation. It
 + * hints the scheduler that the user has completed processing of the critical
 + * section (which depends on the atomic synchronisation). The scheduler is 
 now
 + * allowed to schedule events from the same queue to some other thread.
 + *
 + * Early atomic context release may increase parallelism and thus system
 + * performance, but user needs to design carefully the split into critical 
 vs.
 + * non-critical sections.
   */
  void odp_schedule_release_atomic(void);

 --
 2.3.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] api: scheduler: atomic and ordered definitions

2015-02-18 Thread Petri Savolainen
Improved documentation and definition of atomic and ordered
queue synchronisation.

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

---
This is the ordered queue definition (in patch format) promised
in the call yesterday.
---
 include/odp/api/queue.h| 25 +++--
 include/odp/api/schedule.h | 15 ---
 2 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h
index 9519edf..85b0fd7 100644
--- a/include/odp/api/queue.h
+++ b/include/odp/api/queue.h
@@ -104,16 +104,37 @@ extern C {
 /**
  * @def ODP_SCHED_SYNC_NONE
  * Queue not synchronised
+ *
+ * The scheduler does not provide event synchronisation or ordering, only load
+ * balancing. Events can be scheduled freely to multiple threads for concurrent
+ * processing.
  */
 
 /**
  * @def ODP_SCHED_SYNC_ATOMIC
- * Atomic queue
+ * Atomic queue synchronisation
+ *
+ * Events from an atomic queue can be scheduled only to a single thread at a
+ * time. The thread is guaranteed to have exclusive (atomic) access to the
+ * associated queue context and event ordering is maintained. This enables the
+ * user to avoid SW synchronisation for the same.
+ *
+ * The atomic queue is dedicated to the thread until it requests another event
+ * from the scheduler (which implicitly releases the queue) or calls
+ * odp_schedule_release_atomic(), which allows the scheduler to release the
+ * queue immediately.
  */
 
 /**
  * @def ODP_SCHED_SYNC_ORDERED
- * Ordered queue
+ * Ordered queue synchronisation
+ *
+ * Events from an ordered queue can be scheduled to multiple threads for
+ * concurrent processing. The source queue (dequeue) ordering is maintained 
when
+ * events are enqueued to their destination queue(s) before another schedule
+ * call. Events from the same (source) queue appear in their original order
+ * when dequeued from a destination queue. The destination queue type or
+ * synchronisation is not limited.
  */
 
 /**
diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h
index 5c08357..3bf0578 100644
--- a/include/odp/api/schedule.h
+++ b/include/odp/api/schedule.h
@@ -93,9 +93,9 @@ int odp_schedule_multi(odp_queue_t *from, uint64_t wait, 
odp_event_t events[],
  * Pause scheduling
  *
  * Pause global scheduling for this thread. After this call, all schedule calls
- * will return only locally reserved buffers (if any). User can exit the
+ * will return only locally pre-scheduled events (if any). User can exit the
  * schedule loop only after the schedule function indicates that there's no 
more
- * buffers (no more locally reserved buffers).
+ * (pre-scheduled) events.
  *
  * Must be used with odp_schedule() and odp_schedule_multi() before exiting (or
  * stalling) the schedule loop.
@@ -111,7 +111,16 @@ void odp_schedule_pause(void);
 void odp_schedule_resume(void);
 
 /**
- * Release currently hold atomic context
+ * Release the current atomic context
+ *
+ * This call is valid only for source queues with atomic synchronisation. It
+ * hints the scheduler that the user has completed processing of the critical
+ * section (which depends on the atomic synchronisation). The scheduler is now
+ * allowed to schedule events from the same queue to some other thread.
+ *
+ * Early atomic context release may increase parallelism and thus system
+ * performance, but user needs to design carefully the split into critical vs.
+ * non-critical sections.
  */
 void odp_schedule_release_atomic(void);
 
-- 
2.3.0


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


[lng-odp] [PATCH v3] api: scheduler: atomic and ordered definitions

2015-02-18 Thread Petri Savolainen
Improved documentation and definition of atomic and ordered
queue synchronisation.

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

---
This is the ordered queue definition (in patch format) promised
in the call yesterday.
---
 include/odp/api/queue.h| 25 +++--
 include/odp/api/schedule.h | 15 ---
 2 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h
index 9519edf..6a8b15f 100644
--- a/include/odp/api/queue.h
+++ b/include/odp/api/queue.h
@@ -104,16 +104,37 @@ extern C {
 /**
  * @def ODP_SCHED_SYNC_NONE
  * Queue not synchronised
+ *
+ * The scheduler does not provide event synchronisation or ordering, only load
+ * balancing. Events can be scheduled freely to multiple threads for concurrent
+ * processing.
  */
 
 /**
  * @def ODP_SCHED_SYNC_ATOMIC
- * Atomic queue
+ * Atomic queue synchronisation
+ *
+ * Events from an atomic queue can be scheduled only to a single thread at a
+ * time. The thread is guaranteed to have exclusive (atomic) access to the
+ * associated queue context and event ordering is maintained. This enables the
+ * user to avoid SW synchronisation for those two.
+ *
+ * The atomic queue is dedicated to the thread until it requests another event
+ * from the scheduler (which implicitly releases the queue) or calls
+ * odp_schedule_release_atomic(), which allows the scheduler to release the
+ * queue immediately.
  */
 
 /**
  * @def ODP_SCHED_SYNC_ORDERED
- * Ordered queue
+ * Ordered queue synchronisation
+ *
+ * Events from an ordered queue can be scheduled to multiple threads for
+ * concurrent processing. The source queue (dequeue) ordering is maintained 
when
+ * events are enqueued to their destination queue(s) before another schedule
+ * call. Events from the same (source) queue appear in their original order
+ * when dequeued from a destination queue. The destination queue can have any
+ * queue type and synchronisation method.
  */
 
 /**
diff --git a/include/odp/api/schedule.h b/include/odp/api/schedule.h
index 5c08357..3bf0578 100644
--- a/include/odp/api/schedule.h
+++ b/include/odp/api/schedule.h
@@ -93,9 +93,9 @@ int odp_schedule_multi(odp_queue_t *from, uint64_t wait, 
odp_event_t events[],
  * Pause scheduling
  *
  * Pause global scheduling for this thread. After this call, all schedule calls
- * will return only locally reserved buffers (if any). User can exit the
+ * will return only locally pre-scheduled events (if any). User can exit the
  * schedule loop only after the schedule function indicates that there's no 
more
- * buffers (no more locally reserved buffers).
+ * (pre-scheduled) events.
  *
  * Must be used with odp_schedule() and odp_schedule_multi() before exiting (or
  * stalling) the schedule loop.
@@ -111,7 +111,16 @@ void odp_schedule_pause(void);
 void odp_schedule_resume(void);
 
 /**
- * Release currently hold atomic context
+ * Release the current atomic context
+ *
+ * This call is valid only for source queues with atomic synchronisation. It
+ * hints the scheduler that the user has completed processing of the critical
+ * section (which depends on the atomic synchronisation). The scheduler is now
+ * allowed to schedule events from the same queue to some other thread.
+ *
+ * Early atomic context release may increase parallelism and thus system
+ * performance, but user needs to design carefully the split into critical vs.
+ * non-critical sections.
  */
 void odp_schedule_release_atomic(void);
 
-- 
2.3.0


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


[lng-odp] Use of Patchworks

2015-02-18 Thread Mike Holmes
All,

We should start using http://patches.opendataplane.org/project/lng-odp/list/
to track progress of a patch or to reference a patch from bugzilla.
The reason is that the existing Linaro patches link https://patches.linaro
.org/project/lng-odp/ is not able to track submissions from non Linaro
email addresses.

I think we could help our selves if we all did try to update our own patch
status in this tool. The tool is semi automatic, but not perfect because it
cant tell if something is just progressing slowly or obsolete for example.

Mike

-- 
*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 v2 00/10] add global and local termination

2015-02-18 Thread Robbie King (robking)
While I'm not a big fan of the lookup APIs myself, if
they exist implementations should be able to use them I think.

Does the nesting violate any coding style restrictions?

   ret = odp_shm_free(odp_shm_lookup(shm_odp_cos_tbl));


-Original Message-
From: Taras Kondratiuk [mailto:taras.kondrat...@linaro.org] 
Sent: Wednesday, February 18, 2015 11:01 AM
To: Robbie King (robking)
Cc: Mike Holmes; lng-odp@lists.linaro.org; Petri Savolainen 
(petri.savolai...@linaro.org)
Subject: Re: [lng-odp] [PATCH v2 00/10] add global and local termination

On 02/18/2015 05:53 PM, Robbie King (robking) wrote:
 Hey Mike (and everyone else),

 I noticed this code is replicated throughout the patch:

   cos_shm = odp_shm_lookup(shm_odp_cos_tbl);
   if (cos_shm == ODP_SHM_INVALID)
   return -1;
   ret = odp_shm_free(cos_shm);

 As I was looking to make the changes we discussed (continue
 on versus returning -1) it seemed instead of replicating
 even more code it would be better to have some cleaner way
 of doing this.

 One possibility is to simply nest the calls (shm_free just
 returns -1 if passed SHM_INVALID).

ret = odp_shm_free(odp_shm_lookup(shm_odp_cos_tbl));

 Another option is to create a helper function, something like:

ret = odp_shm_free_by_name(shm_odp_cos_tbl);

 If the helper is the way to go, then it could either be internal
 or published API.  Any thoughts on the correct solution?

 1) nested calls
 2) internal API
 3) published API

I prefer a forth option :)
Save allocated odp_shm_t handle and don't lookup it.
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp