diff mbox

api_test: remove odp_shm_test

Message ID 1429041581-2284-1-git-send-email-mike.holmes@linaro.org
State Accepted
Commit b1e20c71bb50a1b8806d4d2c5da95f4bdb397d7e
Headers show

Commit Message

Mike Holmes April 14, 2015, 7:59 p.m. UTC
The shm test is obsolte, remove it

Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 test/api_test/Makefile.am    |  6 +---
 test/api_test/odp_common.c   |  2 --
 test/api_test/odp_shm_test.c | 67 --------------------------------------------
 test/api_test/odp_shm_test.h | 24 ----------------
 4 files changed, 1 insertion(+), 98 deletions(-)
 delete mode 100644 test/api_test/odp_shm_test.c
 delete mode 100644 test/api_test/odp_shm_test.h

Comments

Maxim Uvarov April 14, 2015, 8:21 p.m. UTC | #1
On 04/14/15 22:59, Mike Holmes wrote:
> The shm test is obsolte, remove it
Why is it obsolete?

Maxim.

> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> ---
>   test/api_test/Makefile.am    |  6 +---
>   test/api_test/odp_common.c   |  2 --
>   test/api_test/odp_shm_test.c | 67 --------------------------------------------
>   test/api_test/odp_shm_test.h | 24 ----------------
>   4 files changed, 1 insertion(+), 98 deletions(-)
>   delete mode 100644 test/api_test/odp_shm_test.c
>   delete mode 100644 test/api_test/odp_shm_test.h
>
> diff --git a/test/api_test/Makefile.am b/test/api_test/Makefile.am
> index f231fee..ddbac53 100644
> --- a/test/api_test/Makefile.am
> +++ b/test/api_test/Makefile.am
> @@ -1,17 +1,13 @@
>   include $(top_srcdir)/test/Makefile.inc
>   
> -bin_PROGRAMS = odp_shm odp_ring
> +bin_PROGRAMS = odp_ring
>   
> -odp_shm_CFLAGS = $(AM_CFLAGS)
>   odp_ring_CFLAGS = $(AM_CFLAGS)
>   
> -odp_shm_LDFLAGS = $(AM_LDFLAGS) -static
>   odp_ring_LDFLAGS = $(AM_LDFLAGS) -static
>   
>   noinst_HEADERS = \
>   		  $(top_srcdir)/test/api_test/odp_common.h \
> -		  $(top_srcdir)/test/api_test/odp_shm_test.h \
>   		  $(top_srcdir)/test/test_debug.h
>   
> -dist_odp_shm_SOURCES = odp_shm_test.c odp_common.c
>   dist_odp_ring_SOURCES = odp_ring_test.c odp_common.c
> diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c
> index 18b365e..0677f9b 100644
> --- a/test/api_test/odp_common.c
> +++ b/test/api_test/odp_common.c
> @@ -14,7 +14,6 @@
>   #include <odp.h>
>   #include <odp/helper/linux.h>
>   #include <odp_common.h>
> -#include <odp_shm_test.h>
>   #include <test_debug.h>
>   
>   #define MAX_WORKERS           32            /**< Max worker threads */
> @@ -22,7 +21,6 @@
>   /* Globals */
>   static odph_linux_pthread_t thread_tbl[MAX_WORKERS]; /**< worker threads table*/
>   static int num_workers;				    /**< number of workers 	*/
> -__thread test_shared_data_t *test_shared_data;	    /**< pointer to shared data */
>   
>   /**
>    * Print system information
> diff --git a/test/api_test/odp_shm_test.c b/test/api_test/odp_shm_test.c
> deleted file mode 100644
> index 13d037d..0000000
> --- a/test/api_test/odp_shm_test.c
> +++ /dev/null
> @@ -1,67 +0,0 @@
> -/* Copyright (c) 2013, Linaro Limited
> - * All rights reserved.
> - *
> - * SPDX-License-Identifier:     BSD-3-Clause
> - */
> -
> -/**
> - * @file
> - *
> - * ODP test shared memory
> - */
> -
> -#include <string.h>
> -#include <odp.h>
> -#include <odp_common.h>
> -#include <odp_shm_test.h>
> -#include <test_debug.h>
> -
> -static void *run_thread(void *arg)
> -{
> -	pthrd_arg *parg = (pthrd_arg *)arg;
> -	int thr;
> -	odp_shm_t shm;
> -
> -	thr = odp_thread_id();
> -
> -	printf("Thread %i starts\n", thr);
> -
> -	switch (parg->testcase) {
> -	case ODP_SHM_TEST:
> -		shm = odp_shm_lookup("test_shared_data");
> -		test_shared_data = odp_shm_addr(shm);
> -		printf("  [%i] shared data at %p\n", thr, test_shared_data);
> -		break;
> -	default:
> -		LOG_ERR("Invalid test case [%d]\n", parg->testcase);
> -	}
> -	fflush(stdout);
> -
> -	return parg;
> -}
> -
> -int main(int argc __attribute__((__unused__)),
> -	 char *argv[] __attribute__((__unused__)))
> -{
> -	pthrd_arg thrdarg;
> -	odp_shm_t shm;
> -
> -	if (odp_test_global_init() != 0)
> -		return -1;
> -
> -	odp_print_system_info();
> -
> -	shm = odp_shm_reserve("test_shared_data",
> -			      sizeof(test_shared_data_t), 128, 0);
> -	test_shared_data = odp_shm_addr(shm);
> -	memset(test_shared_data, 0, sizeof(test_shared_data_t));
> -	printf("test shared data at %p\n\n", test_shared_data);
> -
> -	thrdarg.testcase = ODP_SHM_TEST;
> -	thrdarg.numthrds = odp_cpu_count();
> -	odp_test_thread_create(run_thread, &thrdarg);
> -
> -	odp_test_thread_exit(&thrdarg);
> -
> -	return 0;
> -}
> diff --git a/test/api_test/odp_shm_test.h b/test/api_test/odp_shm_test.h
> deleted file mode 100644
> index 3b3f49b..0000000
> --- a/test/api_test/odp_shm_test.h
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -/* Copyright (c) 2013, Linaro Limited
> - * All rights reserved.
> - *
> - * SPDX-License-Identifier:     BSD-3-Clause
> - */
> -
> -/**
> - * @file
> - *
> - * ODP api test shared memory header
> - */
> -
> -#ifndef ODP_SHM_TEST_H
> -#define ODP_SHM_TEST_H
> -
> -typedef struct {
> -	int foo;
> -	int bar;
> -} test_shared_data_t;
> -
> -extern __thread test_shared_data_t *test_shared_data;
> -extern int test_shm(void);
> -
> -#endif /* ODP_SHM_TEST_H */
Mike Holmes April 15, 2015, 2:29 a.m. UTC | #2
On 14 April 2015 at 16:21, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> On 04/14/15 22:59, Mike Holmes wrote:
>
>> The shm test is obsolte, remove it
>>
> Why is it obsolete?
>

A few reasons

It is never called and hence it is not maintained and it core dumps, I dont
know how many releases that has been true but it is now, but fundamentally
it is nowhere near as comprehensive a test as we have in validation and so
it is no longer necessary.

Additionally we need to move or delete everything in api_test becasue that
whole directory is obsolete. The only thing I plan to save is the ring test
which needs to migrate to validation and or the performance test unless we
transition the ring code inside Linux-generic as suggested today.


>
> Maxim.
>
>
>  Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>> ---
>>   test/api_test/Makefile.am    |  6 +---
>>   test/api_test/odp_common.c   |  2 --
>>   test/api_test/odp_shm_test.c | 67
>> --------------------------------------------
>>   test/api_test/odp_shm_test.h | 24 ----------------
>>   4 files changed, 1 insertion(+), 98 deletions(-)
>>   delete mode 100644 test/api_test/odp_shm_test.c
>>   delete mode 100644 test/api_test/odp_shm_test.h
>>
>> diff --git a/test/api_test/Makefile.am b/test/api_test/Makefile.am
>> index f231fee..ddbac53 100644
>> --- a/test/api_test/Makefile.am
>> +++ b/test/api_test/Makefile.am
>> @@ -1,17 +1,13 @@
>>   include $(top_srcdir)/test/Makefile.inc
>>   -bin_PROGRAMS = odp_shm odp_ring
>> +bin_PROGRAMS = odp_ring
>>   -odp_shm_CFLAGS = $(AM_CFLAGS)
>>   odp_ring_CFLAGS = $(AM_CFLAGS)
>>   -odp_shm_LDFLAGS = $(AM_LDFLAGS) -static
>>   odp_ring_LDFLAGS = $(AM_LDFLAGS) -static
>>     noinst_HEADERS = \
>>                   $(top_srcdir)/test/api_test/odp_common.h \
>> -                 $(top_srcdir)/test/api_test/odp_shm_test.h \
>>                   $(top_srcdir)/test/test_debug.h
>>   -dist_odp_shm_SOURCES = odp_shm_test.c odp_common.c
>>   dist_odp_ring_SOURCES = odp_ring_test.c odp_common.c
>> diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c
>> index 18b365e..0677f9b 100644
>> --- a/test/api_test/odp_common.c
>> +++ b/test/api_test/odp_common.c
>> @@ -14,7 +14,6 @@
>>   #include <odp.h>
>>   #include <odp/helper/linux.h>
>>   #include <odp_common.h>
>> -#include <odp_shm_test.h>
>>   #include <test_debug.h>
>>     #define MAX_WORKERS           32            /**< Max worker threads */
>> @@ -22,7 +21,6 @@
>>   /* Globals */
>>   static odph_linux_pthread_t thread_tbl[MAX_WORKERS]; /**< worker
>> threads table*/
>>   static int num_workers;                                   /**< number
>> of workers      */
>> -__thread test_shared_data_t *test_shared_data;     /**< pointer to
>> shared data */
>>     /**
>>    * Print system information
>> diff --git a/test/api_test/odp_shm_test.c b/test/api_test/odp_shm_test.c
>> deleted file mode 100644
>> index 13d037d..0000000
>> --- a/test/api_test/odp_shm_test.c
>> +++ /dev/null
>> @@ -1,67 +0,0 @@
>> -/* Copyright (c) 2013, Linaro Limited
>> - * All rights reserved.
>> - *
>> - * SPDX-License-Identifier:     BSD-3-Clause
>> - */
>> -
>> -/**
>> - * @file
>> - *
>> - * ODP test shared memory
>> - */
>> -
>> -#include <string.h>
>> -#include <odp.h>
>> -#include <odp_common.h>
>> -#include <odp_shm_test.h>
>> -#include <test_debug.h>
>> -
>> -static void *run_thread(void *arg)
>> -{
>> -       pthrd_arg *parg = (pthrd_arg *)arg;
>> -       int thr;
>> -       odp_shm_t shm;
>> -
>> -       thr = odp_thread_id();
>> -
>> -       printf("Thread %i starts\n", thr);
>> -
>> -       switch (parg->testcase) {
>> -       case ODP_SHM_TEST:
>> -               shm = odp_shm_lookup("test_shared_data");
>> -               test_shared_data = odp_shm_addr(shm);
>> -               printf("  [%i] shared data at %p\n", thr,
>> test_shared_data);
>> -               break;
>> -       default:
>> -               LOG_ERR("Invalid test case [%d]\n", parg->testcase);
>> -       }
>> -       fflush(stdout);
>> -
>> -       return parg;
>> -}
>> -
>> -int main(int argc __attribute__((__unused__)),
>> -        char *argv[] __attribute__((__unused__)))
>> -{
>> -       pthrd_arg thrdarg;
>> -       odp_shm_t shm;
>> -
>> -       if (odp_test_global_init() != 0)
>> -               return -1;
>> -
>> -       odp_print_system_info();
>> -
>> -       shm = odp_shm_reserve("test_shared_data",
>> -                             sizeof(test_shared_data_t), 128, 0);
>> -       test_shared_data = odp_shm_addr(shm);
>> -       memset(test_shared_data, 0, sizeof(test_shared_data_t));
>> -       printf("test shared data at %p\n\n", test_shared_data);
>> -
>> -       thrdarg.testcase = ODP_SHM_TEST;
>> -       thrdarg.numthrds = odp_cpu_count();
>> -       odp_test_thread_create(run_thread, &thrdarg);
>> -
>> -       odp_test_thread_exit(&thrdarg);
>> -
>> -       return 0;
>> -}
>> diff --git a/test/api_test/odp_shm_test.h b/test/api_test/odp_shm_test.h
>> deleted file mode 100644
>> index 3b3f49b..0000000
>> --- a/test/api_test/odp_shm_test.h
>> +++ /dev/null
>> @@ -1,24 +0,0 @@
>> -/* Copyright (c) 2013, Linaro Limited
>> - * All rights reserved.
>> - *
>> - * SPDX-License-Identifier:     BSD-3-Clause
>> - */
>> -
>> -/**
>> - * @file
>> - *
>> - * ODP api test shared memory header
>> - */
>> -
>> -#ifndef ODP_SHM_TEST_H
>> -#define ODP_SHM_TEST_H
>> -
>> -typedef struct {
>> -       int foo;
>> -       int bar;
>> -} test_shared_data_t;
>> -
>> -extern __thread test_shared_data_t *test_shared_data;
>> -extern int test_shm(void);
>> -
>> -#endif /* ODP_SHM_TEST_H */
>>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov April 15, 2015, 7:55 a.m. UTC | #3
On 04/15/15 05:29, Mike Holmes wrote:
>
>
> On 14 April 2015 at 16:21, Maxim Uvarov <maxim.uvarov@linaro.org 
> <mailto:maxim.uvarov@linaro.org>> wrote:
>
>     On 04/14/15 22:59, Mike Holmes wrote:
>
>         The shm test is obsolte, remove it
>
>     Why is it obsolete?
>
>
> A few reasons
>
> It is never called and hence it is not maintained and it core dumps, I 
> dont know how many releases that has been true but it is now, but 
> fundamentally it is nowhere near as comprehensive a test as we have in 
> validation and so it is no longer necessary.
>
> Additionally we need to move or delete everything in api_test becasue 
> that whole directory is obsolete. The only thing I plan to save is the 
> ring test which needs to migrate to validation and or the performance 
> test unless we transition the ring code inside Linux-generic as 
> suggested today.

Ok, that test covered with ./test/validation/odp_shm.c.


Maxim.

>
>     Maxim.
>
>
>         Signed-off-by: Mike Holmes <mike.holmes@linaro.org
>         <mailto:mike.holmes@linaro.org>>
>         ---
>           test/api_test/Makefile.am    |  6 +---
>           test/api_test/odp_common.c   |  2 --
>           test/api_test/odp_shm_test.c | 67
>         --------------------------------------------
>           test/api_test/odp_shm_test.h | 24 ----------------
>           4 files changed, 1 insertion(+), 98 deletions(-)
>           delete mode 100644 test/api_test/odp_shm_test.c
>           delete mode 100644 test/api_test/odp_shm_test.h
>
>         diff --git a/test/api_test/Makefile.am b/test/api_test/Makefile.am
>         index f231fee..ddbac53 100644
>         --- a/test/api_test/Makefile.am
>         +++ b/test/api_test/Makefile.am
>         @@ -1,17 +1,13 @@
>           include $(top_srcdir)/test/Makefile.inc
>           -bin_PROGRAMS = odp_shm odp_ring
>         +bin_PROGRAMS = odp_ring
>           -odp_shm_CFLAGS = $(AM_CFLAGS)
>           odp_ring_CFLAGS = $(AM_CFLAGS)
>           -odp_shm_LDFLAGS = $(AM_LDFLAGS) -static
>           odp_ring_LDFLAGS = $(AM_LDFLAGS) -static
>             noinst_HEADERS = \
>         $(top_srcdir)/test/api_test/odp_common.h \
>         -  $(top_srcdir)/test/api_test/odp_shm_test.h \
>                           $(top_srcdir)/test/test_debug.h
>           -dist_odp_shm_SOURCES = odp_shm_test.c odp_common.c
>           dist_odp_ring_SOURCES = odp_ring_test.c odp_common.c
>         diff --git a/test/api_test/odp_common.c
>         b/test/api_test/odp_common.c
>         index 18b365e..0677f9b 100644
>         --- a/test/api_test/odp_common.c
>         +++ b/test/api_test/odp_common.c
>         @@ -14,7 +14,6 @@
>           #include <odp.h>
>           #include <odp/helper/linux.h>
>           #include <odp_common.h>
>         -#include <odp_shm_test.h>
>           #include <test_debug.h>
>             #define MAX_WORKERS           32 /**< Max worker threads */
>         @@ -22,7 +21,6 @@
>           /* Globals */
>           static odph_linux_pthread_t thread_tbl[MAX_WORKERS]; /**<
>         worker threads table*/
>           static int num_workers;        /**< number of workers      */
>         -__thread test_shared_data_t *test_shared_data;  /**< pointer
>         to shared data */
>             /**
>            * Print system information
>         diff --git a/test/api_test/odp_shm_test.c
>         b/test/api_test/odp_shm_test.c
>         deleted file mode 100644
>         index 13d037d..0000000
>         --- a/test/api_test/odp_shm_test.c
>         +++ /dev/null
>         @@ -1,67 +0,0 @@
>         -/* Copyright (c) 2013, Linaro Limited
>         - * All rights reserved.
>         - *
>         - * SPDX-License-Identifier:     BSD-3-Clause
>         - */
>         -
>         -/**
>         - * @file
>         - *
>         - * ODP test shared memory
>         - */
>         -
>         -#include <string.h>
>         -#include <odp.h>
>         -#include <odp_common.h>
>         -#include <odp_shm_test.h>
>         -#include <test_debug.h>
>         -
>         -static void *run_thread(void *arg)
>         -{
>         -       pthrd_arg *parg = (pthrd_arg *)arg;
>         -       int thr;
>         -       odp_shm_t shm;
>         -
>         -       thr = odp_thread_id();
>         -
>         -       printf("Thread %i starts\n", thr);
>         -
>         -       switch (parg->testcase) {
>         -       case ODP_SHM_TEST:
>         -               shm = odp_shm_lookup("test_shared_data");
>         -               test_shared_data = odp_shm_addr(shm);
>         -               printf("  [%i] shared data at %p\n", thr,
>         test_shared_data);
>         -               break;
>         -       default:
>         -               LOG_ERR("Invalid test case [%d]\n",
>         parg->testcase);
>         -       }
>         -       fflush(stdout);
>         -
>         -       return parg;
>         -}
>         -
>         -int main(int argc __attribute__((__unused__)),
>         -        char *argv[] __attribute__((__unused__)))
>         -{
>         -       pthrd_arg thrdarg;
>         -       odp_shm_t shm;
>         -
>         -       if (odp_test_global_init() != 0)
>         -               return -1;
>         -
>         -       odp_print_system_info();
>         -
>         -       shm = odp_shm_reserve("test_shared_data",
>         -  sizeof(test_shared_data_t), 128, 0);
>         -       test_shared_data = odp_shm_addr(shm);
>         -       memset(test_shared_data, 0, sizeof(test_shared_data_t));
>         -       printf("test shared data at %p\n\n", test_shared_data);
>         -
>         -       thrdarg.testcase = ODP_SHM_TEST;
>         -       thrdarg.numthrds = odp_cpu_count();
>         -       odp_test_thread_create(run_thread, &thrdarg);
>         -
>         -       odp_test_thread_exit(&thrdarg);
>         -
>         -       return 0;
>         -}
>         diff --git a/test/api_test/odp_shm_test.h
>         b/test/api_test/odp_shm_test.h
>         deleted file mode 100644
>         index 3b3f49b..0000000
>         --- a/test/api_test/odp_shm_test.h
>         +++ /dev/null
>         @@ -1,24 +0,0 @@
>         -/* Copyright (c) 2013, Linaro Limited
>         - * All rights reserved.
>         - *
>         - * SPDX-License-Identifier:     BSD-3-Clause
>         - */
>         -
>         -/**
>         - * @file
>         - *
>         - * ODP api test shared memory header
>         - */
>         -
>         -#ifndef ODP_SHM_TEST_H
>         -#define ODP_SHM_TEST_H
>         -
>         -typedef struct {
>         -       int foo;
>         -       int bar;
>         -} test_shared_data_t;
>         -
>         -extern __thread test_shared_data_t *test_shared_data;
>         -extern int test_shm(void);
>         -
>         -#endif /* ODP_SHM_TEST_H */
>
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
> -- 
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org <http://www.linaro.org/>***│ *Open source software for ARM SoCs
>
Taras Kondratiuk April 15, 2015, 8:08 a.m. UTC | #4
On 04/15/2015 05:29 AM, Mike Holmes wrote:
>
>
> On 14 April 2015 at 16:21, Maxim Uvarov <maxim.uvarov@linaro.org
> <mailto:maxim.uvarov@linaro.org>> wrote:
>
>     On 04/14/15 22:59, Mike Holmes wrote:
>
>         The shm test is obsolte, remove it
>
>     Why is it obsolete?
>
>
> A few reasons
>
> It is never called and hence it is not maintained and it core dumps, I
> dont know how many releases that has been true but it is now, but
> fundamentally it is nowhere near as comprehensive a test as we have in
> validation and so it is no longer necessary.
>
> Additionally we need to move or delete everything in api_test becasue
> that whole directory is obsolete. The only thing I plan to save is the
> ring test which needs to migrate to validation and or the performance
> test unless we transition the ring code inside Linux-generic as
> suggested today.

Our validation tests should validate only ODP API.
Rings don't belong to API.
Mike Holmes April 15, 2015, 2:57 p.m. UTC | #5
On 15 April 2015 at 04:08, Taras Kondratiuk <taras.kondratiuk@linaro.org>
wrote:

> On 04/15/2015 05:29 AM, Mike Holmes wrote:
>
>>
>>
>> On 14 April 2015 at 16:21, Maxim Uvarov <maxim.uvarov@linaro.org
>> <mailto:maxim.uvarov@linaro.org>> wrote:
>>
>>     On 04/14/15 22:59, Mike Holmes wrote:
>>
>>         The shm test is obsolte, remove it
>>
>>     Why is it obsolete?
>>
>>
>> A few reasons
>>
>> It is never called and hence it is not maintained and it core dumps, I
>> dont know how many releases that has been true but it is now, but
>> fundamentally it is nowhere near as comprehensive a test as we have in
>> validation and so it is no longer necessary.
>>
>> Additionally we need to move or delete everything in api_test becasue
>> that whole directory is obsolete. The only thing I plan to save is the
>> ring test which needs to migrate to validation and or the performance
>> test unless we transition the ring code inside Linux-generic as
>> suggested today.
>>
>
> Our validation tests should validate only ODP API.
> Rings don't belong to API.
>

That is also part of the current discussion about what helpers are.
I hope to work towards resolving that, helpers are currently not part of
the official API, they are helpers, but we have helpers that are heavily
used - eth.h etc and those like ring that are not used at all.
Ola Liljedahl April 15, 2015, 3:02 p.m. UTC | #6
On 15 April 2015 at 16:57, Mike Holmes <mike.holmes@linaro.org> wrote:

>
>
> On 15 April 2015 at 04:08, Taras Kondratiuk <taras.kondratiuk@linaro.org>
> wrote:
>
>> On 04/15/2015 05:29 AM, Mike Holmes wrote:
>>
>>>
>>>
>>> On 14 April 2015 at 16:21, Maxim Uvarov <maxim.uvarov@linaro.org
>>> <mailto:maxim.uvarov@linaro.org>> wrote:
>>>
>>>     On 04/14/15 22:59, Mike Holmes wrote:
>>>
>>>         The shm test is obsolte, remove it
>>>
>>>     Why is it obsolete?
>>>
>>>
>>> A few reasons
>>>
>>> It is never called and hence it is not maintained and it core dumps, I
>>> dont know how many releases that has been true but it is now, but
>>> fundamentally it is nowhere near as comprehensive a test as we have in
>>> validation and so it is no longer necessary.
>>>
>>> Additionally we need to move or delete everything in api_test becasue
>>> that whole directory is obsolete. The only thing I plan to save is the
>>> ring test which needs to migrate to validation and or the performance
>>> test unless we transition the ring code inside Linux-generic as
>>> suggested today.
>>>
>>
>> Our validation tests should validate only ODP API.
>> Rings don't belong to API.
>>
> Why do we even have the ring implementation when ODP has polled queues
which have the same semantics?
Is there some use case which requires the user to know the implementation
of the queues (e.g. for placing the memory used by the rings in some
specific (shared) place)?



>
> That is also part of the current discussion about what helpers are.
> I hope to work towards resolving that, helpers are currently not part of
> the official API, they are helpers, but we have helpers that are heavily
> used - eth.h etc and those like ring that are not used at all.
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
Mike Holmes April 15, 2015, 5:34 p.m. UTC | #7
On 15 April 2015 at 11:02, Ola Liljedahl <ola.liljedahl@linaro.org> wrote:

> On 15 April 2015 at 16:57, Mike Holmes <mike.holmes@linaro.org> wrote:
>
>>
>>
>> On 15 April 2015 at 04:08, Taras Kondratiuk <taras.kondratiuk@linaro.org>
>> wrote:
>>
>>> On 04/15/2015 05:29 AM, Mike Holmes wrote:
>>>
>>>>
>>>>
>>>> On 14 April 2015 at 16:21, Maxim Uvarov <maxim.uvarov@linaro.org
>>>> <mailto:maxim.uvarov@linaro.org>> wrote:
>>>>
>>>>     On 04/14/15 22:59, Mike Holmes wrote:
>>>>
>>>>         The shm test is obsolte, remove it
>>>>
>>>>     Why is it obsolete?
>>>>
>>>>
>>>> A few reasons
>>>>
>>>> It is never called and hence it is not maintained and it core dumps, I
>>>> dont know how many releases that has been true but it is now, but
>>>> fundamentally it is nowhere near as comprehensive a test as we have in
>>>> validation and so it is no longer necessary.
>>>>
>>>> Additionally we need to move or delete everything in api_test becasue
>>>> that whole directory is obsolete. The only thing I plan to save is the
>>>> ring test which needs to migrate to validation and or the performance
>>>> test unless we transition the ring code inside Linux-generic as
>>>> suggested today.
>>>>
>>>
>>> Our validation tests should validate only ODP API.
>>> Rings don't belong to API.
>>>
>> Why do we even have the ring implementation when ODP has polled queues
> which have the same semantics?
> Is there some use case which requires the user to know the implementation
> of the queues (e.g. for placing the memory used by the rings in some
> specific (shared) place)?
>

I dont recall the motivation now, but without a case to keep them it looks
like no one needs the ring code, we are certainly not testing it in any way.

If it stays I want it tested or it will rot like odp_shm has in this very
directory. To test it that probably means that helpers are independently
tested from the API so we need to find the correct location for the test -
maybe helpers need to be an independent library to start with ?


>
>
>
>>
>> That is also part of the current discussion about what helpers are.
>> I hope to work towards resolving that, helpers are currently not part of
>> the official API, they are helpers, but we have helpers that are heavily
>> used - eth.h etc and those like ring that are not used at all.
>>
>>
>> --
>> Mike Holmes
>> Technical Manager - Linaro Networking Group
>> Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
>>
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>>
>
Taras Kondratiuk April 16, 2015, 8:39 a.m. UTC | #8
On 04/16/2015 11:35 AM, Savolainen, Petri (Nokia - FI/Espoo) wrote:
> If it stays I want it tested or it will rot like odp_shm has in this
> very directory. To test it that probably means that helpers are
> independently tested from the API so we need to find the correct
> location for the test - maybe helpers need to be an independent library
> to start with ?
>
> You could create tests for helpers under “helper/test”.
>
> Helpers are independent from ODP API (helpers may use ODP API, but ODP
> API must not use helpers), but ODP tests suite and examples use those.
> The purpose of helpers is to enable easy test applications creation and
> maintenance (e.g. reuse the Ethernet header definition over all test
> apps). Since test apps are under ODP repo, so should be helpers. Real
> applications may or may not use helpers, but those should not expect
> helpers to be HW accelerated or otherwise optimized.
>

Currently both ODP examples/tests and linux-generic platform uses
helpers. This prevents clear separation of helpers from implementation.
Mike Holmes April 16, 2015, 2:31 p.m. UTC | #9
Before this valuable thread hijacks the patch can some one review it ? I
dont think there is any good reason to keep odp_shm.

I have been working with Christophe and a really clean solution is emerging
that untangles  a lot of this.

So to state my vision in rough form

   - helper implementation is under helpers not in Linux generic, it is os
   dependent not platform dependent.
   - test/api_test is deleted
   - helpers do have tests in the appropriate place in the structure if
   they are functional in any way.
   - A helper that supports creating an odp_worker that is OS independent
   at the API level is needed. It will have a Linux implementation equal to
   what we have now. We need this to make tests and examples a little more
   portable. We will not provide support for bare metal etc so this is an API
   change only at heart. The choice between process or thread for the linux
   odp_worker create will be at compile time.  We dont use the process model
   in the validation tests currently anyway.
   - We delete rings unless some one has a use case to keep them.
   - We need to account for OS and platform specific configuration that is
   needed for the tests to run - Christophe now have a very elegant patch
   brewing. It makes the pktio_run etc much cleaner and make the tests a truly
   independent library potentially,  with no hacks to get platform specifics
   solved to run them.
   - Helpers like the protocol headers are clearly used
   by implementations and applications this should be allowed, but helpers
   should be separated where they only support apps, examples and tests, thus
   creating odp_workers is a different kind of helper.
   - ODP != OS independence but tests need to be closer to that than we
   have now unless we downplay the validation suite. I think with an OS
   independent odp_wroker_create  + Christophes work we will hit the sweet
   spot avoiding the hard work for non linux cases,  but leaving the door open
   for bare-metal folks  to do what they need to.

Would love to have this discussion in next Tuesdays public call if we dont
beat it ti death before then.


On 16 April 2015 at 07:16, Savolainen, Petri (Nokia - FI/Espoo) <
petri.savolainen@nokia.com> wrote:

>
>
> > -----Original Message-----
> > From: ext Benoît Ganne [mailto:bganne@kalray.eu]
> > Sent: Thursday, April 16, 2015 1:51 PM
> > To: Savolainen, Petri (Nokia - FI/Espoo); Taras Kondratiuk
> > Cc: lng-odp
> > Subject: Re: [lng-odp] [PATCH] api_test: remove odp_shm_test
> >
> > >> I think there is a grey area here: we say helpers are not part of ODP,
> > >> but we cannot compile ODP tests and examples w/o them. Can we really
> > >> consider an implementation to be ODP-compliant w/o those?
> >
> > > An implementation does not have to (should not) re-implement the
> > > odp/helper directory. It can be delivered as is (similar to odp/test
> > > or odp/example). Helpers can be thought as part of the test suite
> > > infrastructure, but pulled to the top level as definitions are
> > > generic enough.
> >
> > For example, tests and examples make heavy use of odph_linux_pthread_* .
> > This is a problem for eg. bare metal environment. I believe that Phil
> > proposed during the call to rename that "execution_unit" or something
> > similar exactly for this reason.
> > But then we also have the problem with odph_linux_process_*, especially
> > for our platform where we could have different images for different
> > process: some for Linux, some for bare metal. Bare metal images cannot
> > run under Linux and vice-versa.
> > If helpers are needed for examples and tests, I would argue they should
> > be as platform-neutral as possible and carefully defined. This is not a
> > problem for protocols headers, but it is for processes management.
> >
> > ben
>
> Some tests/examples (e.g. Ipsec) include also Linux/posix headers directly
> (so bare metal problems are not limited to odph_linux_*). And that's OK -
> we don't want ODP to become another OS. The software written under the ODP
> project may not be able support different bare metal targets, but leave
> that (validation) effort to individual vendors. In practice, test
> suite/examples depend on Linux now, and that may be the case in the future
> also (as conclusion of this discussion).
>
> The important thing is that the API does not depend on Linux/POSIX/etc -
> only on C99.
>
> -Petri
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
Mike Holmes April 16, 2015, 2:34 p.m. UTC | #10
Major mistake odp_worker_create  == odph_worker_create the "h" matters :)

On 16 April 2015 at 10:31, Mike Holmes <mike.holmes@linaro.org> wrote:

> Before this valuable thread hijacks the patch can some one review it ? I
> dont think there is any good reason to keep odp_shm.
>
> I have been working with Christophe and a really clean solution is
> emerging that untangles  a lot of this.
>
> So to state my vision in rough form
>
>    - helper implementation is under helpers not in Linux generic, it is
>    os dependent not platform dependent.
>    - test/api_test is deleted
>    - helpers do have tests in the appropriate place in the structure if
>    they are functional in any way.
>    - A helper that supports creating an odp_worker that is OS independent
>    at the API level is needed. It will have a Linux implementation equal to
>    what we have now. We need this to make tests and examples a little more
>    portable. We will not provide support for bare metal etc so this is an API
>    change only at heart. The choice between process or thread for the linux
>    odp_worker create will be at compile time.  We dont use the process model
>    in the validation tests currently anyway.
>    - We delete rings unless some one has a use case to keep them.
>    - We need to account for OS and platform specific configuration that
>    is needed for the tests to run - Christophe now have a very elegant patch
>    brewing. It makes the pktio_run etc much cleaner and make the tests a truly
>    independent library potentially,  with no hacks to get platform specifics
>    solved to run them.
>    - Helpers like the protocol headers are clearly used
>    by implementations and applications this should be allowed, but helpers
>    should be separated where they only support apps, examples and tests, thus
>    creating odp_workers is a different kind of helper.
>    - ODP != OS independence but tests need to be closer to that than we
>    have now unless we downplay the validation suite. I think with an OS
>    independent odp_wroker_create  + Christophes work we will hit the sweet
>    spot avoiding the hard work for non linux cases,  but leaving the door open
>    for bare-metal folks  to do what they need to.
>
> Would love to have this discussion in next Tuesdays public call if we dont
> beat it ti death before then.
>
>
> On 16 April 2015 at 07:16, Savolainen, Petri (Nokia - FI/Espoo) <
> petri.savolainen@nokia.com> wrote:
>
>>
>>
>> > -----Original Message-----
>> > From: ext Benoît Ganne [mailto:bganne@kalray.eu]
>> > Sent: Thursday, April 16, 2015 1:51 PM
>> > To: Savolainen, Petri (Nokia - FI/Espoo); Taras Kondratiuk
>> > Cc: lng-odp
>> > Subject: Re: [lng-odp] [PATCH] api_test: remove odp_shm_test
>> >
>> > >> I think there is a grey area here: we say helpers are not part of
>> ODP,
>> > >> but we cannot compile ODP tests and examples w/o them. Can we really
>> > >> consider an implementation to be ODP-compliant w/o those?
>> >
>> > > An implementation does not have to (should not) re-implement the
>> > > odp/helper directory. It can be delivered as is (similar to odp/test
>> > > or odp/example). Helpers can be thought as part of the test suite
>> > > infrastructure, but pulled to the top level as definitions are
>> > > generic enough.
>> >
>> > For example, tests and examples make heavy use of odph_linux_pthread_* .
>> > This is a problem for eg. bare metal environment. I believe that Phil
>> > proposed during the call to rename that "execution_unit" or something
>> > similar exactly for this reason.
>> > But then we also have the problem with odph_linux_process_*, especially
>> > for our platform where we could have different images for different
>> > process: some for Linux, some for bare metal. Bare metal images cannot
>> > run under Linux and vice-versa.
>> > If helpers are needed for examples and tests, I would argue they should
>> > be as platform-neutral as possible and carefully defined. This is not a
>> > problem for protocols headers, but it is for processes management.
>> >
>> > ben
>>
>> Some tests/examples (e.g. Ipsec) include also Linux/posix headers
>> directly (so bare metal problems are not limited to odph_linux_*). And
>> that's OK - we don't want ODP to become another OS. The software written
>> under the ODP project may not be able support different bare metal targets,
>> but leave that (validation) effort to individual vendors. In practice, test
>> suite/examples depend on Linux now, and that may be the case in the future
>> also (as conclusion of this discussion).
>>
>> The important thing is that the API does not depend on Linux/POSIX/etc -
>> only on C99.
>>
>> -Petri
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
>
>
>
Mike Holmes April 17, 2015, 1:03 p.m. UTC | #11
On 17 April 2015 at 03:22, Savolainen, Petri (Nokia - FI/Espoo) <
petri.savolainen@nokia.com> wrote:

>  It’s a good idea to add odph_worker, but that would be added in parallel
> to odph_linux.
>

This raises a question in my mind, if we only need to support the tests and
examples we provide and can test,  why would we have that parallel linux
specific api in our code base - we wont be using it at all.


> So that applications which  explicitly need to create Linux processes,
> pthreads or both can still do that.
>

Who's application ? anyone is free to do that if needed that is why they
are helpers and not part of the API, but why do we add support if we wont
be using it. It will be like rings, in the code base and never used with
its test rotten and core dumping.


> All validation tests can use odp_worker (only), but e.g. some
> examples/apps may need direct access to Linux process/thread data structs.
>

We dont have any to date and if we do get to this situation in
linux-generic I start to question if we are heading away from the core of
ODP being agnostic to OS etc and so should we do that ?


I do see us running  odph_worker in both of the linux modes in the
validation of linux generic so that we test odp_worker as a process and
thread under Linux.



>
> Agree that test/api_test and helper/ring should be removed.
>
>
>
> -Petri
>
>
>
>
>
> *From:* ext Mike Holmes [mailto:mike.holmes@linaro.org]
> *Sent:* Thursday, April 16, 2015 5:34 PM
> *To:* Savolainen, Petri (Nokia - FI/Espoo)
> *Cc:* ext Benoît Ganne; Taras Kondratiuk; lng-odp
>
> *Subject:* Re: [lng-odp] [PATCH] api_test: remove odp_shm_test
>
>
>
> Major mistake odp_worker_create  == odph_worker_create the "h" matters :)
>
>
>
> On 16 April 2015 at 10:31, Mike Holmes <mike.holmes@linaro.org> wrote:
>
> Before this valuable thread hijacks the patch can some one review it ? I
> dont think there is any good reason to keep odp_shm.
>
>
>
> I have been working with Christophe and a really clean solution is
> emerging that untangles  a lot of this.
>
>
>
> So to state my vision in rough form
>
>    - helper implementation is under helpers not in Linux generic, it is
>    os dependent not platform dependent.
>    - test/api_test is deleted
>    - helpers do have tests in the appropriate place in the structure if
>    they are functional in any way.
>    - A helper that supports creating an odp_worker that is OS independent
>    at the API level is needed. It will have a Linux implementation equal to
>    what we have now. We need this to make tests and examples a little more
>    portable. We will not provide support for bare metal etc so this is an API
>    change only at heart. The choice between process or thread for the linux
>    odp_worker create will be at compile time.  We dont use the process model
>    in the validation tests currently anyway.
>    - We delete rings unless some one has a use case to keep them.
>    - We need to account for OS and platform specific configuration that
>    is needed for the tests to run - Christophe now have a very elegant patch
>    brewing. It makes the pktio_run etc much cleaner and make the tests a truly
>    independent library potentially,  with no hacks to get platform specifics
>    solved to run them.
>    - Helpers like the protocol headers are clearly used
>    by implementations and applications this should be allowed, but helpers
>    should be separated where they only support apps, examples and tests, thus
>    creating odp_workers is a different kind of helper.
>    - ODP != OS independence but tests need to be closer to that than we
>    have now unless we downplay the validation suite. I think with an OS
>    independent odp_wroker_create  + Christophes work we will hit the sweet
>    spot avoiding the hard work for non linux cases,  but leaving the door open
>    for bare-metal folks  to do what they need to.
>
>  Would love to have this discussion in next Tuesdays public call if we
> dont beat it ti death before then.
>
>
>
>
>
> On 16 April 2015 at 07:16, Savolainen, Petri (Nokia - FI/Espoo) <
> petri.savolainen@nokia.com> wrote:
>
>
>
> > -----Original Message-----
> > From: ext Benoît Ganne [mailto:bganne@kalray.eu]
> > Sent: Thursday, April 16, 2015 1:51 PM
> > To: Savolainen, Petri (Nokia - FI/Espoo); Taras Kondratiuk
> > Cc: lng-odp
> > Subject: Re: [lng-odp] [PATCH] api_test: remove odp_shm_test
> >
> > >> I think there is a grey area here: we say helpers are not part of ODP,
> > >> but we cannot compile ODP tests and examples w/o them. Can we really
> > >> consider an implementation to be ODP-compliant w/o those?
> >
> > > An implementation does not have to (should not) re-implement the
> > > odp/helper directory. It can be delivered as is (similar to odp/test
> > > or odp/example). Helpers can be thought as part of the test suite
> > > infrastructure, but pulled to the top level as definitions are
> > > generic enough.
> >
> > For example, tests and examples make heavy use of odph_linux_pthread_* .
> > This is a problem for eg. bare metal environment. I believe that Phil
> > proposed during the call to rename that "execution_unit" or something
> > similar exactly for this reason.
> > But then we also have the problem with odph_linux_process_*, especially
> > for our platform where we could have different images for different
> > process: some for Linux, some for bare metal. Bare metal images cannot
> > run under Linux and vice-versa.
> > If helpers are needed for examples and tests, I would argue they should
> > be as platform-neutral as possible and carefully defined. This is not a
> > problem for protocols headers, but it is for processes management.
> >
> > ben
>
> Some tests/examples (e.g. Ipsec) include also Linux/posix headers directly
> (so bare metal problems are not limited to odph_linux_*). And that's OK -
> we don't want ODP to become another OS. The software written under the ODP
> project may not be able support different bare metal targets, but leave
> that (validation) effort to individual vendors. In practice, test
> suite/examples depend on Linux now, and that may be the case in the future
> also (as conclusion of this discussion).
>
> The important thing is that the API does not depend on Linux/POSIX/etc -
> only on C99.
>
> -Petri
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
>
> --
>
> Mike Holmes
>
> Technical Manager - Linaro Networking Group
>
> Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
>
>
>
>
>
>
>
> --
>
> Mike Holmes
>
> Technical Manager - Linaro Networking Group
>
> Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
>
>
>
Mike Holmes April 20, 2015, 5:55 p.m. UTC | #12
We clarified the direction this thread took on the call this morning.

The Linux dependency window will stay open for examples to potentially be
Linux dependent,  the assumption here being that as we develop more
sophisticated examples they may need many Linux features.  Currently there
is nothing that has a level of complexity that requires this, so all the
current executables can be platform independent.
Any Linux dependent examples will be gathered  - probably via the directory
hierarchy - so that they can be optionally compiled and run so as not to
hinder bare metal cases.

PING the original patch still needs a review and is fully in line with our
direction.

On 20 April 2015 at 03:27, Savolainen, Petri (Nokia - FI/Espoo) <
petri.savolainen@nokia.com> wrote:

>  I expect that we cannot modify every current and future example app to
> be OS agnostic (== bare metal ready). Some examples, like IPsec, depend on
> third party libraries, which in turn may depend on other Linux/Posix
> interfaces. Third party code may expect either process or pthread model.
> It’s good to demonstrate explicitly how ODP is setup in both of those
> cases. Majority of the applications will run Linux anyway.
>
>
>
> I recommend that we support OS agnostic validation suite (triple the
> testing effort there) - but examples/other test apps  can choose which from
> the three models (OS agnostic, Linux process or pthread) suite them the
> best. So, all three helper APIs are needed.
>
>
>
> -Petri
>
>
>
>
>
> *From:* ext Mike Holmes [mailto:mike.holmes@linaro.org]
> *Sent:* Friday, April 17, 2015 4:04 PM
>
> *To:* Savolainen, Petri (Nokia - FI/Espoo)
> *Cc:* ext Benoît Ganne; Taras Kondratiuk; lng-odp
> *Subject:* Re: [lng-odp] [PATCH] api_test: remove odp_shm_test
>
>
>
>
>
>
>
> On 17 April 2015 at 03:22, Savolainen, Petri (Nokia - FI/Espoo) <
> petri.savolainen@nokia.com> wrote:
>
> It’s a good idea to add odph_worker, but that would be added in parallel
> to odph_linux.
>
>
>
> This raises a question in my mind, if we only need to support the tests
> and examples we provide and can test,  why would we have that parallel
> linux specific api in our code base - we wont be using it at all.
>
>
>
>  So that applications which  explicitly need to create Linux processes,
> pthreads or both can still do that.
>
>
>
> Who's application ? anyone is free to do that if needed that is why they
> are helpers and not part of the API, but why do we add support if we wont
> be using it. It will be like rings, in the code base and never used with
> its test rotten and core dumping.
>
>
>
>  All validation tests can use odp_worker (only), but e.g. some
> examples/apps may need direct access to Linux process/thread data structs.
>
>
>
> We dont have any to date and if we do get to this situation in
> linux-generic I start to question if we are heading away from the core of
> ODP being agnostic to OS etc and so should we do that ?
>
>
>
>
>
> I do see us running  odph_worker in both of the linux modes in the
> validation of linux generic so that we test odp_worker as a process and
> thread under Linux.
>
>
>
>
>
>
>
> Agree that test/api_test and helper/ring should be removed.
>
>
>
> -Petri
>
>
>
>
>
> *From:* ext Mike Holmes [mailto:mike.holmes@linaro.org]
> *Sent:* Thursday, April 16, 2015 5:34 PM
> *To:* Savolainen, Petri (Nokia - FI/Espoo)
> *Cc:* ext Benoît Ganne; Taras Kondratiuk; lng-odp
>
>
> *Subject:* Re: [lng-odp] [PATCH] api_test: remove odp_shm_test
>
>
>
> Major mistake odp_worker_create  == odph_worker_create the "h" matters :)
>
>
>
> On 16 April 2015 at 10:31, Mike Holmes <mike.holmes@linaro.org> wrote:
>
> Before this valuable thread hijacks the patch can some one review it ? I
> dont think there is any good reason to keep odp_shm.
>
>
>
> I have been working with Christophe and a really clean solution is
> emerging that untangles  a lot of this.
>
>
>
> So to state my vision in rough form
>
>    - helper implementation is under helpers not in Linux generic, it is
>    os dependent not platform dependent.
>    - test/api_test is deleted
>    - helpers do have tests in the appropriate place in the structure if
>    they are functional in any way.
>    - A helper that supports creating an odp_worker that is OS independent
>    at the API level is needed. It will have a Linux implementation equal to
>    what we have now. We need this to make tests and examples a little more
>    portable. We will not provide support for bare metal etc so this is an API
>    change only at heart. The choice between process or thread for the linux
>    odp_worker create will be at compile time.  We dont use the process model
>    in the validation tests currently anyway.
>    - We delete rings unless some one has a use case to keep them.
>    - We need to account for OS and platform specific configuration that
>    is needed for the tests to run - Christophe now have a very elegant patch
>    brewing. It makes the pktio_run etc much cleaner and make the tests a truly
>    independent library potentially,  with no hacks to get platform specifics
>    solved to run them.
>    - Helpers like the protocol headers are clearly used
>    by implementations and applications this should be allowed, but helpers
>    should be separated where they only support apps, examples and tests, thus
>    creating odp_workers is a different kind of helper.
>    - ODP != OS independence but tests need to be closer to that than we
>    have now unless we downplay the validation suite. I think with an OS
>    independent odp_wroker_create  + Christophes work we will hit the sweet
>    spot avoiding the hard work for non linux cases,  but leaving the door open
>    for bare-metal folks  to do what they need to.
>
>  Would love to have this discussion in next Tuesdays public call if we
> dont beat it ti death before then.
>
>
>
>
>
> On 16 April 2015 at 07:16, Savolainen, Petri (Nokia - FI/Espoo) <
> petri.savolainen@nokia.com> wrote:
>
>
>
> > -----Original Message-----
> > From: ext Benoît Ganne [mailto:bganne@kalray.eu]
> > Sent: Thursday, April 16, 2015 1:51 PM
> > To: Savolainen, Petri (Nokia - FI/Espoo); Taras Kondratiuk
> > Cc: lng-odp
> > Subject: Re: [lng-odp] [PATCH] api_test: remove odp_shm_test
> >
> > >> I think there is a grey area here: we say helpers are not part of ODP,
> > >> but we cannot compile ODP tests and examples w/o them. Can we really
> > >> consider an implementation to be ODP-compliant w/o those?
> >
> > > An implementation does not have to (should not) re-implement the
> > > odp/helper directory. It can be delivered as is (similar to odp/test
> > > or odp/example). Helpers can be thought as part of the test suite
> > > infrastructure, but pulled to the top level as definitions are
> > > generic enough.
> >
> > For example, tests and examples make heavy use of odph_linux_pthread_* .
> > This is a problem for eg. bare metal environment. I believe that Phil
> > proposed during the call to rename that "execution_unit" or something
> > similar exactly for this reason.
> > But then we also have the problem with odph_linux_process_*, especially
> > for our platform where we could have different images for different
> > process: some for Linux, some for bare metal. Bare metal images cannot
> > run under Linux and vice-versa.
> > If helpers are needed for examples and tests, I would argue they should
> > be as platform-neutral as possible and carefully defined. This is not a
> > problem for protocols headers, but it is for processes management.
> >
> > ben
>
> Some tests/examples (e.g. Ipsec) include also Linux/posix headers directly
> (so bare metal problems are not limited to odph_linux_*). And that's OK -
> we don't want ODP to become another OS. The software written under the ODP
> project may not be able support different bare metal targets, but leave
> that (validation) effort to individual vendors. In practice, test
> suite/examples depend on Linux now, and that may be the case in the future
> also (as conclusion of this discussion).
>
> The important thing is that the API does not depend on Linux/POSIX/etc -
> only on C99.
>
> -Petri
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
>
> --
>
> Mike Holmes
>
> Technical Manager - Linaro Networking Group
>
> Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
>
>
>
>
>
>
>
> --
>
> Mike Holmes
>
> Technical Manager - Linaro Networking Group
>
> Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
>
>
>
>
>
>
>
> --
>
> Mike Holmes
>
> Technical Manager - Linaro Networking Group
>
> Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
>
>
>
Maxim Uvarov April 21, 2015, 8:10 a.m. UTC | #13
Merged,
Maxim.

On 04/21/15 10:25, Savolainen, Petri (Nokia - FI/Espoo) wrote:
> Assuming that entire api_test directory will be removed next.
>
>
> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
>
>
>> -----Original Message-----
>> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of ext
>> Mike Holmes
>> Sent: Tuesday, April 14, 2015 11:00 PM
>> To: christophe.milard@linaro.org
>> Cc: lng-odp@lists.linaro.org
>> Subject: [lng-odp] [PATCH] api_test: remove odp_shm_test
>>
>> The shm test is obsolte, remove it
>>
>> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>> ---
>>   test/api_test/Makefile.am    |  6 +---
>>   test/api_test/odp_common.c   |  2 --
>>   test/api_test/odp_shm_test.c | 67 ---------------------------------------
>> -----
>>   test/api_test/odp_shm_test.h | 24 ----------------
>>   4 files changed, 1 insertion(+), 98 deletions(-)
>>   delete mode 100644 test/api_test/odp_shm_test.c
>>   delete mode 100644 test/api_test/odp_shm_test.h
>>
>> diff --git a/test/api_test/Makefile.am b/test/api_test/Makefile.am
>> index f231fee..ddbac53 100644
>> --- a/test/api_test/Makefile.am
>> +++ b/test/api_test/Makefile.am
>> @@ -1,17 +1,13 @@
>>   include $(top_srcdir)/test/Makefile.inc
>>
>> -bin_PROGRAMS = odp_shm odp_ring
>> +bin_PROGRAMS = odp_ring
>>
>> -odp_shm_CFLAGS = $(AM_CFLAGS)
>>   odp_ring_CFLAGS = $(AM_CFLAGS)
>>
>> -odp_shm_LDFLAGS = $(AM_LDFLAGS) -static
>>   odp_ring_LDFLAGS = $(AM_LDFLAGS) -static
>>
>>   noinst_HEADERS = \
>>   		  $(top_srcdir)/test/api_test/odp_common.h \
>> -		  $(top_srcdir)/test/api_test/odp_shm_test.h \
>>   		  $(top_srcdir)/test/test_debug.h
>>
>> -dist_odp_shm_SOURCES = odp_shm_test.c odp_common.c
>>   dist_odp_ring_SOURCES = odp_ring_test.c odp_common.c
>> diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c
>> index 18b365e..0677f9b 100644
>> --- a/test/api_test/odp_common.c
>> +++ b/test/api_test/odp_common.c
>> @@ -14,7 +14,6 @@
>>   #include <odp.h>
>>   #include <odp/helper/linux.h>
>>   #include <odp_common.h>
>> -#include <odp_shm_test.h>
>>   #include <test_debug.h>
>>
>>   #define MAX_WORKERS           32            /**< Max worker threads */
>> @@ -22,7 +21,6 @@
>>   /* Globals */
>>   static odph_linux_pthread_t thread_tbl[MAX_WORKERS]; /**< worker threads
>> table*/
>>   static int num_workers;				    /**< number of workers
>> 	*/
>> -__thread test_shared_data_t *test_shared_data;	    /**< pointer to shared
>> data */
>>
>>   /**
>>    * Print system information
>> diff --git a/test/api_test/odp_shm_test.c b/test/api_test/odp_shm_test.c
>> deleted file mode 100644
>> index 13d037d..0000000
>> --- a/test/api_test/odp_shm_test.c
>> +++ /dev/null
>> @@ -1,67 +0,0 @@
>> -/* Copyright (c) 2013, Linaro Limited
>> - * All rights reserved.
>> - *
>> - * SPDX-License-Identifier:     BSD-3-Clause
>> - */
>> -
>> -/**
>> - * @file
>> - *
>> - * ODP test shared memory
>> - */
>> -
>> -#include <string.h>
>> -#include <odp.h>
>> -#include <odp_common.h>
>> -#include <odp_shm_test.h>
>> -#include <test_debug.h>
>> -
>> -static void *run_thread(void *arg)
>> -{
>> -	pthrd_arg *parg = (pthrd_arg *)arg;
>> -	int thr;
>> -	odp_shm_t shm;
>> -
>> -	thr = odp_thread_id();
>> -
>> -	printf("Thread %i starts\n", thr);
>> -
>> -	switch (parg->testcase) {
>> -	case ODP_SHM_TEST:
>> -		shm = odp_shm_lookup("test_shared_data");
>> -		test_shared_data = odp_shm_addr(shm);
>> -		printf("  [%i] shared data at %p\n", thr, test_shared_data);
>> -		break;
>> -	default:
>> -		LOG_ERR("Invalid test case [%d]\n", parg->testcase);
>> -	}
>> -	fflush(stdout);
>> -
>> -	return parg;
>> -}
>> -
>> -int main(int argc __attribute__((__unused__)),
>> -	 char *argv[] __attribute__((__unused__)))
>> -{
>> -	pthrd_arg thrdarg;
>> -	odp_shm_t shm;
>> -
>> -	if (odp_test_global_init() != 0)
>> -		return -1;
>> -
>> -	odp_print_system_info();
>> -
>> -	shm = odp_shm_reserve("test_shared_data",
>> -			      sizeof(test_shared_data_t), 128, 0);
>> -	test_shared_data = odp_shm_addr(shm);
>> -	memset(test_shared_data, 0, sizeof(test_shared_data_t));
>> -	printf("test shared data at %p\n\n", test_shared_data);
>> -
>> -	thrdarg.testcase = ODP_SHM_TEST;
>> -	thrdarg.numthrds = odp_cpu_count();
>> -	odp_test_thread_create(run_thread, &thrdarg);
>> -
>> -	odp_test_thread_exit(&thrdarg);
>> -
>> -	return 0;
>> -}
>> diff --git a/test/api_test/odp_shm_test.h b/test/api_test/odp_shm_test.h
>> deleted file mode 100644
>> index 3b3f49b..0000000
>> --- a/test/api_test/odp_shm_test.h
>> +++ /dev/null
>> @@ -1,24 +0,0 @@
>> -/* Copyright (c) 2013, Linaro Limited
>> - * All rights reserved.
>> - *
>> - * SPDX-License-Identifier:     BSD-3-Clause
>> - */
>> -
>> -/**
>> - * @file
>> - *
>> - * ODP api test shared memory header
>> - */
>> -
>> -#ifndef ODP_SHM_TEST_H
>> -#define ODP_SHM_TEST_H
>> -
>> -typedef struct {
>> -	int foo;
>> -	int bar;
>> -} test_shared_data_t;
>> -
>> -extern __thread test_shared_data_t *test_shared_data;
>> -extern int test_shm(void);
>> -
>> -#endif /* ODP_SHM_TEST_H */
>> --
>> 2.1.0
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/test/api_test/Makefile.am b/test/api_test/Makefile.am
index f231fee..ddbac53 100644
--- a/test/api_test/Makefile.am
+++ b/test/api_test/Makefile.am
@@ -1,17 +1,13 @@ 
 include $(top_srcdir)/test/Makefile.inc
 
-bin_PROGRAMS = odp_shm odp_ring
+bin_PROGRAMS = odp_ring
 
-odp_shm_CFLAGS = $(AM_CFLAGS)
 odp_ring_CFLAGS = $(AM_CFLAGS)
 
-odp_shm_LDFLAGS = $(AM_LDFLAGS) -static
 odp_ring_LDFLAGS = $(AM_LDFLAGS) -static
 
 noinst_HEADERS = \
 		  $(top_srcdir)/test/api_test/odp_common.h \
-		  $(top_srcdir)/test/api_test/odp_shm_test.h \
 		  $(top_srcdir)/test/test_debug.h
 
-dist_odp_shm_SOURCES = odp_shm_test.c odp_common.c
 dist_odp_ring_SOURCES = odp_ring_test.c odp_common.c
diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c
index 18b365e..0677f9b 100644
--- a/test/api_test/odp_common.c
+++ b/test/api_test/odp_common.c
@@ -14,7 +14,6 @@ 
 #include <odp.h>
 #include <odp/helper/linux.h>
 #include <odp_common.h>
-#include <odp_shm_test.h>
 #include <test_debug.h>
 
 #define MAX_WORKERS           32            /**< Max worker threads */
@@ -22,7 +21,6 @@ 
 /* Globals */
 static odph_linux_pthread_t thread_tbl[MAX_WORKERS]; /**< worker threads table*/
 static int num_workers;				    /**< number of workers 	*/
-__thread test_shared_data_t *test_shared_data;	    /**< pointer to shared data */
 
 /**
  * Print system information
diff --git a/test/api_test/odp_shm_test.c b/test/api_test/odp_shm_test.c
deleted file mode 100644
index 13d037d..0000000
--- a/test/api_test/odp_shm_test.c
+++ /dev/null
@@ -1,67 +0,0 @@ 
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier:     BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP test shared memory
- */
-
-#include <string.h>
-#include <odp.h>
-#include <odp_common.h>
-#include <odp_shm_test.h>
-#include <test_debug.h>
-
-static void *run_thread(void *arg)
-{
-	pthrd_arg *parg = (pthrd_arg *)arg;
-	int thr;
-	odp_shm_t shm;
-
-	thr = odp_thread_id();
-
-	printf("Thread %i starts\n", thr);
-
-	switch (parg->testcase) {
-	case ODP_SHM_TEST:
-		shm = odp_shm_lookup("test_shared_data");
-		test_shared_data = odp_shm_addr(shm);
-		printf("  [%i] shared data at %p\n", thr, test_shared_data);
-		break;
-	default:
-		LOG_ERR("Invalid test case [%d]\n", parg->testcase);
-	}
-	fflush(stdout);
-
-	return parg;
-}
-
-int main(int argc __attribute__((__unused__)),
-	 char *argv[] __attribute__((__unused__)))
-{
-	pthrd_arg thrdarg;
-	odp_shm_t shm;
-
-	if (odp_test_global_init() != 0)
-		return -1;
-
-	odp_print_system_info();
-
-	shm = odp_shm_reserve("test_shared_data",
-			      sizeof(test_shared_data_t), 128, 0);
-	test_shared_data = odp_shm_addr(shm);
-	memset(test_shared_data, 0, sizeof(test_shared_data_t));
-	printf("test shared data at %p\n\n", test_shared_data);
-
-	thrdarg.testcase = ODP_SHM_TEST;
-	thrdarg.numthrds = odp_cpu_count();
-	odp_test_thread_create(run_thread, &thrdarg);
-
-	odp_test_thread_exit(&thrdarg);
-
-	return 0;
-}
diff --git a/test/api_test/odp_shm_test.h b/test/api_test/odp_shm_test.h
deleted file mode 100644
index 3b3f49b..0000000
--- a/test/api_test/odp_shm_test.h
+++ /dev/null
@@ -1,24 +0,0 @@ 
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier:     BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP api test shared memory header
- */
-
-#ifndef ODP_SHM_TEST_H
-#define ODP_SHM_TEST_H
-
-typedef struct {
-	int foo;
-	int bar;
-} test_shared_data_t;
-
-extern __thread test_shared_data_t *test_shared_data;
-extern int test_shm(void);
-
-#endif /* ODP_SHM_TEST_H */