Re: [lng-odp] [PATCH] test: performance: return when pkt alloc fails

2016-05-04 Thread Krishna Garapati
Thanks mike, I missed the comment received. my bad.

/Krishna

On 3 May 2016 at 23:33, Mike Holmes  wrote:

> merged
>
> Krishna, I made Maxims update and added his reviewed by for you
>
> On 25 April 2016 at 09:15, Maxim Uvarov  wrote:
>
>> On 04/11/16 12:11, Balakrishna Garapati wrote:
>>
>>> Resolving https://bugs.linaro.org/show_bug.cgi?id=2135 by return
>>> over packet allocation failure.
>>>
>>> Signed-off-by: Balakrishna Garapati 
>>> ---
>>>   test/performance/odp_crypto.c | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/test/performance/odp_crypto.c
>>> b/test/performance/odp_crypto.c
>>> index fe1c7b4..ca461e5 100644
>>> --- a/test/performance/odp_crypto.c
>>> +++ b/test/performance/odp_crypto.c
>>> @@ -550,6 +550,7 @@ run_measure_one(crypto_args_t *cargs,
>>> if (pkt == ODP_PACKET_INVALID) {
>>> app_err("failed to allocate
>>> buffer\n");
>>> rc = -1;
>>> +   return rc;
>>>
>> that has to be simple:
>> return -1;
>>
>> you can add my
>>  Reviewed-by: Maxim Uvarov 
>>
>> for updated version.
>>
>> Maxim.
>>
>> } else {
>>> void *mem = odp_packet_data(pkt);
>>>
>>>
>>
>> ___
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org  *│ *Open source software for ARM SoCs
> "Work should be fun and collaborative, the rest follows"
>
>
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 2135] CID 158537: : Unused value: odp_crypto.c

2016-05-04 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2135

Krishna Garapati  changed:

   What|Removed |Added

 CC||balakrishna.garapati@linaro
   ||.org

--- Comment #3 from Krishna Garapati  ---
Bug has been fixed in the fallowing commit,

commitid:7c27b1e270678a4b7aa1ab9a791a8aea9366b59a

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


[lng-odp] [Bug 2217] New: Traffic manager validation tests fail on a 32-bit x86 host

2016-05-04 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2217

Bug ID: 2217
   Summary: Traffic manager validation tests fail on a 32-bit x86
host
   Product: OpenDataPlane - linux- generic reference
   Version: v1.10
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: critical
  Priority: ---
 Component: Traffic Manager
  Assignee: lng-odp@lists.linaro.org
  Reporter: matias@nokia.com
CC: lng-odp@lists.linaro.org
  Target Milestone: ---

Traffic manager validation tests fail on a 32-bit x86 host (Ubuntu 16.04).

Output from the first failing validation test:

  Test: traffic_mngr_test_shaper ...Sent 50 packets
tm_process_expired_timers bad timer return
traffic_mngr.c:2382:test_shaper_bw():Sent 50 pkts but only 2 came back
traffic_mngr.c:2382:test_shaper_bw():Sent 50 pkts but only 0 came back
traffic_mngr.c:2382:test_shaper_bw():Sent 50 pkts but only 0 came back
traffic_mngr.c:2382:test_shaper_bw():Sent 50 pkts but only 0 came back
tm_process_expired_timers bad timer return
traffic_mngr.c:2382:test_shaper_bw():Sent 50 pkts but only 2 came back
FAILED
1. traffic_mngr.c:3666  - test_shaper_bw("bw1", "node_1_1_1", 0, 1 * MBPS)
== 0
2. traffic_mngr.c:3667  - test_shaper_bw("bw4", "node_1_1_1", 1, 4 * MBPS)
== 0
3. traffic_mngr.c:3668  - test_shaper_bw("bw10", "node_1_1_1", 2, 10 *
MBPS) == 0
4. traffic_mngr.c:3669  - test_shaper_bw("bw40", "node_1_1_1", 3, 40 *
MBPS) == 0
5. traffic_mngr.c:3670  - test_shaper_bw("bw100", "node_1_1_2", 0, 100 *
MBPS) == 0


It seems that at least here (odp_traffic_mngr.c) the code assumes 64-bit
pointers:

2156:   timer_context = (uint64_t)(uintptr_t)ptr;
2157:   queue_num = (timer_context & 0x) >> 4;
2158:   timer_seq = timer_context >> 32;
2159:   tm_queue_obj = tm_system->queue_num_tbl[queue_num];

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


[lng-odp] [PATCH 1/2] configure: detect ARCH correctly for 32-bit x86 hosts

2016-05-04 Thread Matias Elo
Currently, 32-bit x86 host may end up using linux ARCH as
the host identifier is not recognized. Fix this by mapping
i686* to ARCH x86.

Signed-off-by: Matias Elo 
---
 configure.ac | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.ac b/configure.ac
index 723c957..5e7e380 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,6 +60,7 @@ AX_VALGRIND_CHECK
 ##
 AS_CASE([$host],
   [x86*], [ARCH=x86],
+  [i686*], [ARCH=x86],
   [mips64*], [ARCH=mips64],
   [powerpc*], [ARCH=powerpc],
   [ARCH=linux]
-- 
1.9.1

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


[lng-odp] [PATCH 2/2] time: fix invalid casting on a 32-bit host

2016-05-04 Thread Matias Elo
The size of 'struct timespec' may vary on different host
architectures as it includes type long members. This breaks
time functions on a 32-bit x86 host. Fix this by
individually copying struct timespec members to odp_time_t.

Signed-off-by: Matias Elo 
---
 platform/linux-generic/odp_time.c | 26 +++---
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/platform/linux-generic/odp_time.c 
b/platform/linux-generic/odp_time.c
index 040f754..81e0522 100644
--- a/platform/linux-generic/odp_time.c
+++ b/platform/linux-generic/odp_time.c
@@ -11,11 +11,6 @@
 #include 
 #include 
 
-typedef union {
-   odp_time_t  ex;
-   struct timespec in;
-} _odp_time_t;
-
 static odp_time_t start_time;
 
 static inline
@@ -47,13 +42,17 @@ static inline odp_time_t time_diff(odp_time_t t2, 
odp_time_t t1)
 static inline odp_time_t time_local(void)
 {
int ret;
-   _odp_time_t time;
+   odp_time_t time;
+   struct timespec sys_time;
 
-   ret = clock_gettime(CLOCK_MONOTONIC_RAW, &time.in);
+   ret = clock_gettime(CLOCK_MONOTONIC_RAW, &sys_time);
if (odp_unlikely(ret != 0))
ODP_ABORT("clock_gettime failed\n");
 
-   return time_diff(time.ex, start_time);
+   time.tv_sec = sys_time.tv_sec;
+   time.tv_nsec = sys_time.tv_nsec;
+
+   return time_diff(time, start_time);
 }
 
 static inline int time_cmp(odp_time_t t2, odp_time_t t1)
@@ -195,10 +194,15 @@ uint64_t odp_time_to_u64(odp_time_t time)
 int odp_time_init_global(void)
 {
int ret;
-   _odp_time_t time;
+   struct timespec time;
 
-   ret = clock_gettime(CLOCK_MONOTONIC_RAW, &time.in);
-   start_time = ret ? ODP_TIME_NULL : time.ex;
+   ret = clock_gettime(CLOCK_MONOTONIC_RAW, &time);
+   if (ret) {
+   start_time = ODP_TIME_NULL;
+   } else {
+   start_time.tv_sec = time.tv_sec;
+   start_time.tv_nsec = time.tv_nsec;
+   }
 
return ret;
 }
-- 
1.9.1

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


[lng-odp] [Bug 2218] New: ARCH linux missing ODP_CACHE_LINE_SIZE define

2016-05-04 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2218

Bug ID: 2218
   Summary: ARCH linux missing ODP_CACHE_LINE_SIZE define
   Product: OpenDataPlane - linux- generic reference
   Version: v1.10
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: major
  Priority: ---
 Component: General ODP
  Assignee: lng-odp@lists.linaro.org
  Reporter: matias@nokia.com
  Target Milestone: ---

ODP linux-generic arch linux is missing ODP_CACHE_LINE_SIZE definition. This
causes build to fail on an unrecognized platform (for example i686).

Error message:
  CC   odp_classifier-odp_classifier.o
odp_classifier.c: In function ‘main’:
odp_classifier.c:502:10: error: ‘ODP_CACHE_LINE_SIZE’ undeclared (first use in
this function)
  ODP_CACHE_LINE_SIZE, 0);

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


[lng-odp] [PATCH v2 2/2] linux-generic: timer: add missing odp_time*_to_u64() functions

2016-05-04 Thread Matias Elo
Add missing odp_timer_pool_to_u64(), odp_timer_to_u64(), and
odp_timeout_to_u64() functions. Use the functions in timer
validation tests.

Signed-off-by: Matias Elo 
---
V2:
+ Use _odp_pri() helper (Maxim)
+ Use strong typing

 platform/linux-generic/odp_timer.c | 15 +++
 test/validation/timer/timer.c  |  3 +++
 2 files changed, 18 insertions(+)

diff --git a/platform/linux-generic/odp_timer.c 
b/platform/linux-generic/odp_timer.c
index 9e21f3a..6b84309 100644
--- a/platform/linux-generic/odp_timer.c
+++ b/platform/linux-generic/odp_timer.c
@@ -829,6 +829,11 @@ int odp_timer_pool_info(odp_timer_pool_t tpid,
return 0;
 }
 
+uint64_t odp_timer_pool_to_u64(odp_timer_pool_t tpid)
+{
+   return _odp_pri(tpid);
+}
+
 odp_timer_t odp_timer_alloc(odp_timer_pool_t tpid,
odp_queue_t queue,
void *user_ptr)
@@ -902,6 +907,11 @@ int odp_timer_cancel(odp_timer_t hdl, odp_event_t *tmo_ev)
}
 }
 
+uint64_t odp_timer_to_u64(odp_timer_t hdl)
+{
+   return _odp_pri(hdl);
+}
+
 odp_timeout_t odp_timeout_from_event(odp_event_t ev)
 {
/* This check not mandated by the API specification */
@@ -915,6 +925,11 @@ odp_event_t odp_timeout_to_event(odp_timeout_t tmo)
return (odp_event_t)tmo;
 }
 
+uint64_t odp_timeout_to_u64(odp_timeout_t tmo)
+{
+   return _odp_pri(tmo);
+}
+
 int odp_timeout_fresh(odp_timeout_t tmo)
 {
const odp_timeout_hdr_t *hdr = timeout_hdr(tmo);
diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c
index 1032adc..6b484cd 100644
--- a/test/validation/timer/timer.c
+++ b/test/validation/timer/timer.c
@@ -168,6 +168,7 @@ void timer_test_odp_timer_cancel(void)
tim = odp_timer_alloc(tp, queue, USER_PTR);
if (tim == ODP_TIMER_INVALID)
CU_FAIL_FATAL("Failed to allocate timer");
+   LOG_DBG("Timer handle: %" PRIu64 "\n", odp_timer_to_u64(tim));
 
ev = odp_timeout_to_event(odp_timeout_alloc(pool));
if (ev == ODP_EVENT_INVALID)
@@ -189,6 +190,7 @@ void timer_test_odp_timer_cancel(void)
tmo = odp_timeout_from_event(ev);
if (tmo == ODP_TIMEOUT_INVALID)
CU_FAIL_FATAL("Cancel did not return timeout");
+   LOG_DBG("Timeout handle: %" PRIu64 "\n", odp_timeout_to_u64(tmo));
 
if (odp_timeout_timer(tmo) != tim)
CU_FAIL("Cancel invalid tmo.timer");
@@ -501,6 +503,7 @@ void timer_test_odp_timer_all(void)
CU_ASSERT(tpinfo.param.max_tmo == MAX);
CU_ASSERT(strcmp(tpinfo.name, NAME) == 0);
 
+   LOG_DBG("Timer pool handle: %" PRIu64 "\n", odp_timer_pool_to_u64(tp));
LOG_DBG("#timers..: %u\n", NTIMERS);
LOG_DBG("Tmo range: %u ms (%" PRIu64 " ticks)\n", RANGE_MS,
odp_timer_ns_to_tick(tp, 100ULL * RANGE_MS));
-- 
1.9.1

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


[lng-odp] [PATCH v2 1/2] linux-generic: timer: use strong typing

2016-05-04 Thread Matias Elo
Use strong typing for odp_timer_t and odp_timeout_t. Fix
couple exposed usage errors.

Signed-off-by: Matias Elo 
---
 example/timer/odp_timer_test.c|  8 
 platform/linux-generic/include/odp/api/plat/timer_types.h | 10 ++
 platform/linux-generic/odp_timer.c|  6 +++---
 test/validation/timer/timer.c |  2 +-
 4 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index f1d3be4..c07d6ed 100644
--- a/example/timer/odp_timer_test.c
+++ b/example/timer/odp_timer_test.c
@@ -165,16 +165,16 @@ static void test_abs_timeouts(int thr, test_globals_t 
*gbls)
if (!odp_timeout_fresh(tmo)) {
/* Not the expected expiration tick, timer has
 * been reset or cancelled or freed */
-   EXAMPLE_ABORT("Unexpected timeout received (timer %" 
PRIx32 ", tick %" PRIu64 ")\n",
- ttp->tim, tick);
+   EXAMPLE_ABORT("Unexpected timeout received (timer %" 
PRIu64 ", tick %" PRIu64 ")\n",
+ odp_timer_to_u64(ttp->tim), tick);
}
EXAMPLE_DBG("  [%i] timeout, tick %"PRIu64"\n", thr, tick);
 
uint32_t rx_num = odp_atomic_fetch_dec_u32(&gbls->remain);
 
if (!rx_num)
-   EXAMPLE_ABORT("Unexpected timeout received (timer %x, 
tick %"PRIu64")\n",
- ttp->tim, tick);
+   EXAMPLE_ABORT("Unexpected timeout received (timer %" 
PRIu64 ", tick %" PRIu64 ")\n",
+ odp_timer_to_u64(ttp->tim), tick);
else if (rx_num > num_workers)
continue;
 
diff --git a/platform/linux-generic/include/odp/api/plat/timer_types.h 
b/platform/linux-generic/include/odp/api/plat/timer_types.h
index 006683e..93ea162 100644
--- a/platform/linux-generic/include/odp/api/plat/timer_types.h
+++ b/platform/linux-generic/include/odp/api/plat/timer_types.h
@@ -18,6 +18,8 @@
 extern "C" {
 #endif
 
+#include 
+
 /** @addtogroup odp_timer
  *  @{
  **/
@@ -28,13 +30,13 @@ typedef struct odp_timer_pool_s *odp_timer_pool_t;
 
 #define ODP_TIMER_POOL_INVALID NULL
 
-typedef uint32_t odp_timer_t;
+typedef ODP_HANDLE_T(odp_timer_t);
 
-#define ODP_TIMER_INVALID ((uint32_t)~0U)
+#define ODP_TIMER_INVALID _odp_cast_scalar(odp_timer_t, 0x)
 
-typedef void *odp_timeout_t;
+typedef ODP_HANDLE_T(odp_timeout_t);
 
-#define ODP_TIMEOUT_INVALID NULL
+#define ODP_TIMEOUT_INVALID  _odp_cast_scalar(odp_timeout_t, 0)
 
 /**
  * @}
diff --git a/platform/linux-generic/odp_timer.c 
b/platform/linux-generic/odp_timer.c
index f4fb1f6..9e21f3a 100644
--- a/platform/linux-generic/odp_timer.c
+++ b/platform/linux-generic/odp_timer.c
@@ -184,7 +184,7 @@ static odp_timer_pool *timer_pool[MAX_TIMER_POOLS];
 
 static inline odp_timer_pool *handle_to_tp(odp_timer_t hdl)
 {
-   uint32_t tp_idx = hdl >> INDEX_BITS;
+   uint32_t tp_idx = _odp_typeval(hdl) >> INDEX_BITS;
if (odp_likely(tp_idx < MAX_TIMER_POOLS)) {
odp_timer_pool *tp = timer_pool[tp_idx];
if (odp_likely(tp != NULL))
@@ -196,7 +196,7 @@ static inline odp_timer_pool *handle_to_tp(odp_timer_t hdl)
 static inline uint32_t handle_to_idx(odp_timer_t hdl,
struct odp_timer_pool_s *tp)
 {
-   uint32_t idx = hdl & ((1U << INDEX_BITS) - 1U);
+   uint32_t idx = _odp_typeval(hdl) & ((1U << INDEX_BITS) - 1U);
PREFETCH(&tp->tick_buf[idx]);
if (odp_likely(idx < odp_atomic_load_u32(&tp->high_wm)))
return idx;
@@ -207,7 +207,7 @@ static inline odp_timer_t tp_idx_to_handle(struct 
odp_timer_pool_s *tp,
uint32_t idx)
 {
ODP_ASSERT(idx < (1U << INDEX_BITS));
-   return (tp->tp_idx << INDEX_BITS) | idx;
+   return _odp_cast_scalar(odp_timer_t, (tp->tp_idx << INDEX_BITS) | idx);
 }
 
 /* Forward declarations */
diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c
index aad11aa..1032adc 100644
--- a/test/validation/timer/timer.c
+++ b/test/validation/timer/timer.c
@@ -297,7 +297,7 @@ static void *worker_entrypoint(void *arg TEST_UNUSED)
if (tt[i].tim == ODP_TIMER_INVALID) {
LOG_DBG("Failed to allocate timer (%" PRIu32 "/%d)\n",
i, NTIMERS);
-   odp_timeout_free(tt[i].ev);
+   odp_event_free(tt[i].ev);
break;
}
tt[i].ev2 = tt[i].ev;
-- 
1.9.1

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


Re: [lng-odp] [API-NEXT, RFC, 1/1] api: cpu: performance profiling start/stop

2016-05-04 Thread Mike Holmes
It sounded like the arch call was leaning towards documenting that on
odp-linux  the application must ensure that odp_threads are pinned to cores
when launched.
This is a restriction that some platforms may not need to make, vs the idea
that a piece of ODP code can use these APIs to ensure the behavior it needs
without knowledge or reliance on the wider system.

On 4 May 2016 at 01:45, Yi He  wrote:

> Establish a performance profiling environment guarantees meaningful
> and consistency of consecutive invocations of the odp_cpu_xxx() APIs.
> While after profiling was done restore the execution environment to
> its multi-core optimized state.
>
> Signed-off-by: Yi He 
> ---
>  include/odp/api/spec/cpu.h | 31 +++
>  1 file changed, 31 insertions(+)
>
> diff --git a/include/odp/api/spec/cpu.h b/include/odp/api/spec/cpu.h
> index 2789511..0bc9327 100644
> --- a/include/odp/api/spec/cpu.h
> +++ b/include/odp/api/spec/cpu.h
> @@ -27,6 +27,21 @@ extern "C" {
>
>
>  /**
> + * @typedef odp_profiler_t
> + * ODP performance profiler handle
> + */
> +
> +/**
> + * Setup a performance profiling environment
> + *
> + * A performance profiling environment guarantees meaningful and
> consistency of
> + * consecutive invocations of the odp_cpu_xxx() APIs.
> + *
> + * @return performance profiler handle
> + */
> +odp_profiler_t odp_profiler_start(void);
> +
> +/**
>   * CPU identifier
>   *
>   * Determine CPU identifier on which the calling is running. CPU
> numbering is
> @@ -170,6 +185,22 @@ uint64_t odp_cpu_cycles_resolution(void);
>  void odp_cpu_pause(void);
>
>  /**
> + * Stop the performance profiling environment
> + *
> + * Stop performance profiling and restore the execution environment to its
> + * multi-core optimized state, won't preserve meaningful and consistency
> of
> + * consecutive invocations of the odp_cpu_xxx() APIs anymore.
> + *
> + * @param profiler  performance profiler handle
> + *
> + * @retval 0 on success
> + * @retval <0 on failure
> + *
> + * @see odp_profiler_start()
> + */
> +int odp_profiler_stop(odp_profiler_t profiler);
> +
> +/**
>   * @}
>   */
>
> --
> 1.9.1
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>



-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org  *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT, RFC, 1/1] api: cpu: performance profiling start/stop

2016-05-04 Thread Bill Fischofer
I think there are two fallouts form this discussion.  First, there is the
question of the precise semantics of the existing timing APIs as they
relate to processor locality. Applications such as profiling tests, to the
extent that they APIs that have processor-local semantics, must ensure that
the thread(s) using these APIs are pinned for the duration of the
measurement.

The other point is the one that Petri brought up about having other APIs
that provide timing information based on wall time or other metrics that
are not processor-local.  While these may not have the same performance
characteristics, they would be independent of thread migration
considerations.

Of course all this depends on exactly what one is trying to measure. Since
thread migration is not free, allowing such activity may or may not be
relevant to what is being measured, so ODP probably wants to have both
processor-local and systemwide timing APIs.  We just need to be sure they
are specified precisely so that applications know how to use them properly.

On Wed, May 4, 2016 at 10:23 AM, Mike Holmes  wrote:

> It sounded like the arch call was leaning towards documenting that on
> odp-linux  the application must ensure that odp_threads are pinned to cores
> when launched.
> This is a restriction that some platforms may not need to make, vs the
> idea that a piece of ODP code can use these APIs to ensure the behavior it
> needs without knowledge or reliance on the wider system.
>
> On 4 May 2016 at 01:45, Yi He  wrote:
>
>> Establish a performance profiling environment guarantees meaningful
>> and consistency of consecutive invocations of the odp_cpu_xxx() APIs.
>> While after profiling was done restore the execution environment to
>> its multi-core optimized state.
>>
>> Signed-off-by: Yi He 
>> ---
>>  include/odp/api/spec/cpu.h | 31 +++
>>  1 file changed, 31 insertions(+)
>>
>> diff --git a/include/odp/api/spec/cpu.h b/include/odp/api/spec/cpu.h
>> index 2789511..0bc9327 100644
>> --- a/include/odp/api/spec/cpu.h
>> +++ b/include/odp/api/spec/cpu.h
>> @@ -27,6 +27,21 @@ extern "C" {
>>
>>
>>  /**
>> + * @typedef odp_profiler_t
>> + * ODP performance profiler handle
>> + */
>> +
>> +/**
>> + * Setup a performance profiling environment
>> + *
>> + * A performance profiling environment guarantees meaningful and
>> consistency of
>> + * consecutive invocations of the odp_cpu_xxx() APIs.
>> + *
>> + * @return performance profiler handle
>> + */
>> +odp_profiler_t odp_profiler_start(void);
>> +
>> +/**
>>   * CPU identifier
>>   *
>>   * Determine CPU identifier on which the calling is running. CPU
>> numbering is
>> @@ -170,6 +185,22 @@ uint64_t odp_cpu_cycles_resolution(void);
>>  void odp_cpu_pause(void);
>>
>>  /**
>> + * Stop the performance profiling environment
>> + *
>> + * Stop performance profiling and restore the execution environment to
>> its
>> + * multi-core optimized state, won't preserve meaningful and consistency
>> of
>> + * consecutive invocations of the odp_cpu_xxx() APIs anymore.
>> + *
>> + * @param profiler  performance profiler handle
>> + *
>> + * @retval 0 on success
>> + * @retval <0 on failure
>> + *
>> + * @see odp_profiler_start()
>> + */
>> +int odp_profiler_stop(odp_profiler_t profiler);
>> +
>> +/**
>>   * @}
>>   */
>>
>> --
>> 1.9.1
>>
>> ___
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org  *│ *Open source software for ARM SoCs
> "Work should be fun and collaborative, the rest follows"
>
>
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH v2 1/2] linux-generic: timer: use strong typing

2016-05-04 Thread Bill Fischofer
For this series:

Reviewed-and-tested-by: Bill Fischofer 

On Wed, May 4, 2016 at 10:02 AM, Matias Elo  wrote:

> Use strong typing for odp_timer_t and odp_timeout_t. Fix
> couple exposed usage errors.
>
> Signed-off-by: Matias Elo 
> ---
>  example/timer/odp_timer_test.c|  8 
>  platform/linux-generic/include/odp/api/plat/timer_types.h | 10 ++
>  platform/linux-generic/odp_timer.c|  6 +++---
>  test/validation/timer/timer.c |  2 +-
>  4 files changed, 14 insertions(+), 12 deletions(-)
>
> diff --git a/example/timer/odp_timer_test.c
> b/example/timer/odp_timer_test.c
> index f1d3be4..c07d6ed 100644
> --- a/example/timer/odp_timer_test.c
> +++ b/example/timer/odp_timer_test.c
> @@ -165,16 +165,16 @@ static void test_abs_timeouts(int thr,
> test_globals_t *gbls)
> if (!odp_timeout_fresh(tmo)) {
> /* Not the expected expiration tick, timer has
>  * been reset or cancelled or freed */
> -   EXAMPLE_ABORT("Unexpected timeout received (timer
> %" PRIx32 ", tick %" PRIu64 ")\n",
> - ttp->tim, tick);
> +   EXAMPLE_ABORT("Unexpected timeout received (timer
> %" PRIu64 ", tick %" PRIu64 ")\n",
> + odp_timer_to_u64(ttp->tim), tick);
> }
> EXAMPLE_DBG("  [%i] timeout, tick %"PRIu64"\n", thr, tick);
>
> uint32_t rx_num = odp_atomic_fetch_dec_u32(&gbls->remain);
>
> if (!rx_num)
> -   EXAMPLE_ABORT("Unexpected timeout received (timer
> %x, tick %"PRIu64")\n",
> - ttp->tim, tick);
> +   EXAMPLE_ABORT("Unexpected timeout received (timer
> %" PRIu64 ", tick %" PRIu64 ")\n",
> + odp_timer_to_u64(ttp->tim), tick);
> else if (rx_num > num_workers)
> continue;
>
> diff --git a/platform/linux-generic/include/odp/api/plat/timer_types.h
> b/platform/linux-generic/include/odp/api/plat/timer_types.h
> index 006683e..93ea162 100644
> --- a/platform/linux-generic/include/odp/api/plat/timer_types.h
> +++ b/platform/linux-generic/include/odp/api/plat/timer_types.h
> @@ -18,6 +18,8 @@
>  extern "C" {
>  #endif
>
> +#include 
> +
>  /** @addtogroup odp_timer
>   *  @{
>   **/
> @@ -28,13 +30,13 @@ typedef struct odp_timer_pool_s *odp_timer_pool_t;
>
>  #define ODP_TIMER_POOL_INVALID NULL
>
> -typedef uint32_t odp_timer_t;
> +typedef ODP_HANDLE_T(odp_timer_t);
>
> -#define ODP_TIMER_INVALID ((uint32_t)~0U)
> +#define ODP_TIMER_INVALID _odp_cast_scalar(odp_timer_t, 0x)
>
> -typedef void *odp_timeout_t;
> +typedef ODP_HANDLE_T(odp_timeout_t);
>
> -#define ODP_TIMEOUT_INVALID NULL
> +#define ODP_TIMEOUT_INVALID  _odp_cast_scalar(odp_timeout_t, 0)
>
>  /**
>   * @}
> diff --git a/platform/linux-generic/odp_timer.c
> b/platform/linux-generic/odp_timer.c
> index f4fb1f6..9e21f3a 100644
> --- a/platform/linux-generic/odp_timer.c
> +++ b/platform/linux-generic/odp_timer.c
> @@ -184,7 +184,7 @@ static odp_timer_pool *timer_pool[MAX_TIMER_POOLS];
>
>  static inline odp_timer_pool *handle_to_tp(odp_timer_t hdl)
>  {
> -   uint32_t tp_idx = hdl >> INDEX_BITS;
> +   uint32_t tp_idx = _odp_typeval(hdl) >> INDEX_BITS;
> if (odp_likely(tp_idx < MAX_TIMER_POOLS)) {
> odp_timer_pool *tp = timer_pool[tp_idx];
> if (odp_likely(tp != NULL))
> @@ -196,7 +196,7 @@ static inline odp_timer_pool *handle_to_tp(odp_timer_t
> hdl)
>  static inline uint32_t handle_to_idx(odp_timer_t hdl,
> struct odp_timer_pool_s *tp)
>  {
> -   uint32_t idx = hdl & ((1U << INDEX_BITS) - 1U);
> +   uint32_t idx = _odp_typeval(hdl) & ((1U << INDEX_BITS) - 1U);
> PREFETCH(&tp->tick_buf[idx]);
> if (odp_likely(idx < odp_atomic_load_u32(&tp->high_wm)))
> return idx;
> @@ -207,7 +207,7 @@ static inline odp_timer_t tp_idx_to_handle(struct
> odp_timer_pool_s *tp,
> uint32_t idx)
>  {
> ODP_ASSERT(idx < (1U << INDEX_BITS));
> -   return (tp->tp_idx << INDEX_BITS) | idx;
> +   return _odp_cast_scalar(odp_timer_t, (tp->tp_idx << INDEX_BITS) |
> idx);
>  }
>
>  /* Forward declarations */
> diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c
> index aad11aa..1032adc 100644
> --- a/test/validation/timer/timer.c
> +++ b/test/validation/timer/timer.c
> @@ -297,7 +297,7 @@ static void *worker_entrypoint(void *arg TEST_UNUSED)
> if (tt[i].tim == ODP_TIMER_INVALID) {
> LOG_DBG("Failed to allocate timer (%" PRIu32
> "/%d)\n",
> i, NTIMERS);
> -   odp_timeout_free(tt[i].ev);
> +   odp_event_free(tt[i].ev);
> break;
>

Re: [lng-odp] [PATCH 1/2] configure: detect ARCH correctly for 32-bit x86 hosts

2016-05-04 Thread Bill Fischofer
For this series:

Reviewed-by: Bill Fischofer 

On Wed, May 4, 2016 at 8:01 AM, Matias Elo  wrote:

> Currently, 32-bit x86 host may end up using linux ARCH as
> the host identifier is not recognized. Fix this by mapping
> i686* to ARCH x86.
>
> Signed-off-by: Matias Elo 
> ---
>  configure.ac | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/configure.ac b/configure.ac
> index 723c957..5e7e380 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -60,6 +60,7 @@ AX_VALGRIND_CHECK
>  ##
>  AS_CASE([$host],
>[x86*], [ARCH=x86],
> +  [i686*], [ARCH=x86],
>[mips64*], [ARCH=mips64],
>[powerpc*], [ARCH=powerpc],
>[ARCH=linux]
> --
> 1.9.1
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH] linux-generic: arch: add missing cache line size definition for linux

2016-05-04 Thread Bill Fischofer
Use a default cache line size of 64 for otherwise unrecognized linux
platforms. This resolves bug https://bugs.linaro.org/show_bug.cgi?id=2218

Reported-by: Matias Elo 
Signed-off-by: Bill Fischofer 
---
 platform/linux-generic/arch/linux/odp/api/cpu_arch.h | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/platform/linux-generic/arch/linux/odp/api/cpu_arch.h 
b/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
index 1c79f87..29f8889 100644
--- a/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
+++ b/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
@@ -11,6 +11,16 @@
 extern "C" {
 #endif
 
+/** @ingroup odp_compiler_optim
+ *  @{
+ */
+
+#define ODP_CACHE_LINE_SIZE 64
+
+/**
+ * @}
+ */
+
 static inline void odp_cpu_pause(void)
 {
 }
-- 
2.5.0

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


[lng-odp] [Bug 2218] ARCH linux missing ODP_CACHE_LINE_SIZE define

2016-05-04 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2218

Bill Fischofer  changed:

   What|Removed |Added

   Assignee|lng-odp@lists.linaro.org|bill.fischo...@linaro.org
 CC||bill.fischo...@linaro.org

--- Comment #1 from Bill Fischofer  ---
Patch http://patches.opendataplane.org/patch/5900/ posted to address this bug.

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


[lng-odp] [PATCH v2] doc: support ascidoctor

2016-05-04 Thread Mike Holmes
ascidoctor is a python asciidoc interpreter it has greater capabilities
than asciidoc which is a perl based interpreter

The resulting style sheet improvements result in more professional
looking docs that can be further enhanced with our own css at some
point.

This also supports including code snippets in the documentation from the
doxygen specification  files.

Signed-off-by: Mike Holmes 
Reviewed-by: Bill Fischofer 
---
 CONTRIBUTING|  4 ++--
 DEPENDENCIES|  2 +-
 doc/Makefile.inc|  4 ++--
 doc/m4/configure.m4 | 12 ++--
 doc/users-guide/users-guide-tm.adoc | 18 +-
 5 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/CONTRIBUTING b/CONTRIBUTING
index f6e3fc6..f2f8947 100644
--- a/CONTRIBUTING
+++ b/CONTRIBUTING
@@ -106,7 +106,7 @@ Code without a proper signoff cannot be merged into the 
mainline.
 
 5. Documenting the user docs
 
-- Users guides are stored in asciidoc format in the odp/docs directory and in
+- Users guides are stored in asciidoctor format in the odp/docs directory and 
in
   sub directories of it as appropriate.
 - ODP code references such as types and enums are highlighted using the
   + syntax. For example text referring to the type odp_pktio_t would decorate 
the
@@ -129,7 +129,7 @@ Code without a proper signoff cannot be merged into the 
mainline.
 image::../images/.svg[align="center"]
 - The images are stored in the doc/images directory as svg files.
 - Body text shall wrap at the 80 char point.
-- No warnings may be generated by the asciidoc tool.
+- No warnings may be generated by the asciidoctor tool.
 
 6. References
 -
diff --git a/DEPENDENCIES b/DEPENDENCIES
index d59858c..a5266c9 100644
--- a/DEPENDENCIES
+++ b/DEPENDENCIES
@@ -252,7 +252,7 @@ The tested version of doxygen is 1.8.8
 
 5.2.1 HTML
# Debian/Ubuntu
-   $ apt-get install asciidoc source-highlight librsvg2-bin
+   $ apt-get install asciidoctor source-highlight librsvg2-bin
 
 6.0 Submitting patches
 
diff --git a/doc/Makefile.inc b/doc/Makefile.inc
index c0b641e..643b1d4 100644
--- a/doc/Makefile.inc
+++ b/doc/Makefile.inc
@@ -7,6 +7,6 @@ VPATH=$(top_builddir)/doc/images
dot -T svg $^ -o $@
 
 .adoc.html:
-   asciidoc $(ASCIIDOC_FLAGS) --out-file=$@ $<
+   asciidoctor $(ASCIIDOC_FLAGS) --out-file=$@ $<
 
-ASCIIDOC_FLAGS =-a data-uri -b html5  -a icons -a toc2  -a max-width=55em
+ASCIIDOC_FLAGS =-a data-uri -b html5 -a icons=font -a toc2
diff --git a/doc/m4/configure.m4 b/doc/m4/configure.m4
index b30c70b..998afe9 100644
--- a/doc/m4/configure.m4
+++ b/doc/m4/configure.m4
@@ -7,11 +7,11 @@ if test -z "$DOXYGEN";
 fi
 
 ##
-# Check for asciidoc availability
+# Check for asciidoctor availability
 ##
-AC_CHECK_PROGS([ASCIIDOC], [asciidoc])
-if test -z "$ASCIIDOC";
-   then AC_MSG_WARN([asciidoc not found - continuing without asciidoc support])
+AC_CHECK_PROGS([ASCIIDOCTOR], [asciidoctor])
+if test -z "$ASCIIDOCTOR";
+   then AC_MSG_WARN([asciidoctor not found - continuing without asciidoctor 
support])
 fi
 
 ##
@@ -21,8 +21,8 @@ user_guides=no
 AC_ARG_ENABLE([user-guides],
 [  --enable-user-guidesgenerate supplemental users guides],
 [if test "x$enableval" = "xyes"; then
-if test -z "$ASCIIDOC";
-   then AC_MSG_ERROR([cannot generate user guides without asciidoc])
+if test -z "$ASCIIDOCTOR";
+   then AC_MSG_ERROR([cannot generate user guides without asciidoctor])
 else
user_guides=yes
 fi
diff --git a/doc/users-guide/users-guide-tm.adoc 
b/doc/users-guide/users-guide-tm.adoc
index 132fdc1..5dc2190 100644
--- a/doc/users-guide/users-guide-tm.adoc
+++ b/doc/users-guide/users-guide-tm.adoc
@@ -269,7 +269,7 @@ result in faster operation and/or less memory used.
 [source,c]
 
 
-   odp_tm_params_init(&tm_params); /* <1> */
+   odp_tm_params_init(&tm_params); // <1>
tm_params.pktio = egress_pktio;
tm = odp_tm_create(“Example TM”, &tm_params);
 
@@ -285,11 +285,11 @@ result in faster operation and/or less memory used.
tmq_B2 = odp_tm_queue_create(tm, &queue_params);
tmq_C2 = odp_tm_queue_create(tm, &queue_params);
 
-   odp_tm_node_params_init(&node_params); /* <2> */
+   odp_tm_node_params_init(&node_params); // <2>
node_params.level = 1;
tm_node_1 = odp_tm_node_create(tm, “TmNode1”, &node_params);
 
-   odp_tm_queue_connect(tmq_A1, tm_node_1); /* <3> */
+   odp_tm_queue_connect(tmq_A1, tm_node_1); // <3>
odp_tm_queue_connect(tmq_B1, tm_node_1);
odp_tm_queue_connect(tmq_A2, tm_node_1);
odp_tm_queue_connect(tmq_B2, tm_node_1);
@@ -302,7 +302,7 @@ code does is create a scheduler PROFILE, which is 
effectively a regist

Re: [lng-odp] [PATCH v2] doc: support ascidoctor

2016-05-04 Thread Mike Holmes
Merged

On 4 May 2016 at 13:04, Mike Holmes  wrote:

> ascidoctor is a python asciidoc interpreter it has greater capabilities
> than asciidoc which is a perl based interpreter
>
> The resulting style sheet improvements result in more professional
> looking docs that can be further enhanced with our own css at some
> point.
>
> This also supports including code snippets in the documentation from the
> doxygen specification  files.
>
> Signed-off-by: Mike Holmes 
> Reviewed-by: Bill Fischofer 
> ---
>  CONTRIBUTING|  4 ++--
>  DEPENDENCIES|  2 +-
>  doc/Makefile.inc|  4 ++--
>  doc/m4/configure.m4 | 12 ++--
>  doc/users-guide/users-guide-tm.adoc | 18 +-
>  5 files changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/CONTRIBUTING b/CONTRIBUTING
> index f6e3fc6..f2f8947 100644
> --- a/CONTRIBUTING
> +++ b/CONTRIBUTING
> @@ -106,7 +106,7 @@ Code without a proper signoff cannot be merged into
> the mainline.
>
>  5. Documenting the user docs
>  
> -- Users guides are stored in asciidoc format in the odp/docs directory
> and in
> +- Users guides are stored in asciidoctor format in the odp/docs directory
> and in
>sub directories of it as appropriate.
>  - ODP code references such as types and enums are highlighted using the
>+ syntax. For example text referring to the type odp_pktio_t would
> decorate the
> @@ -129,7 +129,7 @@ Code without a proper signoff cannot be merged into
> the mainline.
>  image::../images/.svg[align="center"]
>  - The images are stored in the doc/images directory as svg files.
>  - Body text shall wrap at the 80 char point.
> -- No warnings may be generated by the asciidoc tool.
> +- No warnings may be generated by the asciidoctor tool.
>
>  6. References
>  -
> diff --git a/DEPENDENCIES b/DEPENDENCIES
> index d59858c..a5266c9 100644
> --- a/DEPENDENCIES
> +++ b/DEPENDENCIES
> @@ -252,7 +252,7 @@ The tested version of doxygen is 1.8.8
>
>  5.2.1 HTML
> # Debian/Ubuntu
> -   $ apt-get install asciidoc source-highlight librsvg2-bin
> +   $ apt-get install asciidoctor source-highlight librsvg2-bin
>
>  6.0 Submitting patches
>
> diff --git a/doc/Makefile.inc b/doc/Makefile.inc
> index c0b641e..643b1d4 100644
> --- a/doc/Makefile.inc
> +++ b/doc/Makefile.inc
> @@ -7,6 +7,6 @@ VPATH=$(top_builddir)/doc/images
> dot -T svg $^ -o $@
>
>  .adoc.html:
> -   asciidoc $(ASCIIDOC_FLAGS) --out-file=$@ $<
> +   asciidoctor $(ASCIIDOC_FLAGS) --out-file=$@ $<
>
> -ASCIIDOC_FLAGS =-a data-uri -b html5  -a icons -a toc2  -a max-width=55em
> +ASCIIDOC_FLAGS =-a data-uri -b html5 -a icons=font -a toc2
> diff --git a/doc/m4/configure.m4 b/doc/m4/configure.m4
> index b30c70b..998afe9 100644
> --- a/doc/m4/configure.m4
> +++ b/doc/m4/configure.m4
> @@ -7,11 +7,11 @@ if test -z "$DOXYGEN";
>  fi
>
>  ##
> -# Check for asciidoc availability
> +# Check for asciidoctor availability
>  ##
> -AC_CHECK_PROGS([ASCIIDOC], [asciidoc])
> -if test -z "$ASCIIDOC";
> -   then AC_MSG_WARN([asciidoc not found - continuing without asciidoc
> support])
> +AC_CHECK_PROGS([ASCIIDOCTOR], [asciidoctor])
> +if test -z "$ASCIIDOCTOR";
> +   then AC_MSG_WARN([asciidoctor not found - continuing without
> asciidoctor support])
>  fi
>
>  ##
> @@ -21,8 +21,8 @@ user_guides=no
>  AC_ARG_ENABLE([user-guides],
>  [  --enable-user-guidesgenerate supplemental users guides],
>  [if test "x$enableval" = "xyes"; then
> -if test -z "$ASCIIDOC";
> -   then AC_MSG_ERROR([cannot generate user guides without
> asciidoc])
> +if test -z "$ASCIIDOCTOR";
> +   then AC_MSG_ERROR([cannot generate user guides without
> asciidoctor])
>  else
> user_guides=yes
>  fi
> diff --git a/doc/users-guide/users-guide-tm.adoc
> b/doc/users-guide/users-guide-tm.adoc
> index 132fdc1..5dc2190 100644
> --- a/doc/users-guide/users-guide-tm.adoc
> +++ b/doc/users-guide/users-guide-tm.adoc
> @@ -269,7 +269,7 @@ result in faster operation and/or less memory used.
>  [source,c]
>  
>
> -   odp_tm_params_init(&tm_params); /* <1> */
> +   odp_tm_params_init(&tm_params); // <1>
> tm_params.pktio = egress_pktio;
> tm = odp_tm_create(“Example TM”, &tm_params);
>
> @@ -285,11 +285,11 @@ result in faster operation and/or less memory used.
> tmq_B2 = odp_tm_queue_create(tm, &queue_params);
> tmq_C2 = odp_tm_queue_create(tm, &queue_params);
>
> -   odp_tm_node_params_init(&node_params); /* <2> */
> +   odp_tm_node_params_init(&node_params); // <2>
> node_params.level = 1;
> tm_node_1 = odp_tm_node_create(tm, “TmNode1”, &node_params);
>
> -   odp_tm_queue_connect(tmq_A1, tm_node_1); /* <3> 

Re: [lng-odp] [PATCH] linux-generic: arch: add missing cache line size definition for linux

2016-05-04 Thread Mike Holmes
On 4 May 2016 at 12:47, Bill Fischofer  wrote:

> Use a default cache line size of 64 for otherwise unrecognized linux
> platforms. This resolves bug https://bugs.linaro.org/show_bug.cgi?id=2218
>
> Reported-by: Matias Elo 
> Signed-off-by: Bill Fischofer 
> ---
>  platform/linux-generic/arch/linux/odp/api/cpu_arch.h | 10 ++
>  1 file changed, 10 insertions(+)
>
> diff --git a/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
> b/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
> index 1c79f87..29f8889 100644
> --- a/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
> +++ b/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
> @@ -11,6 +11,16 @@
>  extern "C" {
>  #endif
>
> +/** @ingroup odp_compiler_optim
> + *  @{
> + */
> +
> +#define ODP_CACHE_LINE_SIZE 64
>

Is this a good number on a 16 bit linux system how about 32 ?


> +
> +/**
> + * @}
> + */
> +
>  static inline void odp_cpu_pause(void)
>  {
>  }
> --
> 2.5.0
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>



-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org  *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] linux-generic: arch: add missing cache line size definition for linux

2016-05-04 Thread Bill Fischofer
On Wed, May 4, 2016 at 2:35 PM, Mike Holmes  wrote:

>
>
> On 4 May 2016 at 12:47, Bill Fischofer  wrote:
>
>> Use a default cache line size of 64 for otherwise unrecognized linux
>> platforms. This resolves bug https://bugs.linaro.org/show_bug.cgi?id=2218
>>
>> Reported-by: Matias Elo 
>> Signed-off-by: Bill Fischofer 
>> ---
>>  platform/linux-generic/arch/linux/odp/api/cpu_arch.h | 10 ++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
>> b/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
>> index 1c79f87..29f8889 100644
>> --- a/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
>> +++ b/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
>> @@ -11,6 +11,16 @@
>>  extern "C" {
>>  #endif
>>
>> +/** @ingroup odp_compiler_optim
>> + *  @{
>> + */
>> +
>> +#define ODP_CACHE_LINE_SIZE 64
>>
>
> Is this a good number on a 16 bit linux system how about 32 ?
>

We don't support 16-bit linux.  32-bit is the minimum for ODP.  Also, for
cache alignment overaligned is better than underaligned, so if the actual
cache line size is 32 then using 64-byte alignment does no harm since a
64-byte aligned address is also 32-byte aligned.


>
>
>> +
>> +/**
>> + * @}
>> + */
>> +
>>  static inline void odp_cpu_pause(void)
>>  {
>>  }
>> --
>> 2.5.0
>>
>> ___
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org  *│ *Open source software for ARM SoCs
> "Work should be fun and collaborative, the rest follows"
>
>
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] linux-generic: arch: add missing cache line size definition for linux

2016-05-04 Thread Mike Holmes
On 4 May 2016 at 15:40, Bill Fischofer  wrote:

>
>
> On Wed, May 4, 2016 at 2:35 PM, Mike Holmes 
> wrote:
>
>>
>>
>> On 4 May 2016 at 12:47, Bill Fischofer  wrote:
>>
>>> Use a default cache line size of 64 for otherwise unrecognized linux
>>> platforms. This resolves bug
>>> https://bugs.linaro.org/show_bug.cgi?id=2218
>>>
>>> Reported-by: Matias Elo 
>>> Signed-off-by: Bill Fischofer 
>>> ---
>>>  platform/linux-generic/arch/linux/odp/api/cpu_arch.h | 10 ++
>>>  1 file changed, 10 insertions(+)
>>>
>>> diff --git a/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
>>> b/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
>>> index 1c79f87..29f8889 100644
>>> --- a/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
>>> +++ b/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
>>> @@ -11,6 +11,16 @@
>>>  extern "C" {
>>>  #endif
>>>
>>> +/** @ingroup odp_compiler_optim
>>> + *  @{
>>> + */
>>> +
>>> +#define ODP_CACHE_LINE_SIZE 64
>>>
>>
>> Is this a good number on a 16 bit linux system how about 32 ?
>>
>
> We don't support 16-bit linux.
>

Yes we do, at least we have to assume so :) - it is called linux-generic it
is based on any place linux can run, if some mad Eastern European drinking
a gallon of Vodka makes linux run on a 3 and 1/2 bit CPU we currently
support it by the default ARCH=linux

Additionally nowhere can I find that we state we dont support 16 bit linux.


>  32-bit is the minimum for ODP.
>

This needs to be prominently added to the docs, and then I can agree.


> Also, for cache alignment overaligned is better than underaligned, so if
> the actual cache line size is 32 then using 64-byte alignment does no harm
> since a 64-byte aligned address is also 32-byte aligned.
>

This gets you a silent degradation in the amount of memory you use on a
linux system that happens to be less than 64bits, and also silently an
enforced under alignment on a 128 bit system, the very thing you wanted to
avoid.

I am being nit picky to really get it well defined, I think we assume too
much  that really ODP is run with the OS=linux, on a 64Bit CPU with posix
threading.


>
>
>>
>>
>>> +
>>> +/**
>>> + * @}
>>> + */
>>> +
>>>  static inline void odp_cpu_pause(void)
>>>  {
>>>  }
>>> --
>>> 2.5.0
>>>
>>> ___
>>> lng-odp mailing list
>>> lng-odp@lists.linaro.org
>>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>>
>>
>>
>>
>> --
>> Mike Holmes
>> Technical Manager - Linaro Networking Group
>> Linaro.org  *│ *Open source software for ARM SoCs
>> "Work should be fun and collaborative, the rest follows"
>>
>>
>>
>


-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org  *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH v2 2/3] doc: users-guide: add packet flow overview

2016-05-04 Thread Mike Holmes
Signed-off-by: Mike Holmes 
---
 doc/users-guide/Makefile.am  | 3 ++-
 doc/users-guide/users-guide.adoc | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 doc/users-guide/users-guide.adoc

diff --git a/doc/users-guide/Makefile.am b/doc/users-guide/Makefile.am
index 5cc8c7c..ffb0d1c 100644
--- a/doc/users-guide/Makefile.am
+++ b/doc/users-guide/Makefile.am
@@ -9,7 +9,8 @@ IMAGES = $(top_srcdir)/doc/images/overview.svg \
 $(top_srcdir)/doc/images/odp_traffic_manager.svg \
 $(top_srcdir)/doc/images/parallel_queue.svg \
 $(top_srcdir)/doc/images/atomic_queue.svg \
-$(top_srcdir)/doc/images/ordered_queue.svg
+$(top_srcdir)/doc/images/ordered_queue.svg \
+$(top_srcdir)/doc/images/packet_flow.svg
 
 IMAGES += $(top_srcdir)/doc/images/pktio_fsm.svg
 
diff --git a/doc/users-guide/users-guide.adoc b/doc/users-guide/users-guide.adoc
old mode 100644
new mode 100755
index a2e5058..c91c8ab
--- a/doc/users-guide/users-guide.adoc
+++ b/doc/users-guide/users-guide.adoc
@@ -201,6 +201,9 @@ main ODP concepts are:
 Thread, Event, Queue, Pool, Shared Memory, Buffer, Packet, PktIO, Time, Timer,
 and Synchronizer.
 
+.OpenDataPlane Packet Flow Overview
+image::packet_flow.svg[align="center"]
+
 === Thread
 The thread is the fundamental programming unit in ODP.  ODP applications are
 organized into a collection of threads that perform the work that the
-- 
2.7.4

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


[lng-odp] [PATCH v2 3/3] doc: users-guide: depend on the images

2016-05-04 Thread Mike Holmes
Signed-off-by: Mike Holmes 
---
 doc/users-guide/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/users-guide/Makefile.am b/doc/users-guide/Makefile.am
index ffb0d1c..214e2c0 100644
--- a/doc/users-guide/Makefile.am
+++ b/doc/users-guide/Makefile.am
@@ -21,7 +21,7 @@ endif
 EXTRA_DIST = $(SRC) $(IMAGES)
 
 doc_DATA = $(TARGET)
-$(TARGET): $(SRC)
+$(TARGET): $(SRC) $(IMAGES)
 
 clean-local:
rm -f $(builddir)/$(TARGET)
-- 
2.7.4

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


Re: [lng-odp] [PATCH] linux-generic: arch: add missing cache line size definition for linux

2016-05-04 Thread Bill Fischofer
On Wed, May 4, 2016 at 2:53 PM, Mike Holmes  wrote:

>
>
> On 4 May 2016 at 15:40, Bill Fischofer  wrote:
>
>>
>>
>> On Wed, May 4, 2016 at 2:35 PM, Mike Holmes 
>> wrote:
>>
>>>
>>>
>>> On 4 May 2016 at 12:47, Bill Fischofer 
>>> wrote:
>>>
 Use a default cache line size of 64 for otherwise unrecognized linux
 platforms. This resolves bug
 https://bugs.linaro.org/show_bug.cgi?id=2218

 Reported-by: Matias Elo 
 Signed-off-by: Bill Fischofer 
 ---
  platform/linux-generic/arch/linux/odp/api/cpu_arch.h | 10 ++
  1 file changed, 10 insertions(+)

 diff --git a/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
 b/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
 index 1c79f87..29f8889 100644
 --- a/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
 +++ b/platform/linux-generic/arch/linux/odp/api/cpu_arch.h
 @@ -11,6 +11,16 @@
  extern "C" {
  #endif

 +/** @ingroup odp_compiler_optim
 + *  @{
 + */
 +
 +#define ODP_CACHE_LINE_SIZE 64

>>>
>>> Is this a good number on a 16 bit linux system how about 32 ?
>>>
>>
>> We don't support 16-bit linux.
>>
>
> Yes we do, at least we have to assume so :) - it is called linux-generic
> it is based on any place linux can run, if some mad Eastern European
> drinking a gallon of Vodka makes linux run on a 3 and 1/2 bit CPU we
> currently support it by the default ARCH=linux
>
> Additionally nowhere can I find that we state we dont support 16 bit linux.
>

I can't find an explicit reference to this in the ODP archives but I recall
very early in the project we decided to restrict ODP to a minimum of 32-bit
support because (a) none of our members had 16-bit HW and (b) we didn't
have any tools or systems to test ODP in 16-bit linux environments. If we
wanted to add such support it would be a major effort for little return.
The current linux-generic implementation, for example, assumes a minimum of
32-bit addressing in many places.

We can certainly add a documentation note to the Implementer's Guide that
ODP is designed for systems that use 32-bit or 64-bit addressing.


>
>
>>  32-bit is the minimum for ODP.
>>
>
> This needs to be prominently added to the docs, and then I can agree.
>
>
>> Also, for cache alignment overaligned is better than underaligned, so if
>> the actual cache line size is 32 then using 64-byte alignment does no harm
>> since a 64-byte aligned address is also 32-byte aligned.
>>
>
> This gets you a silent degradation in the amount of memory you use on a
> linux system that happens to be less than 64bits, and also silently an
> enforced under alignment on a 128 bit system, the very thing you wanted to
> avoid.
>
> I am being nit picky to really get it well defined, I think we assume too
> much  that really ODP is run with the OS=linux, on a 64Bit CPU with posix
> threading.
>

I think you're trying to turn a bug-fix into an architecture discussion. If
someone has a better "guess" as to what cache line size to use for an
unknown and unspecified architecture I'm happy to change this.  But the
issue is that the #define is missing, which causes the compile error Matias
reported.


>
>
>>
>>
>>>
>>>
 +
 +/**
 + * @}
 + */
 +
  static inline void odp_cpu_pause(void)
  {
  }
 --
 2.5.0

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

>>>
>>>
>>>
>>> --
>>> Mike Holmes
>>> Technical Manager - Linaro Networking Group
>>> Linaro.org  *│ *Open source software for ARM
>>> SoCs
>>> "Work should be fun and collaborative, the rest follows"
>>>
>>>
>>>
>>
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org  *│ *Open source software for ARM SoCs
> "Work should be fun and collaborative, the rest follows"
>
>
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 2220] New: Coverity: Unused values in packet test

2016-05-04 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2220

Bug ID: 2220
   Summary: Coverity: Unused values in packet test
   Product: OpenDataPlane - linux- generic reference
   Version: v1.10
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Buffers & Packets
  Assignee: bill.fischo...@linaro.org
  Reporter: bill.fischo...@linaro.org
CC: lng-odp@lists.linaro.org
  Target Milestone: ---

*** CID 161200:(UNUSED_VALUE)
/test/validation/packet/packet.c: 1170 in packet_test_align()
1164/* Realign for addressability */
1165CU_ASSERT(odp_packet_align(&pkt, offset,
1166   seg_len + 2, 0) >= 0);
1167
1168/* Alignment doesn't change packet length or contents
*/
1169CU_ASSERT(odp_packet_len(pkt) == pkt_len);
>>> CID 161200:(UNUSED_VALUE)
>>> Assigning value from "odp_packet_offset(pkt, offset, &aligned_seglen, 
>>> NULL)" to "aligned_data" here, but that stored value is overwritten before 
>>> it can be used.
1170aligned_data = odp_packet_offset(pkt, offset,
1171 &aligned_seglen,
NULL);
1172_packet_compare_offset(pkt, offset,
1173   segmented_test_packet, offset,
1174   aligned_seglen);
1175
/test/validation/packet/packet.c: 1162 in packet_test_align()
1156
1157if (odp_packet_is_segmented(pkt)) {
1158/* Can't address across segment boundaries */
1159CU_ASSERT(odp_packet_align(&pkt, 0, pkt_len, 0) < 0);
1160
1161offset = seg_len - 5;
>>> CID 161200:(UNUSED_VALUE)
>>> Assigning value from "odp_packet_offset(pkt, offset, &seg_len, NULL)" 
>>> to "pkt_data" here, but that stored value is overwritten before it can be 
>>> used.
1162pkt_data = odp_packet_offset(pkt, offset, &seg_len,
NULL);
1163
1164/* Realign for addressability */
1165CU_ASSERT(odp_packet_align(&pkt, offset,
1166   seg_len + 2, 0) >= 0);
1167

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


[lng-odp] [PATCH] test: packet: remove unused values to address coverity scan issue

2016-05-04 Thread Bill Fischofer
Resolve bug https://bugs.linaro.org/show_bug.cgi?id=2220 by removing
unused values.

Signed-off-by: Bill Fischofer 
---
 test/validation/packet/packet.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/test/validation/packet/packet.c b/test/validation/packet/packet.c
index 7c9622f..bf8d9f4 100644
--- a/test/validation/packet/packet.c
+++ b/test/validation/packet/packet.c
@@ -1159,7 +1159,7 @@ void packet_test_align(void)
CU_ASSERT(odp_packet_align(&pkt, 0, pkt_len, 0) < 0);
 
offset = seg_len - 5;
-   pkt_data = odp_packet_offset(pkt, offset, &seg_len, NULL);
+   (void)odp_packet_offset(pkt, offset, &seg_len, NULL);
 
/* Realign for addressability */
CU_ASSERT(odp_packet_align(&pkt, offset,
@@ -1167,8 +1167,7 @@ void packet_test_align(void)
 
/* Alignment doesn't change packet length or contents */
CU_ASSERT(odp_packet_len(pkt) == pkt_len);
-   aligned_data = odp_packet_offset(pkt, offset,
-&aligned_seglen, NULL);
+   (void)odp_packet_offset(pkt, offset, &aligned_seglen, NULL);
_packet_compare_offset(pkt, offset,
   segmented_test_packet, offset,
   aligned_seglen);
-- 
2.5.0

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


[lng-odp] [Bug 2221] New: IPC maintainability issues identified by coverity

2016-05-04 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2221

Bug ID: 2221
   Summary: IPC maintainability issues identified by coverity
   Product: OpenDataPlane - linux- generic reference
   Version: v1.10
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Packet IO
  Assignee: maxim.uva...@linaro.org
  Reporter: bill.fischo...@linaro.org
CC: lng-odp@lists.linaro.org
  Target Milestone: ---

*** CID 161201:  Code maintainability issues  (UNUSED_VALUE)
/platform/linux-generic/pktio/ipc.c: 630 in ipc_pktio_send()
624 odp_packet_free(pkt);
625 pkt_table_mapped[i] = newpkt;
626 } else {
627 pkt_table_mapped[i] = pkt;
628 }
629
>>> CID 161201:  Code maintainability issues  (UNUSED_VALUE)
>>> Assigning value from "(void *)&pkt" to "rbuf_p" here, but that stored 
>>> value is overwritten before it can be used.
630 rbuf_p = (void *)&pkt;
631
632 /* buf_hdr.addr can not be used directly in remote
process,
633  * convert it to offset
634  */
635 for (j = 0; j < ODP_BUFFER_MAX_SEG; j++) {

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


[lng-odp] [Bug 2222] New: Coverity: uninitialized variables

2016-05-04 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=

Bug ID: 
   Summary: Coverity: uninitialized variables
   Product: OpenDataPlane - linux- generic reference
   Version: v1.10
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Packet IO
  Assignee: maxim.uva...@linaro.org
  Reporter: bill.fischo...@linaro.org
CC: lng-odp@lists.linaro.org
  Target Milestone: ---

*** CID 161196:  Uninitialized variables  (UNINIT)
/test/validation/pktio/pktio.c: 881 in test_recv_tmo()
875 odp_pktio_t pktio[MAX_NUM_IFACES];
876 odp_pktio_capability_t capa;
877 odp_pktin_queue_param_t in_queue_param;
878 odp_pktout_queue_t pktout_queue;
879 int test_pkt_count = 6;
880 odp_packet_t pkt_tbl[test_pkt_count];
>>> CID 161196:  Uninitialized variables  (UNINIT)
>>> Declaring variable "pkt_seq" without initializer.
881 uint32_t pkt_seq[test_pkt_count];
882 uint64_t ns;
883 unsigned num_q;
884 int ret;
885 int i;
886

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


[lng-odp] [Bug 2223] New: Coverity issues with Monarch RC2 Traffic Manager

2016-05-04 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2223

Bug ID: 2223
   Summary: Coverity issues with Monarch RC2 Traffic Manager
   Product: OpenDataPlane - linux- generic reference
   Version: v1.10
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Traffic Manager
  Assignee: lng-odp@lists.linaro.org
  Reporter: bill.fischo...@linaro.org
CC: lng-odp@lists.linaro.org
  Target Milestone: ---

*** CID 161199:  Code maintainability issues  (UNUSED_VALUE)
/test/validation/traffic_mngr/traffic_mngr.c: 3405 in test_ip_marking()
3399
3400/* Next enable IP TOS marking for just the given color
parameter */
3401if ((!test_ecn) && (!test_drop_prec))
3402return 0;
3403
3404if (test_ecn)
>>> CID 161199:  Code maintainability issues  (UNUSED_VALUE)
>>> Assigning value from "odp_tm_ecn_marking(odp_tm, pkt_color, 1)" to "rc" 
>>> here, but that stored value is overwritten before it can be used.
3405rc = odp_tm_ecn_marking(odp_tm, pkt_color, true);
3406
3407if (test_drop_prec)
3408rc = odp_tm_drop_prec_marking(odp_tm, pkt_color, true);
3409
3410tm_queue = find_tm_queue(0, node_name, 0);

** CID 161198:  Code maintainability issues  (UNUSED_VALUE)
/test/validation/traffic_mngr/traffic_mngr.c: 3408 in test_ip_marking()



*** CID 161198:  Code maintainability issues  (UNUSED_VALUE)
/test/validation/traffic_mngr/traffic_mngr.c: 3408 in test_ip_marking()
3402return 0;
3403
3404if (test_ecn)
3405rc = odp_tm_ecn_marking(odp_tm, pkt_color, true);
3406
3407if (test_drop_prec)
>>> CID 161198:  Code maintainability issues  (UNUSED_VALUE)
>>> Assigning value from "odp_tm_drop_prec_marking(odp_tm, pkt_color, 1)" 
>>> to "rc" here, but that stored value is overwritten before it can be used.
3408rc = odp_tm_drop_prec_marking(odp_tm, pkt_color, true);
3409
3410tm_queue = find_tm_queue(0, node_name, 0);
3411if (tm_queue == ODP_TM_INVALID) {
3412LOG_ERR("No tm_queue found for node_name='%s'\n",
node_name);
3413return -1;

** CID 161197:  Control flow issues  (UNREACHABLE)
/test/validation/traffic_mngr/traffic_mngr.c: 1635 in dump_tm_tree()



*** CID 161197:  Control flow issues  (UNREACHABLE)
/test/validation/traffic_mngr/traffic_mngr.c: 1635 in dump_tm_tree()
1629
1630 static void dump_tm_tree(uint32_t tm_idx)
1631 {
1632tm_node_desc_t *root_node_desc;
1633
1634return;
>>> CID 161197:  Control flow issues  (UNREACHABLE)
>>> This code cannot be reached: "root_node_desc = root_node_...".
1635root_node_desc = root_node_descs[tm_idx];
1636dump_tm_subtree(root_node_desc);
1637 }
1638
1639 static int unconfig_tm_queue_profiles(odp_tm_queue_t tm_queue)
1640 {


** CID 161195:  Memory - illegal accesses  (OVERRUN)
/platform/linux-generic/odp_traffic_mngr.c: 2651 in odp_tm_vlan_marking()



*** CID 161195:  Memory - illegal accesses  (OVERRUN)
/platform/linux-generic/odp_traffic_mngr.c: 2651 in odp_tm_vlan_marking()
2645
2646tm_system = GET_TM_SYSTEM(odp_tm);
2647if ((tm_system == NULL) || (ODP_NUM_PACKET_COLORS < color))
2648return -1;
2649
2650if (drop_eligible_enabled)
>>> CID 161195:  Memory - illegal accesses  (OVERRUN)
>>> Overrunning array "tm_system->requirements.marking_colors_needed" of 3 
>>> 4-byte elements at element index 3 (byte offset 12) using index "color" 
>>> (which evaluates to 3).
2651if ((!tm_system->requirements.vlan_marking_needed) ||
2652   
(!tm_system->requirements.marking_colors_needed[color]))
2653return -2;
2654
2655vlan_marking = &tm_system->marking.vlan_marking[color];
2656vlan_marking->marking_enabled   = drop_eligible_enabled;

** CID 161194:  Memory - corruptions  (OVERRUN)
/platform/linux-generic/odp_traffic_mngr.c: 2656 in odp_tm_vlan_marking()



*** CID 161194:  Memory - corruptions  (OVERRUN)
/platform/linux-generic/odp_traffic_mngr.c: 2656 in odp_tm_vlan_marking()
2650if (drop_eligible_enabled)
2651if ((!tm_system->requirements.vlan_marking_needed) ||
2652   
(!tm_system

[lng-odp] [Bug 2220] Coverity: Unused values in packet test

2016-05-04 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2220

--- Comment #1 from Bill Fischofer  ---
Patch http://patches.opendataplane.org/patch/5905/ posted to address this
issue.

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


[lng-odp] [Bug 2224] New: Coverity: Negative return

2016-05-04 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2224

Bug ID: 2224
   Summary: Coverity: Negative return
   Product: OpenDataPlane - linux- generic reference
   Version: v1.10
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Packet IO
  Assignee: maxim.uva...@linaro.org
  Reporter: bill.fischo...@linaro.org
CC: lng-odp@lists.linaro.org
  Target Milestone: ---

*** CID 161192:  Integer handling issues  (NEGATIVE_RETURNS)
/test/validation/pktio/pktio.c: 505 in recv_packets_tmo()
499 unsigned from_val;
500 unsigned *from = NULL;
501
502 if (mode == RECV_MQ_TMO)
503 from = &from_val;
504
>>> CID 161192:  Integer handling issues  (NEGATIVE_RETURNS)
>>> Assigning: unsigned variable "num_q" = "odp_pktin_queue".
505 num_q = odp_pktin_queue(pktio, pktin, MAX_QUEUES);
506 CU_ASSERT_FATAL(num_q > 0);
507
508 /** Multiple odp_pktin_recv_tmo()/odp_pktin_recv_mq_tmo() calls
may be
509  *  required to discard possible non-test packets. */
510 do {

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


[lng-odp] [Bug 2225] New: Coverity ring test issues

2016-05-04 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2225

Bug ID: 2225
   Summary: Coverity ring test issues
   Product: OpenDataPlane - linux- generic reference
   Version: v1.10
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: General ODP
  Assignee: lng-odp@lists.linaro.org
  Reporter: bill.fischo...@linaro.org
  Target Milestone: ---

The following issues are flagged by Coverity in the ring tests:

*** CID 161193:  Incorrect expression  (NO_EFFECT)
/platform/linux-generic/test/ring/ringtest.c: 443 in main()
437 exit(EXIT_FAILURE);
438 }
439
440 _ring_tailq_init();
441
442 num_workers = odp_cpumask_default_worker(&cpu_mask,
MAX_WORKERS);
>>> CID 161193:  Incorrect expression  (NO_EFFECT)
>>> Assignment operation "rarg.thrdarg.numthrds = rarg.thrdarg.numthrds" 
>>> has no effect.
443 rarg.thrdarg.numthrds = rarg.thrdarg.numthrds;
444
445 rarg.thrdarg.testcase = ODP_RING_TEST_BASIC;
446
447 memset(&thr_params, 0, sizeof(thr_params));
448 thr_params.start= test_ring;


*** CID 161191:  Control flow issues  (DEADCODE)
/platform/linux-generic/test/ring/ringtest.c: 400 in test_ring()
394 break;
395
396 case ODP_RING_TEST_STRESS:
397 test_ring_stress(parg->stress_type);
398
399 if (result)
>>> CID 161191:  Control flow issues  (DEADCODE)
>>> Execution cannot reach this statement: "_ring_list_dump();".
400 _ring_list_dump();
401 break;
402
403 default:
404 LOG_ERR("Invalid test case [%d]\n",
parg->thrdarg.testcase);
405 result = -1;

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


Re: [lng-odp] [API-NEXT, RFC, 1/1] api: cpu: performance profiling start/stop

2016-05-04 Thread Yi He
Hi, thanks Mike and Bill,

>From your clear summarize can we put it into several TO-DO decisions: (we
can have a discussion in next ARCH call):

   1. How to addressing the precise semantics of the existing timing APIs
   (odp_cpu_xxx) as they relate to processor locality.


   - *A:* guarantee by adding constraint to ODP thread concept: every ODP
   thread shall be deployed and pinned on one CPU core.
  - A sub-question: my understanding is that application programmers
  only need to specify available CPU sets for control/worker
threads, and it
  is ODP to arrange the threads onto each CPU core while launching, right?
   - *B*: guarantee by adding new APIs to disable/enable CPU migration.
   - Then document clearly in user's guide or API document.


   1. Understand the requirement to have both processor-local and
   system-wide timing APIs:


   - There are some APIs available in time.h (odp_time_local(), etc).
   - We can have a thread to understand the relationship, usage scenarios
   and constraints of APIs in time.h and cpu.h.

Best Regards, Yi

On 4 May 2016 at 23:32, Bill Fischofer  wrote:

> I think there are two fallouts form this discussion.  First, there is the
> question of the precise semantics of the existing timing APIs as they
> relate to processor locality. Applications such as profiling tests, to the
> extent that they APIs that have processor-local semantics, must ensure that
> the thread(s) using these APIs are pinned for the duration of the
> measurement.
>
> The other point is the one that Petri brought up about having other APIs
> that provide timing information based on wall time or other metrics that
> are not processor-local.  While these may not have the same performance
> characteristics, they would be independent of thread migration
> considerations.
>
> Of course all this depends on exactly what one is trying to measure. Since
> thread migration is not free, allowing such activity may or may not be
> relevant to what is being measured, so ODP probably wants to have both
> processor-local and systemwide timing APIs.  We just need to be sure they
> are specified precisely so that applications know how to use them properly.
>
> On Wed, May 4, 2016 at 10:23 AM, Mike Holmes 
> wrote:
>
>> It sounded like the arch call was leaning towards documenting that on
>> odp-linux  the application must ensure that odp_threads are pinned to cores
>> when launched.
>> This is a restriction that some platforms may not need to make, vs the
>> idea that a piece of ODP code can use these APIs to ensure the behavior it
>> needs without knowledge or reliance on the wider system.
>>
>> On 4 May 2016 at 01:45, Yi He  wrote:
>>
>>> Establish a performance profiling environment guarantees meaningful
>>> and consistency of consecutive invocations of the odp_cpu_xxx() APIs.
>>> While after profiling was done restore the execution environment to
>>> its multi-core optimized state.
>>>
>>> Signed-off-by: Yi He 
>>> ---
>>>  include/odp/api/spec/cpu.h | 31 +++
>>>  1 file changed, 31 insertions(+)
>>>
>>> diff --git a/include/odp/api/spec/cpu.h b/include/odp/api/spec/cpu.h
>>> index 2789511..0bc9327 100644
>>> --- a/include/odp/api/spec/cpu.h
>>> +++ b/include/odp/api/spec/cpu.h
>>> @@ -27,6 +27,21 @@ extern "C" {
>>>
>>>
>>>  /**
>>> + * @typedef odp_profiler_t
>>> + * ODP performance profiler handle
>>> + */
>>> +
>>> +/**
>>> + * Setup a performance profiling environment
>>> + *
>>> + * A performance profiling environment guarantees meaningful and
>>> consistency of
>>> + * consecutive invocations of the odp_cpu_xxx() APIs.
>>> + *
>>> + * @return performance profiler handle
>>> + */
>>> +odp_profiler_t odp_profiler_start(void);
>>> +
>>> +/**
>>>   * CPU identifier
>>>   *
>>>   * Determine CPU identifier on which the calling is running. CPU
>>> numbering is
>>> @@ -170,6 +185,22 @@ uint64_t odp_cpu_cycles_resolution(void);
>>>  void odp_cpu_pause(void);
>>>
>>>  /**
>>> + * Stop the performance profiling environment
>>> + *
>>> + * Stop performance profiling and restore the execution environment to
>>> its
>>> + * multi-core optimized state, won't preserve meaningful and
>>> consistency of
>>> + * consecutive invocations of the odp_cpu_xxx() APIs anymore.
>>> + *
>>> + * @param profiler  performance profiler handle
>>> + *
>>> + * @retval 0 on success
>>> + * @retval <0 on failure
>>> + *
>>> + * @see odp_profiler_start()
>>> + */
>>> +int odp_profiler_stop(odp_profiler_t profiler);
>>> +
>>> +/**
>>>   * @}
>>>   */
>>>
>>> --
>>> 1.9.1
>>>
>>> ___
>>> lng-odp mailing list
>>> lng-odp@lists.linaro.org
>>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>>
>>
>>
>>
>> --
>> Mike Holmes
>> Technical Manager - Linaro Networking Group
>> Linaro.org  *│ *Open source software for ARM SoCs
>> "Work should be fun and collaborative, the rest follows"
>>
>>
>>
>>