Re: [lng-odp] [PATCH v2 2/6] linux-generic: use source files instead of symbolic links

2016-08-04 Thread Bill Fischofer
On Thu, Aug 4, 2016 at 2:48 PM, Mike Holmes  wrote:

> On 4 August 2016 at 15:30, Brian Brooks  wrote:
>
> > Use source files in arch/default for undetected archs. This
> > alleviates the need to use symlinks in the source code
> > directory structure.
> >
>
> I prefer a behaviour where this fails at config time if a new ARCH appears.
> If you dont do this you start running with defaults and get rubbish
> performance or even errors and possibly crashes rather than being notified
> upfront to pay attention to what you are required to configure.
>

Agree. The earlier the better for misconfiguration detection.


>
>
>
> >
> > Signed-off-by: Brian Brooks 
> > ---
> >  configure.ac   | 13 +-
> >  platform/Makefile.inc  |  3 --
> >  platform/linux-generic/arch/arm/odp/api/cpu_arch.h |  1 -
> >  platform/linux-generic/arch/arm/odp_cpu_arch.c |  1 -
> >  .../linux-generic/arch/arm/odp_sysinfo_parse.c |  1 -
> >  platform/linux-generic/arch/powerpc/odp_cpu_arch.c | 49
> > +-
> >  6 files changed, 49 insertions(+), 19 deletions(-)
> >  delete mode 12 platform/linux-generic/arch/arm/odp/api/cpu_arch.h
> >  delete mode 12 platform/linux-generic/arch/arm/odp_cpu_arch.c
> >  delete mode 12 platform/linux-generic/arch/arm/odp_sysinfo_parse.c
> >  mode change 12 => 100644 platform/linux-generic/arch/
> > powerpc/odp_cpu_arch.c
> >
> > diff --git a/configure.ac b/configure.ac
> > index c0f0f21..a7e058a 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -77,22 +77,11 @@ AS_CASE([$host],
> >[i686*], [ARCH_DIR=x86],
> >[mips64*], [ARCH_DIR=mips64],
> >[powerpc*], [ARCH_DIR=powerpc],
> > -  [aarch64*], [ARCH_DIR=arm],
> > -  [arm*], [ARCH_DIR=arm],
> > -  [ARCH_DIR=undefined]
> > +  [ARCH_DIR=default]
> >  )
> >  AC_SUBST([ARCH_DIR])
> >
> >  
> > ##
> > -# Warn on the defaults if arch is undefined
> > -###
> > ###
> > -if test "${ARCH_DIR}" == "undefined";
> > -then
> > -echo "ARCH_DIR is undefined, please add your ARCH_DIR based on
> > host=${host}"
> > -exit 1
> > -fi
> > -
> > -###
> > ###
> >  # Set correct pkgconfig version
> >  
> > ##
> >  PKGCONFIG_VERSION=$(echo $VERSION | awk -F '.git' '{print $1}')
> > diff --git a/platform/Makefile.inc b/platform/Makefile.inc
> > index a44f88f..2a4255c 100644
> > --- a/platform/Makefile.inc
> > +++ b/platform/Makefile.inc
> > @@ -62,9 +62,6 @@ odpapispecinclude_HEADERS = \
> >   $(top_srcdir)/include/odp/api/spec/version.h
> >
> >  EXTRA_DIST = \
> > -arch/arm/odp/api/cpu_arch.h \
> > -arch/arm/odp_cpu_arch.c \
> > -arch/arm/odp_sysinfo_parse.c \
> >  arch/default/odp/api/cpu_arch.h \
> >  arch/default/odp_cpu_arch.c \
> >  arch/default/odp_sysinfo_parse.c \
> > diff --git a/platform/linux-generic/arch/arm/odp/api/cpu_arch.h
> > b/platform/linux-generic/arch/arm/odp/api/cpu_arch.h
> > deleted file mode 12
> > index e86e132..000
> > --- a/platform/linux-generic/arch/arm/odp/api/cpu_arch.h
> > +++ /dev/null
> > @@ -1 +0,0 @@
> > -../../../default/odp/api/cpu_arch.h
> > \ No newline at end of file
> > diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c
> > b/platform/linux-generic/arch/arm/odp_cpu_arch.c
> > deleted file mode 12
> > index deebc47..000
> > --- a/platform/linux-generic/arch/arm/odp_cpu_arch.c
> > +++ /dev/null
> > @@ -1 +0,0 @@
> > -../default/odp_cpu_arch.c
> > \ No newline at end of file
> > diff --git a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c
> > b/platform/linux-generic/arch/arm/odp_sysinfo_parse.c
> > deleted file mode 12
> > index 39962b8..000
> > --- a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c
> > +++ /dev/null
> > @@ -1 +0,0 @@
> > -../default/odp_sysinfo_parse.c
> > \ No newline at end of file
> > diff --git a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
> > b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
> > deleted file mode 12
> > index deebc47..000
> > --- a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
> > +++ /dev/null
> > @@ -1 +0,0 @@
> > -../default/odp_cpu_arch.c
> > \ No newline at end of file
> > diff --git a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
> > b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
> > new file mode 100644
> > index 000..2ac223e
> > --- /dev/null
> > +++ b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
> > @@ -0,0 +1,48 @@
> > +/* Copyright (c) 2015, Linaro Limited
> > + * All rights reserved.
> > + *
> > + * SPDX-License-Identifier: BSD-3-Clause
> > + */
> > +
> > +#include 
> > +
> > +#include 
> > +#include 
> > +
> > +#incl

Re: [lng-odp] [PATCHv2] test: linux-gen: add pcap playback test

2016-08-04 Thread Bill Fischofer
On Tue, Aug 2, 2016 at 11:08 AM, Maxim Uvarov 
wrote:

> add pcap play back test which takes 2 arguments: 1 - pcap file,
> 2 - packet mask to match. Intend is to test odp with different
> input traffic to check internal implementation functions. In
> current case it's test for vlan tag instertion for packet mmap:
> pkt_mmap_vlan_insert().
>
> Signed-off-by: Maxim Uvarov 
>

Reviewed-and-tested-by: Bill Fischofer 


> ---
>  v2: up the patch, dirrect execution looks like works.
>
>  test/linux-generic/.gitignore   |   1 +
>  test/linux-generic/Makefile.am  |  10 +-
>  test/linux-generic/cls/.gitignore   |   3 +
>  test/linux-generic/cls/Makefile.am  |  13 ++
>  test/linux-generic/cls/cls.c| 349 ++
> ++
>  test/linux-generic/cls/cls_main.c   |  12 ++
>  test/linux-generic/cls/cls_suites.h |   1 +
>  test/linux-generic/cls/vlan.pcap| Bin 0 -> 9728 bytes
>  test/linux-generic/cls/vlan_run.sh  |  49 +
>  test/linux-generic/m4/configure.m4  |   1 +
>  10 files changed, 435 insertions(+), 4 deletions(-)
>  create mode 100644 test/linux-generic/cls/.gitignore
>  create mode 100644 test/linux-generic/cls/Makefile.am
>  create mode 100644 test/linux-generic/cls/cls.c
>  create mode 100644 test/linux-generic/cls/cls_main.c
>  create mode 100644 test/linux-generic/cls/cls_suites.h
>  create mode 100644 test/linux-generic/cls/vlan.pcap
>  create mode 100755 test/linux-generic/cls/vlan_run.sh
>
> diff --git a/test/linux-generic/.gitignore b/test/linux-generic/.gitignore
> index 5dabf91..f65c7c1 100644
> --- a/test/linux-generic/.gitignore
> +++ b/test/linux-generic/.gitignore
> @@ -1,3 +1,4 @@
>  *.log
>  *.trs
>  tests-validation.env
> +test_out.pcap
> diff --git a/test/linux-generic/Makefile.am b/test/linux-generic/Makefile.
> am
> index f5cc52d..9acbab0 100644
> --- a/test/linux-generic/Makefile.am
> +++ b/test/linux-generic/Makefile.am
> @@ -1,5 +1,8 @@
>  include $(top_srcdir)/test/Makefile.inc
>  TESTS_ENVIRONMENT += TEST_DIR=${top_builddir}/test/common_plat/validation
> +TEST_EXTENSIONS = .sh
> +
> +dist_check_SCRIPTS = run-test tests-validation.env $(LOG_COMPILER)
>
>  ALL_API_VALIDATION_DIR = ${top_builddir}/test/common_plat/validation/api
>
> @@ -37,11 +40,14 @@ TESTS = validation/api/pktio/pktio_run.sh \
>
>  SUBDIRS += validation/api/pktio\
>validation/api/shmem\
> +  cls\
>pktio_ipc\
>ring
>
>  if HAVE_PCAP
>  TESTS += validation/api/pktio/pktio_run_pcap.sh
> +TESTS += cls/vlan_run.sh
> +dist_check_SCRIPTS += cls/vlan_run.sh cls/vlan.pcap
>  endif
>  if netmap_support
>  TESTS += validation/api/pktio/pktio_run_netmap.sh
> @@ -61,10 +67,6 @@ SUBDIRS += validation/api/pktio
>  endif
>  endif
>
> -TEST_EXTENSIONS = .sh
> -
> -dist_check_SCRIPTS = run-test tests-validation.env $(LOG_COMPILER)
> -
>  test_SCRIPTS = $(dist_check_SCRIPTS)
>
>  tests-validation.env:
> diff --git a/test/linux-generic/cls/.gitignore b/test/linux-generic/cls/.
> gitignore
> new file mode 100644
> index 000..9447625
> --- /dev/null
> +++ b/test/linux-generic/cls/.gitignore
> @@ -0,0 +1,3 @@
> +cls_main
> +*.log
> +*.trs
> diff --git a/test/linux-generic/cls/Makefile.am b/test/linux-generic/cls/
> Makefile.am
> new file mode 100644
> index 000..43fb0bc
> --- /dev/null
> +++ b/test/linux-generic/cls/Makefile.am
> @@ -0,0 +1,13 @@
> +include ../Makefile.inc
> +
> +noinst_LTLIBRARIES = libtestcls.la
> +libtestcls_la_SOURCES = cls.c
> +libtestcls_la_CFLAGS = $(AM_CFLAGS) $(INCCUNIT_COMMON) $(INCODP)
> +
> +test_PROGRAMS = cls_main$(EXEEXT)
> +dist_cls_main_SOURCES = cls_main.c
> +
> +cls_main_LDFLAGS = $(AM_LDFLAGS)
> +cls_main_LDADD = libtestcls.la $(LIBCUNIT_COMMON) $(LIBODP)
> +
> +noinst_HEADERS = cls_suites.h
> diff --git a/test/linux-generic/cls/cls.c b/test/linux-generic/cls/cls.c
> new file mode 100644
> index 000..d527ec8
> --- /dev/null
> +++ b/test/linux-generic/cls/cls.c
> @@ -0,0 +1,349 @@
> +/* Copyright (c) 2016, Linaro Limited
> + * All rights reserved.
> + *
> + * SPDX-License-Identifier: BSD-3-Clause
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +#include "cls_suites.h"
> +
> +/** Get rid of path in filename - only for unix-type paths using '/' */
> +#define NO_PATH(file_name) (strrchr((file_name), '/') ? \
> +   strrchr((file_name), '/') + 1 : (file_name))
> +
> +/**
> + * Print usage information
> + */
> +static void usage(char *progname)
> +{
> +   printf("\n"
> +  "This is test application to verify that linux-generic
> classifier\n"
> +  "correctly classifies packets on input. Main intend is add
> more code\n"
> +  "coverage for internal functions playing different traffic
> recorded to\n"
> +  "pcap files."
> +  "\n"
> +  "Usage: %s OPTIONS\n"
> +  "  E.g. %s -i pcap_fi

Re: [lng-odp] [PATCH v2 2/6] linux-generic: use source files instead of symbolic links

2016-08-04 Thread Mike Holmes
On 4 August 2016 at 15:30, Brian Brooks  wrote:

> Use source files in arch/default for undetected archs. This
> alleviates the need to use symlinks in the source code
> directory structure.
>

I prefer a behaviour where this fails at config time if a new ARCH appears.
If you dont do this you start running with defaults and get rubbish
performance or even errors and possibly crashes rather than being notified
upfront to pay attention to what you are required to configure.



>
> Signed-off-by: Brian Brooks 
> ---
>  configure.ac   | 13 +-
>  platform/Makefile.inc  |  3 --
>  platform/linux-generic/arch/arm/odp/api/cpu_arch.h |  1 -
>  platform/linux-generic/arch/arm/odp_cpu_arch.c |  1 -
>  .../linux-generic/arch/arm/odp_sysinfo_parse.c |  1 -
>  platform/linux-generic/arch/powerpc/odp_cpu_arch.c | 49
> +-
>  6 files changed, 49 insertions(+), 19 deletions(-)
>  delete mode 12 platform/linux-generic/arch/arm/odp/api/cpu_arch.h
>  delete mode 12 platform/linux-generic/arch/arm/odp_cpu_arch.c
>  delete mode 12 platform/linux-generic/arch/arm/odp_sysinfo_parse.c
>  mode change 12 => 100644 platform/linux-generic/arch/
> powerpc/odp_cpu_arch.c
>
> diff --git a/configure.ac b/configure.ac
> index c0f0f21..a7e058a 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -77,22 +77,11 @@ AS_CASE([$host],
>[i686*], [ARCH_DIR=x86],
>[mips64*], [ARCH_DIR=mips64],
>[powerpc*], [ARCH_DIR=powerpc],
> -  [aarch64*], [ARCH_DIR=arm],
> -  [arm*], [ARCH_DIR=arm],
> -  [ARCH_DIR=undefined]
> +  [ARCH_DIR=default]
>  )
>  AC_SUBST([ARCH_DIR])
>
>  
> ##
> -# Warn on the defaults if arch is undefined
> -###
> ###
> -if test "${ARCH_DIR}" == "undefined";
> -then
> -echo "ARCH_DIR is undefined, please add your ARCH_DIR based on
> host=${host}"
> -exit 1
> -fi
> -
> -###
> ###
>  # Set correct pkgconfig version
>  
> ##
>  PKGCONFIG_VERSION=$(echo $VERSION | awk -F '.git' '{print $1}')
> diff --git a/platform/Makefile.inc b/platform/Makefile.inc
> index a44f88f..2a4255c 100644
> --- a/platform/Makefile.inc
> +++ b/platform/Makefile.inc
> @@ -62,9 +62,6 @@ odpapispecinclude_HEADERS = \
>   $(top_srcdir)/include/odp/api/spec/version.h
>
>  EXTRA_DIST = \
> -arch/arm/odp/api/cpu_arch.h \
> -arch/arm/odp_cpu_arch.c \
> -arch/arm/odp_sysinfo_parse.c \
>  arch/default/odp/api/cpu_arch.h \
>  arch/default/odp_cpu_arch.c \
>  arch/default/odp_sysinfo_parse.c \
> diff --git a/platform/linux-generic/arch/arm/odp/api/cpu_arch.h
> b/platform/linux-generic/arch/arm/odp/api/cpu_arch.h
> deleted file mode 12
> index e86e132..000
> --- a/platform/linux-generic/arch/arm/odp/api/cpu_arch.h
> +++ /dev/null
> @@ -1 +0,0 @@
> -../../../default/odp/api/cpu_arch.h
> \ No newline at end of file
> diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c
> b/platform/linux-generic/arch/arm/odp_cpu_arch.c
> deleted file mode 12
> index deebc47..000
> --- a/platform/linux-generic/arch/arm/odp_cpu_arch.c
> +++ /dev/null
> @@ -1 +0,0 @@
> -../default/odp_cpu_arch.c
> \ No newline at end of file
> diff --git a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c
> b/platform/linux-generic/arch/arm/odp_sysinfo_parse.c
> deleted file mode 12
> index 39962b8..000
> --- a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c
> +++ /dev/null
> @@ -1 +0,0 @@
> -../default/odp_sysinfo_parse.c
> \ No newline at end of file
> diff --git a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
> b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
> deleted file mode 12
> index deebc47..000
> --- a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
> +++ /dev/null
> @@ -1 +0,0 @@
> -../default/odp_cpu_arch.c
> \ No newline at end of file
> diff --git a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
> b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
> new file mode 100644
> index 000..2ac223e
> --- /dev/null
> +++ b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
> @@ -0,0 +1,48 @@
> +/* Copyright (c) 2015, Linaro Limited
> + * All rights reserved.
> + *
> + * SPDX-License-Identifier: BSD-3-Clause
> + */
> +
> +#include 
> +
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define GIGA 10
> +
> +uint64_t odp_cpu_cycles(void)
> +{
> +   struct timespec time;
> +   uint64_t sec, ns, hz, cycles;
> +   int ret;
> +
> +   ret = clock_gettime(CLOCK_MONOTONIC_RAW, &time);
> +
> +   if (ret != 0)
> +   ODP_ABORT("clock_gettime failed\n");
> +
> +   hz  = odp_cpu

[lng-odp] [PATCH v2 6/6] linux-generic: internal odp_cpu_hz_current()

2016-08-04 Thread Brian Brooks
Prefix odp_cpu_hz_current with '_' to be consistent with other
internal cpu definitions in arch directory.

Signed-off-by: Brian Brooks 
---
 platform/linux-generic/arch/default/odp_sysinfo_parse.c | 3 ++-
 platform/linux-generic/arch/mips64/odp_sysinfo_parse.c  | 3 ++-
 platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c | 3 ++-
 platform/linux-generic/arch/x86/odp_sysinfo_parse.c | 3 ++-
 platform/linux-generic/include/odp_cpu_internal.h   | 1 +
 platform/linux-generic/include/odp_internal.h   | 1 -
 platform/linux-generic/odp_system_info.c| 5 +++--
 7 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/platform/linux-generic/arch/default/odp_sysinfo_parse.c 
b/platform/linux-generic/arch/default/odp_sysinfo_parse.c
index 53e2aae..cae6d19 100644
--- a/platform/linux-generic/arch/default/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/default/odp_sysinfo_parse.c
@@ -5,6 +5,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 
@@ -21,7 +22,7 @@ int cpuinfo_parser(FILE *file ODP_UNUSED, system_info_t 
*sysinfo)
return 0;
 }
 
-uint64_t odp_cpu_hz_current(int id ODP_UNUSED)
+uint64_t _odp_cpu_hz_current(int id ODP_UNUSED)
 {
return 0;
 }
diff --git a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c 
b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
index 407264b..d452653 100644
--- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include 
 #include 
 #include 
 
@@ -58,7 +59,7 @@ int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
return 0;
 }
 
-uint64_t odp_cpu_hz_current(int id ODP_UNUSED)
+uint64_t _odp_cpu_hz_current(int id ODP_UNUSED)
 {
return 0;
 }
diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c 
b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
index 3b88d55..b877059 100644
--- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include 
 #include 
 #include 
 
@@ -57,7 +58,7 @@ int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
return 0;
 }
 
-uint64_t odp_cpu_hz_current(int id ODP_UNUSED)
+uint64_t _odp_cpu_hz_current(int id ODP_UNUSED)
 {
return 0;
 }
diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c 
b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
index 96127ec..8e013a9 100644
--- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include 
 #include 
 #include 
 
@@ -38,7 +39,7 @@ int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
return 0;
 }
 
-uint64_t odp_cpu_hz_current(int id)
+uint64_t _odp_cpu_hz_current(int id)
 {
char str[1024];
FILE *file;
diff --git a/platform/linux-generic/include/odp_cpu_internal.h 
b/platform/linux-generic/include/odp_cpu_internal.h
index 351d430..8511f86 100644
--- a/platform/linux-generic/include/odp_cpu_internal.h
+++ b/platform/linux-generic/include/odp_cpu_internal.h
@@ -14,6 +14,7 @@ extern "C" {
 #include 
 
 uint64_t _odp_cpu_cycles(void);
+uint64_t _odp_cpu_hz_current(int id);
 
 #ifdef __cplusplus
 }
diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index 8bad450..646027a 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -120,7 +120,6 @@ int _odp_int_name_tbl_init_global(void);
 int _odp_int_name_tbl_term_global(void);
 
 int cpuinfo_parser(FILE *file, system_info_t *sysinfo);
-uint64_t odp_cpu_hz_current(int id);
 
 #ifdef __cplusplus
 }
diff --git a/platform/linux-generic/odp_system_info.c 
b/platform/linux-generic/odp_system_info.c
index bbe5358..ddf1440 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -7,6 +7,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -177,12 +178,12 @@ uint64_t odp_cpu_hz(void)
 {
int id = sched_getcpu();
 
-   return odp_cpu_hz_current(id);
+   return _odp_cpu_hz_current(id);
 }
 
 uint64_t odp_cpu_hz_id(int id)
 {
-   return odp_cpu_hz_current(id);
+   return _odp_cpu_hz_current(id);
 }
 
 uint64_t odp_cpu_hz_max(void)
-- 
2.9.2



[lng-odp] [PATCH v2 5/6] linux-generic: internal odp_cpu_cycles()

2016-08-04 Thread Brian Brooks
Lift the definition of odp_cpu_cycles() out of the arch
specific directory into the common odp_cpu.c which then
calls the internal arch specific definition.

Signed-off-by: Brian Brooks 
---
 platform/linux-generic/Makefile.am |  1 +
 platform/linux-generic/arch/default/odp_cpu_arch.c |  3 ++-
 platform/linux-generic/arch/mips64/odp_cpu_arch.c  |  3 ++-
 platform/linux-generic/arch/powerpc/odp_cpu_arch.c |  3 ++-
 platform/linux-generic/arch/x86/odp_cpu_arch.c |  3 ++-
 platform/linux-generic/include/odp_cpu_internal.h  | 22 ++
 platform/linux-generic/odp_cpu.c   |  6 ++
 7 files changed, 37 insertions(+), 4 deletions(-)
 create mode 100644 platform/linux-generic/include/odp_cpu_internal.h

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 8dc2764..7c364ec 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -97,6 +97,7 @@ noinst_HEADERS = \
  ${srcdir}/include/odp_classification_inlines.h \
  ${srcdir}/include/odp_classification_internal.h \
  ${srcdir}/include/odp_config_internal.h \
+ ${srcdir}/include/odp_cpu_internal.h \
  ${srcdir}/include/odp_crypto_internal.h \
  ${srcdir}/include/odp_debug_internal.h \
  ${srcdir}/include/odp_forward_typedefs_internal.h \
diff --git a/platform/linux-generic/arch/default/odp_cpu_arch.c 
b/platform/linux-generic/arch/default/odp_cpu_arch.c
index 109dd93..e7899fd 100644
--- a/platform/linux-generic/arch/default/odp_cpu_arch.c
+++ b/platform/linux-generic/arch/default/odp_cpu_arch.c
@@ -12,11 +12,12 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #define GIGA 10
 
-uint64_t odp_cpu_cycles(void)
+uint64_t _odp_cpu_cycles(void)
 {
struct timespec time;
uint64_t sec, ns, hz, cycles;
diff --git a/platform/linux-generic/arch/mips64/odp_cpu_arch.c 
b/platform/linux-generic/arch/mips64/odp_cpu_arch.c
index 6dc8f86..1b282e4 100644
--- a/platform/linux-generic/arch/mips64/odp_cpu_arch.c
+++ b/platform/linux-generic/arch/mips64/odp_cpu_arch.c
@@ -7,8 +7,9 @@
 #include 
 #include 
 #include 
+#include 
 
-uint64_t odp_cpu_cycles(void)
+uint64_t _odp_cpu_cycles(void)
 {
#define CVMX_TMP_STR(x) CVMX_TMP_STR2(x)
#define CVMX_TMP_STR2(x) #x
diff --git a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c 
b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
index 109dd93..e7899fd 100644
--- a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
+++ b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
@@ -12,11 +12,12 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #define GIGA 10
 
-uint64_t odp_cpu_cycles(void)
+uint64_t _odp_cpu_cycles(void)
 {
struct timespec time;
uint64_t sec, ns, hz, cycles;
diff --git a/platform/linux-generic/arch/x86/odp_cpu_arch.c 
b/platform/linux-generic/arch/x86/odp_cpu_arch.c
index c3be356..c596775 100644
--- a/platform/linux-generic/arch/x86/odp_cpu_arch.c
+++ b/platform/linux-generic/arch/x86/odp_cpu_arch.c
@@ -4,8 +4,9 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 #include 
+#include 
 
-uint64_t odp_cpu_cycles(void)
+uint64_t _odp_cpu_cycles(void)
 {
union {
uint64_t tsc_64;
diff --git a/platform/linux-generic/include/odp_cpu_internal.h 
b/platform/linux-generic/include/odp_cpu_internal.h
new file mode 100644
index 000..351d430
--- /dev/null
+++ b/platform/linux-generic/include/odp_cpu_internal.h
@@ -0,0 +1,22 @@
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef ODP_CPU_INTERNAL_H_
+#define ODP_CPU_INTERNAL_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+uint64_t _odp_cpu_cycles(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/odp_cpu.c b/platform/linux-generic/odp_cpu.c
index 282defd..da4f2bc 100644
--- a/platform/linux-generic/odp_cpu.c
+++ b/platform/linux-generic/odp_cpu.c
@@ -6,6 +6,12 @@
 
 #include 
 #include 
+#include 
+
+uint64_t odp_cpu_cycles(void)
+{
+   return _odp_cpu_cycles();
+}
 
 uint64_t odp_cpu_cycles_diff(uint64_t c2, uint64_t c1)
 {
-- 
2.9.2



[lng-odp] [PATCH v2 4/6] linux-generic: lift odp_cpu_cycles_max/resolution()

2016-08-04 Thread Brian Brooks
Define odp_cpu_cycles_max() and odp_cpu_cycles_resolution()
in the include API directory. These do not point to an internal
value in arch because they are common across all archs.

Signed-off-by: Brian Brooks 
---
 platform/linux-generic/arch/default/odp_cpu_arch.c | 10 --
 platform/linux-generic/arch/mips64/odp_cpu_arch.c  | 10 --
 platform/linux-generic/arch/powerpc/odp_cpu_arch.c | 10 --
 platform/linux-generic/arch/x86/odp_cpu_arch.c | 10 --
 platform/linux-generic/include/odp/api/cpu.h   | 11 +++
 5 files changed, 11 insertions(+), 40 deletions(-)

diff --git a/platform/linux-generic/arch/default/odp_cpu_arch.c 
b/platform/linux-generic/arch/default/odp_cpu_arch.c
index 2ac223e..109dd93 100644
--- a/platform/linux-generic/arch/default/odp_cpu_arch.c
+++ b/platform/linux-generic/arch/default/odp_cpu_arch.c
@@ -36,13 +36,3 @@ uint64_t odp_cpu_cycles(void)
 
return cycles;
 }
-
-uint64_t odp_cpu_cycles_max(void)
-{
-   return UINT64_MAX;
-}
-
-uint64_t odp_cpu_cycles_resolution(void)
-{
-   return 1;
-}
diff --git a/platform/linux-generic/arch/mips64/odp_cpu_arch.c 
b/platform/linux-generic/arch/mips64/odp_cpu_arch.c
index 646acf9..6dc8f86 100644
--- a/platform/linux-generic/arch/mips64/odp_cpu_arch.c
+++ b/platform/linux-generic/arch/mips64/odp_cpu_arch.c
@@ -19,13 +19,3 @@ uint64_t odp_cpu_cycles(void)
 
return cycle;
 }
-
-uint64_t odp_cpu_cycles_max(void)
-{
-   return UINT64_MAX;
-}
-
-uint64_t odp_cpu_cycles_resolution(void)
-{
-   return 1;
-}
diff --git a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c 
b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
index 2ac223e..109dd93 100644
--- a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
+++ b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
@@ -36,13 +36,3 @@ uint64_t odp_cpu_cycles(void)
 
return cycles;
 }
-
-uint64_t odp_cpu_cycles_max(void)
-{
-   return UINT64_MAX;
-}
-
-uint64_t odp_cpu_cycles_resolution(void)
-{
-   return 1;
-}
diff --git a/platform/linux-generic/arch/x86/odp_cpu_arch.c 
b/platform/linux-generic/arch/x86/odp_cpu_arch.c
index c8cf27b..c3be356 100644
--- a/platform/linux-generic/arch/x86/odp_cpu_arch.c
+++ b/platform/linux-generic/arch/x86/odp_cpu_arch.c
@@ -21,13 +21,3 @@ uint64_t odp_cpu_cycles(void)
 
return tsc.tsc_64;
 }
-
-uint64_t odp_cpu_cycles_max(void)
-{
-   return UINT64_MAX;
-}
-
-uint64_t odp_cpu_cycles_resolution(void)
-{
-   return 1;
-}
diff --git a/platform/linux-generic/include/odp/api/cpu.h 
b/platform/linux-generic/include/odp/api/cpu.h
index 4585d35..8dd978e 100644
--- a/platform/linux-generic/include/odp/api/cpu.h
+++ b/platform/linux-generic/include/odp/api/cpu.h
@@ -18,6 +18,17 @@ extern "C" {
 #endif
 
 #include "cpu_arch.h"
+#include 
+
+static inline uint64_t odp_cpu_cycles_max(void)
+{
+   return UINT64_MAX;
+}
+
+static inline uint64_t odp_cpu_cycles_resolution(void)
+{
+   return 1;
+}
 
 static inline void odp_cpu_pause(void)
 {
-- 
2.9.2



[lng-odp] [PATCH v2 3/6] linux-generic: move cpu_arch.h up two directories

2016-08-04 Thread Brian Brooks
Signed-off-by: Brian Brooks 
---
 platform/Makefile.inc| 8 
 platform/linux-generic/Makefile.am   | 2 +-
 platform/linux-generic/arch/default/{odp/api => }/cpu_arch.h | 0
 platform/linux-generic/arch/mips64/{odp/api => }/cpu_arch.h  | 0
 platform/linux-generic/arch/powerpc/{odp/api => }/cpu_arch.h | 0
 platform/linux-generic/arch/x86/{odp/api => }/cpu_arch.h | 0
 platform/linux-generic/include/odp/api/align.h   | 2 +-
 platform/linux-generic/include/odp/api/cpu.h | 2 +-
 8 files changed, 7 insertions(+), 7 deletions(-)
 rename platform/linux-generic/arch/default/{odp/api => }/cpu_arch.h (100%)
 rename platform/linux-generic/arch/mips64/{odp/api => }/cpu_arch.h (100%)
 rename platform/linux-generic/arch/powerpc/{odp/api => }/cpu_arch.h (100%)
 rename platform/linux-generic/arch/x86/{odp/api => }/cpu_arch.h (100%)

diff --git a/platform/Makefile.inc b/platform/Makefile.inc
index 2a4255c..e20bd3e 100644
--- a/platform/Makefile.inc
+++ b/platform/Makefile.inc
@@ -62,15 +62,15 @@ odpapispecinclude_HEADERS = \
  $(top_srcdir)/include/odp/api/spec/version.h
 
 EXTRA_DIST = \
-arch/default/odp/api/cpu_arch.h \
+arch/default/cpu_arch.h \
 arch/default/odp_cpu_arch.c \
 arch/default/odp_sysinfo_parse.c \
-arch/mips64/odp/api/cpu_arch.h \
+arch/mips64/cpu_arch.h \
 arch/mips64/odp_cpu_arch.c \
 arch/mips64/odp_sysinfo_parse.c \
-arch/powerpc/odp/api/cpu_arch.h \
+arch/powerpc/cpu_arch.h \
 arch/powerpc/odp_cpu_arch.c \
 arch/powerpc/odp_sysinfo_parse.c \
-arch/x86/odp/api/cpu_arch.h \
+arch/x86/cpu_arch.h \
 arch/x86/odp_cpu_arch.c \
 arch/x86/odp_sysinfo_parse.c
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 0cfd0fe..8dc2764 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -56,7 +56,7 @@ odpapiinclude_HEADERS = \
  $(srcdir)/include/odp/api/version.h \
  $(srcdir)/include/odp/api/visibility_begin.h \
  $(srcdir)/include/odp/api/visibility_end.h \
- $(srcdir)/arch/@ARCH_DIR@/odp/api/cpu_arch.h
+ $(srcdir)/arch/@ARCH_DIR@/cpu_arch.h
 
 odpapiplatincludedir= $(includedir)/odp/api/plat
 odpapiplatinclude_HEADERS = \
diff --git a/platform/linux-generic/arch/default/odp/api/cpu_arch.h 
b/platform/linux-generic/arch/default/cpu_arch.h
similarity index 100%
rename from platform/linux-generic/arch/default/odp/api/cpu_arch.h
rename to platform/linux-generic/arch/default/cpu_arch.h
diff --git a/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h 
b/platform/linux-generic/arch/mips64/cpu_arch.h
similarity index 100%
rename from platform/linux-generic/arch/mips64/odp/api/cpu_arch.h
rename to platform/linux-generic/arch/mips64/cpu_arch.h
diff --git a/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h 
b/platform/linux-generic/arch/powerpc/cpu_arch.h
similarity index 100%
rename from platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h
rename to platform/linux-generic/arch/powerpc/cpu_arch.h
diff --git a/platform/linux-generic/arch/x86/odp/api/cpu_arch.h 
b/platform/linux-generic/arch/x86/cpu_arch.h
similarity index 100%
rename from platform/linux-generic/arch/x86/odp/api/cpu_arch.h
rename to platform/linux-generic/arch/x86/cpu_arch.h
diff --git a/platform/linux-generic/include/odp/api/align.h 
b/platform/linux-generic/include/odp/api/align.h
index c238b80..9aa9f37 100644
--- a/platform/linux-generic/include/odp/api/align.h
+++ b/platform/linux-generic/include/odp/api/align.h
@@ -17,7 +17,7 @@
 extern "C" {
 #endif
 
-#include 
+#include "cpu_arch.h"
 
 /** @ingroup odp_compiler_optim
  *  @{
diff --git a/platform/linux-generic/include/odp/api/cpu.h 
b/platform/linux-generic/include/odp/api/cpu.h
index ae04769..4585d35 100644
--- a/platform/linux-generic/include/odp/api/cpu.h
+++ b/platform/linux-generic/include/odp/api/cpu.h
@@ -17,7 +17,7 @@
 extern "C" {
 #endif
 
-#include 
+#include "cpu_arch.h"
 
 static inline void odp_cpu_pause(void)
 {
-- 
2.9.2



[lng-odp] [PATCH v2 2/6] linux-generic: use source files instead of symbolic links

2016-08-04 Thread Brian Brooks
Use source files in arch/default for undetected archs. This
alleviates the need to use symlinks in the source code
directory structure.

Signed-off-by: Brian Brooks 
---
 configure.ac   | 13 +-
 platform/Makefile.inc  |  3 --
 platform/linux-generic/arch/arm/odp/api/cpu_arch.h |  1 -
 platform/linux-generic/arch/arm/odp_cpu_arch.c |  1 -
 .../linux-generic/arch/arm/odp_sysinfo_parse.c |  1 -
 platform/linux-generic/arch/powerpc/odp_cpu_arch.c | 49 +-
 6 files changed, 49 insertions(+), 19 deletions(-)
 delete mode 12 platform/linux-generic/arch/arm/odp/api/cpu_arch.h
 delete mode 12 platform/linux-generic/arch/arm/odp_cpu_arch.c
 delete mode 12 platform/linux-generic/arch/arm/odp_sysinfo_parse.c
 mode change 12 => 100644 platform/linux-generic/arch/powerpc/odp_cpu_arch.c

diff --git a/configure.ac b/configure.ac
index c0f0f21..a7e058a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,22 +77,11 @@ AS_CASE([$host],
   [i686*], [ARCH_DIR=x86],
   [mips64*], [ARCH_DIR=mips64],
   [powerpc*], [ARCH_DIR=powerpc],
-  [aarch64*], [ARCH_DIR=arm],
-  [arm*], [ARCH_DIR=arm],
-  [ARCH_DIR=undefined]
+  [ARCH_DIR=default]
 )
 AC_SUBST([ARCH_DIR])
 
 ##
-# Warn on the defaults if arch is undefined
-##
-if test "${ARCH_DIR}" == "undefined";
-then
-echo "ARCH_DIR is undefined, please add your ARCH_DIR based on 
host=${host}"
-exit 1
-fi
-
-##
 # Set correct pkgconfig version
 ##
 PKGCONFIG_VERSION=$(echo $VERSION | awk -F '.git' '{print $1}')
diff --git a/platform/Makefile.inc b/platform/Makefile.inc
index a44f88f..2a4255c 100644
--- a/platform/Makefile.inc
+++ b/platform/Makefile.inc
@@ -62,9 +62,6 @@ odpapispecinclude_HEADERS = \
  $(top_srcdir)/include/odp/api/spec/version.h
 
 EXTRA_DIST = \
-arch/arm/odp/api/cpu_arch.h \
-arch/arm/odp_cpu_arch.c \
-arch/arm/odp_sysinfo_parse.c \
 arch/default/odp/api/cpu_arch.h \
 arch/default/odp_cpu_arch.c \
 arch/default/odp_sysinfo_parse.c \
diff --git a/platform/linux-generic/arch/arm/odp/api/cpu_arch.h 
b/platform/linux-generic/arch/arm/odp/api/cpu_arch.h
deleted file mode 12
index e86e132..000
--- a/platform/linux-generic/arch/arm/odp/api/cpu_arch.h
+++ /dev/null
@@ -1 +0,0 @@
-../../../default/odp/api/cpu_arch.h
\ No newline at end of file
diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c 
b/platform/linux-generic/arch/arm/odp_cpu_arch.c
deleted file mode 12
index deebc47..000
--- a/platform/linux-generic/arch/arm/odp_cpu_arch.c
+++ /dev/null
@@ -1 +0,0 @@
-../default/odp_cpu_arch.c
\ No newline at end of file
diff --git a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c 
b/platform/linux-generic/arch/arm/odp_sysinfo_parse.c
deleted file mode 12
index 39962b8..000
--- a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c
+++ /dev/null
@@ -1 +0,0 @@
-../default/odp_sysinfo_parse.c
\ No newline at end of file
diff --git a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c 
b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
deleted file mode 12
index deebc47..000
--- a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
+++ /dev/null
@@ -1 +0,0 @@
-../default/odp_cpu_arch.c
\ No newline at end of file
diff --git a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c 
b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
new file mode 100644
index 000..2ac223e
--- /dev/null
+++ b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
@@ -0,0 +1,48 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#define GIGA 10
+
+uint64_t odp_cpu_cycles(void)
+{
+   struct timespec time;
+   uint64_t sec, ns, hz, cycles;
+   int ret;
+
+   ret = clock_gettime(CLOCK_MONOTONIC_RAW, &time);
+
+   if (ret != 0)
+   ODP_ABORT("clock_gettime failed\n");
+
+   hz  = odp_cpu_hz_max();
+   sec = (uint64_t)time.tv_sec;
+   ns  = (uint64_t)time.tv_nsec;
+
+   cycles  = sec * hz;
+   cycles += (ns * hz) / GIGA;
+
+   return cycles;
+}
+
+uint64_t odp_cpu_cycles_max(void)
+{
+   return UINT64_MAX;
+}
+
+uint64_t odp_cpu_cycles_resolution(void)
+{
+   return 1;
+}
-- 
2.9.2



[lng-odp] [PATCH v2 1/6] linux-generic: internal odp_cpu_pause()

2016-08-04 Thread Brian Brooks
Signed-off-by: Brian Brooks 
---
 platform/linux-generic/arch/default/odp/api/cpu_arch.h | 2 +-
 platform/linux-generic/arch/mips64/odp/api/cpu_arch.h  | 2 +-
 platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h | 2 +-
 platform/linux-generic/arch/x86/odp/api/cpu_arch.h | 2 +-
 platform/linux-generic/include/odp/api/cpu.h   | 5 +
 5 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/platform/linux-generic/arch/default/odp/api/cpu_arch.h 
b/platform/linux-generic/arch/default/odp/api/cpu_arch.h
index 22b1da2..0d52616 100644
--- a/platform/linux-generic/arch/default/odp/api/cpu_arch.h
+++ b/platform/linux-generic/arch/default/odp/api/cpu_arch.h
@@ -13,7 +13,7 @@ extern "C" {
 
 #define _ODP_CACHE_LINE_SIZE 64
 
-static inline void odp_cpu_pause(void)
+static inline void _odp_cpu_pause(void)
 {
 }
 
diff --git a/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h 
b/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h
index 3582b12..8235908 100644
--- a/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h
+++ b/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h
@@ -17,7 +17,7 @@ extern "C" {
 #error Please add support for your arch in cpu_arch.h
 #endif
 
-static inline void odp_cpu_pause(void)
+static inline void _odp_cpu_pause(void)
 {
__asm__ __volatile__ ("nop");
__asm__ __volatile__ ("nop");
diff --git a/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h 
b/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h
index 22b1da2..0d52616 100644
--- a/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h
+++ b/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h
@@ -13,7 +13,7 @@ extern "C" {
 
 #define _ODP_CACHE_LINE_SIZE 64
 
-static inline void odp_cpu_pause(void)
+static inline void _odp_cpu_pause(void)
 {
 }
 
diff --git a/platform/linux-generic/arch/x86/odp/api/cpu_arch.h 
b/platform/linux-generic/arch/x86/odp/api/cpu_arch.h
index 44e6b30..4f4dbff 100644
--- a/platform/linux-generic/arch/x86/odp/api/cpu_arch.h
+++ b/platform/linux-generic/arch/x86/odp/api/cpu_arch.h
@@ -13,7 +13,7 @@ extern "C" {
 
 #define _ODP_CACHE_LINE_SIZE 64
 
-static inline void odp_cpu_pause(void)
+static inline void _odp_cpu_pause(void)
 {
 #ifdef __SSE2__
__asm__ __volatile__ ("pause");
diff --git a/platform/linux-generic/include/odp/api/cpu.h 
b/platform/linux-generic/include/odp/api/cpu.h
index d49c782..ae04769 100644
--- a/platform/linux-generic/include/odp/api/cpu.h
+++ b/platform/linux-generic/include/odp/api/cpu.h
@@ -19,6 +19,11 @@ extern "C" {
 
 #include 
 
+static inline void odp_cpu_pause(void)
+{
+   _odp_cpu_pause();
+}
+
 #include 
 
 #ifdef __cplusplus
-- 
2.9.2



[lng-odp] [Bug 2456] New: ODP name string lengths are multiply defined across the API

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

Bug ID: 2456
   Summary: ODP name string lengths are multiply defined across
the API
   Product: OpenDataPlane - linux- generic reference
   Version: v1.10.1
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: General ODP
  Assignee: lng-odp@lists.linaro.org
  Reporter: mike.hol...@linaro.org
  Target Milestone: ---

Do we really need different length strings when naming ODP elements ?

I would expect one ODP_NAME_LENGTH = 32

test/common_plat/validation/api/traffic_mngr/traffic_mngr.c:#define TM_NAME_LEN
 32
helper/include/odp/helper/table.h:#define ODPH_TABLE_NAME_LEN  32
include/odp/api/spec/pool.h:#define ODP_POOL_NAME_LEN  32
include/odp/api/spec/shared_memory.h:#define ODP_SHM_NAME_LEN 32
include/odp/api/spec/timer.h:#define ODP_TIMER_POOL_NAME_LEN  32
platform/linux-generic/include/odp/api/plat/classification_types.h:#define
ODP_COS_NAME_LEN 32
platform/linux-generic/include/odp/api/plat/queue_types.h:#define
ODP_QUEUE_NAME_LEN 32
platform/linux-generic/include/odp/api/plat/schedule_types.h:#define
ODP_SCHED_GROUP_NAME_LEN 32
platform/linux-generic/include/odp_name_table_internal.h:#define
_ODP_INT_NAME_LEN 32
platform/linux-generic/include/odp_packet_io_internal.h:#define PKTIO_NAME_LEN
256

-- 
You are receiving this mail because:
You are the assignee for the bug.

Re: [lng-odp] [PATCH] validation: tm: use strncmp() to avoid potential string overrun

2016-08-04 Thread Bill Fischofer
On Thu, Aug 4, 2016 at 10:23 AM, Mike Holmes  wrote:

>
>
> On 3 August 2016 at 17:06, Bill Fischofer 
> wrote:
>
>> Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2426 by switching
>> from
>> strcmp() to strncmp()
>>
>> Signed-off-by: Bill Fischofer 
>>
>
> Reviewd-by: Mike Holmes 
>
> This raises a question on how many name lengths we need, maybe all the
> public API ones can be merged  ?
>
> test/common_plat/validation/api/traffic_mngr/traffic_mngr.c:#define
> TM_NAME_LEN  32
> helper/include/odp/helper/table.h:#define ODPH_TABLE_NAME_LEN  32
> include/odp/api/spec/pool.h:#define ODP_POOL_NAME_LEN  32
> include/odp/api/spec/shared_memory.h:#define ODP_SHM_NAME_LEN 32
> include/odp/api/spec/timer.h:#define ODP_TIMER_POOL_NAME_LEN  32
> platform/linux-generic/include/odp/api/plat/classification_types.h:#define
> ODP_COS_NAME_LEN 32
> platform/linux-generic/include/odp/api/plat/queue_types.h:#define
> ODP_QUEUE_NAME_LEN 32
> platform/linux-generic/include/odp/api/plat/schedule_types.h:#define
> ODP_SCHED_GROUP_NAME_LEN 32
> platform/linux-generic/include/odp_name_table_internal.h:#define
> _ODP_INT_NAME_LEN 32
> platform/linux-generic/include/odp_packet_io_internal.h:#define
> PKTIO_NAME_LEN 256
>

These should probably all be made internal and moved to the various
odp_xxx_capability() APIs for consistency. A possible cleanup item for
Tiger Moth? We should get Petri's opinion when he returns.


>
>
>
> ---
>>  test/common_plat/validation/api/traffic_mngr/traffic_mngr.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/test/common_plat/validation/api/traffic_mngr/traffic_mngr.c
>> b/test/common_plat/validation/api/traffic_mngr/traffic_mngr.c
>> index b857800..c7bde40 100644
>> --- a/test/common_plat/validation/api/traffic_mngr/traffic_mngr.c
>> +++ b/test/common_plat/validation/api/traffic_mngr/traffic_mngr.c
>> @@ -1507,7 +1507,7 @@ static tm_node_desc_t *find_node_desc(uint8_t
>>  tm_system_idx,
>> name_ptr++;
>>
>> while (node_desc != NULL) {
>> -   if (strcmp(node_desc->node_name, node_name) == 0)
>> +   if (strncmp(node_desc->node_name, node_name, TM_NAME_LEN)
>> == 0)
>> return node_desc;
>>
>> if (name_ptr == NULL)
>> --
>> 2.7.4
>>
>>
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org  *│ *Open source software for ARM SoCs
> "Work should be fun and collaborative, the rest follows"
>
>
>


Re: [lng-odp] [PATCH] test:linux-generic: run odp_scheduling in process mode

2016-08-04 Thread Bill Fischofer
On Thu, Aug 4, 2016 at 11:17 AM, Brian Brooks 
wrote:

> On 08/04 11:01:09, Bill Fischofer wrote:
> > On Thu, Aug 4, 2016 at 10:59 AM, Mike Holmes 
> wrote:
> >
> > >
> > >
> > > On 4 August 2016 at 11:47, Bill Fischofer 
> > > wrote:
> > >
> > >>
> > >> On Thu, Aug 4, 2016 at 10:36 AM, Mike Holmes 
> > >> wrote:
> > >>
> > >>> On my vanilla x86 I don't get any issues, keen to get this in and
> have
> > >>> CI run it on lots of HW to see what happens, many of the other tests
> > >>> completely fail in process mode so we will expose a lot as we add
> them I
> > >>> think.
> > >>>
> > >>> On 4 August 2016 at 11:33, Bill Fischofer  >
> > >>> wrote:
> > >>>
> > 
> > 
> >  On Thu, Aug 4, 2016 at 10:26 AM, Brian Brooks <
> brian.bro...@linaro.org>
> >  wrote:
> > 
> > > Reviewed-by: Brian Brooks 
> > >
> > > On 08/04 09:18:14, Mike Holmes wrote:
> > > > +ret=0
> > > > +
> > > > +run()
> > > > +{
> > > > + echo odp_scheduling_run_proc starts with $1 worker threads
> > > > + echo =
> > > > +
> > > > + $PERFORMANCE/odp_scheduling${EXEEXT} --odph_proc -c $1 ||
> > > ret=1
> > > > +}
> > > > +
> > > > +run 1
> > > > +run 8
> > > > +
> > > > +exit $ret
> > >
> > > Seeing this randomly in both multithread and multiprocess modes:
> > >
> > 
> >  Before or after you apply this patch? What environment are you
> seeing
> >  these errors in. They should definitely not be happening.
> > 
> > 
> > >
> > > ../../../odp/platform/linux-generic/odp_queue.c:328:odp_
> queue_destroy():queue
> > > "sched_00_07" not empty
> > > ../../../odp/platform/linux-generic/odp_schedule.c:271:
> schedule_term_global():Queue
> > > not empty
> > > ../../../odp/platform/linux-generic/odp_schedule.c:294:
> schedule_term_global():Pool
> > > destroy fail.
> > > ../../../odp/platform/linux-generic/odp_init.c:188:_odp_
> term_global():ODP
> > > schedule term failed.
> > > ../../../odp/platform/linux-generic/odp_queue.c:170:odp_
> queue_term_global():Not
> > > destroyed queue: sched_00_07
> > > ../../../odp/platform/linux-generic/odp_init.c:195:_odp_
> term_global():ODP
> > > queue term failed.
> > > ../../../odp/platform/linux-generic/odp_pool.c:149:odp_
> pool_term_global():Not
> > > destroyed pool: odp_sched_pool
> > > ../../../odp/platform/linux-generic/odp_pool.c:149:odp_
> pool_term_global():Not
> > > destroyed pool: msg_pool
> > > ../../../odp/platform/linux-generic/odp_init.c:202:_odp_
> term_global():ODP
> > > buffer pool term failed.
> > > ~/odp_incoming/odp_build/test/common_plat/performance$ echo $?
> > > 0
> > >
> > >
> > >> Looks like we have a real issue that somehow creeped into master. I
> can
> > >> sporadically reproduce these same errors on my x86 system.  It looks
> like
> > >> this is also present in the monarch_lts branch.
> > >>
> > >
> > >
> > > I think that we agreed that Monarch would not support Process mode
> becasue
> > > we never tested for it, but for TgrM we need to start fixing it.
> > >
> >
> > Unfortunately the issue Brian identified has nothing to do with process
> > mode. This happens in regular pthread mode on all levels past v1.10.0.0
> as
> > far as I can see.
>
> The issue seems to emerge only under high event rates. The application asks
> for more work, but none will be scheduled. However, there actually will be
> work in the queue. So, the teardown will fail because the queue is not
> empty.
> There may be a disconnect between the scheduling and the queueing or some
> other synchronization related bug. I think I've seen something similar on
> an ARM platform, so it may be architecture independent.
>

Well, now that I'm trying to find the root issue, it's proving elusive. I
was able to get this failure in < 10 runs before but now it doesn't want to
show itself.  If you can repro this more readily, can you get a core dump
of the failure?  I've been running with this patch:

---
>From ba1fa0eb943fa7a3a3c9202b9e5bf5fc2ed5d1f4 Mon Sep 17 00:00:00 2001
From: Bill Fischofer 
Date: Thu, 4 Aug 2016 11:38:01 -0500
Subject: [PATCH] debug: abort on cleanup errors

Signed-off-by: Bill Fischofer 
---
 test/performance/odp_scheduling.c | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/test/performance/odp_scheduling.c
b/test/performance/odp_scheduling.c
index c575b70..7505df9 100644
--- a/test/performance/odp_scheduling.c
+++ b/test/performance/odp_scheduling.c
@@ -785,6 +785,7 @@ int main(int argc, char *argv[])
  char cpumaskstr[ODP_CPUMASK_STR_SIZE];
  odp_pool_param_t params;
  int ret = 0;
+ int rc = 0;
  odp_instance_t instance;
  odph_odpthread_params_t thr_params;

@@ -953,15 +954,17 @@ int main(int argc, char *argv[])

  for (j = 0; j < QUEUES_PER_PRIO; j++) {
  queue = globals->queue[i][j];
- odp_queue_dest

Re: [lng-odp] [PATCH 1/6] linux-generic: internal odp_cpu_pause()

2016-08-04 Thread Brian Brooks
On 08/04 13:39:43, Christophe Milard wrote:
> Hi,
> I have problems applying these patches:
> ... anyone has tried?
> Can you grab them from the list and apply them, Brian?

I see the same issue.. Will investigate and respin. Thanks for pointing it out.


Re: [lng-odp] [PATCH] test:linux-generic: run odp_scheduling in process mode

2016-08-04 Thread Brian Brooks
On 08/04 11:01:09, Bill Fischofer wrote:
> On Thu, Aug 4, 2016 at 10:59 AM, Mike Holmes  wrote:
> 
> >
> >
> > On 4 August 2016 at 11:47, Bill Fischofer 
> > wrote:
> >
> >>
> >> On Thu, Aug 4, 2016 at 10:36 AM, Mike Holmes 
> >> wrote:
> >>
> >>> On my vanilla x86 I don't get any issues, keen to get this in and  have
> >>> CI run it on lots of HW to see what happens, many of the other tests
> >>> completely fail in process mode so we will expose a lot as we add them I
> >>> think.
> >>>
> >>> On 4 August 2016 at 11:33, Bill Fischofer 
> >>> wrote:
> >>>
> 
> 
>  On Thu, Aug 4, 2016 at 10:26 AM, Brian Brooks 
>  wrote:
> 
> > Reviewed-by: Brian Brooks 
> >
> > On 08/04 09:18:14, Mike Holmes wrote:
> > > +ret=0
> > > +
> > > +run()
> > > +{
> > > + echo odp_scheduling_run_proc starts with $1 worker threads
> > > + echo =
> > > +
> > > + $PERFORMANCE/odp_scheduling${EXEEXT} --odph_proc -c $1 ||
> > ret=1
> > > +}
> > > +
> > > +run 1
> > > +run 8
> > > +
> > > +exit $ret
> >
> > Seeing this randomly in both multithread and multiprocess modes:
> >
> 
>  Before or after you apply this patch? What environment are you seeing
>  these errors in. They should definitely not be happening.
> 
> 
> >
> > ../../../odp/platform/linux-generic/odp_queue.c:328:odp_queue_destroy():queue
> > "sched_00_07" not empty
> > ../../../odp/platform/linux-generic/odp_schedule.c:271:schedule_term_global():Queue
> > not empty
> > ../../../odp/platform/linux-generic/odp_schedule.c:294:schedule_term_global():Pool
> > destroy fail.
> > ../../../odp/platform/linux-generic/odp_init.c:188:_odp_term_global():ODP
> > schedule term failed.
> > ../../../odp/platform/linux-generic/odp_queue.c:170:odp_queue_term_global():Not
> > destroyed queue: sched_00_07
> > ../../../odp/platform/linux-generic/odp_init.c:195:_odp_term_global():ODP
> > queue term failed.
> > ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
> > destroyed pool: odp_sched_pool
> > ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
> > destroyed pool: msg_pool
> > ../../../odp/platform/linux-generic/odp_init.c:202:_odp_term_global():ODP
> > buffer pool term failed.
> > ~/odp_incoming/odp_build/test/common_plat/performance$ echo $?
> > 0
> >
> >
> >> Looks like we have a real issue that somehow creeped into master. I can
> >> sporadically reproduce these same errors on my x86 system.  It looks like
> >> this is also present in the monarch_lts branch.
> >>
> >
> >
> > I think that we agreed that Monarch would not support Process mode becasue
> > we never tested for it, but for TgrM we need to start fixing it.
> >
> 
> Unfortunately the issue Brian identified has nothing to do with process
> mode. This happens in regular pthread mode on all levels past v1.10.0.0 as
> far as I can see.

The issue seems to emerge only under high event rates. The application asks
for more work, but none will be scheduled. However, there actually will be
work in the queue. So, the teardown will fail because the queue is not empty.
There may be a disconnect between the scheduling and the queueing or some
other synchronization related bug. I think I've seen something similar on
an ARM platform, so it may be architecture independent.


Re: [lng-odp] [PATCH] test:linux-generic: run odp_scheduling in process mode

2016-08-04 Thread Maxim Uvarov

On 08/04/16 18:26, Brian Brooks wrote:

Reviewed-by: Brian Brooks 

On 08/04 09:18:14, Mike Holmes wrote:

+ret=0
+
+run()
+{
+   echo odp_scheduling_run_proc starts with $1 worker threads
+   echo =
+
+   $PERFORMANCE/odp_scheduling${EXEEXT} --odph_proc -c $1 || ret=1
+}
+
+run 1
+run 8
+
+exit $ret

Seeing this randomly in both multithread and multiprocess modes:

../../../odp/platform/linux-generic/odp_queue.c:328:odp_queue_destroy():queue 
"sched_00_07" not empty
../../../odp/platform/linux-generic/odp_schedule.c:271:schedule_term_global():Queue
 not empty
../../../odp/platform/linux-generic/odp_schedule.c:294:schedule_term_global():Pool
 destroy fail.
../../../odp/platform/linux-generic/odp_init.c:188:_odp_term_global():ODP 
schedule term failed.
../../../odp/platform/linux-generic/odp_queue.c:170:odp_queue_term_global():Not 
destroyed queue: sched_00_07
../../../odp/platform/linux-generic/odp_init.c:195:_odp_term_global():ODP queue 
term failed.
../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not 
destroyed pool: odp_sched_pool
../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not 
destroyed pool: msg_pool
../../../odp/platform/linux-generic/odp_init.c:202:_odp_term_global():ODP 
buffer pool term failed.
~/odp_incoming/odp_build/test/common_plat/performance$ echo $?
0


btw, if ipc pktio enable and termination function return error, than 
there will be pool file in /dev/shm/.
In docker shm space limited to 64MB. So other test can began randomly 
fail on pool allocation or pool usage.


Maxim.


Potentially two items: one for correctly returning the failure code, and
another related to teardown. Both beyond the scope of this patch which LGTM.




Re: [lng-odp] [PATCH] test:linux-generic: run odp_scheduling in process mode

2016-08-04 Thread Bill Fischofer
On Thu, Aug 4, 2016 at 10:59 AM, Mike Holmes  wrote:

>
>
> On 4 August 2016 at 11:47, Bill Fischofer 
> wrote:
>
>>
>> On Thu, Aug 4, 2016 at 10:36 AM, Mike Holmes 
>> wrote:
>>
>>> On my vanilla x86 I don't get any issues, keen to get this in and  have
>>> CI run it on lots of HW to see what happens, many of the other tests
>>> completely fail in process mode so we will expose a lot as we add them I
>>> think.
>>>
>>> On 4 August 2016 at 11:33, Bill Fischofer 
>>> wrote:
>>>


 On Thu, Aug 4, 2016 at 10:26 AM, Brian Brooks 
 wrote:

> Reviewed-by: Brian Brooks 
>
> On 08/04 09:18:14, Mike Holmes wrote:
> > +ret=0
> > +
> > +run()
> > +{
> > + echo odp_scheduling_run_proc starts with $1 worker threads
> > + echo =
> > +
> > + $PERFORMANCE/odp_scheduling${EXEEXT} --odph_proc -c $1 ||
> ret=1
> > +}
> > +
> > +run 1
> > +run 8
> > +
> > +exit $ret
>
> Seeing this randomly in both multithread and multiprocess modes:
>

 Before or after you apply this patch? What environment are you seeing
 these errors in. They should definitely not be happening.


>
> ../../../odp/platform/linux-generic/odp_queue.c:328:odp_queue_destroy():queue
> "sched_00_07" not empty
> ../../../odp/platform/linux-generic/odp_schedule.c:271:schedule_term_global():Queue
> not empty
> ../../../odp/platform/linux-generic/odp_schedule.c:294:schedule_term_global():Pool
> destroy fail.
> ../../../odp/platform/linux-generic/odp_init.c:188:_odp_term_global():ODP
> schedule term failed.
> ../../../odp/platform/linux-generic/odp_queue.c:170:odp_queue_term_global():Not
> destroyed queue: sched_00_07
> ../../../odp/platform/linux-generic/odp_init.c:195:_odp_term_global():ODP
> queue term failed.
> ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
> destroyed pool: odp_sched_pool
> ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
> destroyed pool: msg_pool
> ../../../odp/platform/linux-generic/odp_init.c:202:_odp_term_global():ODP
> buffer pool term failed.
> ~/odp_incoming/odp_build/test/common_plat/performance$ echo $?
> 0
>
>
>> Looks like we have a real issue that somehow creeped into master. I can
>> sporadically reproduce these same errors on my x86 system.  It looks like
>> this is also present in the monarch_lts branch.
>>
>
>
> I think that we agreed that Monarch would not support Process mode becasue
> we never tested for it, but for TgrM we need to start fixing it.
>

Unfortunately the issue Brian identified has nothing to do with process
mode. This happens in regular pthread mode on all levels past v1.10.0.0 as
far as I can see.


>
> Mike
>
>
>>
>>
>>> Potentially two items: one for correctly returning the failure code, and
> another related to teardown. Both beyond the scope of this patch which
> LGTM.
>


>>>
>>>
>>> --
>>> Mike Holmes
>>> Technical Manager - Linaro Networking Group
>>> Linaro.org  *│ *Open source software for ARM
>>> SoCs
>>> "Work should be fun and collaborative, the rest follows"
>>>
>>>
>>>
>>
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org  *│ *Open source software for ARM SoCs
> "Work should be fun and collaborative, the rest follows"
>
>
>


Re: [lng-odp] [PATCH] test:linux-generic: run odp_scheduling in process mode

2016-08-04 Thread Bill Fischofer
On Thu, Aug 4, 2016 at 11:03 AM, Maxim Uvarov 
wrote:

> On 08/04/16 18:26, Brian Brooks wrote:
>
>> Reviewed-by: Brian Brooks 
>>
>> On 08/04 09:18:14, Mike Holmes wrote:
>>
>>> +ret=0
>>> +
>>> +run()
>>> +{
>>> +   echo odp_scheduling_run_proc starts with $1 worker threads
>>> +   echo =
>>> +
>>> +   $PERFORMANCE/odp_scheduling${EXEEXT} --odph_proc -c $1 || ret=1
>>> +}
>>> +
>>> +run 1
>>> +run 8
>>> +
>>> +exit $ret
>>>
>> Seeing this randomly in both multithread and multiprocess modes:
>>
>> ../../../odp/platform/linux-generic/odp_queue.c:328:odp_queue_destroy():queue
>> "sched_00_07" not empty
>> ../../../odp/platform/linux-generic/odp_schedule.c:271:schedule_term_global():Queue
>> not empty
>> ../../../odp/platform/linux-generic/odp_schedule.c:294:schedule_term_global():Pool
>> destroy fail.
>> ../../../odp/platform/linux-generic/odp_init.c:188:_odp_term_global():ODP
>> schedule term failed.
>> ../../../odp/platform/linux-generic/odp_queue.c:170:odp_queue_term_global():Not
>> destroyed queue: sched_00_07
>> ../../../odp/platform/linux-generic/odp_init.c:195:_odp_term_global():ODP
>> queue term failed.
>> ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
>> destroyed pool: odp_sched_pool
>> ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
>> destroyed pool: msg_pool
>> ../../../odp/platform/linux-generic/odp_init.c:202:_odp_term_global():ODP
>> buffer pool term failed.
>> ~/odp_incoming/odp_build/test/common_plat/performance$ echo $?
>> 0
>>
>
> btw, if ipc pktio enable and termination function return error, than there
> will be pool file in /dev/shm/.
> In docker shm space limited to 64MB. So other test can began randomly fail
> on pool allocation or pool usage.


I've not enabled ipc pktio and this test doesn't do any pktio operations so
I don't think that's the issue here.


>
>
> Maxim.
>
>
>> Potentially two items: one for correctly returning the failure code, and
>> another related to teardown. Both beyond the scope of this patch which
>> LGTM.
>>
>
>


Re: [lng-odp] [PATCH] test:linux-generic: run odp_scheduling in process mode

2016-08-04 Thread Mike Holmes
On 4 August 2016 at 11:47, Bill Fischofer  wrote:

>
> On Thu, Aug 4, 2016 at 10:36 AM, Mike Holmes 
> wrote:
>
>> On my vanilla x86 I don't get any issues, keen to get this in and  have
>> CI run it on lots of HW to see what happens, many of the other tests
>> completely fail in process mode so we will expose a lot as we add them I
>> think.
>>
>> On 4 August 2016 at 11:33, Bill Fischofer 
>> wrote:
>>
>>>
>>>
>>> On Thu, Aug 4, 2016 at 10:26 AM, Brian Brooks 
>>> wrote:
>>>
 Reviewed-by: Brian Brooks 

 On 08/04 09:18:14, Mike Holmes wrote:
 > +ret=0
 > +
 > +run()
 > +{
 > + echo odp_scheduling_run_proc starts with $1 worker threads
 > + echo =
 > +
 > + $PERFORMANCE/odp_scheduling${EXEEXT} --odph_proc -c $1 || ret=1
 > +}
 > +
 > +run 1
 > +run 8
 > +
 > +exit $ret

 Seeing this randomly in both multithread and multiprocess modes:

>>>
>>> Before or after you apply this patch? What environment are you seeing
>>> these errors in. They should definitely not be happening.
>>>
>>>

 ../../../odp/platform/linux-generic/odp_queue.c:328:odp_queue_destroy():queue
 "sched_00_07" not empty
 ../../../odp/platform/linux-generic/odp_schedule.c:271:schedule_term_global():Queue
 not empty
 ../../../odp/platform/linux-generic/odp_schedule.c:294:schedule_term_global():Pool
 destroy fail.
 ../../../odp/platform/linux-generic/odp_init.c:188:_odp_term_global():ODP
 schedule term failed.
 ../../../odp/platform/linux-generic/odp_queue.c:170:odp_queue_term_global():Not
 destroyed queue: sched_00_07
 ../../../odp/platform/linux-generic/odp_init.c:195:_odp_term_global():ODP
 queue term failed.
 ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
 destroyed pool: odp_sched_pool
 ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
 destroyed pool: msg_pool
 ../../../odp/platform/linux-generic/odp_init.c:202:_odp_term_global():ODP
 buffer pool term failed.
 ~/odp_incoming/odp_build/test/common_plat/performance$ echo $?
 0


> Looks like we have a real issue that somehow creeped into master. I can
> sporadically reproduce these same errors on my x86 system.  It looks like
> this is also present in the monarch_lts branch.
>


I think that we agreed that Monarch would not support Process mode becasue
we never tested for it, but for TgrM we need to start fixing it.

Mike


>
>
>> Potentially two items: one for correctly returning the failure code, and
 another related to teardown. Both beyond the scope of this patch which
 LGTM.

>>>
>>>
>>
>>
>> --
>> Mike Holmes
>> Technical Manager - Linaro Networking Group
>> Linaro.org  *│ *Open source software for ARM SoCs
>> "Work should be fun and collaborative, the rest follows"
>>
>>
>>
>


-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org  *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"


Re: [lng-odp] [PATCH] test:linux-generic: run odp_scheduling in process mode

2016-08-04 Thread Bill Fischofer
Quick update. I can repro this in v1.10.0.1 as well, however v1.10.0.0
seems good.

On Thu, Aug 4, 2016 at 10:47 AM, Bill Fischofer 
wrote:

>
> On Thu, Aug 4, 2016 at 10:36 AM, Mike Holmes 
> wrote:
>
>> On my vanilla x86 I don't get any issues, keen to get this in and  have
>> CI run it on lots of HW to see what happens, many of the other tests
>> completely fail in process mode so we will expose a lot as we add them I
>> think.
>>
>> On 4 August 2016 at 11:33, Bill Fischofer 
>> wrote:
>>
>>>
>>>
>>> On Thu, Aug 4, 2016 at 10:26 AM, Brian Brooks 
>>> wrote:
>>>
 Reviewed-by: Brian Brooks 

 On 08/04 09:18:14, Mike Holmes wrote:
 > +ret=0
 > +
 > +run()
 > +{
 > + echo odp_scheduling_run_proc starts with $1 worker threads
 > + echo =
 > +
 > + $PERFORMANCE/odp_scheduling${EXEEXT} --odph_proc -c $1 || ret=1
 > +}
 > +
 > +run 1
 > +run 8
 > +
 > +exit $ret

 Seeing this randomly in both multithread and multiprocess modes:

>>>
>>> Before or after you apply this patch? What environment are you seeing
>>> these errors in. They should definitely not be happening.
>>>
>>>

 ../../../odp/platform/linux-generic/odp_queue.c:328:odp_queue_destroy():queue
 "sched_00_07" not empty
 ../../../odp/platform/linux-generic/odp_schedule.c:271:schedule_term_global():Queue
 not empty
 ../../../odp/platform/linux-generic/odp_schedule.c:294:schedule_term_global():Pool
 destroy fail.
 ../../../odp/platform/linux-generic/odp_init.c:188:_odp_term_global():ODP
 schedule term failed.
 ../../../odp/platform/linux-generic/odp_queue.c:170:odp_queue_term_global():Not
 destroyed queue: sched_00_07
 ../../../odp/platform/linux-generic/odp_init.c:195:_odp_term_global():ODP
 queue term failed.
 ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
 destroyed pool: odp_sched_pool
 ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
 destroyed pool: msg_pool
 ../../../odp/platform/linux-generic/odp_init.c:202:_odp_term_global():ODP
 buffer pool term failed.
 ~/odp_incoming/odp_build/test/common_plat/performance$ echo $?
 0


> Looks like we have a real issue that somehow creeped into master. I can
> sporadically reproduce these same errors on my x86 system.  It looks like
> this is also present in the monarch_lts branch.
>
>
>> Potentially two items: one for correctly returning the failure code, and
 another related to teardown. Both beyond the scope of this patch which
 LGTM.

>>>
>>>
>>
>>
>> --
>> Mike Holmes
>> Technical Manager - Linaro Networking Group
>> Linaro.org  *│ *Open source software for ARM SoCs
>> "Work should be fun and collaborative, the rest follows"
>>
>>
>>
>


Re: [lng-odp] [PATCH] test:linux-generic: run odp_scheduling in process mode

2016-08-04 Thread Bill Fischofer
On Thu, Aug 4, 2016 at 10:36 AM, Mike Holmes  wrote:

> On my vanilla x86 I don't get any issues, keen to get this in and  have CI
> run it on lots of HW to see what happens, many of the other tests
> completely fail in process mode so we will expose a lot as we add them I
> think.
>
> On 4 August 2016 at 11:33, Bill Fischofer 
> wrote:
>
>>
>>
>> On Thu, Aug 4, 2016 at 10:26 AM, Brian Brooks 
>> wrote:
>>
>>> Reviewed-by: Brian Brooks 
>>>
>>> On 08/04 09:18:14, Mike Holmes wrote:
>>> > +ret=0
>>> > +
>>> > +run()
>>> > +{
>>> > + echo odp_scheduling_run_proc starts with $1 worker threads
>>> > + echo =
>>> > +
>>> > + $PERFORMANCE/odp_scheduling${EXEEXT} --odph_proc -c $1 || ret=1
>>> > +}
>>> > +
>>> > +run 1
>>> > +run 8
>>> > +
>>> > +exit $ret
>>>
>>> Seeing this randomly in both multithread and multiprocess modes:
>>>
>>
>> Before or after you apply this patch? What environment are you seeing
>> these errors in. They should definitely not be happening.
>>
>>
>>>
>>> ../../../odp/platform/linux-generic/odp_queue.c:328:odp_queue_destroy():queue
>>> "sched_00_07" not empty
>>> ../../../odp/platform/linux-generic/odp_schedule.c:271:schedule_term_global():Queue
>>> not empty
>>> ../../../odp/platform/linux-generic/odp_schedule.c:294:schedule_term_global():Pool
>>> destroy fail.
>>> ../../../odp/platform/linux-generic/odp_init.c:188:_odp_term_global():ODP
>>> schedule term failed.
>>> ../../../odp/platform/linux-generic/odp_queue.c:170:odp_queue_term_global():Not
>>> destroyed queue: sched_00_07
>>> ../../../odp/platform/linux-generic/odp_init.c:195:_odp_term_global():ODP
>>> queue term failed.
>>> ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
>>> destroyed pool: odp_sched_pool
>>> ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
>>> destroyed pool: msg_pool
>>> ../../../odp/platform/linux-generic/odp_init.c:202:_odp_term_global():ODP
>>> buffer pool term failed.
>>> ~/odp_incoming/odp_build/test/common_plat/performance$ echo $?
>>> 0
>>>
>>>
Looks like we have a real issue that somehow creeped into master. I can
sporadically reproduce these same errors on my x86 system.  It looks like
this is also present in the monarch_lts branch.


> Potentially two items: one for correctly returning the failure code, and
>>> another related to teardown. Both beyond the scope of this patch which
>>> LGTM.
>>>
>>
>>
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org  *│ *Open source software for ARM SoCs
> "Work should be fun and collaborative, the rest follows"
>
>
>


Re: [lng-odp] [PATCH] test:linux-generic: run odp_scheduling in process mode

2016-08-04 Thread Mike Holmes
On my vanilla x86 I don't get any issues, keen to get this in and  have CI
run it on lots of HW to see what happens, many of the other tests
completely fail in process mode so we will expose a lot as we add them I
think.

On 4 August 2016 at 11:33, Bill Fischofer  wrote:

>
>
> On Thu, Aug 4, 2016 at 10:26 AM, Brian Brooks 
> wrote:
>
>> Reviewed-by: Brian Brooks 
>>
>> On 08/04 09:18:14, Mike Holmes wrote:
>> > +ret=0
>> > +
>> > +run()
>> > +{
>> > + echo odp_scheduling_run_proc starts with $1 worker threads
>> > + echo =
>> > +
>> > + $PERFORMANCE/odp_scheduling${EXEEXT} --odph_proc -c $1 || ret=1
>> > +}
>> > +
>> > +run 1
>> > +run 8
>> > +
>> > +exit $ret
>>
>> Seeing this randomly in both multithread and multiprocess modes:
>>
>
> Before or after you apply this patch? What environment are you seeing
> these errors in. They should definitely not be happening.
>
>
>>
>> ../../../odp/platform/linux-generic/odp_queue.c:328:odp_queue_destroy():queue
>> "sched_00_07" not empty
>> ../../../odp/platform/linux-generic/odp_schedule.c:271:schedule_term_global():Queue
>> not empty
>> ../../../odp/platform/linux-generic/odp_schedule.c:294:schedule_term_global():Pool
>> destroy fail.
>> ../../../odp/platform/linux-generic/odp_init.c:188:_odp_term_global():ODP
>> schedule term failed.
>> ../../../odp/platform/linux-generic/odp_queue.c:170:odp_queue_term_global():Not
>> destroyed queue: sched_00_07
>> ../../../odp/platform/linux-generic/odp_init.c:195:_odp_term_global():ODP
>> queue term failed.
>> ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
>> destroyed pool: odp_sched_pool
>> ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
>> destroyed pool: msg_pool
>> ../../../odp/platform/linux-generic/odp_init.c:202:_odp_term_global():ODP
>> buffer pool term failed.
>> ~/odp_incoming/odp_build/test/common_plat/performance$ echo $?
>> 0
>>
>> Potentially two items: one for correctly returning the failure code, and
>> another related to teardown. Both beyond the scope of this patch which
>> LGTM.
>>
>
>


-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org  *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"


Re: [lng-odp] [PATCH] test:linux-generic: run odp_scheduling in process mode

2016-08-04 Thread Bill Fischofer
On Thu, Aug 4, 2016 at 10:26 AM, Brian Brooks 
wrote:

> Reviewed-by: Brian Brooks 
>
> On 08/04 09:18:14, Mike Holmes wrote:
> > +ret=0
> > +
> > +run()
> > +{
> > + echo odp_scheduling_run_proc starts with $1 worker threads
> > + echo =
> > +
> > + $PERFORMANCE/odp_scheduling${EXEEXT} --odph_proc -c $1 || ret=1
> > +}
> > +
> > +run 1
> > +run 8
> > +
> > +exit $ret
>
> Seeing this randomly in both multithread and multiprocess modes:
>

Before or after you apply this patch? What environment are you seeing these
errors in. They should definitely not be happening.


>
> ../../../odp/platform/linux-generic/odp_queue.c:328:odp_queue_destroy():queue
> "sched_00_07" not empty
> ../../../odp/platform/linux-generic/odp_schedule.c:271:schedule_term_global():Queue
> not empty
> ../../../odp/platform/linux-generic/odp_schedule.c:294:schedule_term_global():Pool
> destroy fail.
> ../../../odp/platform/linux-generic/odp_init.c:188:_odp_term_global():ODP
> schedule term failed.
> ../../../odp/platform/linux-generic/odp_queue.c:170:odp_queue_term_global():Not
> destroyed queue: sched_00_07
> ../../../odp/platform/linux-generic/odp_init.c:195:_odp_term_global():ODP
> queue term failed.
> ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
> destroyed pool: odp_sched_pool
> ../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not
> destroyed pool: msg_pool
> ../../../odp/platform/linux-generic/odp_init.c:202:_odp_term_global():ODP
> buffer pool term failed.
> ~/odp_incoming/odp_build/test/common_plat/performance$ echo $?
> 0
>
> Potentially two items: one for correctly returning the failure code, and
> another related to teardown. Both beyond the scope of this patch which
> LGTM.
>


Re: [lng-odp] [PATCH] validation: tm: use strncmp() to avoid potential string overrun

2016-08-04 Thread Mike Holmes
On 3 August 2016 at 17:06, Bill Fischofer  wrote:

> Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2426 by switching from
> strcmp() to strncmp()
>
> Signed-off-by: Bill Fischofer 
>

Reviewd-by: Mike Holmes 

This raises a question on how many name lengths we need, maybe all the
public API ones can be merged  ?

test/common_plat/validation/api/traffic_mngr/traffic_mngr.c:#define
TM_NAME_LEN  32
helper/include/odp/helper/table.h:#define ODPH_TABLE_NAME_LEN  32
include/odp/api/spec/pool.h:#define ODP_POOL_NAME_LEN  32
include/odp/api/spec/shared_memory.h:#define ODP_SHM_NAME_LEN 32
include/odp/api/spec/timer.h:#define ODP_TIMER_POOL_NAME_LEN  32
platform/linux-generic/include/odp/api/plat/classification_types.h:#define
ODP_COS_NAME_LEN 32
platform/linux-generic/include/odp/api/plat/queue_types.h:#define
ODP_QUEUE_NAME_LEN 32
platform/linux-generic/include/odp/api/plat/schedule_types.h:#define
ODP_SCHED_GROUP_NAME_LEN 32
platform/linux-generic/include/odp_name_table_internal.h:#define
_ODP_INT_NAME_LEN 32
platform/linux-generic/include/odp_packet_io_internal.h:#define
PKTIO_NAME_LEN 256



---
>  test/common_plat/validation/api/traffic_mngr/traffic_mngr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/common_plat/validation/api/traffic_mngr/traffic_mngr.c
> b/test/common_plat/validation/api/traffic_mngr/traffic_mngr.c
> index b857800..c7bde40 100644
> --- a/test/common_plat/validation/api/traffic_mngr/traffic_mngr.c
> +++ b/test/common_plat/validation/api/traffic_mngr/traffic_mngr.c
> @@ -1507,7 +1507,7 @@ static tm_node_desc_t *find_node_desc(uint8_t
>  tm_system_idx,
> name_ptr++;
>
> while (node_desc != NULL) {
> -   if (strcmp(node_desc->node_name, node_name) == 0)
> +   if (strncmp(node_desc->node_name, node_name, TM_NAME_LEN)
> == 0)
> return node_desc;
>
> if (name_ptr == NULL)
> --
> 2.7.4
>
>


-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org  *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"


Re: [lng-odp] [PATCH] test:linux-generic: run odp_scheduling in process mode

2016-08-04 Thread Brian Brooks
Reviewed-by: Brian Brooks 

On 08/04 09:18:14, Mike Holmes wrote:
> +ret=0
> +
> +run()
> +{
> + echo odp_scheduling_run_proc starts with $1 worker threads
> + echo =
> +
> + $PERFORMANCE/odp_scheduling${EXEEXT} --odph_proc -c $1 || ret=1
> +}
> +
> +run 1
> +run 8
> +
> +exit $ret

Seeing this randomly in both multithread and multiprocess modes:

../../../odp/platform/linux-generic/odp_queue.c:328:odp_queue_destroy():queue 
"sched_00_07" not empty
../../../odp/platform/linux-generic/odp_schedule.c:271:schedule_term_global():Queue
 not empty
../../../odp/platform/linux-generic/odp_schedule.c:294:schedule_term_global():Pool
 destroy fail.
../../../odp/platform/linux-generic/odp_init.c:188:_odp_term_global():ODP 
schedule term failed.
../../../odp/platform/linux-generic/odp_queue.c:170:odp_queue_term_global():Not 
destroyed queue: sched_00_07
../../../odp/platform/linux-generic/odp_init.c:195:_odp_term_global():ODP queue 
term failed.
../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not 
destroyed pool: odp_sched_pool
../../../odp/platform/linux-generic/odp_pool.c:149:odp_pool_term_global():Not 
destroyed pool: msg_pool
../../../odp/platform/linux-generic/odp_init.c:202:_odp_term_global():ODP 
buffer pool term failed.
~/odp_incoming/odp_build/test/common_plat/performance$ echo $?
0

Potentially two items: one for correctly returning the failure code, and
another related to teardown. Both beyond the scope of this patch which LGTM.


Re: [lng-odp] [API-NEXT PATCHv2] api: byteorder: avoid bitfield order doxygen omissions

2016-08-04 Thread Bill Fischofer
ping - needs review. thx.

On Tue, Jul 12, 2016 at 9:27 PM, Bill Fischofer 
wrote:

> Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2402 by assigning
> explicit values to ODP_LITTLE_ENDIAN_BITFIELD and ODP_BIT_ENDIAN_BITFIELD
> to avoid Doxygen warnings. This makes these consistent with the usage for
> ODP_BIG_ENDIAN and ODP_LITTLE_ENDIAN. Also define the summary variable
> ODP_BITFIELD_ORDER which can be used similar to ODP_BYTE_ORDER for an
> explicit test of bitfield endianness.
>
> Note that this requires tests of these fields to change from #ifdef to #if.
>
> Signed-off-by: Bill Fischofer 
> ---
>  helper/include/odp/helper/tcp.h   | 4 ++--
>  include/odp/api/spec/byteorder.h  | 3 +++
>  platform/linux-generic/include/odp/api/plat/byteorder_types.h | 8
> ++--
>  platform/linux-generic/include/protocols/tcp.h| 4 ++--
>  4 files changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/helper/include/odp/helper/tcp.h b/helper/include/odp/helper/
> tcp.h
> index cabef90..fd234e5 100644
> --- a/helper/include/odp/helper/tcp.h
> +++ b/helper/include/odp/helper/tcp.h
> @@ -34,7 +34,7 @@ typedef struct ODP_PACKED {
> odp_u32be_t ack_no;   /**< Acknowledgment number */
> union {
> odp_u16be_t doffset_flags;
> -#if defined(ODP_BIG_ENDIAN_BITFIELD)
> +#if ODP_BIG_ENDIAN_BITFIELD
> struct {
> odp_u16be_t rsvd1:8;
> odp_u16be_t flags:8; /**< TCP flags as a byte */
> @@ -51,7 +51,7 @@ typedef struct ODP_PACKED {
> odp_u16be_t syn:1;
> odp_u16be_t fin:1;
> };
> -#elif defined(ODP_LITTLE_ENDIAN_BITFIELD)
> +#elif ODP_LITTLE_ENDIAN_BITFIELD
> struct {
> odp_u16be_t flags:8;
> odp_u16be_t rsvd1:8; /**< TCP flags as a byte */
> diff --git a/include/odp/api/spec/byteorder.h b/include/odp/api/spec/
> byteorder.h
> index 1018997..e16a0d5 100644
> --- a/include/odp/api/spec/byteorder.h
> +++ b/include/odp/api/spec/byteorder.h
> @@ -39,6 +39,9 @@ extern "C" {
>   *
>   * @def ODP_BYTE_ORDER
>   * Selected byte order
> + *
> + * @def ODP_BITFIELD_ORDER
> + * Selected bitfield order
>   */
>
>  /**
> diff --git a/platform/linux-generic/include/odp/api/plat/byteorder_types.h
> b/platform/linux-generic/include/odp/api/plat/byteorder_types.h
> index 679d4cf..09235b5 100644
> --- a/platform/linux-generic/include/odp/api/plat/byteorder_types.h
> +++ b/platform/linux-generic/include/odp/api/plat/byteorder_types.h
> @@ -52,12 +52,16 @@ extern "C" {
> #define ODP_LITTLE_ENDIAN   1
> #define ODP_BIG_ENDIAN  0
> #define ODP_BYTE_ORDER  ODP_LITTLE_ENDIAN
> -   #define ODP_LITTLE_ENDIAN_BITFIELD
> +   #define ODP_LITTLE_ENDIAN_BITFIELD  1
> +   #define ODP_BIG_ENDIAN_BITFIELD 0
> +   #define ODP_BITFIELD_ORDER  ODP_LITTLE_ENDIAN_BITFIELD
>  #else
> #define ODP_LITTLE_ENDIAN   0
> #define ODP_BIG_ENDIAN  1
> #define ODP_BYTE_ORDER  ODP_BIG_ENDIAN
> -   #define ODP_BIG_ENDIAN_BITFIELD
> +   #define ODP_LITTLE_ENDIAN_BITFIELD  0
> +   #define ODP_BIG_ENDIAN_BITFIELD 1
> +   #define ODP_BITFIELD_ORDER  ODP_BIG_ENDIAN_BITFIELD
>  #endif
>
>  typedef uint16_t __odp_bitwise odp_u16le_t;
> diff --git a/platform/linux-generic/include/protocols/tcp.h
> b/platform/linux-generic/include/protocols/tcp.h
> index 4e92e4b..114262e 100644
> --- a/platform/linux-generic/include/protocols/tcp.h
> +++ b/platform/linux-generic/include/protocols/tcp.h
> @@ -34,7 +34,7 @@ typedef struct ODP_PACKED {
> odp_u32be_t ack_no;   /**< Acknowledgment number */
> union {
> odp_u16be_t doffset_flags;
> -#if defined(ODP_BIG_ENDIAN_BITFIELD)
> +#if ODP_BIG_ENDIAN_BITFIELD
> struct {
> odp_u16be_t rsvd1:8;
> odp_u16be_t flags:8; /**< TCP flags as a byte */
> @@ -51,7 +51,7 @@ typedef struct ODP_PACKED {
> odp_u16be_t syn:1;
> odp_u16be_t fin:1;
> };
> -#elif defined(ODP_LITTLE_ENDIAN_BITFIELD)
> +#elif ODP_LITTLE_ENDIAN_BITFIELD
> struct {
> odp_u16be_t flags:8;
> odp_u16be_t rsvd1:8; /**< TCP flags as a byte */
> --
> 2.7.4
>
>


Re: [lng-odp] [PATCH] doc/implementers add internal prefix recommendation

2016-08-04 Thread Mike Holmes
On 4 August 2016 at 10:11, Christophe Milard 
wrote:

> On 4 August 2016 at 16:08, Mike Holmes  wrote:
> > Promote coding style that reduces the chance of collisions with
> > applications.
> >
> > Signed-off-by: Mike Holmes 
> > ---
> >  doc/implementers-guide/implementers-guide.adoc | 7 +++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/doc/implementers-guide/implementers-guide.adoc
> b/doc/implementers-guide/implementers-guide.adoc
> > index 5c0e864..829f316 100644
> > --- a/doc/implementers-guide/implementers-guide.adoc
> > +++ b/doc/implementers-guide/implementers-guide.adoc
> > @@ -182,6 +182,13 @@ recommended that other implementations follow the
> same schema
> >  (*odp-*) to make the representation of the ODP
> >  implementations uniform in a distribution.
> >
> > +== ODP internal function naming recommendations
> > +When symbols are required that may leak into the external API
> definition they
> > +should be prefixed _odp to reduce the chance of a name collision.
> > +
> > +Whenever possible internal functions should be static to reduce link
> time issues
>
> Should it be this line break between the last word ("issues") and the
> dot (".") ?
>

yes or it is > 80 chars :)

>
> Christophe.
> > +.
> > +
> >  [[validation]]
> >  == The Validation Suite
> >  ODP provides a comprehensive set of API validation tests that are
> intended to be
> > --
> > 2.7.4
> >
>



-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org  *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"


Re: [lng-odp] [PATCH] doc/implementers add internal prefix recommendation

2016-08-04 Thread Christophe Milard
On 4 August 2016 at 16:08, Mike Holmes  wrote:
> Promote coding style that reduces the chance of collisions with
> applications.
>
> Signed-off-by: Mike Holmes 
> ---
>  doc/implementers-guide/implementers-guide.adoc | 7 +++
>  1 file changed, 7 insertions(+)
>
> diff --git a/doc/implementers-guide/implementers-guide.adoc 
> b/doc/implementers-guide/implementers-guide.adoc
> index 5c0e864..829f316 100644
> --- a/doc/implementers-guide/implementers-guide.adoc
> +++ b/doc/implementers-guide/implementers-guide.adoc
> @@ -182,6 +182,13 @@ recommended that other implementations follow the same 
> schema
>  (*odp-*) to make the representation of the ODP
>  implementations uniform in a distribution.
>
> +== ODP internal function naming recommendations
> +When symbols are required that may leak into the external API definition they
> +should be prefixed _odp to reduce the chance of a name collision.
> +
> +Whenever possible internal functions should be static to reduce link time 
> issues

Should it be this line break between the last word ("issues") and the
dot (".") ?

Christophe.
> +.
> +
>  [[validation]]
>  == The Validation Suite
>  ODP provides a comprehensive set of API validation tests that are intended 
> to be
> --
> 2.7.4
>


[lng-odp] [PATCH] doc/implementers add internal prefix recommendation

2016-08-04 Thread Mike Holmes
Promote coding style that reduces the chance of collisions with
applications.

Signed-off-by: Mike Holmes 
---
 doc/implementers-guide/implementers-guide.adoc | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/doc/implementers-guide/implementers-guide.adoc 
b/doc/implementers-guide/implementers-guide.adoc
index 5c0e864..829f316 100644
--- a/doc/implementers-guide/implementers-guide.adoc
+++ b/doc/implementers-guide/implementers-guide.adoc
@@ -182,6 +182,13 @@ recommended that other implementations follow the same 
schema
 (*odp-*) to make the representation of the ODP
 implementations uniform in a distribution.
 
+== ODP internal function naming recommendations
+When symbols are required that may leak into the external API definition they
+should be prefixed _odp to reduce the chance of a name collision.
+
+Whenever possible internal functions should be static to reduce link time 
issues
+.
+
 [[validation]]
 == The Validation Suite
 ODP provides a comprehensive set of API validation tests that are intended to 
be
-- 
2.7.4



Re: [lng-odp] [API-NEXT PATCH] linux-gen: drv: byteorder: fixed macro typo

2016-08-04 Thread Mike Holmes
On 4 August 2016 at 04:51, Christophe Milard 
wrote:

> Signed-off-by: Christophe Milard 
>

Reviewed-by: Mike Holmes 


> ---
>  platform/linux-generic/include/odp/drv/plat/byteorder_types.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/platform/linux-generic/include/odp/drv/plat/byteorder_types.h
> b/platform/linux-generic/include/odp/drv/plat/byteorder_types.h
> index bf461e5..cb7aec2 100644
> --- a/platform/linux-generic/include/odp/drv/plat/byteorder_types.h
> +++ b/platform/linux-generic/include/odp/drv/plat/byteorder_types.h
> @@ -48,7 +48,7 @@ extern "C" {
>  #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
> #define ODPDRV_LITTLE_ENDIAN   1
> #define ODPDRV_BIG_ENDIAN  0
> -   #define ODPDRV_BYTE_ORDER  ODP_LITTLE_ENDIAN
> +   #define ODPDRV_BYTE_ORDER  ODPDRV_LITTLE_ENDIAN
> #define ODPDRV_LITTLE_ENDIAN_BITFIELD
>  #else
> #define ODPDRV_LITTLE_ENDIAN   0
> --
> 2.7.4
>
>


-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org  *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"


Re: [lng-odp] [API-NEXT PATCH] test: drv: atomic renamed to drvatomic

2016-08-04 Thread Mike Holmes
On 4 August 2016 at 04:58, Christophe Milard 
wrote:

> At installation time (make install) all tests executables are copied
> into a single directory (lib/odp/tests).
> Having two modules with identical names on the two interfaces (api and drv)
> leads to the same test executable name ('atomic_main' in this case).
> As a consequence one of the test overwrites the other at copy time,
> and is run twice at make check install (successfully, so no error is
> shown).
> We therefore have to guarantee module name unicity over ODP: we
> cannot have an atomic module on the drv interface if such a module
> name already exists on the api interface.
> The atomic module from the drv interface is hence renamed drvatomic.
>

Rather than add this scoping to each test by hand, can drv tests be
in lib/odp/drv/tests so that they all get scoped automatically ? I know
this means altering the path that the executables are found on which may
not be that easy so this is just a thought.


>
> Signed-off-by: Christophe Milard 
> ---
>  test/common_plat/m4/configure.m4   |  2 +-
>  test/common_plat/validation/drv/Makefile.am|  2 +-
>  test/common_plat/validation/drv/atomic/.gitignore  |  1 -
>  test/common_plat/validation/drv/atomic/Makefile.am | 10 
>  test/common_plat/validation/drv/atomic/atomic.h| 38 ---
>  .../validation/drv/drvatomic/.gitignore|  1 +
>  .../validation/drv/drvatomic/Makefile.am   | 10 
>  .../drv/{atomic/atomic.c => drvatomic/drvatomic.c} | 54
> +++---
>  .../validation/drv/drvatomic/drvatomic.h   | 35 ++
>  .../atomic_main.c => drvatomic/drvatomic_main.c}   |  4 +-
>  test/linux-generic/Makefile.am |  2 +-
>  11 files changed, 78 insertions(+), 81 deletions(-)
>  delete mode 100644 test/common_plat/validation/drv/atomic/.gitignore
>  delete mode 100644 test/common_plat/validation/drv/atomic/Makefile.am
>  delete mode 100644 test/common_plat/validation/drv/atomic/atomic.h
>  create mode 100644 test/common_plat/validation/drv/drvatomic/.gitignore
>  create mode 100644 test/common_plat/validation/drv/drvatomic/Makefile.am
>  rename test/common_plat/validation/drv/{atomic/atomic.c =>
> drvatomic/drvatomic.c} (94%)
>  create mode 100644 test/common_plat/validation/drv/drvatomic/drvatomic.h
>  rename test/common_plat/validation/drv/{atomic/atomic_main.c =>
> drvatomic/drvatomic_main.c} (72%)
>
> diff --git a/test/common_plat/m4/configure.m4
> b/test/common_plat/m4/configure.m4
> index bfde6cb..20c3a3b 100644
> --- a/test/common_plat/m4/configure.m4
> +++ b/test/common_plat/m4/configure.m4
> @@ -32,4 +32,4 @@ AC_CONFIG_FILES([test/common_plat/Makefile
>  test/common_plat/validation/api/timer/Makefile
>  test/common_plat/validation/api/traffic_mngr/Makefile
>  test/common_plat/validation/drv/Makefile
> -test/common_plat/validation/drv/atomic/Makefile])
> +test/common_plat/validation/drv/drvatomic/Makefile])
> diff --git a/test/common_plat/validation/drv/Makefile.am
> b/test/common_plat/validation/drv/Makefile.am
> index 0dae3c3..eedbad5 100644
> --- a/test/common_plat/validation/drv/Makefile.am
> +++ b/test/common_plat/validation/drv/Makefile.am
> @@ -1,4 +1,4 @@
> -ODPDRV_MODULES = atomic
> +ODPDRV_MODULES = drvatomic
>
>  SUBDIRS = $(ODPDRV_MODULES)
>
> diff --git a/test/common_plat/validation/drv/atomic/.gitignore
> b/test/common_plat/validation/drv/atomic/.gitignore
> deleted file mode 100644
> index 610ffea..000
> --- a/test/common_plat/validation/drv/atomic/.gitignore
> +++ /dev/null
> @@ -1 +0,0 @@
> -atomic_main
> diff --git a/test/common_plat/validation/drv/atomic/Makefile.am
> b/test/common_plat/validation/drv/atomic/Makefile.am
> deleted file mode 100644
> index 9b6bd63..000
> --- a/test/common_plat/validation/drv/atomic/Makefile.am
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -include ../Makefile.inc
> -
> -noinst_LTLIBRARIES = libtestatomic.la
> -libtestatomic_la_SOURCES = atomic.c
> -
> -test_PROGRAMS = atomic_main$(EXEEXT)
> -dist_atomic_main_SOURCES = atomic_main.c
> -atomic_main_LDADD = libtestatomic.la $(LIBCUNIT_COMMON) $(LIBODP)
> -
> -EXTRA_DIST = atomic.h
> diff --git a/test/common_plat/validation/drv/atomic/atomic.h
> b/test/common_plat/validation/drv/atomic/atomic.h
> deleted file mode 100644
> index 438c0a3..000
> --- a/test/common_plat/validation/drv/atomic/atomic.h
> +++ /dev/null
> @@ -1,38 +0,0 @@
> -/* Copyright (c) 2016, Linaro Limited
> - * All rights reserved.
> - *
> - * SPDX-License-Identifier: BSD-3-Clause
> - */
> -
> -#ifndef _ODP_TEST_ATOMIC_H_
> -#define _ODP_TEST_ATOMIC_H_
> -
> -#include 
> -
> -/* test functions: */
> -void atomic_test_atomic_inc_dec(void);
> -void atomic_test_atomic_add_sub(void);
> -void atomic_test_atomic_fetch_inc_dec(void);
> -void atomic_test_atomic_fetch_add_sub(void);
> -void atomic_test_atomic_max_min(void);
> -void atomic_test_atomic_cas_in

[lng-odp] [PATCH] test:linux-generic: run odp_scheduling in process mode

2016-08-04 Thread Mike Holmes
Set up the environment to allow calling the performance tests in process
mode as part of make check when enabled.

To run the tests use --enable-test-perf-proc

Initial patch using odp_scheduling as a proof

Signed-off-by: Mike Holmes 
---
 configure.ac   |  2 ++
 test/linux-generic/Makefile.am |  2 +-
 test/linux-generic/m4/configure.m4 |  5 -
 test/linux-generic/m4/performance.m4   |  9 
 test/linux-generic/performance/.gitignore  |  2 ++
 test/linux-generic/performance/Makefile.am | 13 +++
 .../performance/odp_scheduling_run_proc.sh | 26 ++
 7 files changed, 57 insertions(+), 2 deletions(-)
 create mode 100644 test/linux-generic/m4/performance.m4
 create mode 100644 test/linux-generic/performance/.gitignore
 create mode 100644 test/linux-generic/performance/Makefile.am
 create mode 100755 test/linux-generic/performance/odp_scheduling_run_proc.sh

diff --git a/configure.ac b/configure.ac
index c0f0f21..6551287 100644
--- a/configure.ac
+++ b/configure.ac
@@ -169,6 +169,7 @@ AM_CONDITIONAL([test_installdir], [test "$testdir" != ""])
 AM_CONDITIONAL([cunit_support], [test x$cunit_support = xyes ])
 AM_CONDITIONAL([test_vald], [test x$test_vald = xyes ])
 AM_CONDITIONAL([test_perf], [test x$test_perf = xyes ])
+AM_CONDITIONAL([test_perf_proc], [test x$test_perf_proc = xyes ])
 AM_CONDITIONAL([test_cpp], [test x$test_cpp = xyes ])
 AM_CONDITIONAL([test_helper], [test x$test_helper = xyes ])
 AM_CONDITIONAL([test_example], [test x$test_example = xyes ])
@@ -302,6 +303,7 @@ AC_MSG_RESULT([
cunit:  ${cunit_support}
test_vald:  ${test_vald}
test_perf:  ${test_perf}
+   test_perf_proc: ${test_perf_proc}
test_cpp:   ${test_cpp}
test_helper:${test_helper}
test_example:   ${test_example}
diff --git a/test/linux-generic/Makefile.am b/test/linux-generic/Makefile.am
index f5cc52d..4660cf0 100644
--- a/test/linux-generic/Makefile.am
+++ b/test/linux-generic/Makefile.am
@@ -3,7 +3,7 @@ TESTS_ENVIRONMENT += 
TEST_DIR=${top_builddir}/test/common_plat/validation
 
 ALL_API_VALIDATION_DIR = ${top_builddir}/test/common_plat/validation/api
 
-SUBDIRS =
+SUBDIRS = performance
 
 if test_vald
 TESTS = validation/api/pktio/pktio_run.sh \
diff --git a/test/linux-generic/m4/configure.m4 
b/test/linux-generic/m4/configure.m4
index 9eec545..6b92201 100644
--- a/test/linux-generic/m4/configure.m4
+++ b/test/linux-generic/m4/configure.m4
@@ -1,5 +1,8 @@
+m4_include([test/linux-generic/m4/performance.m4])
+
 AC_CONFIG_FILES([test/linux-generic/Makefile
 test/linux-generic/validation/api/shmem/Makefile
 test/linux-generic/validation/api/pktio/Makefile
 test/linux-generic/pktio_ipc/Makefile
-test/linux-generic/ring/Makefile])
+test/linux-generic/ring/Makefile
+test/linux-generic/performance/Makefile])
diff --git a/test/linux-generic/m4/performance.m4 
b/test/linux-generic/m4/performance.m4
new file mode 100644
index 000..7f54b96
--- /dev/null
+++ b/test/linux-generic/m4/performance.m4
@@ -0,0 +1,9 @@
+##
+# Enable/disable test-perf-proc
+##
+test_perf_proc=no
+AC_ARG_ENABLE([test-perf-proc],
+[  --enable-test-perf-proc  run test in test/performance in process 
mode],
+[if test "x$enableval" = "xyes"; then
+test_perf_proc=yes
+fi])
diff --git a/test/linux-generic/performance/.gitignore 
b/test/linux-generic/performance/.gitignore
new file mode 100644
index 000..7e563b8
--- /dev/null
+++ b/test/linux-generic/performance/.gitignore
@@ -0,0 +1,2 @@
+*.log
+*.trs
diff --git a/test/linux-generic/performance/Makefile.am 
b/test/linux-generic/performance/Makefile.am
new file mode 100644
index 000..cb72fce
--- /dev/null
+++ b/test/linux-generic/performance/Makefile.am
@@ -0,0 +1,13 @@
+include $(top_srcdir)/test/Makefile.inc
+
+TESTS_ENVIRONMENT += TEST_DIR=${builddir}
+
+TESTSCRIPTS = odp_scheduling_run_proc.sh
+
+TEST_EXTENSIONS = .sh
+
+if test_perf_proc
+TESTS = $(TESTSCRIPTS)
+endif
+
+EXTRA_DIST = $(TESTSCRIPTS)
diff --git a/test/linux-generic/performance/odp_scheduling_run_proc.sh 
b/test/linux-generic/performance/odp_scheduling_run_proc.sh
new file mode 100755
index 000..b3ef26f
--- /dev/null
+++ b/test/linux-generic/performance/odp_scheduling_run_proc.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Copyright (c) 2016, Linaro Limited
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Script that passes command line arguments to odp_scheduling test when
+# launched by 'make check'
+
+TEST_DIR="${TEST_DIR:-$(dirname $0)}"
+PERFORMANCE="$TEST_DIR/../../common_plat/performance"

[lng-odp] [Bug 2414] api/spec/crypto.h contains todo items

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

Mike Holmes  changed:

   What|Removed |Added

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

--- Comment #2 from Mike Holmes  ---
b6a5e70

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[lng-odp] [Bug 2424] CID 164655: Security best practices violations pktio/ipc.c:

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

Mike Holmes  changed:

   What|Removed |Added

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

--- Comment #2 from Mike Holmes  ---
No longer seen in coverity

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[lng-odp] [Bug 2435] Traffic manager example includes internal files

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

Mike Holmes  changed:

   What|Removed |Added

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

--- Comment #1 from Mike Holmes  ---
ca927a7

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.

[lng-odp] [Bug 2453] PRIu64 is causing problems for odp-dpdk

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

Mike Holmes  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Assignee|lng-odp@lists.linaro.org|balakrishna.garapati@linaro
   ||.org
 Status|UNCONFIRMED |CONFIRMED

--- Comment #2 from Mike Holmes  ---
Probably should use odp_pool_to_u64 in the odp-dpdk code if we need 32bit
support

-- 
You are receiving this mail because:
You are the assignee for the bug.

Re: [lng-odp] [PATCH 1/6] linux-generic: internal odp_cpu_pause()

2016-08-04 Thread Christophe Milard
Hi,
I have problems applying these patches:
... anyone has tried?
Can you grab them from the list and apply them, Brian?

Christophe.

git am ~/incoming/PATCH_1-6_linux-generic_internal_odp_cpu_pause_.mbox
Applying: linux-generic: internal odp_cpu_pause()
fatal: corrupt patch at line 33
Patch failed at 0001 linux-generic: internal odp_cpu_pause()
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

On 2 August 2016 at 23:29, Brian Brooks  wrote:
> Signed-off-by: Brian Brooks 
> ---
>  platform/linux-generic/arch/default/odp/api/cpu_arch.h | 2 +-
>  platform/linux-generic/arch/mips64/odp/api/cpu_arch.h  | 2 +-
>  platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h | 2 +-
>  platform/linux-generic/arch/x86/odp/api/cpu_arch.h | 2 +-
>  platform/linux-generic/include/odp/api/cpu.h   | 5 +
>  5 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/platform/linux-generic/arch/default/odp/api/cpu_arch.h 
> b/platform/linux-generic/arch/default/odp/api/cpu_arch.h
> index 22b1da2..0d52616 100644
> --- a/platform/linux-generic/arch/default/odp/api/cpu_arch.h
> +++ b/platform/linux-generic/arch/default/odp/api/cpu_arch.h
> @@ -13,7 +13,7 @@ extern "C" {
>
>  #define _ODP_CACHE_LINE_SIZE 64
>
> -static inline void odp_cpu_pause(void)
> +static inline void _odp_cpu_pause(void)
>  {
>  }
>
> diff --git a/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h 
> b/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h
> index 3582b12..8235908 100644
> --- a/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h
> +++ b/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h
> @@ -17,7 +17,7 @@ extern "C" {
>  #error Please add support for your arch in cpu_arch.h
>  #endif
>
> -static inline void odp_cpu_pause(void)
> +static inline void _odp_cpu_pause(void)
>  {
> __asm__ __volatile__ ("nop");
> __asm__ __volatile__ ("nop");
> diff --git a/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h 
> b/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h
> index 22b1da2..0d52616 100644
> --- a/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h
> +++ b/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h
> @@ -13,7 +13,7 @@ extern "C" {
>
>  #define _ODP_CACHE_LINE_SIZE 64
>
> -static inline void odp_cpu_pause(void)
> +static inline void _odp_cpu_pause(void)
>  {
>  }
>
> diff --git a/platform/linux-generic/arch/x86/odp/api/cpu_arch.h 
> b/platform/linux-generic/arch/x86/odp/api/cpu_arch.h
> index 44e6b30..4f4dbff 100644
> --- a/platform/linux-generic/arch/x86/odp/api/cpu_arch.h
> +++ b/platform/linux-generic/arch/x86/odp/api/cpu_arch.h
> @@ -13,7 +13,7 @@ extern "C" {
>
>  #define _ODP_CACHE_LINE_SIZE 64
>
> -static inline void odp_cpu_pause(void)
> +static inline void _odp_cpu_pause(void)
>  {
>  #ifdef __SSE2__
> __asm__ __volatile__ ("pause");
> diff --git a/platform/linux-generic/include/odp/api/cpu.h 
> b/platform/linux-generic/include/odp/api/cpu.h
> index d49c782..ae04769 100644
> --- a/platform/linux-generic/include/odp/api/cpu.h
> +++ b/platform/linux-generic/include/odp/api/cpu.h
> @@ -19,6 +19,11 @@ extern "C" {
>
>  #include 
>
> +static inline void odp_cpu_pause(void)
> +{
> +   _odp_cpu_pause();
> +}
> +
>  #include 
>
>  #ifdef __cplusplus
> --
> 2.9.2


Re: [lng-odp] [PATCH] linux-gen: doc: defining the ODP thread

2016-08-04 Thread Maxim Uvarov

On 08/04/16 12:02, Christophe Milard wrote:

On 4 August 2016 at 08:40, Maxim Uvarov  wrote:

I'm not sure that:

platform/linux-generic/include/odp/api/platform_specific.dox
directory is good for documentation files.




Do we want to create a directory for a single file when the need for
other files is not clear?




I guess it has to be in the same directory where other .dox exist.

Maxim.


I do not see also corresponding changes in Makefile like EXTRA_DIST

I guess you are right here: I probably missed something...
Hope Mike comes with good hints as I am not sure where this is handled...

Christophe


Mike, can you please also review. Doxygen looks like your field :)

Thank you,
Maxim.



On 08/03/16 22:17, Christophe Milard wrote:

ping


On 29 July 2016 at 19:33, Bill Fischofer 
wrote:


On Thu, Jul 28, 2016 at 6:59 AM, Christophe Milard
 wrote:

Defining an odp thread for the linux generic implementation of ODP.

Signed-off-by: Christophe Milard 


Reviewed-and-tested-by: Bill Fischofer 


---
   .../include/odp/api/platform_specific.dox  | 46
++
   1 file changed, 46 insertions(+)
   create mode 100644
platform/linux-generic/include/odp/api/platform_specific.dox

diff --git
a/platform/linux-generic/include/odp/api/platform_specific.dox
b/platform/linux-generic/include/odp/api/platform_specific.dox
new file mode 100644
index 000..e116ec6
--- /dev/null
+++ b/platform/linux-generic/include/odp/api/platform_specific.dox
@@ -0,0 +1,46 @@
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+* @file platform_specific.dox
+* extra linux-generic documentation
+*/
+
+/** @addtogroup odp_thread
+ *  @par ODP thread
+ *  In this ODP implementation an odp thread is either:
+ *  - a linux process descendant (or same as) the odp instantiation
process.
+ *  - a pthread 'member' of a linux process descendant (or same as) the
odp
+ *  instantiation process.
+ */
+
+/**
+ *  @fn odp_init_local(odp_instance_t instance, odp_thread_type_t
thr_type)
+ *  @note  In this ODP implementation odpthreads have to be
+ * processes descendant of (or same as) the ODP
+ * instantiation process, or pthreads 'member' of
such
+ * processes.
+ *  @note  As ODP instantiation processes cannot be
descendants
+ * of each others, the instance parameter provided
+ * to odp_init_local() is actually fully defined by
these
+ * requirements: It has to be the value returned by
the
+ * unique call to odp_init_global() made by one
single
+ * acsendant of the current process.
+ */
+
+/**
+ *  @fn odp_init_global(odp_instance_t *instance,
+ *  const odp_init_t *params,
+ *  const odp_platform_init_t *platform_params)
+ *  @note  This ODP implementation supports mupliple instances of
ODP
+ * (i.e. multiple call to odp_init_global()) with the
following
+ * restrictions:
+ *  @note   -Different ODP instances cannot share the same
instantiation
+ * process. In other words, a single process may
+ * only call odp_init_global() once.
+ *  @note  -Different ODP instantiation processes cannot be
descendant of
+ * each other.
+ */
--
2.7.4





Re: [lng-odp] [PATCH] linux-gen: doc: defining the ODP thread

2016-08-04 Thread Christophe Milard
On 4 August 2016 at 08:40, Maxim Uvarov  wrote:
> I'm not sure that:
>
> platform/linux-generic/include/odp/api/platform_specific.dox
> directory is good for documentation files.

Do we want to create a directory for a single file when the need for
other files is not clear?

>
> I do not see also corresponding changes in Makefile like EXTRA_DIST

I guess you are right here: I probably missed something...
Hope Mike comes with good hints as I am not sure where this is handled...

Christophe

>
> Mike, can you please also review. Doxygen looks like your field :)
>
> Thank you,
> Maxim.
>
>
>
> On 08/03/16 22:17, Christophe Milard wrote:
>>
>> ping
>>
>>
>> On 29 July 2016 at 19:33, Bill Fischofer 
>> wrote:
>>>
>>>
>>> On Thu, Jul 28, 2016 at 6:59 AM, Christophe Milard
>>>  wrote:

 Defining an odp thread for the linux generic implementation of ODP.

 Signed-off-by: Christophe Milard 
>>>
>>>
>>> Reviewed-and-tested-by: Bill Fischofer 
>>>
 ---
   .../include/odp/api/platform_specific.dox  | 46
 ++
   1 file changed, 46 insertions(+)
   create mode 100644
 platform/linux-generic/include/odp/api/platform_specific.dox

 diff --git
 a/platform/linux-generic/include/odp/api/platform_specific.dox
 b/platform/linux-generic/include/odp/api/platform_specific.dox
 new file mode 100644
 index 000..e116ec6
 --- /dev/null
 +++ b/platform/linux-generic/include/odp/api/platform_specific.dox
 @@ -0,0 +1,46 @@
 +/* Copyright (c) 2016, Linaro Limited
 + * All rights reserved
 + *
 + * SPDX-License-Identifier: BSD-3-Clause
 + */
 +
 +/**
 +* @file platform_specific.dox
 +* extra linux-generic documentation
 +*/
 +
 +/** @addtogroup odp_thread
 + *  @par ODP thread
 + *  In this ODP implementation an odp thread is either:
 + *  - a linux process descendant (or same as) the odp instantiation
 process.
 + *  - a pthread 'member' of a linux process descendant (or same as) the
 odp
 + *  instantiation process.
 + */
 +
 +/**
 + *  @fn odp_init_local(odp_instance_t instance, odp_thread_type_t
 thr_type)
 + *  @note  In this ODP implementation odpthreads have to be
 + * processes descendant of (or same as) the ODP
 + * instantiation process, or pthreads 'member' of
 such
 + * processes.
 + *  @note  As ODP instantiation processes cannot be
 descendants
 + * of each others, the instance parameter provided
 + * to odp_init_local() is actually fully defined by
 these
 + * requirements: It has to be the value returned by
 the
 + * unique call to odp_init_global() made by one
 single
 + * acsendant of the current process.
 + */
 +
 +/**
 + *  @fn odp_init_global(odp_instance_t *instance,
 + *  const odp_init_t *params,
 + *  const odp_platform_init_t *platform_params)
 + *  @note  This ODP implementation supports mupliple instances of
 ODP
 + * (i.e. multiple call to odp_init_global()) with the
 following
 + * restrictions:
 + *  @note   -Different ODP instances cannot share the same
 instantiation
 + * process. In other words, a single process may
 + * only call odp_init_global() once.
 + *  @note  -Different ODP instantiation processes cannot be
 descendant of
 + * each other.
 + */
 --
 2.7.4

>


[lng-odp] [API-NEXT PATCH] test: drv: atomic renamed to drvatomic

2016-08-04 Thread Christophe Milard
At installation time (make install) all tests executables are copied
into a single directory (lib/odp/tests).
Having two modules with identical names on the two interfaces (api and drv)
leads to the same test executable name ('atomic_main' in this case).
As a consequence one of the test overwrites the other at copy time,
and is run twice at make check install (successfully, so no error is
shown).
We therefore have to guarantee module name unicity over ODP: we
cannot have an atomic module on the drv interface if such a module
name already exists on the api interface.
The atomic module from the drv interface is hence renamed drvatomic.

Signed-off-by: Christophe Milard 
---
 test/common_plat/m4/configure.m4   |  2 +-
 test/common_plat/validation/drv/Makefile.am|  2 +-
 test/common_plat/validation/drv/atomic/.gitignore  |  1 -
 test/common_plat/validation/drv/atomic/Makefile.am | 10 
 test/common_plat/validation/drv/atomic/atomic.h| 38 ---
 .../validation/drv/drvatomic/.gitignore|  1 +
 .../validation/drv/drvatomic/Makefile.am   | 10 
 .../drv/{atomic/atomic.c => drvatomic/drvatomic.c} | 54 +++---
 .../validation/drv/drvatomic/drvatomic.h   | 35 ++
 .../atomic_main.c => drvatomic/drvatomic_main.c}   |  4 +-
 test/linux-generic/Makefile.am |  2 +-
 11 files changed, 78 insertions(+), 81 deletions(-)
 delete mode 100644 test/common_plat/validation/drv/atomic/.gitignore
 delete mode 100644 test/common_plat/validation/drv/atomic/Makefile.am
 delete mode 100644 test/common_plat/validation/drv/atomic/atomic.h
 create mode 100644 test/common_plat/validation/drv/drvatomic/.gitignore
 create mode 100644 test/common_plat/validation/drv/drvatomic/Makefile.am
 rename test/common_plat/validation/drv/{atomic/atomic.c => 
drvatomic/drvatomic.c} (94%)
 create mode 100644 test/common_plat/validation/drv/drvatomic/drvatomic.h
 rename test/common_plat/validation/drv/{atomic/atomic_main.c => 
drvatomic/drvatomic_main.c} (72%)

diff --git a/test/common_plat/m4/configure.m4 b/test/common_plat/m4/configure.m4
index bfde6cb..20c3a3b 100644
--- a/test/common_plat/m4/configure.m4
+++ b/test/common_plat/m4/configure.m4
@@ -32,4 +32,4 @@ AC_CONFIG_FILES([test/common_plat/Makefile
 test/common_plat/validation/api/timer/Makefile
 test/common_plat/validation/api/traffic_mngr/Makefile
 test/common_plat/validation/drv/Makefile
-test/common_plat/validation/drv/atomic/Makefile])
+test/common_plat/validation/drv/drvatomic/Makefile])
diff --git a/test/common_plat/validation/drv/Makefile.am 
b/test/common_plat/validation/drv/Makefile.am
index 0dae3c3..eedbad5 100644
--- a/test/common_plat/validation/drv/Makefile.am
+++ b/test/common_plat/validation/drv/Makefile.am
@@ -1,4 +1,4 @@
-ODPDRV_MODULES = atomic
+ODPDRV_MODULES = drvatomic
 
 SUBDIRS = $(ODPDRV_MODULES)
 
diff --git a/test/common_plat/validation/drv/atomic/.gitignore 
b/test/common_plat/validation/drv/atomic/.gitignore
deleted file mode 100644
index 610ffea..000
--- a/test/common_plat/validation/drv/atomic/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-atomic_main
diff --git a/test/common_plat/validation/drv/atomic/Makefile.am 
b/test/common_plat/validation/drv/atomic/Makefile.am
deleted file mode 100644
index 9b6bd63..000
--- a/test/common_plat/validation/drv/atomic/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-include ../Makefile.inc
-
-noinst_LTLIBRARIES = libtestatomic.la
-libtestatomic_la_SOURCES = atomic.c
-
-test_PROGRAMS = atomic_main$(EXEEXT)
-dist_atomic_main_SOURCES = atomic_main.c
-atomic_main_LDADD = libtestatomic.la $(LIBCUNIT_COMMON) $(LIBODP)
-
-EXTRA_DIST = atomic.h
diff --git a/test/common_plat/validation/drv/atomic/atomic.h 
b/test/common_plat/validation/drv/atomic/atomic.h
deleted file mode 100644
index 438c0a3..000
--- a/test/common_plat/validation/drv/atomic/atomic.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef _ODP_TEST_ATOMIC_H_
-#define _ODP_TEST_ATOMIC_H_
-
-#include 
-
-/* test functions: */
-void atomic_test_atomic_inc_dec(void);
-void atomic_test_atomic_add_sub(void);
-void atomic_test_atomic_fetch_inc_dec(void);
-void atomic_test_atomic_fetch_add_sub(void);
-void atomic_test_atomic_max_min(void);
-void atomic_test_atomic_cas_inc_dec(void);
-void atomic_test_atomic_xchg(void);
-void atomic_test_atomic_non_relaxed(void);
-void atomic_test_atomic_op_lock_free(void);
-
-/* test arrays: */
-extern odp_testinfo_t atomic_suite_atomic[];
-
-/* test array init/term functions: */
-int atomic_suite_init(void);
-
-/* test registry: */
-extern odp_suiteinfo_t atomic_suites[];
-
-/* executable init/term functions: */
-int atomic_init(odp_instance_t *inst);
-
-/* main test program: */
-int atomic_main(int argc, char *argv[]);
-
-#endif
diff --git a/test/co

[lng-odp] [API-NEXT PATCH] linux-gen: drv: byteorder: fixed macro typo

2016-08-04 Thread Christophe Milard
Signed-off-by: Christophe Milard 
---
 platform/linux-generic/include/odp/drv/plat/byteorder_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/platform/linux-generic/include/odp/drv/plat/byteorder_types.h 
b/platform/linux-generic/include/odp/drv/plat/byteorder_types.h
index bf461e5..cb7aec2 100644
--- a/platform/linux-generic/include/odp/drv/plat/byteorder_types.h
+++ b/platform/linux-generic/include/odp/drv/plat/byteorder_types.h
@@ -48,7 +48,7 @@ extern "C" {
 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define ODPDRV_LITTLE_ENDIAN   1
#define ODPDRV_BIG_ENDIAN  0
-   #define ODPDRV_BYTE_ORDER  ODP_LITTLE_ENDIAN
+   #define ODPDRV_BYTE_ORDER  ODPDRV_LITTLE_ENDIAN
#define ODPDRV_LITTLE_ENDIAN_BITFIELD
 #else
#define ODPDRV_LITTLE_ENDIAN   0
-- 
2.7.4