Re: [lng-odp] [PATCH] validation: schedule: code clean up

2015-03-12 Thread Maxim Uvarov

Merged,
Maxim.

On 03/11/15 20:42, Bill Fischofer wrote:



On Wed, Mar 11, 2015 at 7:59 AM, Petri Savolainen 
petri.savolai...@nokia.com mailto:petri.savolai...@nokia.com wrote:


Cleaned up usage of buf count, thread args and globals.

Signed-off-by: Petri Savolainen petri.savolai...@nokia.com
mailto:petri.savolai...@nokia.com


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


---
 test/validation/odp_schedule.c | 102
-
 1 file changed, 49 insertions(+), 53 deletions(-)

diff --git a/test/validation/odp_schedule.c
b/test/validation/odp_schedule.c
index 3035db8..a9369c5 100644
--- a/test/validation/odp_schedule.c
+++ b/test/validation/odp_schedule.c
@@ -38,14 +38,14 @@
 typedef struct {
int cpu_count;
odp_barrier_t barrier;
-   odp_schedule_prio_t current_prio;
-   int prio_buf_count;
-   odp_ticketlock_t count_lock;
+   int buf_count;
+   odp_ticketlock_t lock;
odp_spinlock_t atomic_lock;
 } test_globals_t;

-typedef struct ODP_PACKED {
-   pthrd_arg thrdarg;
+typedef struct {
+   pthrd_arg cu_thr;
+   test_globals_t *globals;
odp_schedule_sync_t sync;
int num_queues;
int num_prio;
@@ -84,22 +84,13 @@ static void *schedule_common_(void *arg)
 {
thread_args_t *args = (thread_args_t *)arg;
odp_schedule_sync_t sync;
-   int num_queues, num_prio, num_bufs, num_cpus;
-   odp_shm_t shm;
+   int num_cpus;
test_globals_t *globals;

+   globals = args-globals;
sync = args-sync;
-   num_queues = args-num_queues;
-   num_prio = args-num_prio;
-   num_bufs = args-num_bufs;
num_cpus = args-num_cpus;

-   shm = odp_shm_lookup(GLOBALS_SHM_NAME);
-   CU_ASSERT_FATAL(shm != ODP_SHM_INVALID);
-   globals = odp_shm_addr(shm);
-   CU_ASSERT_FATAL(globals != NULL);
-
-
if (num_cpus == globals-cpu_count)
odp_barrier_wait(globals-barrier);

@@ -110,13 +101,12 @@ static void *schedule_common_(void *arg)
int num = 0;
int locked;

-  odp_ticketlock_lock(globals-count_lock);
-   if (globals-prio_buf_count ==
-   num_bufs * num_queues * num_prio) {
-  odp_ticketlock_unlock(globals-count_lock);
+  odp_ticketlock_lock(globals-lock);
+   if (globals-buf_count == 0) {
+  odp_ticketlock_unlock(globals-lock);
break;
}
-  odp_ticketlock_unlock(globals-count_lock);
+  odp_ticketlock_unlock(globals-lock);

if (args-enable_schd_multi) {
odp_event_t events[BURST_BUF_SIZE];
@@ -155,13 +145,18 @@ static void *schedule_common_(void *arg)
}
}

-  odp_ticketlock_lock(globals-count_lock);
-   globals-prio_buf_count += num;
-
if (sync == ODP_SCHED_SYNC_ATOMIC)
odp_schedule_release_atomic();

-  odp_ticketlock_unlock(globals-count_lock);
+  odp_ticketlock_lock(globals-lock);
+   globals-buf_count -= num;
+
+   if (globals-buf_count  0) {
+  odp_ticketlock_unlock(globals-lock);
+   CU_FAIL_FATAL(Buffer counting failed);
+   }
+
+  odp_ticketlock_unlock(globals-lock);
}

return NULL;
@@ -173,8 +168,11 @@ static void fill_queues(thread_args_t *args)
int num_queues, num_prio;
odp_pool_t pool;
int i, j, k;
+   int buf_count = 0;
+   test_globals_t *globals;
char name[32];

+   globals = args-globals;
sync = args-sync;
num_queues = args-num_queues;
num_prio = args-num_prio;
@@ -214,9 +212,12 @@ static void fill_queues(thread_args_t *args)
CU_ASSERT(buf != ODP_BUFFER_INVALID);
ev = odp_buffer_to_event(buf);
CU_ASSERT(odp_queue_enq(queue, ev) == 0);
+   buf_count++;
}
}
}
+
+   globals-buf_count = buf_count;
 }

 static void schedule_common(odp_schedule_sync_t sync, int num_queues,
@@ -231,9 +232,7 @@ static void
schedule_common(odp_schedule_sync_t sync, int num_queues,
globals = odp_shm_addr(shm);
CU_ASSERT_FATAL(globals != NULL);

-   globals-current_prio = ODP_SCHED_PRIO_HIGHEST;
-   globals-prio_buf_count = 0;
-
+   args.globals = globals;
args.sync = sync;
 

Re: [lng-odp] [PATCH ARCH] remove api_guide_lines

2015-03-12 Thread Maxim Uvarov

Reviewed-by:  Maxim Uvarov maxim.uva...@linaro.org

On 03/11/15 21:43, Bill Fischofer wrote:



On Wed, Mar 11, 2015 at 1:30 PM, Mike Holmes mike.hol...@linaro.org 
mailto:mike.hol...@linaro.org wrote:


This docuemtnation has been moved to the API document

Signed-off-by: Mike Holmes mike.hol...@linaro.org
mailto:mike.hol...@linaro.org


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


---
 api_guide_lines.dox | 178

 1 file changed, 178 deletions(-)
 delete mode 100644 api_guide_lines.dox

diff --git a/api_guide_lines.dox b/api_guide_lines.dox
deleted file mode 100644
index 4cfe088..000
--- a/api_guide_lines.dox
+++ /dev/null
@@ -1,178 +0,0 @@
-/* Copyright (c) 2014, Linaro Limited
-
- * All rights reserved
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
-
-@page api_guide_lines  API Guide Lines
-
-@tableofcontents
-
-@section introduction Introduction
-ODP APIs are implemented as callable C functions that often
return a typed value.
-This document describes the approach to handling return values
and error indications expected of conforming ODP implementations.
-As such it should be regarded as providing guidelines for how to
create new ODP APIs.
-
-@section functional Functional Definition
-This section defines the use of data types, calling conventions,
and return codes used by ODP APIs.
-All ODP APIs MUST follow these conventions as part of their design.
-
-@subsection naming Naming Conventions
-All ODP APIs begin with the prefix odp_ and those that describe
an action to be performed on an object follow the naming
convention of object followed by action.
-The advantage of this approach is that an alphabetical list of
APIs for an object all sort together since they all have names of
the form odp_object_action().
-
-So for example the API call to allocate a buffer is named
odp_buffer_alloc() rather than odp_alloc_buffer().
-
-@subsection data_types Data Types and Use of typedef
-ODP is designed to allow broad variability in how APIs are
implemented on various platforms.
-To support this, most APIs operate on abstract data types that
are defined via typedef on a per-implementation basis.
-These abstract types follow the naming convention of odp_object_t.
-
-Typedefs that encapsulate C structs follow the convention:
-
-@code
-typedef struct odp_descriptive_name_s {
-...
-} odp_descriptive_name_t;
-@endcode
-
-The use of typedef allows implementations to choose underlying
data representations that map efficiently to platform capabilities
while providing accessor functions to provide structured access to
implementation information in a portable manner
-Similarly, the use of enum is RECOMMENDED to provide value
abstraction for API parameters while enabling the implementation
to choose code points that map well to platform native values.
-
-Several native C types are used conventionally within ODP and
SHOULD be employed in API design:
-
-type | Correct use
- |---| :-
-void | SHOULD be used for APIs that do not return a value
-void*| SHOULD be used for APIs that return a pointer intended to
be used by the caller. For example, a routine that returns the
address of an application context area SHOULD use a void * return type
-odp_bool_t  | SHOULD be used for APIs that return a @ref boolean
value.
-int  | SHOULD be used for success and failure indications, with 0
indicating a success. Errno may be set
-
-@subsection parameters Parameter Structure and Validation
-ODP is a framework for use in the data plane.
-Data plane applications typically have extreme performance
requirements mandating very strict attention to path length
considerations in the design of all ODP APIs, with the exception
of those designed to be used infrequently such as only during
initialization or termination processing.
-
-Minimizing pathlength in API design involves several considerations:
- - The number of parameters passed to a call.
-   In general, ODP APIs designed for frequent use SHOULD have few
parameters.
-   Limiting parameter count to one or two well-chosen parameters
SHOULD be the goal for APIs designed for frequent use.
-   If a call requires more complex parameter data then it is
RECOMMENDED that instead of multiple parameters a single pointer
to a struct that can be statically templated and modified by the
caller be used.
- - The use of macros and inlining.
-   ODP APIs MAY be implemented as preprocessor macros and/or
inline functions.
-   This is especially true for accessor 

Re: [lng-odp] [PATCHv2] linux-generic: odp_timer: set user_ptr for cancelled timeout

2015-03-12 Thread Maxim Uvarov

Merged,
Maxim.

On 03/11/15 19:54, Bill Fischofer wrote:
I originally was going to point out the 'typo' but my first reaction 
was that if should be of rather than in.  However, on reflection it 
seemed that if was what was intended.  However, I agree that this 
revised wording is clearer.



On Wed, Mar 11, 2015 at 10:36 AM, Ola Liljedahl 
ola.liljed...@linaro.org mailto:ola.liljed...@linaro.org wrote:


Ensure that the timeout user_ptr and timer fields are set when the
corresponding timer is immediately cancelled.
https://bugs.linaro.org/show_bug.cgi?id=1313

Signed-off-by: Ola Liljedahl ola.liljed...@linaro.org
mailto:ola.liljed...@linaro.org


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


---
(This document/code contribution attached is provided under the
terms of
agreement LES-LTM-21309)

Passes odp_timer validation with the new odp_timer_cancel() test
from Petri.

v2:
Updated some comments in odp_timer.c to make the meaning clearer.

 platform/linux-generic/odp_timer.c | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/platform/linux-generic/odp_timer.c
b/platform/linux-generic/odp_timer.c
index 61a02b6..b7cb04f 100644
--- a/platform/linux-generic/odp_timer.c
+++ b/platform/linux-generic/odp_timer.c
@@ -421,6 +421,16 @@ static bool timer_reset(uint32_t idx,
 #endif
} else {
/* We have a new timeout buffer which replaces any
old one */
+   /* Fill in some (constant) header fields for
timeout events */
+   if (_odp_buffer_type(*tmo_buf) == ODP_EVENT_TIMEOUT) {
+   /* Convert from buffer to timeout hdr */
+   odp_timeout_hdr_t *tmo_hdr =
+  timeout_hdr_from_buf(*tmo_buf);
+   tmo_hdr-timer = tp_idx_to_handle(tp, idx);
+   tmo_hdr-user_ptr = tp-timers[idx].user_ptr;
+   /* expiration field filled in when timer
expires */
+   }
+   /* Else ignore buffers of other types */
odp_buffer_t old_buf = ODP_BUFFER_INVALID;
 #ifdef ODP_ATOMIC_U128
tick_buf_t new, old;
@@ -556,16 +566,16 @@ static unsigned timer_expire(odp_timer_pool
*tp, uint32_t idx, uint64_t tick)
_odp_atomic_flag_clear(IDX2LOCK(idx));
 #endif
if (odp_likely(tmo_buf != ODP_BUFFER_INVALID)) {
-   /* Fill in metadata fields in system timeout buffer */
+   /* Fill in expiration tick for timeout events */
if (_odp_buffer_type(tmo_buf) == ODP_EVENT_TIMEOUT) {
/* Convert from buffer to timeout hdr */
odp_timeout_hdr_t *tmo_hdr =
timeout_hdr_from_buf(tmo_buf);
-   tmo_hdr-timer = tp_idx_to_handle(tp, idx);
tmo_hdr-expiration = exp_tck;
-   tmo_hdr-user_ptr = tim-user_ptr;
+   /* timer and user_ptr fields filled in
when timer
+* was set */
}
-   /* Else ignore buffers of other types */
+   /* Else ignore events of other types */
/* Post the timeout to the destination queue */
int rc = odp_queue_enq(tim-queue,
 odp_buffer_to_event(tmo_buf));
--
1.9.1


___
lng-odp mailing list
lng-odp@lists.linaro.org mailto: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 mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCHv3] linux-generic: only print errors to stderr

2015-03-12 Thread Maxim Uvarov

Merged,
Maxim.

On 03/06/15 16:24, Stuart Haslam wrote:

The default logger prints all log levels to stderr. To make things
easier when debugging failures change it to print only errors to stderr
and everything else to stdout.

Signed-off-by: Stuart Haslam stuart.has...@linaro.org
Reviewed-by: Taras Kondratiuk taras.kondrat...@linaro.org
---
v2: Fixed indentation (forgot to checkpatch v1)
v3: Removed ODP_UNUSED for level as it's now used

  platform/linux-generic/odp_weak.c | 15 +--
  1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/platform/linux-generic/odp_weak.c 
b/platform/linux-generic/odp_weak.c
index 7fa5955..f4336f0 100644
--- a/platform/linux-generic/odp_weak.c
+++ b/platform/linux-generic/odp_weak.c
@@ -10,13 +10,24 @@
  #include odp/hints.h
  
  ODP_WEAK_SYMBOL ODP_PRINTF_FORMAT(2, 3)

-int odp_override_log(odp_log_level_e level ODP_UNUSED, const char *fmt, ...)
+int odp_override_log(odp_log_level_e level, const char *fmt, ...)
  {
va_list args;
int r;
+   FILE *logfd;
+
+   switch (level) {
+   case ODP_LOG_ERR:
+   case ODP_LOG_UNIMPLEMENTED:
+   case ODP_LOG_ABORT:
+   logfd = stderr;
+   break;
+   default:
+   logfd = stdout;
+   }
  
  	va_start(args, fmt);

-   r = vfprintf(stderr, fmt, args);
+   r = vfprintf(logfd, fmt, args);
va_end(args);
  
  	return r;



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


Re: [lng-odp] [PATCH 0/3] Fix the leaks in examples (bug 1117)

2015-03-12 Thread Ola Liljedahl
These examples won't leak memory continuously so why is this a problem?
Are we catering to e.g. bare metal environments which may not clean up
after applications have terminated?


On 11 March 2015 at 14:52, Ciprian Barbu ciprian.ba...@linaro.org wrote:

 This series continues the patch I sent some while ago to replace strtok
 with
 strtok_r in odp_pktio:

 https://git.linaro.org/lng/odp.git/commit/273955e6db6bb220f2736d3709e4237c50d04772

 The bug that this series fixes only refers to resource leaks, but the
 initial
 strtok_r fix should have been done for all examples, there is no need to
 use the
 reentrant version of strtok because it is only used from one thread, once,
 during parsing of args.

 There was a suggestion at some point to make the parsing of if_names
 common for
 all examples, I don't think it's easy to factor it out, it would introduce
 more
 code than necessary and we're only talking about a few lines of code.

 Ciprian Barbu (3):
   example: odp_l2fwd: replace strtok_r with strtok and fix leaks
   example: odp_ipsec: replace strtok_r with strtok and fix leaks
   example: generator: replace strtok_r with strtok and fix leaks

  example/generator/odp_generator.c | 30 --
  example/ipsec/odp_ipsec.c | 30 ++
  example/l2fwd/odp_l2fwd.c | 29 +++--
  3 files changed, 45 insertions(+), 44 deletions(-)

 --
 1.8.3.2


 ___
 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 3/3] example: generator: replace strtok_r with strtok and fix leaks

2015-03-12 Thread Ciprian Barbu
The odp_ipsec example leaks some strings allocated during parse_args.
https://bugs.linaro.org/show_bug.cgi?id=1117
CID 56899:  Resource leak  (RESOURCE_LEAK)

Signed-off-by: Ciprian Barbu ciprian.ba...@linaro.org
---
 example/generator/odp_generator.c | 30 --
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/example/generator/odp_generator.c 
b/example/generator/odp_generator.c
index 3870fd1..96f6cf7 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -51,6 +51,7 @@ typedef struct {
int cpu_count;  /** system CPU count */
int if_count;   /** Number of interfaces to be used */
char **if_names;/** Array of pointers to interface names */
+   char *if_str;   /** Storage for interface names */
odp_pool_t pool;/** Pool for packet IO */
odph_ethaddr_t srcmac;  /** src mac addr */
odph_ethaddr_t dstmac;  /** dest mac addr */
@@ -703,6 +704,9 @@ int main(int argc, char *argv[])
 
/* Master thread waits for other threads to exit */
odph_linux_pthread_join(thread_tbl, num_workers);
+
+   free(args-appl.if_names);
+   free(args-appl.if_str);
printf(Exit\n\n);
 
return 0;
@@ -720,7 +724,7 @@ static void parse_args(int argc, char *argv[], appl_args_t 
*appl_args)
 {
int opt;
int long_index;
-   char *names, *str, *token, *save;
+   char *token;
size_t len;
int i;
static struct option longopts[] = {
@@ -763,19 +767,19 @@ static void parse_args(int argc, char *argv[], 
appl_args_t *appl_args)
}
len += 1;   /* add room for '\0' */
 
-   names = malloc(len);
-   if (names == NULL) {
+   appl_args-if_str = malloc(len);
+   if (appl_args-if_str == NULL) {
usage(argv[0]);
exit(EXIT_FAILURE);
}
 
/* count the number of tokens separated by ',' */
-   strcpy(names, optarg);
-   for (str = names, i = 0;; str = NULL, i++) {
-   token = strtok_r(str, ,, save);
-   if (token == NULL)
-   break;
-   }
+   strcpy(appl_args-if_str, optarg);
+   for (token = strtok(appl_args-if_str, ,), i = 0;
+token != NULL;
+token = strtok(NULL, ,), i++)
+   ;
+
appl_args-if_count = i;
 
if (appl_args-if_count == 0) {
@@ -788,11 +792,9 @@ static void parse_args(int argc, char *argv[], appl_args_t 
*appl_args)
calloc(appl_args-if_count, sizeof(char *));
 
/* store the if names (reset names string) */
-   strcpy(names, optarg);
-   for (str = names, i = 0;; str = NULL, i++) {
-   token = strtok_r(str, ,, save);
-   if (token == NULL)
-   break;
+   strcpy(appl_args-if_str, optarg);
+   for (token = strtok(appl_args-if_str, ,), i = 0;
+token != NULL; token = strtok(NULL, ,), i++) {
appl_args-if_names[i] = token;
}
break;
-- 
1.8.3.2


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


Re: [lng-odp] [PATCH] example: odp_ipsec: fix missing definition for ifreq

2015-03-12 Thread Ciprian Barbu
So after a little chat we had, Maxim suggested I remove the ioctl code
that needs struct ifreq. There is a USE_MAC_ADDR_HACK define in
odp_ipsec that is now set to 1, removing all that code should fix the
problem.

The problem was described here: https://bugs.linaro.org/show_bug.cgi?id=627

Robbie and Bala, can you confirm that we can go ahead with this? Is
there any reason to keep that workaround?

Thanks,
/Ciprian

On Wed, Mar 11, 2015 at 2:45 PM, Ciprian Barbu ciprian.ba...@linaro.org wrote:
 On Wed, Mar 11, 2015 at 2:12 PM, Ola Liljedahl ola.liljed...@linaro.org 
 wrote:
 On 11 March 2015 at 10:58, Ciprian Barbu ciprian.ba...@linaro.org wrote:

 On Tue, Mar 10, 2015 at 7:19 PM, Ola Liljedahl ola.liljed...@linaro.org
 wrote:
  On 10 March 2015 at 17:11, Ciprian Barbu ciprian.ba...@linaro.org
  wrote:
  On Tue, Mar 10, 2015 at 6:06 PM, Ciprian Barbu
  ciprian.ba...@linaro.org wrote:
  On Tue, Mar 10, 2015 at 4:31 PM, Maxim Uvarov
  maxim.uva...@linaro.org wrote:
  On 03/10/15 17:16, Ciprian Barbu wrote:
 
  On Tue, Mar 10, 2015 at 1:33 PM, Maxim Uvarov
  maxim.uva...@linaro.org
  wrote:
 
  Please also specify your env.  I can not reproduce it with
  ./cross-compile-test.sh
 
  I added some info in the bug entry. Were you able to reproduce like
  that?
 
 
  I see that in one includes in net/if.h that structure is under ifdef
  __USE_MISC, in other includes there is no such ifdef.
  Looks like you have different version of headers. For linux/if.h
  there is no
  ifdef for both cases. I think you patch is good to go,
  tested it on my toolchains (compilation only).
 
  This might be a problem with Ubuntu 13.10, I tested on an Ubuntu 14.04
  and it works.
 
  The whole problem comes from the ioctl command that requires struct
  ifreq. From this man page (http://linux.die.net/man/7/netdevice) it
  looks like it should be enough to include sys/ioctl.h and
  net/if.h. I also found that including linux/if.h is usually done by
  code for kernel, so that might actually not be a good idea.
 
  Strange though, adding sys/ioctl.h doesn't fix compiling on my
  environment. Does anyone else run Ubuntu 13.10? maybe I screwed my
  headers somehow installing some packages ...
 
  I also found this:
 
  http://stackoverflow.com/questions/10433982/why-does-c99-complain-about-storage-sizes
  which says the problem is in fact with -std=c99. Strange though how it
  only behaves bad on my Ubuntu 13.10. Would still be good if someone
  else checks on their env ...
  The way I interpret this is that when you specify a specific C
  standard (e.g. C99), by default you will only get access to those
  library features that are included in that standard. If you need to go
  outside of the standard, you need to ask for it specifically. E.g.
  define _BSD_SOURCE in this case.
 
  But this should be independent of Ubuntu releases. I can imagine
  different libc (glibc) versions may do this differently though so this
  could be that cause of differences in behavior between 13.10 and e.g.
  14.04 (which I use).

 Ola, we used to make use of _BSD_SOURCE to get the extra features, but
 the use of this macro has been deprecated since glib 2.20:
 http://man7.org/linux/man-pages/man7/feature_test_macros.7.html.
 Instead of defining _BSD_SOURCE the user must rely on _DEFAULT_SOURCE,
 which exists since 2.19.

 Looking at my glib version I get:
 GNU C Library (Ubuntu EGLIBC 2.17-93ubuntu4) stable release version
 2.17, by Roland McGrath et al.

 So the problem in my case is that I have an old glibc version and the
 way we compile ODP does not cope with that. Other users will be
 affected. Either we do something about it (I haven't found a way to
 check the glibc version at compile time yet) or document that ODP will
 not support glibc older than 2.19 (where _DEFAULT_SOURCE exists).

 Or we add some code to automake/configure to detect which (g)libc version
 you are using and then use the appropriate define (_BSD_SOURCE for = 2.17,
 _DEFAULT_SOURCE for = 2.19, don't know about 2.18).

 Wouldn't this be the right way of solving problems like this? This might
 not be the only time we have such a version problem.

 Sounds good. I think autotools should have the support to get the
 version of packages.

 Anders, do you have more insights on that?


 -- Ola


 
  olli@macmini:~$ gcc --version
  gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
  Copyright (C) 2013 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is
  NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
  PURPOSE.
  olli@macmini:~$ dpkg -S /usr/include/net/if.h
  libc6-dev:amd64, libc6-dev:i386: /usr/include/net/if.h
  olli@macmini:~$ dpkg -s libc6-dev | grep Version
  Version: 2.19-0ubuntu6.6
 
 
 
  /Ciprian
 
 
 
  Maxim.
 
 
 
  Maxim.
 
 
  On 03/10/15 14:14, Maxim Uvarov wrote:
 
  Please add patch description and put bug link in the bottom of it.
  Like
  other git commits do.
 
  Thanks,
  Maxim.
 
  On 03/10/15 12:47, 

[lng-odp] [Bug 1079] examples duplicate interface parsing code

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1079

Ciprian Barbu ciprian.ba...@linaro.org changed:

   What|Removed |Added

 CC||ciprian.ba...@linaro.org

--- Comment #2 from Ciprian Barbu ciprian.ba...@linaro.org ---
Personally I think factoring out only the interface parsing doesn't make sense,
it's not that much code and it's not very complicated either.

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


Re: [lng-odp] [PATCH] validation: pktio: disable arp on virtual interfaces

2015-03-12 Thread Maxim Uvarov

On 03/06/15 13:37, Stuart Haslam wrote:

On Fri, Mar 06, 2015 at 01:00:54PM +0300, Maxim Uvarov wrote:

Virtual interfaces for linux-generic tests does not have
arp addresses. Arp discovery has to be turned off.


Why? Presumably you're making this change because without it you had a
problem, what was it?

--
Stuart.

I think we need this to go in, right?

Maxim.

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


Re: [lng-odp] [PATCH] CONTRIBUTING: add clarification on code style

2015-03-12 Thread Maxim Uvarov

How about move that to ODP api guidelines?

Maxim.

On 03/12/15 02:27, Mike Holmes wrote:

Clarify the locations that variables may be declared

Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
  CONTRIBUTING | 15 +++
  1 file changed, 15 insertions(+)

diff --git a/CONTRIBUTING b/CONTRIBUTING
index 75fb711..ca1ce3f 100644
--- a/CONTRIBUTING
+++ b/CONTRIBUTING
@@ -16,6 +16,21 @@ ODP code shall be documented using the doxygen style 
described in the
  Documenting the code section.
  Check patch script/checkpatch.pl shall be used before submitting a patch.
  
+Supplemental notes:-

+
+ - Variables shall be declared at the begining of scope, for example :-
+
+ int start_of_global_scope;
+
+ main () {
+   int start_of_function_scope;
+   ...
+   if (foo == bar) {
+ int start_of_block_scope;
+ ...
+   }
+ }
+
  2. ODP patch expectations as an  open source project
  
  While specific to the Linux kernel development, the following reference could



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


Re: [lng-odp] [PATCH] example: odp_ipsec: remove USE_MAC_ADDR_HACK

2015-03-12 Thread Maxim Uvarov

Can somebody test that patch?

Maxim.

On 03/11/15 16:13, Ciprian Barbu wrote:

Remove the old hack and switch to using the provided API
This also fixes https://bugs.linaro.org/show_bug.cgi?id=1330

Signed-off-by: Ciprian Barbu ciprian.ba...@linaro.org
---
  example/ipsec/odp_ipsec.c | 58 ++-
  1 file changed, 2 insertions(+), 56 deletions(-)

diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
index 98160ba..82ed0cb 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -211,56 +211,6 @@ void free_pkt_ctx(pkt_ctx_t *ctx)
  }
  
  /**

- * Use socket I/O workaround to query interface MAC address
- *
- * @todo Remove all references to USE_MAC_ADDR_HACK once
- *   https://bugs.linaro.org/show_bug.cgi?id=627 is resolved
- */
-#define USE_MAC_ADDR_HACK 1
-
-#if USE_MAC_ADDR_HACK
-
-/**
- * Query MAC address associated with an interface (temporary workaround
- * till API is created)
- *
- * @param intfString name of the interface
- * @param src_mac MAC address used by the interface
- *
- * @return 0 if successful else -1
- */
-static
-int query_mac_address(char *intf, uint8_t *src_mac)
-{
-   int sd;
-   struct ifreq ifr;
-
-   /* Get a socket descriptor */
-   sd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
-   if (sd  0) {
-   EXAMPLE_ERR(Error: socket() failed for %s\n, intf);
-   return -1;
-   }
-
-   /* Use ioctl() to look up interface name and get its MAC address */
-   memset(ifr, 0, sizeof(ifr));
-   snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), %s, intf);
-   if (ioctl(sd, SIOCGIFHWADDR, ifr)  0) {
-   close(sd);
-   EXAMPLE_ERR(Error: ioctl() failed for %s\n, intf);
-   return -1;
-   }
-   memcpy(src_mac, ifr.ifr_hwaddr.sa_data, ODPH_ETHADDR_LEN);
-
-   /* Fini */
-   close(sd);
-
-   return 0;
-}
-
-#endif
-
-/**
   * Example supports either polling queues or using odp_schedule
   *
   * Specify CFLAGS=-DIPSEC_POLL_QUEUES during configure to enable polling
@@ -590,12 +540,8 @@ void initialize_intf(char *intf)
}
  
  	/* Read the source MAC address for this interface */

-#if USE_MAC_ADDR_HACK
-   ret = query_mac_address(intf, src_mac);
-#else
-   ret = odp_pktio_get_mac_addr(pktio, src_mac);
-#endif
-   if (ret) {
+   ret = odp_pktio_mac_addr(pktio, src_mac, sizeof(src_mac));
+   if (ret = 0) {
EXAMPLE_ERR(Error: failed during MAC address get for %s\n,
intf);
exit(EXIT_FAILURE);



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


Re: [lng-odp] [PATCH 3/3] validation: packet: use true == \!0 per ODP API Guidelines

2015-03-12 Thread Maxim Uvarov

I would like to reword that subject from:

validation: packet: use true == \!0 per ODP API Guidelines

to

validation: check packet flags not not 0

odp packet flags functions return int while it's intend to be odp_bool_t.
odp_bool_t have to be checked for no 0.
 

It should be better due to:
1. == \!0  probably have to be =! 0
2. It's better not add symbols which you need escape with \. I.e. short 
subject has to be easy search-able.


Maxim.



On 03/10/15 20:04, Bill Fischofer wrote:

Signed-off-by: Bill Fischofer bill.fischo...@linaro.org
---
  test/validation/odp_packet.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/validation/odp_packet.c b/test/validation/odp_packet.c
index 8f764bf..0c1d069 100644
--- a/test/validation/odp_packet.c
+++ b/test/validation/odp_packet.c
@@ -425,7 +425,7 @@ do { \
odp_packet_has_##flag##_set(packet, 0);   \
CU_ASSERT(odp_packet_has_##flag(packet) == 0);\
odp_packet_has_##flag##_set(packet, 1);   \
-   CU_ASSERT(odp_packet_has_##flag(packet) == 1);\
+   CU_ASSERT(odp_packet_has_##flag(packet) != 0);\
  } while (0)
  
  static void packet_in_flags(void)



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


Re: [lng-odp] [PATCH 0/3] Fix the leaks in examples (bug 1117)

2015-03-12 Thread Ola Liljedahl
On 11 March 2015 at 17:25, Mike Holmes mike.hol...@linaro.org wrote:



 On 11 March 2015 at 10:32, Ola Liljedahl ola.liljed...@linaro.org wrote:

 These examples won't leak memory continuously so why is this a problem?
 Are we catering to e.g. bare metal environments which may not clean up
 after applications have terminated?


 I think the tests should be clean so they can be reused in bare metal
 environment without too much trouble, but also I agree we only test on
 linux-generic.
 However on  linux generic tools such as clang-scan, Coverity, Valgrind etc
 are run to catch mistakes, that is a lot easier if the code is inherently
 clean in those tools to begin with.

I agree. I missed that this was the cause for the fixes. I don't read all
emails that carefully... delete delete delete


 In some cases we need to mark false positives, in others add some clean up
 - this is one of those clean up items from Coverity
 https://bugs.linaro.org/show_bug.cgi?id=1117

 Mike






 On 11 March 2015 at 14:52, Ciprian Barbu ciprian.ba...@linaro.org
 wrote:

 This series continues the patch I sent some while ago to replace strtok
 with
 strtok_r in odp_pktio:

 https://git.linaro.org/lng/odp.git/commit/273955e6db6bb220f2736d3709e4237c50d04772

 The bug that this series fixes only refers to resource leaks, but the
 initial
 strtok_r fix should have been done for all examples, there is no need to
 use the
 reentrant version of strtok because it is only used from one thread,
 once,
 during parsing of args.

 There was a suggestion at some point to make the parsing of if_names
 common for
 all examples, I don't think it's easy to factor it out, it would
 introduce more
 code than necessary and we're only talking about a few lines of code.

 Ciprian Barbu (3):
   example: odp_l2fwd: replace strtok_r with strtok and fix leaks
   example: odp_ipsec: replace strtok_r with strtok and fix leaks
   example: generator: replace strtok_r with strtok and fix leaks

  example/generator/odp_generator.c | 30 --
  example/ipsec/odp_ipsec.c | 30 ++
  example/l2fwd/odp_l2fwd.c | 29 +++--
  3 files changed, 45 insertions(+), 44 deletions(-)

 --
 1.8.3.2


 ___
 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




 --
 Mike Holmes
 Technical Manager - Linaro Networking Group
 Linaro.org http://www.linaro.org/ *│ *Open source software for ARM SoCs



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


Re: [lng-odp] [PATCH] validation: pktio check return code for pool_destroy

2015-03-12 Thread Maxim Uvarov

Merged,
Maxim.

On 03/11/15 12:40, Stuart Haslam wrote:

On Wed, Mar 11, 2015 at 11:36:25AM +0300, Maxim Uvarov wrote:

Fix CID 88056 to check return code of pool_destroy.

Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org

Reviewed-by: Stuart Haslam stuart.has...@linaro.org


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

diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c
index 6359452..e022c33 100644
--- a/test/validation/odp_pktio.c
+++ b/test/validation/odp_pktio.c
@@ -259,7 +259,7 @@ static odp_pktio_t create_pktio(const char *iface)
  
  	pool = odp_pool_lookup(pool_name);

if (pool != ODP_POOL_INVALID)
-   odp_pool_destroy(pool);
+   CU_ASSERT(odp_pool_destroy(pool) == 0);
  
  	pool = odp_pool_create(pool_name, ODP_SHM_NULL, params);

CU_ASSERT(pool != ODP_POOL_INVALID);
--
1.9.1


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



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


[lng-odp] [PATCH] doc: move api guidelines to API doc

2015-03-12 Thread Mike Holmes
This documentation was moved from the architecture doc to this API doc.

Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 doc/api_guide_lines.dox | 178 
 1 file changed, 178 insertions(+)
 create mode 100644 doc/api_guide_lines.dox

diff --git a/doc/api_guide_lines.dox b/doc/api_guide_lines.dox
new file mode 100644
index 000..4cfe088
--- /dev/null
+++ b/doc/api_guide_lines.dox
@@ -0,0 +1,178 @@
+/* Copyright (c) 2014, Linaro Limited
+
+ * All rights reserved
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+
+@page api_guide_lines  API Guide Lines
+
+@tableofcontents
+
+@section introduction Introduction
+ODP APIs are implemented as callable C functions that often return a typed 
value.
+This document describes the approach to handling return values and error 
indications expected of conforming ODP implementations.
+As such it should be regarded as providing guidelines for how to create new 
ODP APIs.
+
+@section functional Functional Definition
+This section defines the use of data types, calling conventions, and return 
codes used by ODP APIs.
+All ODP APIs MUST follow these conventions as part of their design.
+
+@subsection naming Naming Conventions
+All ODP APIs begin with the prefix odp_ and those that describe an action to 
be performed on an object follow the naming convention of object followed by 
action.
+The advantage of this approach is that an alphabetical list of APIs for an 
object all sort together since they all have names of the form 
odp_object_action().
+
+So for example the API call to allocate a buffer is named odp_buffer_alloc() 
rather than odp_alloc_buffer().
+
+@subsection data_types Data Types and Use of typedef
+ODP is designed to allow broad variability in how APIs are implemented on 
various platforms.
+To support this, most APIs operate on abstract data types that are defined via 
typedef on a per-implementation basis.
+These abstract types follow the naming convention of odp_object_t.
+
+Typedefs that encapsulate C structs follow the convention:
+
+@code
+typedef struct odp_descriptive_name_s {
+...
+} odp_descriptive_name_t;
+@endcode
+
+The use of typedef allows implementations to choose underlying data 
representations that map efficiently to platform capabilities while providing 
accessor functions to provide structured access to implementation information 
in a portable manner
+Similarly, the use of enum is RECOMMENDED to provide value abstraction for API 
parameters while enabling the implementation to choose code points that map 
well to platform native values.
+
+Several native C types are used conventionally within ODP and SHOULD be 
employed in API design:
+
+type | Correct use
+ |---| :-
+void | SHOULD be used for APIs that do not return a value
+void*| SHOULD be used for APIs that return a pointer intended to be used by 
the caller. For example, a routine that returns the address of an application 
context area SHOULD use a void * return type
+odp_bool_t  | SHOULD be used for APIs that return a @ref boolean value.
+int  | SHOULD be used for success and failure indications, with 0 indicating a 
success. Errno may be set
+
+@subsection parameters Parameter Structure and Validation
+ODP is a framework for use in the data plane.
+Data plane applications typically have extreme performance requirements 
mandating very strict attention to path length considerations in the design of 
all ODP APIs, with the exception of those designed to be used infrequently such 
as only during initialization or termination processing.
+
+Minimizing pathlength in API design involves several considerations:
+ - The number of parameters passed to a call.
+   In general, ODP APIs designed for frequent use SHOULD have few parameters.
+   Limiting parameter count to one or two well-chosen parameters SHOULD be the 
goal for APIs designed for frequent use.
+   If a call requires more complex parameter data then it is RECOMMENDED that 
instead of multiple parameters a single pointer to a struct that can be 
statically templated and modified by the caller be used.
+ - The use of macros and inlining.
+   ODP APIs MAY be implemented as preprocessor macros and/or inline functions.
+   This is especially true for accessor functions that are designed to provide 
getters/setters for object meta data.
+ - Limiting parameter validation and error-checking processing.
+   While useful for development and debugging, providing “bullet-proof” APIs 
that perform extensive parameter validation and error checking is often 
inappropriate.
+   While validations that can be performed statically at compile time or at 
little to no runtime cost SHOULD be considered, APIs MAY choose to leave 
behavior as undefined when presented with invalid parameters in the interest of 
runtime efficiency.
+
+One of the reasons for using abstract types is to avoid having implementation 
knowledge “bleed through” the API, leading to possible parameter 

[lng-odp] [Bug 1313] Timeout user pointer metadata is not set on timer_cancel

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1313

--- Comment #3 from Ola Liljedahl ola.liljed...@linaro.org ---
http://patches.opendataplane.org/patch/1034/
v2 changes the wording of some comments.

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


Re: [lng-odp] [PATCH 0/3] Fix the leaks in examples (bug 1117)

2015-03-12 Thread Ciprian Barbu
Any comments on making parsing the interface list common for all
examples? This touches on
https://bugs.linaro.org/show_bug.cgi?id=1079. I don't think it's time
to do that yet. In fact I think we could try changing the way we pass
the if names, instead of using a comma separated list we could repeat
the -i option, e.g.

./odp_l2fwd -i eth0 -i eth1 -i eth2 -i eth3

We would have to limit the number of interfaces we can pass, or parse
the args twice, once to count and allocate and once to save the names.
But right now the examples are merely demonstration apps.

On Wed, Mar 11, 2015 at 6:30 PM, Ola Liljedahl ola.liljed...@linaro.org wrote:
 On 11 March 2015 at 17:25, Mike Holmes mike.hol...@linaro.org wrote:



 On 11 March 2015 at 10:32, Ola Liljedahl ola.liljed...@linaro.org wrote:

 These examples won't leak memory continuously so why is this a problem?
 Are we catering to e.g. bare metal environments which may not clean up
 after applications have terminated?


 I think the tests should be clean so they can be reused in bare metal
 environment without too much trouble, but also I agree we only test on
 linux-generic.
 However on  linux generic tools such as clang-scan, Coverity, Valgrind etc
 are run to catch mistakes, that is a lot easier if the code is inherently
 clean in those tools to begin with.

 I agree. I missed that this was the cause for the fixes. I don't read all
 emails that carefully... delete delete delete


 In some cases we need to mark false positives, in others add some clean up
 - this is one of those clean up items from Coverity
 https://bugs.linaro.org/show_bug.cgi?id=1117

 Mike






 On 11 March 2015 at 14:52, Ciprian Barbu ciprian.ba...@linaro.org
 wrote:

 This series continues the patch I sent some while ago to replace strtok
 with
 strtok_r in odp_pktio:

 https://git.linaro.org/lng/odp.git/commit/273955e6db6bb220f2736d3709e4237c50d04772

 The bug that this series fixes only refers to resource leaks, but the
 initial
 strtok_r fix should have been done for all examples, there is no need to
 use the
 reentrant version of strtok because it is only used from one thread,
 once,
 during parsing of args.

 There was a suggestion at some point to make the parsing of if_names
 common for
 all examples, I don't think it's easy to factor it out, it would
 introduce more
 code than necessary and we're only talking about a few lines of code.

 Ciprian Barbu (3):
   example: odp_l2fwd: replace strtok_r with strtok and fix leaks
   example: odp_ipsec: replace strtok_r with strtok and fix leaks
   example: generator: replace strtok_r with strtok and fix leaks

  example/generator/odp_generator.c | 30 --
  example/ipsec/odp_ipsec.c | 30 ++
  example/l2fwd/odp_l2fwd.c | 29 +++--
  3 files changed, 45 insertions(+), 44 deletions(-)

 --
 1.8.3.2


 ___
 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




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




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


Re: [lng-odp] [PATCH] validation: pktio: prevent race when using veth pair

2015-03-12 Thread Mike Holmes
On 12 March 2015 at 06:54, Stuart Haslam stuart.has...@linaro.org wrote:

 On Wed, Mar 11, 2015 at 04:47:59PM -0400, Mike Holmes wrote:
  I simultaneously ran two independent  instances of odp with make check
  and neither had an issue, one had this patch the other did not.
 
  At the same time I used the ./build.sh script from the cleanup branch of
  https://git.linaro.org/people/anders.roxell/check-odp.git and it was
  pointed at a patched repo
  It failed consistently as before

 Bah. I can reproduce that failure myself now.

 That problem is because build.sh runs ./configure  make  make check
 outside of the source tree, which only works if all of the executables
 required by make check are produced by make, and that's not the case
 for odp_pktio_run. I'll have a think about the best way to resolve that.

  ..
 
  PASS: odp_errno
  FAIL: odp_pktio_run
  make[5]: Entering directory
  '/home/mike/git/check-odp/build/odp/testdir/test/validation'
  make[5]: Nothing to be done for 'all'.
  make[5]: Leaving directory
  '/home/mike/git/check-odp/build/odp/testdir/test/validation'
 
 
  Testsuite summary for OpenDataPlane 1.0.0
 
 
  # TOTAL: 18
  # PASS:  17
  # SKIP:  0
  # XFAIL: 0
  # FAIL:  1
  # XPASS: 0
  # ERROR: 0
 
 
  I don't know why this should be because I ran my local instances with the
  script
  for i in {1..10}; do make clean check -e; done
  and the build.sh uses
  make check -e - but obviously it does this after building from scratch
  downloading the repo etc each time so it does fewer iterations
 
  So I think the new approach is a better idea, and it does not appear to
  hurt, but it does not help the original use case of the scrip tin CI.
 

 I think this patch should still go in though.


I agree and you can add my Reviewed-and-tested-by: Mike Holmes 
mike.hol...@linaro.org



 --
 Stuart.




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


Re: [lng-odp] [PATCH 2/2] validation: timer: added cancel test

2015-03-12 Thread Savolainen, Petri (Nokia - FI/Espoo)
Ping. I think it's time to merge these two patches. This sets the stage for 
testing odp_timeout_xxx() after timer cancel.

-Petri

 -Original Message-
 From: ext Ola Liljedahl [mailto:ola.liljed...@linaro.org]
 Sent: Tuesday, March 10, 2015 4:11 PM
 To: Savolainen, Petri (Nokia - FI/Espoo)
 Cc: LNG ODP Mailman List
 Subject: Re: [lng-odp] [PATCH 2/2] validation: timer: added cancel test
 
 On 10 March 2015 at 10:10, Savolainen, Petri (Nokia - FI/Espoo)
 petri.savolai...@nokia.com wrote:
 
 
  -Original Message-
  From: ext Ola Liljedahl [mailto:ola.liljed...@linaro.org]
  Sent: Monday, March 09, 2015 4:44 PM
  To: Savolainen, Petri (Nokia - FI/Espoo)
  Cc: LNG ODP Mailman List
  Subject: Re: [lng-odp] [PATCH 2/2] validation: timer: added cancel test
 
  On 6 March 2015 at 15:30, Petri Savolainen petri.savolai...@nokia.com
  wrote:
   Added timeout cancel test that simply creates everything
   needed for requensting
  Spelling error.
 
  Maybe Maxim can correct this during merge.
 
 
   one timeout and then cancels that
   before it expires.
  
   The timeout user_ptr bug can be reproduced with this by
   uncommenting the user_ptr check.
  
   Signed-off-by: Petri Savolainen petri.savolai...@nokia.com
   ---
test/validation/odp_timer.c | 83
  +
1 file changed, 83 insertions(+)
  
   diff --git a/test/validation/odp_timer.c
 b/test/validation/odp_timer.c
   index 2ef3b39..1def85b 100644
   --- a/test/validation/odp_timer.c
   +++ b/test/validation/odp_timer.c
   @@ -124,6 +124,88 @@ static void test_timeout_pool_free(void)
   CU_ASSERT(odp_pool_destroy(pool) == 0);
}
  
   +static void test_odp_timer_cancel(void)
   +{
   +   odp_pool_t pool;
   +   odp_pool_param_t params;
   +   odp_timer_pool_param_t tparam;
   +   odp_timer_pool_t tp;
   +   odp_queue_t queue;
   +   odp_timer_t tim;
   +   odp_event_t ev;
   +   odp_timeout_t tmo;
   +   odp_timer_set_t rc;
   +   uint64_t tick;
   +
   +   params.tmo.num = 1;
   +   params.type= ODP_POOL_TIMEOUT;
   +   pool = odp_pool_create(tmo_pool_for_cancel, ODP_SHM_NULL,
  params);
   +
   +   if (pool == ODP_POOL_INVALID)
   +   CU_FAIL_FATAL(Timeout pool create failed);
   +
   +   tparam.res_ns = 100 * ODP_TIME_MSEC;
   +   tparam.min_tmo= 1   * ODP_TIME_SEC;
   +   tparam.max_tmo= 10  * ODP_TIME_SEC;
   +   tparam.num_timers = 1;
   +   tparam.priv   = 0;
   +   tparam.clk_src= ODP_CLOCK_CPU;
   +   tp = odp_timer_pool_create(timer_pool0, tparam);
   +   if (tp == ODP_TIMER_POOL_INVALID)
   +   CU_FAIL_FATAL(Timer pool create failed);
   +
   +   /* Start all created timer pools */
   +   odp_timer_pool_start();
   +
   +   queue = odp_queue_create(timer_queue, ODP_QUEUE_TYPE_POLL,
  NULL);
   +   if (queue == ODP_QUEUE_INVALID)
   +   CU_FAIL_FATAL(Queue create failed);
   +
   +   #define USER_PTR ((void *)0xdead)
   +   tim = odp_timer_alloc(tp, queue, USER_PTR);
   +   if (tim == ODP_TIMER_INVALID)
   +   CU_FAIL_FATAL(Failed to allocate timer);
   +
   +   ev = odp_timeout_to_event(odp_timeout_alloc(pool));
   +   if (ev == ODP_EVENT_INVALID)
   +   CU_FAIL_FATAL(Failed to allocate timeout);
   +
   +   tick = odp_timer_ns_to_tick(tp, 2 * ODP_TIME_SEC);
   +
   +   rc = odp_timer_set_rel(tim, tick, ev);
   +   if (rc != ODP_TIMER_SUCCESS)
   +   CU_FAIL_FATAL(Failed to set timer (relative time));
   +
   +   ev = ODP_EVENT_INVALID;
   +   if (odp_timer_cancel(tim, ev) != 0)
   +   CU_FAIL_FATAL(Failed to cancel timer (relative
 time));
   +
   +   if (ev == ODP_EVENT_INVALID)
   +   CU_FAIL_FATAL(Cancel did not return event);
   +
   +   tmo = odp_timeout_from_event(ev);
   +   if (tmo == ODP_TIMEOUT_INVALID)
   +   CU_FAIL_FATAL(Cancel returned invalid tmo);
  No need for fatal error? CU_FAIL should be enough.
 
  It's fatal for this test if something else than tmo is coming out from
 the cancel.
 True.
 
 
 
 
   +
   +/* Uncomment after user_ptr bug have been corrected
   +   if (odp_timeout_user_ptr(tmo) != USER_PTR)
   +   CU_FAIL_FATAL(Cancel corrupted user_ptr);
  CU_FAIL again.
 
  True. Test can continue to next timeout metadata tests, but it in
 comment now and need to updated (uncommented) any way after implementation
 fix.
 
 
  Tests for odp_timeout_timer() and odp_timeout_tick()?
 
  Yes. Those tests should be added after implementation is fixed.
 Actually I think it is a bad idea to check that the timeout expiration
 tick is always the latest set tick. That would require the
 implementation to update this field *every* time a  timer is reset,
 forcing an access to a data structure that otherwise would not be
 accessed. The expiration tick is set when the timer 

Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

2015-03-12 Thread Taras Kondratiuk

On 03/12/2015 12:03 PM, Savolainen, Petri (Nokia - FI/Espoo) wrote:




-Original Message-
From: ext Taras Kondratiuk [mailto:taras.kondrat...@linaro.org]
Sent: Wednesday, March 11, 2015 5:18 PM
To: Savolainen, Petri (Nokia - FI/Espoo); ext Christophe Milard; lng-
o...@lists.linaro.org
Subject: Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

On 03/11/2015 04:46 PM, Savolainen, Petri (Nokia - FI/Espoo) wrote:

Continuation of cpumask discussion on the call... For creating arbitrary
masks (e.g. fill in a mask with CPU ids of another ODP program in the
system, or testing all possible mask bits), we may need two more calls:

/**

* @return Maximum number of CPUs a mask can hold

*/

int odp_cpumask_max_cpus(void)

/**

   * Set all CPUs in the mask

   *

   * After the call, the mask has odp_cpumask_max_cpus() CPUs set.

* @note CPU numbering may not be contiguous.

*/

void odp_cpumask_setall(odp_cpumask_t *mask)

-Petri

*From:*lng-odp-boun...@lists.linaro.org
[mailto:lng-odp-boun...@lists.linaro.org] *On Behalf Of *ext Savolainen,
Petri (Nokia - FI/Espoo)
*Sent:* Wednesday, March 11, 2015 2:09 PM
*To:* ext Christophe Milard; lng-odp@lists.linaro.org
*Subject:* Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

Actually, this is equal to odp_cpu_max():

odp_cpumask_t mask;

odp_cpu_mask(mask)

odp_cpumask_last(mask)

So maybe odp_cpu_mask() is only new thing we need.


Hi Petri

It is not clear to me why do we need odp_cpu_* and odp_cpumask_* API.

They are used now to create threads and set CPU affinity. But this is
done by ODP helpers, because it is out of ODP scope. Shouldn't 'cpu' and
'cpumask' be a part of helpers too?


The original idea was to use cpumask in definition of odp_schedule_group_t 
(still on todo list). I need go through that use case and see if e.g. a thread 
mask would work instead.


Currently cpumask is used for 'real' CPUs, but IMO scheduler group
should operate on thread IDs instead.



E.g. odp_cpu_id() is good for debugging (e.g. that thread pinning is working).



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


Re: [lng-odp] [PATCH] validation: pktio: prevent race when using veth pair

2015-03-12 Thread Stuart Haslam
On Wed, Mar 11, 2015 at 04:47:59PM -0400, Mike Holmes wrote:
 I simultaneously ran two independent  instances of odp with make check
 and neither had an issue, one had this patch the other did not.
 
 At the same time I used the ./build.sh script from the cleanup branch of
 https://git.linaro.org/people/anders.roxell/check-odp.git and it was
 pointed at a patched repo
 It failed consistently as before

Bah. I can reproduce that failure myself now.

That problem is because build.sh runs ./configure  make  make check
outside of the source tree, which only works if all of the executables
required by make check are produced by make, and that's not the case
for odp_pktio_run. I'll have a think about the best way to resolve that.

 ..
 
 PASS: odp_errno
 FAIL: odp_pktio_run
 make[5]: Entering directory
 '/home/mike/git/check-odp/build/odp/testdir/test/validation'
 make[5]: Nothing to be done for 'all'.
 make[5]: Leaving directory
 '/home/mike/git/check-odp/build/odp/testdir/test/validation'
 
 Testsuite summary for OpenDataPlane 1.0.0
 
 # TOTAL: 18
 # PASS:  17
 # SKIP:  0
 # XFAIL: 0
 # FAIL:  1
 # XPASS: 0
 # ERROR: 0
 
 
 I don't know why this should be because I ran my local instances with the
 script
 for i in {1..10}; do make clean check -e; done
 and the build.sh uses
 make check -e - but obviously it does this after building from scratch
 downloading the repo etc each time so it does fewer iterations
 
 So I think the new approach is a better idea, and it does not appear to
 hurt, but it does not help the original use case of the scrip tin CI.
 

I think this patch should still go in though.

-- 
Stuart.

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


Re: [lng-odp] [PATCH] validation: pktio: disable arp on virtual interfaces

2015-03-12 Thread Stuart Haslam
On Thu, Mar 12, 2015 at 12:23:28PM +0300, Maxim Uvarov wrote:
 On 03/06/15 13:37, Stuart Haslam wrote:
 On Fri, Mar 06, 2015 at 01:00:54PM +0300, Maxim Uvarov wrote:
 Virtual interfaces for linux-generic tests does not have
 arp addresses. Arp discovery has to be turned off.
 
 Why? Presumably you're making this change because without it you had a
 problem, what was it?
 
 --
 Stuart.
 I think we need this to go in, right?
 
 Maxim.

OK, but please make a change in the commit log;

does not have arp addresses - do not have an IP address assigned

With that;

Reviewed-by: Stuart Haslam stuart.has...@linaro.org

-- 
Stuart.

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


Re: [lng-odp] [PATCH 2/2] validation: timer: added cancel test

2015-03-12 Thread Maxim Uvarov

Ola, do you want to add your review-by to these patches?

Maxim.

On 03/12/15 13:26, Savolainen, Petri (Nokia - FI/Espoo) wrote:

Ping. I think it's time to merge these two patches. This sets the stage for 
testing odp_timeout_xxx() after timer cancel.

-Petri


-Original Message-
From: ext Ola Liljedahl [mailto:ola.liljed...@linaro.org]
Sent: Tuesday, March 10, 2015 4:11 PM
To: Savolainen, Petri (Nokia - FI/Espoo)
Cc: LNG ODP Mailman List
Subject: Re: [lng-odp] [PATCH 2/2] validation: timer: added cancel test

On 10 March 2015 at 10:10, Savolainen, Petri (Nokia - FI/Espoo)
petri.savolai...@nokia.com wrote:



-Original Message-
From: ext Ola Liljedahl [mailto:ola.liljed...@linaro.org]
Sent: Monday, March 09, 2015 4:44 PM
To: Savolainen, Petri (Nokia - FI/Espoo)
Cc: LNG ODP Mailman List
Subject: Re: [lng-odp] [PATCH 2/2] validation: timer: added cancel test

On 6 March 2015 at 15:30, Petri Savolainen petri.savolai...@nokia.com
wrote:

Added timeout cancel test that simply creates everything
needed for requensting

Spelling error.

Maybe Maxim can correct this during merge.


one timeout and then cancels that
before it expires.

The timeout user_ptr bug can be reproduced with this by
uncommenting the user_ptr check.

Signed-off-by: Petri Savolainen petri.savolai...@nokia.com
---
  test/validation/odp_timer.c | 83

+

  1 file changed, 83 insertions(+)

diff --git a/test/validation/odp_timer.c

b/test/validation/odp_timer.c

index 2ef3b39..1def85b 100644
--- a/test/validation/odp_timer.c
+++ b/test/validation/odp_timer.c
@@ -124,6 +124,88 @@ static void test_timeout_pool_free(void)
 CU_ASSERT(odp_pool_destroy(pool) == 0);
  }

+static void test_odp_timer_cancel(void)
+{
+   odp_pool_t pool;
+   odp_pool_param_t params;
+   odp_timer_pool_param_t tparam;
+   odp_timer_pool_t tp;
+   odp_queue_t queue;
+   odp_timer_t tim;
+   odp_event_t ev;
+   odp_timeout_t tmo;
+   odp_timer_set_t rc;
+   uint64_t tick;
+
+   params.tmo.num = 1;
+   params.type= ODP_POOL_TIMEOUT;
+   pool = odp_pool_create(tmo_pool_for_cancel, ODP_SHM_NULL,

params);

+
+   if (pool == ODP_POOL_INVALID)
+   CU_FAIL_FATAL(Timeout pool create failed);
+
+   tparam.res_ns = 100 * ODP_TIME_MSEC;
+   tparam.min_tmo= 1   * ODP_TIME_SEC;
+   tparam.max_tmo= 10  * ODP_TIME_SEC;
+   tparam.num_timers = 1;
+   tparam.priv   = 0;
+   tparam.clk_src= ODP_CLOCK_CPU;
+   tp = odp_timer_pool_create(timer_pool0, tparam);
+   if (tp == ODP_TIMER_POOL_INVALID)
+   CU_FAIL_FATAL(Timer pool create failed);
+
+   /* Start all created timer pools */
+   odp_timer_pool_start();
+
+   queue = odp_queue_create(timer_queue, ODP_QUEUE_TYPE_POLL,

NULL);

+   if (queue == ODP_QUEUE_INVALID)
+   CU_FAIL_FATAL(Queue create failed);
+
+   #define USER_PTR ((void *)0xdead)
+   tim = odp_timer_alloc(tp, queue, USER_PTR);
+   if (tim == ODP_TIMER_INVALID)
+   CU_FAIL_FATAL(Failed to allocate timer);
+
+   ev = odp_timeout_to_event(odp_timeout_alloc(pool));
+   if (ev == ODP_EVENT_INVALID)
+   CU_FAIL_FATAL(Failed to allocate timeout);
+
+   tick = odp_timer_ns_to_tick(tp, 2 * ODP_TIME_SEC);
+
+   rc = odp_timer_set_rel(tim, tick, ev);
+   if (rc != ODP_TIMER_SUCCESS)
+   CU_FAIL_FATAL(Failed to set timer (relative time));
+
+   ev = ODP_EVENT_INVALID;
+   if (odp_timer_cancel(tim, ev) != 0)
+   CU_FAIL_FATAL(Failed to cancel timer (relative

time));

+
+   if (ev == ODP_EVENT_INVALID)
+   CU_FAIL_FATAL(Cancel did not return event);
+
+   tmo = odp_timeout_from_event(ev);
+   if (tmo == ODP_TIMEOUT_INVALID)
+   CU_FAIL_FATAL(Cancel returned invalid tmo);

No need for fatal error? CU_FAIL should be enough.

It's fatal for this test if something else than tmo is coming out from

the cancel.
True.




+
+/* Uncomment after user_ptr bug have been corrected
+   if (odp_timeout_user_ptr(tmo) != USER_PTR)
+   CU_FAIL_FATAL(Cancel corrupted user_ptr);

CU_FAIL again.

True. Test can continue to next timeout metadata tests, but it in

comment now and need to updated (uncommented) any way after implementation
fix.

Tests for odp_timeout_timer() and odp_timeout_tick()?

Yes. Those tests should be added after implementation is fixed.

Actually I think it is a bad idea to check that the timeout expiration
tick is always the latest set tick. That would require the
implementation to update this field *every* time a  timer is reset,
forcing an access to a data structure that otherwise would not be
accessed. The expiration tick is set when the timer expires and the
timeout is enqueued.

The timeout timer and user_ptr fields should be updated, this only has
to be done once, when a timeout event is specified in one of the

Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

2015-03-12 Thread Ola Liljedahl
On 12 March 2015 at 11:34, Taras Kondratiuk taras.kondrat...@linaro.org
wrote:

 On 03/12/2015 12:03 PM, Savolainen, Petri (Nokia - FI/Espoo) wrote:



  -Original Message-
 From: ext Taras Kondratiuk [mailto:taras.kondrat...@linaro.org]
 Sent: Wednesday, March 11, 2015 5:18 PM
 To: Savolainen, Petri (Nokia - FI/Espoo); ext Christophe Milard; lng-
 o...@lists.linaro.org
 Subject: Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

 On 03/11/2015 04:46 PM, Savolainen, Petri (Nokia - FI/Espoo) wrote:

 Continuation of cpumask discussion on the call... For creating arbitrary
 masks (e.g. fill in a mask with CPU ids of another ODP program in the
 system, or testing all possible mask bits), we may need two more calls:

 /**

 * @return Maximum number of CPUs a mask can hold

 */

 int odp_cpumask_max_cpus(void)

 /**

* Set all CPUs in the mask

*

* After the call, the mask has odp_cpumask_max_cpus() CPUs set.

 * @note CPU numbering may not be contiguous.

 */

 void odp_cpumask_setall(odp_cpumask_t *mask)

 -Petri

 *From:*lng-odp-boun...@lists.linaro.org
 [mailto:lng-odp-boun...@lists.linaro.org] *On Behalf Of *ext
 Savolainen,
 Petri (Nokia - FI/Espoo)
 *Sent:* Wednesday, March 11, 2015 2:09 PM
 *To:* ext Christophe Milard; lng-odp@lists.linaro.org
 *Subject:* Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

 Actually, this is equal to odp_cpu_max():

 odp_cpumask_t mask;

 odp_cpu_mask(mask)

 odp_cpumask_last(mask)

 So maybe odp_cpu_mask() is only new thing we need.


 Hi Petri

 It is not clear to me why do we need odp_cpu_* and odp_cpumask_* API.

 They are used now to create threads and set CPU affinity. But this is
 done by ODP helpers, because it is out of ODP scope. Shouldn't 'cpu' and
 'cpumask' be a part of helpers too?


 The original idea was to use cpumask in definition of
 odp_schedule_group_t (still on todo list). I need go through that use case
 and see if e.g. a thread mask would work instead.


 Currently cpumask is used for 'real' CPUs, but IMO scheduler group
 should operate on thread IDs instead.

We need a clear understanding of these concepts so we can extend the
architecture to use (CPU or thread) groups for local scheduling.



 E.g. odp_cpu_id() is good for debugging (e.g. that thread pinning is
 working).



 ___
 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] [Bug 1344] New: CID 87295: Improper use of negative value: odp_classification_basic.c

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1344

Bug ID: 1344
   Summary: CID 87295: Improper use of negative value:
odp_classification_basic.c
   Product: OpenDataPlane
   Version: 1.0
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: normal
  Priority: ---
 Component: Classification
  Assignee: bala.manoha...@linaro.org
  Reporter: mike.hol...@linaro.org
CC: lng-odp@lists.linaro.org

63static void classification_destroy_pmr(void)
 64{
 65odp_pmr_t pmr;
 66uint16_t val;
 67uint16_t mask;
 68int retval;
 69val = 1024;
 70mask = 0x;
 71pmr = odp_pmr_create_match(ODP_PMR_TCP_SPORT, val, mask,
sizeof(val));
 72retval = odp_pmr_destroy(pmr);
 73CU_ASSERT(retval == 0);

CID 87295 (#1 of 1): Improper use of negative value (NEGATIVE_RETURNS)
negative_returns: Passing negative constant (odp_pmr_t)0x to a
parameter that cannot be negative. [show details]
 74retval = odp_pmr_destroy(ODP_PMR_INVAL);
 75retval = odp_pmr_destroy(ODP_PMR_INVAL);
 76CU_ASSERT(retval  0);
 77}


/platform/linux-generic/odp_classification.c
473int odp_pmr_destroy(odp_pmr_t pmr_id)
474{
   1. index: Function get_pmr_entry uses pmr_id as an array index. [show
details]
475pmr_t *pmr = get_pmr_entry(pmr_id);
476
477if (pmr == NULL)
478return -1;
479pmr-s.valid = 0;
480return 0;
481}


/platform/linux-generic/odp_classification.c
246pmr_t *get_pmr_entry(odp_pmr_t pmr_id)
247{
   1. Condition (uint32_t)(uintptr_t)pmr_id = 64, taking false branch
   2. Condition pmr_id == (odp_pmr_t)0x, taking false
branch
248if (_odp_typeval(pmr_id) = ODP_PMR_MAX_ENTRY ||
249pmr_id == ODP_PMR_INVAL)
250return NULL;
   3. index: Indexing pmr_tbl-pmr with pmr_id.
251if (pmr_tbl-pmr[_odp_typeval(pmr_id)].s.valid == 0)
252return NULL;
253return (pmr_tbl-pmr[_odp_typeval(pmr_id)]);
254}

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


Re: [lng-odp] [PATCH] validation: pktio: prevent race when using veth pair

2015-03-12 Thread Maxim Uvarov

On 03/11/15 17:22, Stuart Haslam wrote:

+   cnt=$[$cnt+1]

That is not portable, use expr.

./test/validation/odp_pktio_run: 43: [: Illegal number: $[0+1]

Maxim.

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


Re: [lng-odp] [PATCH 2/2] validation: timer: added cancel test

2015-03-12 Thread Savolainen, Petri (Nokia - FI/Espoo)
To keep it simple:

1) Merge with spelling fixed: “requensting” = “requesting”

2) Send another patch that enables odp_timeout_user_ptr() test and adds 
odp_timeout_timer() test.

-Petri



From: ext Ola Liljedahl [mailto:ola.liljed...@linaro.org]
Sent: Thursday, March 12, 2015 2:58 PM
To: Maxim Uvarov
Cc: Savolainen, Petri (Nokia - FI/Espoo); LNG ODP Mailman List
Subject: Re: [lng-odp] [PATCH 2/2] validation: timer: added cancel test

On 12 March 2015 at 12:21, Maxim Uvarov 
maxim.uva...@linaro.orgmailto:maxim.uva...@linaro.org wrote:
Ola, do you want to add your review-by to these patches?
I think the patch should be reposted (by someone) with the user_ptr test 
enabled and the spelling error corrected. I could do this but then someone else 
needs to review it...

-- Ola



Maxim.


On 03/12/15 13:26, Savolainen, Petri (Nokia - FI/Espoo) wrote:
Ping. I think it's time to merge these two patches. This sets the stage for 
testing odp_timeout_xxx() after timer cancel.

-Petri
-Original Message-
From: ext Ola Liljedahl 
[mailto:ola.liljed...@linaro.orgmailto:ola.liljed...@linaro.org]
Sent: Tuesday, March 10, 2015 4:11 PM
To: Savolainen, Petri (Nokia - FI/Espoo)
Cc: LNG ODP Mailman List
Subject: Re: [lng-odp] [PATCH 2/2] validation: timer: added cancel test

On 10 March 2015 at 10:10, Savolainen, Petri (Nokia - FI/Espoo)
petri.savolai...@nokia.commailto:petri.savolai...@nokia.com wrote:

-Original Message-
From: ext Ola Liljedahl 
[mailto:ola.liljed...@linaro.orgmailto:ola.liljed...@linaro.org]
Sent: Monday, March 09, 2015 4:44 PM
To: Savolainen, Petri (Nokia - FI/Espoo)
Cc: LNG ODP Mailman List
Subject: Re: [lng-odp] [PATCH 2/2] validation: timer: added cancel test

On 6 March 2015 at 15:30, Petri Savolainen 
petri.savolai...@nokia.commailto:petri.savolai...@nokia.com
wrote:
Added timeout cancel test that simply creates everything
needed for requensting
Spelling error.
Maybe Maxim can correct this during merge.
one timeout and then cancels that
before it expires.

The timeout user_ptr bug can be reproduced with this by
uncommenting the user_ptr check.

Signed-off-by: Petri Savolainen 
petri.savolai...@nokia.commailto:petri.savolai...@nokia.com
---
  test/validation/odp_timer.c | 83
+
  1 file changed, 83 insertions(+)

diff --git a/test/validation/odp_timer.c
b/test/validation/odp_timer.c
index 2ef3b39..1def85b 100644
--- a/test/validation/odp_timer.c
+++ b/test/validation/odp_timer.c
@@ -124,6 +124,88 @@ static void test_timeout_pool_free(void)
 CU_ASSERT(odp_pool_destroy(pool) == 0);
  }

+static void test_odp_timer_cancel(void)
+{
+   odp_pool_t pool;
+   odp_pool_param_t params;
+   odp_timer_pool_param_t tparam;
+   odp_timer_pool_t tp;
+   odp_queue_t queue;
+   odp_timer_t tim;
+   odp_event_t ev;
+   odp_timeout_t tmo;
+   odp_timer_set_t rc;
+   uint64_t tick;
+
+   params.tmo.num = 1;
+   params.type= ODP_POOL_TIMEOUT;
+   pool = odp_pool_create(tmo_pool_for_cancel, ODP_SHM_NULL,
params);
+
+   if (pool == ODP_POOL_INVALID)
+   CU_FAIL_FATAL(Timeout pool create failed);
+
+   tparam.res_ns = 100 * ODP_TIME_MSEC;
+   tparam.min_tmo= 1   * ODP_TIME_SEC;
+   tparam.max_tmo= 10  * ODP_TIME_SEC;
+   tparam.num_timers = 1;
+   tparam.priv   = 0;
+   tparam.clk_src= ODP_CLOCK_CPU;
+   tp = odp_timer_pool_create(timer_pool0, tparam);
+   if (tp == ODP_TIMER_POOL_INVALID)
+   CU_FAIL_FATAL(Timer pool create failed);
+
+   /* Start all created timer pools */
+   odp_timer_pool_start();
+
+   queue = odp_queue_create(timer_queue, ODP_QUEUE_TYPE_POLL,
NULL);
+   if (queue == ODP_QUEUE_INVALID)
+   CU_FAIL_FATAL(Queue create failed);
+
+   #define USER_PTR ((void *)0xdead)
+   tim = odp_timer_alloc(tp, queue, USER_PTR);
+   if (tim == ODP_TIMER_INVALID)
+   CU_FAIL_FATAL(Failed to allocate timer);
+
+   ev = odp_timeout_to_event(odp_timeout_alloc(pool));
+   if (ev == ODP_EVENT_INVALID)
+   CU_FAIL_FATAL(Failed to allocate timeout);
+
+   tick = odp_timer_ns_to_tick(tp, 2 * ODP_TIME_SEC);
+
+   rc = odp_timer_set_rel(tim, tick, ev);
+   if (rc != ODP_TIMER_SUCCESS)
+   CU_FAIL_FATAL(Failed to set timer (relative time));
+
+   ev = ODP_EVENT_INVALID;
+   if (odp_timer_cancel(tim, ev) != 0)
+   CU_FAIL_FATAL(Failed to cancel timer (relative
time));
+
+   if (ev == ODP_EVENT_INVALID)
+   CU_FAIL_FATAL(Cancel did not return event);
+
+   tmo = odp_timeout_from_event(ev);
+   if (tmo == ODP_TIMEOUT_INVALID)
+   CU_FAIL_FATAL(Cancel returned invalid tmo);
No need for fatal error? CU_FAIL should be enough.
It's fatal for this test if something else than tmo is coming out from
the cancel.
True.

+
+/* Uncomment after user_ptr bug have been corrected
+   if 

[lng-odp] [Bug 1175] CID: 85427: odp_packet_io.c: Dereference null return value

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1175

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

   What|Removed |Added

 Status|CONFIRMED   |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Mike Holmes mike.hol...@linaro.org ---
Fixed in 1.0.1

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


[lng-odp] [Bug 1102] odp_syncronizers: Segmentation fault when run in CI

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1102

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

   What|Removed |Added

 Resolution|--- |NON REPRODUCIBLE
 Status|UNCONFIRMED |RESOLVED

--- Comment #2 from Mike Holmes mike.hol...@linaro.org ---
Issue has not reappeared when moving the docker based CI environment.

-- 
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] query regarding queue ODP_QUEUE_TYPE_SCHED

2015-03-12 Thread nikhil.agar...@freescale.com
Hi All,

ODP API reference manual states that API odp_queue_deq cannot be used with 
queue of type ODP_QUEUE_TYPE_SCHED, Which is logical as queue is already 
scheduled so we need to call odp_schedule for these type of queues.

In contrast with above statement ODP IPSEC example application creates 
completion queue\device default in queue in schedule mode and later in the 
pktio thread calls odp_queue_deq for those queues.

Following is the code snippet from ODP IPSEC application:

Main()
{
.
.
completionq = QUEUE_CREATE(completion,
   ODP_QUEUE_TYPE_SCHED,
   qparam);
.
}

QUEUE_CREATE()
{
..
..
if ((ODP_QUEUE_TYPE_SCHED == type) || (ODP_QUEUE_TYPE_PKTIN == type)) {
poll_queues[num_polled_queues++] = my_queue;
printf(%s: adding %d\n, __func__, my_queue);
}
..
}
Polled_odp_schedule()
{
..

for (idx = 0; idx  num_polled_queues; idx++) {
odp_queue_t queue = poll_queues[idx];
odp_buffer_t buf;

buf = odp_queue_deq(queue);
...
...

}


Please clarify.

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


[lng-odp] [Bug 1259] C++ compile and link to odp lib generates new warnings

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1259

--- Comment #2 from Mike Holmes mike.hol...@linaro.org ---
Possibly build C++ test against gnu-c++ standard which may allow this as an
extension.

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


[lng-odp] [Bug 1284] test/validation/odp_schedule fails to terminate cleanly

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1284

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

   What|Removed |Added

Version|unspecified |1.0

-- 
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 1246] valgrind does not understand the strong_typedef implimentation

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1246

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

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #2 from Mike Holmes mike.hol...@linaro.org ---
Valgrind appears to need a fix to understand this case.

-- 
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 1306] CID 87973: Control flow issues odp_cunit_common.c:

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1306

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

   What|Removed |Added

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

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


[lng-odp] [Bug 1168] odp_schedule test can create more threads than ODP_CONFIG_MAX_THREADS

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1168

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

   What|Removed |Added

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

--- Comment #2 from Mike Holmes mike.hol...@linaro.org ---
commit 70bd7de7182eaae5c920979e4d25cb512e6fffb8

-- 
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 1330] commit 71fcc8a _DEFAULT_SOURCE breaks odp_ipsec example

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1330

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

   What|Removed |Added

 CC||mike.hol...@linaro.org
   Assignee|lng-odp@lists.linaro.org|ciprian.ba...@linaro.org

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


[lng-odp] [Bug 1313] Timeout user pointer metadata is not set on timer_cancel

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1313

Maxim Uvarov maxim.uva...@linaro.org changed:

   What|Removed |Added

 Status|CONFIRMED   |RESOLVED
 CC||maxim.uva...@linaro.org
 Resolution|--- |FIXED

--- Comment #4 from Maxim Uvarov maxim.uva...@linaro.org ---
commit dd48199df5e1d55c3290ce01747edc596e35bd4f
Author: Ola Liljedahl ola.liljed...@linaro.org
Date:   Wed Mar 11 16:36:45 2015 +0100

linux-generic: odp_timer: set user_ptr for cancelled timeout

Ensure that the timeout user_ptr and timer fields are set when the
corresponding timer is immediately cancelled.
https://bugs.linaro.org/show_bug.cgi?id=1313

Signed-off-by: Ola Liljedahl ola.liljed...@linaro.org
Reviewed-by: Bill Fischofer bill.fischo...@linaro.org
Signed-off-by: Maxim Uvarov maxim.uva...@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] [PATCHv2] validation: timer: added cancel test

2015-03-12 Thread Ola Liljedahl
Add basic timer cancel test that checks that everything is OK when
a timer is reset and then cancelled before expiration.

Signed-off-by: Petri Savolainen petri.savolai...@nokia.com
Signed-off-by: Ola Liljedahl ola.liljed...@linaro.org
---
v2:
Enabled test of odp_timeout_user_ptr().
Added test of odp_timeout_timer().
Rephrased commit message.

 test/validation/odp_timer.c | 85 +
 1 file changed, 85 insertions(+)

diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c
index b625b80..10dd10f 100644
--- a/test/validation/odp_timer.c
+++ b/test/validation/odp_timer.c
@@ -124,6 +124,90 @@ static void test_timeout_pool_free(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
 }
 
+static void test_odp_timer_cancel(void)
+{
+   odp_pool_t pool;
+   odp_pool_param_t params;
+   odp_timer_pool_param_t tparam;
+   odp_timer_pool_t tp;
+   odp_queue_t queue;
+   odp_timer_t tim;
+   odp_event_t ev;
+   odp_timeout_t tmo;
+   odp_timer_set_t rc;
+   uint64_t tick;
+
+   params.tmo.num = 1;
+   params.type= ODP_POOL_TIMEOUT;
+   pool = odp_pool_create(tmo_pool_for_cancel, ODP_SHM_NULL, params);
+
+   if (pool == ODP_POOL_INVALID)
+   CU_FAIL_FATAL(Timeout pool create failed);
+
+   tparam.res_ns = 100 * ODP_TIME_MSEC;
+   tparam.min_tmo= 1   * ODP_TIME_SEC;
+   tparam.max_tmo= 10  * ODP_TIME_SEC;
+   tparam.num_timers = 1;
+   tparam.priv   = 0;
+   tparam.clk_src= ODP_CLOCK_CPU;
+   tp = odp_timer_pool_create(timer_pool0, tparam);
+   if (tp == ODP_TIMER_POOL_INVALID)
+   CU_FAIL_FATAL(Timer pool create failed);
+
+   /* Start all created timer pools */
+   odp_timer_pool_start();
+
+   queue = odp_queue_create(timer_queue, ODP_QUEUE_TYPE_POLL, NULL);
+   if (queue == ODP_QUEUE_INVALID)
+   CU_FAIL_FATAL(Queue create failed);
+
+   #define USER_PTR ((void *)0xdead)
+   tim = odp_timer_alloc(tp, queue, USER_PTR);
+   if (tim == ODP_TIMER_INVALID)
+   CU_FAIL_FATAL(Failed to allocate timer);
+
+   ev = odp_timeout_to_event(odp_timeout_alloc(pool));
+   if (ev == ODP_EVENT_INVALID)
+   CU_FAIL_FATAL(Failed to allocate timeout);
+
+   tick = odp_timer_ns_to_tick(tp, 2 * ODP_TIME_SEC);
+
+   rc = odp_timer_set_rel(tim, tick, ev);
+   if (rc != ODP_TIMER_SUCCESS)
+   CU_FAIL_FATAL(Failed to set timer (relative time));
+
+   ev = ODP_EVENT_INVALID;
+   if (odp_timer_cancel(tim, ev) != 0)
+   CU_FAIL_FATAL(Failed to cancel timer (relative time));
+
+   if (ev == ODP_EVENT_INVALID)
+   CU_FAIL_FATAL(Cancel did not return event);
+
+   tmo = odp_timeout_from_event(ev);
+   if (tmo == ODP_TIMEOUT_INVALID)
+   CU_FAIL_FATAL(Cancel did not return timeout);
+
+   if (odp_timeout_timer(tmo) != tim)
+   CU_FAIL(Cancel invalid tmo.timer);
+
+   if (odp_timeout_user_ptr(tmo) != USER_PTR)
+   CU_FAIL(Cancel invalid tmo.user_ptr);
+
+   odp_timeout_free(tmo);
+
+   ev = odp_timer_free(tim);
+   if (ev != ODP_EVENT_INVALID)
+   CU_FAIL_FATAL(Free returned event);
+
+   odp_timer_pool_destroy(tp);
+
+   if (odp_queue_destroy(queue) != 0)
+   CU_FAIL_FATAL(Failed to destroy queue);
+
+   if (odp_pool_destroy(pool) != 0)
+   CU_FAIL_FATAL(Failed to destroy pool);
+}
+
 /* @private Handle a received (timeout) event */
 static void handle_tmo(odp_event_t ev, bool stale, uint64_t prev_tick)
 {
@@ -444,6 +528,7 @@ static void test_odp_timer_all(void)
 CU_TestInfo test_odp_timer[] = {
{test_timeout_pool_alloc,  test_timeout_pool_alloc},
{test_timeout_pool_free,  test_timeout_pool_free},
+   {test_odp_timer_cancel,  test_odp_timer_cancel},
{test_odp_timer_all,  test_odp_timer_all},
CU_TEST_INFO_NULL,
 };
-- 
1.9.1


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


Re: [lng-odp] [PATCHv2] validation: timer: added cancel test

2015-03-12 Thread Ola Liljedahl
This is a v2 of Petris [2/2] validation: timer: added cancel test

-- Ola


On 12 March 2015 at 17:03, Ola Liljedahl ola.liljed...@linaro.org wrote:

 Add basic timer cancel test that checks that everything is OK when
 a timer is reset and then cancelled before expiration.

 Signed-off-by: Petri Savolainen petri.savolai...@nokia.com
 Signed-off-by: Ola Liljedahl ola.liljed...@linaro.org
 ---
 v2:
 Enabled test of odp_timeout_user_ptr().
 Added test of odp_timeout_timer().
 Rephrased commit message.

  test/validation/odp_timer.c | 85
 +
  1 file changed, 85 insertions(+)

 diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c
 index b625b80..10dd10f 100644
 --- a/test/validation/odp_timer.c
 +++ b/test/validation/odp_timer.c
 @@ -124,6 +124,90 @@ static void test_timeout_pool_free(void)
 CU_ASSERT(odp_pool_destroy(pool) == 0);
  }

 +static void test_odp_timer_cancel(void)
 +{
 +   odp_pool_t pool;
 +   odp_pool_param_t params;
 +   odp_timer_pool_param_t tparam;
 +   odp_timer_pool_t tp;
 +   odp_queue_t queue;
 +   odp_timer_t tim;
 +   odp_event_t ev;
 +   odp_timeout_t tmo;
 +   odp_timer_set_t rc;
 +   uint64_t tick;
 +
 +   params.tmo.num = 1;
 +   params.type= ODP_POOL_TIMEOUT;
 +   pool = odp_pool_create(tmo_pool_for_cancel, ODP_SHM_NULL,
 params);
 +
 +   if (pool == ODP_POOL_INVALID)
 +   CU_FAIL_FATAL(Timeout pool create failed);
 +
 +   tparam.res_ns = 100 * ODP_TIME_MSEC;
 +   tparam.min_tmo= 1   * ODP_TIME_SEC;
 +   tparam.max_tmo= 10  * ODP_TIME_SEC;
 +   tparam.num_timers = 1;
 +   tparam.priv   = 0;
 +   tparam.clk_src= ODP_CLOCK_CPU;
 +   tp = odp_timer_pool_create(timer_pool0, tparam);
 +   if (tp == ODP_TIMER_POOL_INVALID)
 +   CU_FAIL_FATAL(Timer pool create failed);
 +
 +   /* Start all created timer pools */
 +   odp_timer_pool_start();
 +
 +   queue = odp_queue_create(timer_queue, ODP_QUEUE_TYPE_POLL, NULL);
 +   if (queue == ODP_QUEUE_INVALID)
 +   CU_FAIL_FATAL(Queue create failed);
 +
 +   #define USER_PTR ((void *)0xdead)
 +   tim = odp_timer_alloc(tp, queue, USER_PTR);
 +   if (tim == ODP_TIMER_INVALID)
 +   CU_FAIL_FATAL(Failed to allocate timer);
 +
 +   ev = odp_timeout_to_event(odp_timeout_alloc(pool));
 +   if (ev == ODP_EVENT_INVALID)
 +   CU_FAIL_FATAL(Failed to allocate timeout);
 +
 +   tick = odp_timer_ns_to_tick(tp, 2 * ODP_TIME_SEC);
 +
 +   rc = odp_timer_set_rel(tim, tick, ev);
 +   if (rc != ODP_TIMER_SUCCESS)
 +   CU_FAIL_FATAL(Failed to set timer (relative time));
 +
 +   ev = ODP_EVENT_INVALID;
 +   if (odp_timer_cancel(tim, ev) != 0)
 +   CU_FAIL_FATAL(Failed to cancel timer (relative time));
 +
 +   if (ev == ODP_EVENT_INVALID)
 +   CU_FAIL_FATAL(Cancel did not return event);
 +
 +   tmo = odp_timeout_from_event(ev);
 +   if (tmo == ODP_TIMEOUT_INVALID)
 +   CU_FAIL_FATAL(Cancel did not return timeout);
 +
 +   if (odp_timeout_timer(tmo) != tim)
 +   CU_FAIL(Cancel invalid tmo.timer);
 +
 +   if (odp_timeout_user_ptr(tmo) != USER_PTR)
 +   CU_FAIL(Cancel invalid tmo.user_ptr);
 +
 +   odp_timeout_free(tmo);
 +
 +   ev = odp_timer_free(tim);
 +   if (ev != ODP_EVENT_INVALID)
 +   CU_FAIL_FATAL(Free returned event);
 +
 +   odp_timer_pool_destroy(tp);
 +
 +   if (odp_queue_destroy(queue) != 0)
 +   CU_FAIL_FATAL(Failed to destroy queue);
 +
 +   if (odp_pool_destroy(pool) != 0)
 +   CU_FAIL_FATAL(Failed to destroy pool);
 +}
 +
  /* @private Handle a received (timeout) event */
  static void handle_tmo(odp_event_t ev, bool stale, uint64_t prev_tick)
  {
 @@ -444,6 +528,7 @@ static void test_odp_timer_all(void)
  CU_TestInfo test_odp_timer[] = {
 {test_timeout_pool_alloc,  test_timeout_pool_alloc},
 {test_timeout_pool_free,  test_timeout_pool_free},
 +   {test_odp_timer_cancel,  test_odp_timer_cancel},
 {test_odp_timer_all,  test_odp_timer_all},
 CU_TEST_INFO_NULL,
  };
 --
 1.9.1


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


[lng-odp] [Bug 1334] packet flag APIs are booleans and should follow boolean guidelines

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1334

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

   What|Removed |Added

 CC||mike.hol...@linaro.org

--- Comment #2 from Mike Holmes mike.hol...@linaro.org ---
will also add doxygen update and commit to api-next

-- 
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 706] odp: l2fwd-dpdk port unable to spwan coremask specified number of threads

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=706

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

   What|Removed |Added

   Assignee|robk...@cisco.com   |santosh.shu...@linaro.org

--- Comment #4 from Mike Holmes mike.hol...@linaro.org ---
Santosh, is this still valid ?

-- 
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 641] Add support for tunnel mode to IPsec example application

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=641

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

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |CONFIRMED

--- Comment #2 from Mike Holmes mike.hol...@linaro.org ---
https://cards.linaro.org/browse/LNG-857

-- 
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
http://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 634] Improve error handling in IPsec example application

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=634

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

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |CONFIRMED

--- Comment #2 from Mike Holmes mike.hol...@linaro.org ---
https://cards.linaro.org/browse/LNG-857

-- 
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
http://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 625] Enhance IPsec example command line options to select polled queues versus scheduled

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=625

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

   What|Removed |Added

Version|unspecified |1.0

-- 
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
http://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 620] odp_ipsec.c todo review items

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=620

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

   What|Removed |Added

Version|unspecified |1.0

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


[lng-odp] [Bug 634] Improve error handling in IPsec example application

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=634

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

   What|Removed |Added

Version|unspecified |1.0

-- 
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
http://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 620] odp_ipsec.c todo review items

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=620

--- Comment #3 from Mike Holmes mike.hol...@linaro.org ---
https://cards.linaro.org/browse/LNG-857

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


[lng-odp] [Bug 625] Enhance IPsec example command line options to select polled queues versus scheduled

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=625

--- Comment #2 from Mike Holmes mike.hol...@linaro.org ---
https://cards.linaro.org/browse/LNG-857

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


[lng-odp] [Bug 626] Enhance IPsec example command line options to select multi buffer dequeue versus single

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=626

--- Comment #2 from Mike Holmes mike.hol...@linaro.org ---
https://cards.linaro.org/browse/LNG-857

-- 
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
http://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 626] Enhance IPsec example command line options to select multi buffer dequeue versus single

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=626

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

   What|Removed |Added

Version|unspecified |1.0

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


[lng-odp] [Bug 641] Add support for tunnel mode to IPsec example application

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=641

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

   What|Removed |Added

Version|unspecified |1.0

--- Comment #3 from Mike Holmes mike.hol...@linaro.org ---
https://cards.linaro.org/browse/LNG-857

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


[lng-odp] [PATCH] linux-generic: strongtypes: add dummy struct var to keep c++ happy

2015-03-12 Thread Bill Fischofer
C++ doesn't like null structs so add a dummy variable to make it happy.
Note that we only use these types as pseudo-pointers for strong typing
so the contents of what they apparently point to is irrelevant since
we never reference it.

This addresses Bug https://bugs.linaro.org/show_bug.cgi?id=1267

Signed-off-by: Bill Fischofer bill.fischo...@linaro.org
---
 platform/linux-generic/include/odp/plat/strong_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/platform/linux-generic/include/odp/plat/strong_types.h 
b/platform/linux-generic/include/odp/plat/strong_types.h
index 7fe73d8..72db7c4 100644
--- a/platform/linux-generic/include/odp/plat/strong_types.h
+++ b/platform/linux-generic/include/odp/plat/strong_types.h
@@ -16,7 +16,7 @@
 #define STRONG_TYPES_H_
 
 /** Use strong typing for ODP types */
-#define odp_handle_t struct {} *
+#define odp_handle_t struct { uint8_t unused_dummy_var; } *
 
 /** Internal macro to get value of an ODP handle */
 #define _odp_typeval(handle) ((uint32_t)(uintptr_t)(handle))
-- 
2.1.0


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


[lng-odp] [Bug 1259] C++ compile and link to odp lib generates new warnings

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1259

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

   What|Removed |Added

   Assignee|lng-odp@lists.linaro.org|mike.hol...@linaro.org

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


[lng-odp] [Bug 1340] CID 88056: Error handling issues: odp_pktio.c

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1340

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

   What|Removed |Added

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

--- Comment #1 from Mike Holmes mike.hol...@linaro.org ---
commit 272595a6ace987f56352b89ada41980c67caf15d

-- 
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 706] odp: l2fwd-dpdk port unable to spwan coremask specified number of threads

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=706

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

   What|Removed |Added

  Component|General ODP API or  |General
   |linux-generic   |
   |implimentation  |
Product|OpenDataPlane   |OpenDataPlane DPDK

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


Re: [lng-odp] [PATCH 2/2] validation: timer: added cancel test

2015-03-12 Thread Ola Liljedahl
On 12 March 2015 at 12:21, Maxim Uvarov maxim.uva...@linaro.org wrote:

 Ola, do you want to add your review-by to these patches?

I think the patch should be reposted (by someone) with the user_ptr test
enabled and the spelling error corrected. I could do this but then someone
else needs to review it...

-- Ola




 Maxim.


 On 03/12/15 13:26, Savolainen, Petri (Nokia - FI/Espoo) wrote:

 Ping. I think it's time to merge these two patches. This sets the stage
 for testing odp_timeout_xxx() after timer cancel.

 -Petri

  -Original Message-
 From: ext Ola Liljedahl [mailto:ola.liljed...@linaro.org]
 Sent: Tuesday, March 10, 2015 4:11 PM
 To: Savolainen, Petri (Nokia - FI/Espoo)
 Cc: LNG ODP Mailman List
 Subject: Re: [lng-odp] [PATCH 2/2] validation: timer: added cancel test

 On 10 March 2015 at 10:10, Savolainen, Petri (Nokia - FI/Espoo)
 petri.savolai...@nokia.com wrote:


  -Original Message-
 From: ext Ola Liljedahl [mailto:ola.liljed...@linaro.org]
 Sent: Monday, March 09, 2015 4:44 PM
 To: Savolainen, Petri (Nokia - FI/Espoo)
 Cc: LNG ODP Mailman List
 Subject: Re: [lng-odp] [PATCH 2/2] validation: timer: added cancel test

 On 6 March 2015 at 15:30, Petri Savolainen petri.savolai...@nokia.com
 
 wrote:

 Added timeout cancel test that simply creates everything
 needed for requensting

 Spelling error.

 Maybe Maxim can correct this during merge.

  one timeout and then cancels that
 before it expires.

 The timeout user_ptr bug can be reproduced with this by
 uncommenting the user_ptr check.

 Signed-off-by: Petri Savolainen petri.savolai...@nokia.com
 ---
   test/validation/odp_timer.c | 83

 +

   1 file changed, 83 insertions(+)

 diff --git a/test/validation/odp_timer.c

 b/test/validation/odp_timer.c

 index 2ef3b39..1def85b 100644
 --- a/test/validation/odp_timer.c
 +++ b/test/validation/odp_timer.c
 @@ -124,6 +124,88 @@ static void test_timeout_pool_free(void)
  CU_ASSERT(odp_pool_destroy(pool) == 0);
   }

 +static void test_odp_timer_cancel(void)
 +{
 +   odp_pool_t pool;
 +   odp_pool_param_t params;
 +   odp_timer_pool_param_t tparam;
 +   odp_timer_pool_t tp;
 +   odp_queue_t queue;
 +   odp_timer_t tim;
 +   odp_event_t ev;
 +   odp_timeout_t tmo;
 +   odp_timer_set_t rc;
 +   uint64_t tick;
 +
 +   params.tmo.num = 1;
 +   params.type= ODP_POOL_TIMEOUT;
 +   pool = odp_pool_create(tmo_pool_for_cancel, ODP_SHM_NULL,

 params);

 +
 +   if (pool == ODP_POOL_INVALID)
 +   CU_FAIL_FATAL(Timeout pool create failed);
 +
 +   tparam.res_ns = 100 * ODP_TIME_MSEC;
 +   tparam.min_tmo= 1   * ODP_TIME_SEC;
 +   tparam.max_tmo= 10  * ODP_TIME_SEC;
 +   tparam.num_timers = 1;
 +   tparam.priv   = 0;
 +   tparam.clk_src= ODP_CLOCK_CPU;
 +   tp = odp_timer_pool_create(timer_pool0, tparam);
 +   if (tp == ODP_TIMER_POOL_INVALID)
 +   CU_FAIL_FATAL(Timer pool create failed);
 +
 +   /* Start all created timer pools */
 +   odp_timer_pool_start();
 +
 +   queue = odp_queue_create(timer_queue, ODP_QUEUE_TYPE_POLL,

 NULL);

 +   if (queue == ODP_QUEUE_INVALID)
 +   CU_FAIL_FATAL(Queue create failed);
 +
 +   #define USER_PTR ((void *)0xdead)
 +   tim = odp_timer_alloc(tp, queue, USER_PTR);
 +   if (tim == ODP_TIMER_INVALID)
 +   CU_FAIL_FATAL(Failed to allocate timer);
 +
 +   ev = odp_timeout_to_event(odp_timeout_alloc(pool));
 +   if (ev == ODP_EVENT_INVALID)
 +   CU_FAIL_FATAL(Failed to allocate timeout);
 +
 +   tick = odp_timer_ns_to_tick(tp, 2 * ODP_TIME_SEC);
 +
 +   rc = odp_timer_set_rel(tim, tick, ev);
 +   if (rc != ODP_TIMER_SUCCESS)
 +   CU_FAIL_FATAL(Failed to set timer (relative time));
 +
 +   ev = ODP_EVENT_INVALID;
 +   if (odp_timer_cancel(tim, ev) != 0)
 +   CU_FAIL_FATAL(Failed to cancel timer (relative

 time));

 +
 +   if (ev == ODP_EVENT_INVALID)
 +   CU_FAIL_FATAL(Cancel did not return event);
 +
 +   tmo = odp_timeout_from_event(ev);
 +   if (tmo == ODP_TIMEOUT_INVALID)
 +   CU_FAIL_FATAL(Cancel returned invalid tmo);

 No need for fatal error? CU_FAIL should be enough.

 It's fatal for this test if something else than tmo is coming out from

 the cancel.
 True.


  +
 +/* Uncomment after user_ptr bug have been corrected
 +   if (odp_timeout_user_ptr(tmo) != USER_PTR)
 +   CU_FAIL_FATAL(Cancel corrupted user_ptr);

 CU_FAIL again.

 True. Test can continue to next timeout metadata tests, but it in

 comment now and need to updated (uncommented) any way after
 implementation
 fix.

 Tests for odp_timeout_timer() and odp_timeout_tick()?

 Yes. Those tests should be added after implementation is fixed.

 Actually I think it is a bad idea to check that the timeout expiration
 tick is always the latest set tick. 

Re: [lng-odp] [PATCH] validation: pktio: prevent race when using veth pair

2015-03-12 Thread Maxim Uvarov

On 03/11/15 23:47, Mike Holmes wrote:

for i in {1..10}; do make clean check -e; done
Mike do you run that under root or not? I.e. which pktio in test odp 
loop or linux veth?


Maxim.

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


Re: [lng-odp] odp_cpu_count() vs odp_cpumask size

2015-03-12 Thread Savolainen, Petri (Nokia - FI/Espoo)


 -Original Message-
 From: ext Taras Kondratiuk [mailto:taras.kondrat...@linaro.org]
 Sent: Wednesday, March 11, 2015 5:18 PM
 To: Savolainen, Petri (Nokia - FI/Espoo); ext Christophe Milard; lng-
 o...@lists.linaro.org
 Subject: Re: [lng-odp] odp_cpu_count() vs odp_cpumask size
 
 On 03/11/2015 04:46 PM, Savolainen, Petri (Nokia - FI/Espoo) wrote:
  Continuation of cpumask discussion on the call... For creating arbitrary
  masks (e.g. fill in a mask with CPU ids of another ODP program in the
  system, or testing all possible mask bits), we may need two more calls:
 
  /**
 
  * @return Maximum number of CPUs a mask can hold
 
  */
 
  int odp_cpumask_max_cpus(void)
 
  /**
 
* Set all CPUs in the mask
 
*
 
* After the call, the mask has odp_cpumask_max_cpus() CPUs set.
 
 * @note CPU numbering may not be contiguous.
 
  */
 
  void odp_cpumask_setall(odp_cpumask_t *mask)
 
  -Petri
 
  *From:*lng-odp-boun...@lists.linaro.org
  [mailto:lng-odp-boun...@lists.linaro.org] *On Behalf Of *ext Savolainen,
  Petri (Nokia - FI/Espoo)
  *Sent:* Wednesday, March 11, 2015 2:09 PM
  *To:* ext Christophe Milard; lng-odp@lists.linaro.org
  *Subject:* Re: [lng-odp] odp_cpu_count() vs odp_cpumask size
 
  Actually, this is equal to odp_cpu_max():
 
  odp_cpumask_t mask;
 
  odp_cpu_mask(mask)
 
  odp_cpumask_last(mask)
 
  So maybe odp_cpu_mask() is only new thing we need.
 
 Hi Petri
 
 It is not clear to me why do we need odp_cpu_* and odp_cpumask_* API.
 
 They are used now to create threads and set CPU affinity. But this is
 done by ODP helpers, because it is out of ODP scope. Shouldn't 'cpu' and
 'cpumask' be a part of helpers too?

The original idea was to use cpumask in definition of odp_schedule_group_t 
(still on todo list). I need go through that use case and see if e.g. a thread 
mask would work instead.

E.g. odp_cpu_id() is good for debugging (e.g. that thread pinning is working). 

-Petri






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


Re: [lng-odp] [PATCH] linux-generic: odp_timer: set user_ptr for cancelled timeout

2015-03-12 Thread Ola Liljedahl
On 10 March 2015 at 16:11, Maxim Uvarov maxim.uva...@linaro.org wrote:
 On 03/10/15 18:08, Ola Liljedahl wrote:

 On 10 March 2015 at 15:59, Maxim Uvarov maxim.uva...@linaro.org wrote:

 On 03/10/15 17:43, Ola Liljedahl wrote:

 Ensure that the timeout user_ptr and timer fields are set when the
 corresponding timer is immediately cancelled.
 https://bugs.linaro.org/show_bug.cgi?id=1313

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

 Passes odp_timer validation with the new odp_timer_cancel() test from
 Petri.

platform/linux-generic/odp_timer.c | 18 ++
1 file changed, 14 insertions(+), 4 deletions(-)

 diff --git a/platform/linux-generic/odp_timer.c
 b/platform/linux-generic/odp_timer.c
 index 61a02b6..6b48d2e 100644
 --- a/platform/linux-generic/odp_timer.c
 +++ b/platform/linux-generic/odp_timer.c
 @@ -421,6 +421,16 @@ static bool timer_reset(uint32_t idx,
#endif
  } else {
  /* We have a new timeout buffer which replaces any old
 one
 */
 +   /* Fill in header fields if timeout event */
 +   if (_odp_buffer_type(*tmo_buf) == ODP_EVENT_TIMEOUT) {
 +   /* Convert from buffer to timeout hdr */
 +   odp_timeout_hdr_t *tmo_hdr =
 +   timeout_hdr_from_buf(*tmo_buf);

 as we discussed earlier  this 2 definitions of tmo_hdr can be one on top
 of
 timer_expire().
 int succ  can be int ret and also defined on top.

 Yes they can but that would be a different coding style. It is OK to
 declare variables at beginning of a block, even Linux does it (see
 Petri's example). This has been OK since the beginning of time (the
 start of the Epoch, Jan. 1st 1970).


 My point here is if you use one variable 2 times in one function, than most
 probably you need define it only once.
 Do you agree?
No.

There is no intrinsic value in having as few variable declarations as
possible. If the scope becomes larger, this could be confusing to the
programmers that try to understand the code. A larger scope means that
the variables are valid longer (from a compiler perspective) even if
the variables are not really valid from a runtime perspective.

If I only need to use a variable in a certain block (because the
corresponding value is only alive there), I want to declare it in that
block and have it go out of scope when the block ends. Possibly
another block in the same function needs a variable of the same type
for some short-lived purpose. Then I will declare that variable in
that block and not try to combine in with an unrelated variable in
another block just because they are of the same type and used for
similar purposes.


 Maxim.


 Maxim.

 +   tmo_hdr-timer = tp_idx_to_handle(tp, idx);
 +   tmo_hdr-user_ptr = tp-timers[idx].user_ptr;
 +   /* expiration field filled in when timer expires
 */
 +   }
 +   /* Else ignore buffers of other types */
  odp_buffer_t old_buf = ODP_BUFFER_INVALID;
#ifdef ODP_ATOMIC_U128
  tick_buf_t new, old;
 @@ -556,16 +566,16 @@ static unsigned timer_expire(odp_timer_pool *tp,
 uint32_t idx, uint64_t tick)
  _odp_atomic_flag_clear(IDX2LOCK(idx));
#endif
  if (odp_likely(tmo_buf != ODP_BUFFER_INVALID)) {
 -   /* Fill in metadata fields in system timeout buffer */
 +   /* Fill in expiration tick if timeout event */
  if (_odp_buffer_type(tmo_buf) == ODP_EVENT_TIMEOUT) {
  /* Convert from buffer to timeout hdr */
  odp_timeout_hdr_t *tmo_hdr =
  timeout_hdr_from_buf(tmo_buf);
 -   tmo_hdr-timer = tp_idx_to_handle(tp, idx);
  tmo_hdr-expiration = exp_tck;
 -   tmo_hdr-user_ptr = tim-user_ptr;
 +   /* timer and user_ptr fields filled in when
 timer
 +* was set */
  }
 -   /* Else ignore buffers of other types */
 +   /* Else ignore events of other types */
  /* Post the timeout to the destination queue */
  int rc = odp_queue_enq(tim-queue,
 odp_buffer_to_event(tmo_buf));



 ___
 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] [Bug 1334] packet flag APIs are booleans and should follow boolean guidelines

2015-03-12 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1334

--- Comment #1 from Bill Fischofer bill.fischo...@linaro.org ---
Patch series starting at http://patches.opendataplane.org/patch/1011/ submitted
to correct type specification of the packet flag API and linux-generic
implementation as well as to relax the validation test to conform to ODP API
guidelines.

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