[lng-odp] [Bug 301] broken queue in odp_pktio.c example

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

--- Comment #6 from Maxim Uvarov maxim.uva...@linaro.org ---
ok, will create new patch specially for that bug.

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


[lng-odp] [PATCH] example: odp_packet uncomment polling queues

2015-02-16 Thread Maxim Uvarov
odp_packet examples has polling queues commented out with if 1.
Input queue (ODP_QUEUE_TYPE_PKTIN) is not attached to scheduler
but it make sense in example show that packets can be accessed
with polling queues also.
https://bugs.linaro.org/show_bug.cgi?id=301

Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
---
 example/packet/odp_pktio.c | 75 +-
 1 file changed, 55 insertions(+), 20 deletions(-)

diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
index 5eec796..537bb8a 100644
--- a/example/packet/odp_pktio.c
+++ b/example/packet/odp_pktio.c
@@ -52,6 +52,11 @@
  */
 #define APPL_MODE_PKT_QUEUE1
 
+/** @def APPL_MODE_PKT_SHED
+ * @brief The application will handle packets with sheduler
+ */
+#define APPL_MODE_PKT_SCHED2
+
 /** @def PRINT_APPL_MODE(x)
  * @brief Macro to print the current status of how the application handles
  * packets.
@@ -113,13 +118,22 @@ static odp_pktio_t create_pktio(const char *dev, 
odp_pool_t pool, int mode)
if (pktio == ODP_PKTIO_INVALID)
EXAMPLE_ABORT(Error: pktio create failed for %s\n, dev);
 
-   /* no further setup needed for burst mode */
-   if (mode == APPL_MODE_PKT_BURST)
+   switch (mode) {
+   case  APPL_MODE_PKT_BURST:
+   /* no further setup needed for burst mode */
return pktio;
+   case APPL_MODE_PKT_QUEUE:
+   qparam.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
+   qparam.sched.sync  = ODP_SCHED_SYNC_NONE;
+   qparam.sched.group = ODP_SCHED_GROUP_DEFAULT;
+   break;
+   case APPL_MODE_PKT_SCHED:
+   qparam.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
+   qparam.sched.sync  = ODP_SCHED_SYNC_ATOMIC;
+   qparam.sched.group = ODP_SCHED_GROUP_DEFAULT;
+   break;
+   }
 
-   qparam.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
-   qparam.sched.sync  = ODP_SCHED_SYNC_ATOMIC;
-   qparam.sched.group = ODP_SCHED_GROUP_DEFAULT;
snprintf(inq_name, sizeof(inq_name), % PRIu64 -pktio_inq_def,
 odp_pktio_to_u64(pktio));
inq_name[ODP_QUEUE_NAME_LEN - 1] = '\0';
@@ -177,17 +191,20 @@ static void *pktio_queue_thread(void *arg)
for (;;) {
odp_pktio_t pktio_tmp;
 
-#if 1
-   /* Use schedule to get buf from any input queue */
-   ev = odp_schedule(NULL, ODP_SCHED_WAIT);
-#else
-   /* Always dequeue from the same input queue */
-   buf = odp_queue_deq(inq_def);
-   if (!odp_buffer_is_valid(buf))
-   continue;
-#endif
-
-   pkt = odp_packet_from_event(ev);
+   switch (thr_args-mode) {
+   case APPL_MODE_PKT_QUEUE:
+   /* Always dequeue from the same input queue */
+   ev = odp_queue_deq(odp_pktio_inq_getdef(pktio));
+   pkt = odp_packet_from_event(ev);
+   if (!odp_packet_is_valid(pkt))
+   continue;
+   break;
+   case APPL_MODE_PKT_SCHED:
+   /* Use schedule to get buf from any input queue */
+   ev = odp_schedule(NULL, ODP_SCHED_WAIT);
+   pkt = odp_packet_from_event(ev);
+   break;
+   }
 
/* Drop packets with errors */
if (odp_unlikely(drop_err_pkts(pkt, 1) == 0)) {
@@ -544,10 +561,20 @@ static void parse_args(int argc, char *argv[], 
appl_args_t *appl_args)
 
case 'm':
i = atoi(optarg);
-   if (i == 0)
+   switch (i) {
+   case 0:
appl_args-mode = APPL_MODE_PKT_BURST;
-   else
+   break;
+   case 1:
appl_args-mode = APPL_MODE_PKT_QUEUE;
+   break;
+   case 2:
+   appl_args-mode = APPL_MODE_PKT_SCHED;
+   break;
+   default:
+   usage(argv[0]);
+   exit(EXIT_SUCCESS);
+   }
break;
case 'h':
usage(argv[0]);
@@ -595,10 +622,17 @@ static void print_info(char *progname, appl_args_t 
*appl_args)
printf( %s, appl_args-if_names[i]);
printf(\n
   Mode:);
-   if (appl_args-mode == APPL_MODE_PKT_BURST)
+   switch (appl_args-mode) {
+   case APPL_MODE_PKT_BURST:
PRINT_APPL_MODE(APPL_MODE_PKT_BURST);
-   else
+   break;
+   case APPL_MODE_PKT_QUEUE:
PRINT_APPL_MODE(APPL_MODE_PKT_QUEUE);
+   break;
+   case 

[lng-odp] [PATCH 1/2] linux-generic: handle copy error in odp_crypto_operation

2015-02-16 Thread Maxim Uvarov
In _odp_packet_copy_to_packet copying of packet can fail,
with check for enought room in the packet. That may happen due
to allocation error or possible memory corruption. Just call
ODP_ABORT here.

https://bugs.linaro.org/show_bug.cgi?id=1054
CID 85004:  Unchecked return value  (CHECKED_RETURN)
Calling _odp_packet_copy_to_packet without checking return value
(as is done elsewhere 5 out of 6 times).

Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
---
 platform/linux-generic/odp_crypto.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/platform/linux-generic/odp_crypto.c 
b/platform/linux-generic/odp_crypto.c
index bc0f961..fb1e3fc 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -355,6 +355,7 @@ odp_crypto_operation(odp_crypto_op_params_t *params,
enum crypto_alg_err rc_auth = ODP_CRYPTO_ALG_ERR_NONE;
odp_crypto_generic_session_t *session;
odp_crypto_op_result_t local_result;
+   int ret;
 
session = (odp_crypto_generic_session_t *)(intptr_t)params-session;
 
@@ -367,8 +368,13 @@ odp_crypto_operation(odp_crypto_op_params_t *params,
if (params-pkt != params-out_pkt) {
if (odp_unlikely(ODP_PACKET_INVALID == params-out_pkt))
ODP_ABORT();
-   _odp_packet_copy_to_packet(params-pkt, 0, params-out_pkt, 0,
-  odp_packet_len(params-pkt));
+   ret = _odp_packet_copy_to_packet(params-pkt,
+0,
+params-out_pkt,
+0,
+odp_packet_len(params-pkt));
+   if (odp_unlikely(ret))
+   ODP_ABORT();
_odp_packet_copy_md_to_packet(params-pkt, params-out_pkt);
odp_packet_free(params-pkt);
params-pkt = ODP_PACKET_INVALID;
-- 
1.8.5.1.163.gd7aced9


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


[lng-odp] [Bug 1216] odp_cpumask.c:87:10: error: comparison between signed and unsigned integer expressions

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

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

   What|Removed |Added

 Ever confirmed|0   |1
   Assignee|lng-odp@lists.linaro.org|maxim.uva...@linaro.org
 Status|UNCONFIRMED |IN_PROGRESS

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


[lng-odp] [Bug 1194] odp_version_api_str no long returns the version string

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

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

   What|Removed |Added

 Ever confirmed|0   |1
   Assignee|lng-odp@lists.linaro.org|maxim.uva...@linaro.org
 Status|UNCONFIRMED |IN_PROGRESS

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


[lng-odp] [Bug 1233] New: odp_scheduling.c:714:2: error: implicit declaration of function ‘clock_gettime’

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

Bug ID: 1233
   Summary: odp_scheduling.c:714:2: error: implicit declaration of
function ‘clock_gettime’
   Product: OpenDataPlane
   Version: 0.10
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: normal
  Priority: ---
 Component: Performance
  Assignee: lng-odp@lists.linaro.org
  Reporter: mike.hol...@linaro.org

make CFLAGS=-std=c99 clean all -k

make[2]: Entering directory '/home/mike/git/odp/test/performance'
  CC   odp_scheduling-odp_scheduling.o
odp_scheduling.c: In function ‘test_time’:
odp_scheduling.c:714:2: error: implicit declaration of function 
‘clock_gettime’
[-Werror=implicit-function-declaration]
  if (clock_gettime(CLOCK_MONOTONIC, tp2)) {
  ^
odp_scheduling.c:714:2: error: nested extern declaration of ‘clock_gettime’
[-Werror=nested-externs]
odp_scheduling.c:714:20: error: ‘CLOCK_MONOTONIC’ undeclared (first use in 
this
function)
  if (clock_gettime(CLOCK_MONOTONIC, tp2)) {
^
odp_scheduling.c:714:20: note: each undeclared identifier is reported only once
for each function it appears in
cc1: all warnings being treated as errors

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


[lng-odp] [Bug 1233] odp_scheduling.c:714:2: error: implicit declaration of function ‘clock_gettime’

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

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

   What|Removed |Added

   Assignee|lng-odp@lists.linaro.org|petri.savolai...@linaro.org

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


[lng-odp] [Bug 300] __Static_assert in linux generic is a C11 feature

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

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

   What|Removed |Added

 Resolution|--- |WONTFIX
 Status|CONFIRMED   |RESOLVED

--- Comment #5 from Mike Holmes mike.hol...@linaro.org ---
pedantic has not been adopted for the ODP build flags, this will not be fixed
at this time

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


[lng-odp] [Bug 301] broken queue in odp_pktio.c example

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

--- Comment #7 from Maxim Uvarov maxim.uva...@linaro.org ---
https://patches.linaro.org/44724/

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


[lng-odp] [Bug 1054] CID 85004 odp_pktio_lookup Unchecked return value

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

--- Comment #1 from Maxim Uvarov maxim.uva...@linaro.org ---
https://patches.linaro.org/44720/

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


[lng-odp] [Bug 1206] CID 86957: Uninitialized pointer read odp_init_log.c

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

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

   What|Removed |Added

 Status|UNCONFIRMED |IN_PROGRESS
 Ever confirmed|0   |1

--- Comment #1 from Mike Holmes mike.hol...@linaro.org ---
https://patches.linaro.org/44722/

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


Re: [lng-odp] [PATCH 1/2] validation: init: fix unitalized data in struct

2015-02-16 Thread Maxim Uvarov

On 02/16/2015 07:43 PM, Mike Holmes wrote:

struct odp_init_t init_data was not fully initalized.

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

Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
  test/validation/odp_init_log.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/test/validation/odp_init_log.c b/test/validation/odp_init_log.c
index 372d4f5..378d2bd 100644
--- a/test/validation/odp_init_log.c
+++ b/test/validation/odp_init_log.c
@@ -17,6 +17,7 @@ static void test_odp_init_global_replace_log(void)
int status;
struct odp_init_t init_data;
  
+	init_data.abort_fn = NULL;

init_data.log_fn = odp_init_log;
I thing memset(init_data, 0, sizeof(struct odp_init_t)) is better here 
in case if this struct will be extended later.


Maxim.

  
  	replacement_logging_used = 0;



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


[lng-odp] [PATCH 2/2] linux-generic: odp_crypto_operation merge 2 ifs

2015-02-16 Thread Maxim Uvarov
Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
---
 platform/linux-generic/odp_crypto.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/platform/linux-generic/odp_crypto.c 
b/platform/linux-generic/odp_crypto.c
index fb1e3fc..9bb887a 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -360,11 +360,10 @@ odp_crypto_operation(odp_crypto_op_params_t *params,
session = (odp_crypto_generic_session_t *)(intptr_t)params-session;
 
/* Resolve output buffer */
-   if (ODP_PACKET_INVALID == params-out_pkt)
-   if (ODP_POOL_INVALID != session-output_pool)
-   params-out_pkt =
-   odp_packet_alloc(session-output_pool,
-odp_packet_len(params-pkt));
+   if (ODP_PACKET_INVALID == params-out_pkt 
+   ODP_POOL_INVALID != session-output_pool)
+   params-out_pkt = odp_packet_alloc(session-output_pool,
+   odp_packet_len(params-pkt));
if (params-pkt != params-out_pkt) {
if (odp_unlikely(ODP_PACKET_INVALID == params-out_pkt))
ODP_ABORT();
-- 
1.8.5.1.163.gd7aced9


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


[lng-odp] [PATCH 2/2] validation: system: fix unterminated string

2015-02-16 Thread Mike Holmes
Calling strncpy with a maximum size argument of 128 bytes on destination
array version_string of size 128 bytes might leave the destination
string unterminated.

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

Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 test/validation/odp_system.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/validation/odp_system.c b/test/validation/odp_system.c
index 65f857a..94ee712 100644
--- a/test/validation/odp_system.c
+++ b/test/validation/odp_system.c
@@ -15,7 +15,8 @@ static void test_odp_version_numbers(void)
char version_string[128];
char *s = version_string;
 
-   strncpy(version_string, odp_version_api_str(), sizeof(version_string));
+   strncpy(version_string, odp_version_api_str(),
+   sizeof(version_string)-1);
 
while (*s) {
if (isdigit(*s) || (strncmp(s, ., 1) == 0)) {
-- 
2.1.0


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


Re: [lng-odp] [PATCH 2/2] validation: system: fix unterminated string

2015-02-16 Thread Maxim Uvarov

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

On 02/16/2015 07:43 PM, Mike Holmes wrote:

Calling strncpy with a maximum size argument of 128 bytes on destination
array version_string of size 128 bytes might leave the destination
string unterminated.

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

Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
  test/validation/odp_system.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/validation/odp_system.c b/test/validation/odp_system.c
index 65f857a..94ee712 100644
--- a/test/validation/odp_system.c
+++ b/test/validation/odp_system.c
@@ -15,7 +15,8 @@ static void test_odp_version_numbers(void)
char version_string[128];
char *s = version_string;
  
-	strncpy(version_string, odp_version_api_str(), sizeof(version_string));

+   strncpy(version_string, odp_version_api_str(),
+   sizeof(version_string)-1);
  
  	while (*s) {

if (isdigit(*s) || (strncmp(s, ., 1) == 0)) {



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


[lng-odp] [Bug 1045] odp_generator is not C99 compliant

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

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

   What|Removed |Added

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

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


[lng-odp] [PATCH v2 03/10] linux-generic: packet_io: add term_global

2015-02-16 Thread Mike Holmes
From: Yan Sonming yan.songm...@linaro.org

Signed-off-by: Yan Songming yan.songm...@linaro.org
Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 platform/linux-generic/include/odp_internal.h |  1 +
 platform/linux-generic/odp_init.c |  5 +
 platform/linux-generic/odp_packet_io.c| 20 
 3 files changed, 26 insertions(+)

diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index 430d2fb..0120c53 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -41,6 +41,7 @@ int odp_shm_init_local(void);
 int odp_buffer_pool_init_global(void);
 
 int odp_pktio_init_global(void);
+int odp_pktio_term_global(void);
 int odp_pktio_init_local(void);
 
 int odp_classification_init_global(void);
diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index 9c2f9e7..cdce239 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -86,6 +86,11 @@ int odp_term_global(void)
return -1;
}
 
+   if (odp_pktio_term_global()) {
+   ODP_ERR(ODP pktio term failed.\n);
+   return -1;
+   }
+
return 0;
 }
 
diff --git a/platform/linux-generic/odp_packet_io.c 
b/platform/linux-generic/odp_packet_io.c
index 559b230..ddd2342 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -79,6 +79,26 @@ int odp_pktio_init_global(void)
return 0;
 }
 
+int odp_pktio_term_global(void)
+{
+   odp_shm_t shm;
+   pktio_entry_t *pktio_entry;
+   int ret = 0;
+   int id;
+
+   for (id = 1; id = ODP_CONFIG_PKTIO_ENTRIES; ++id) {
+   pktio_entry = pktio_tbl-entries[id - 1];
+   odp_queue_destroy(pktio_entry-s.outq_default);
+   }
+
+   shm = odp_shm_lookup(odp_pktio_entries);
+   if (shm == ODP_SHM_INVALID)
+   return -1;
+   ret = odp_shm_free(shm);
+
+   return ret;
+}
+
 int odp_pktio_init_local(void)
 {
return 0;
-- 
2.1.0


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


[lng-odp] [PATCH v2 02/10] linux-generic: odp_crypto: add term_global

2015-02-16 Thread Mike Holmes
From: Yan Sonming yan.songm...@linaro.org

Signed-off-by: Yan Sonming yan.songm...@linaro.org
Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 platform/linux-generic/include/odp_internal.h |  1 +
 platform/linux-generic/odp_crypto.c   | 13 +
 platform/linux-generic/odp_init.c |  5 +
 3 files changed, 19 insertions(+)

diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index 40c040f..430d2fb 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -49,6 +49,7 @@ int odp_classification_term_global(void);
 int odp_queue_init_global(void);
 
 int odp_crypto_init_global(void);
+int odp_crypto_term_global(void);
 
 int odp_schedule_init_global(void);
 int odp_schedule_init_local(void);
diff --git a/platform/linux-generic/odp_crypto.c 
b/platform/linux-generic/odp_crypto.c
index bc0f961..3572678 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -447,6 +447,19 @@ odp_crypto_init_global(void)
return 0;
 }
 
+int odp_crypto_term_global(void)
+{
+   odp_shm_t shm;
+   int ret = 0;
+
+   shm = odp_shm_lookup(crypto_pool);
+   if (shm == ODP_SHM_INVALID)
+   return -1;
+   ret = odp_shm_free(shm);
+
+   return ret;
+}
+
 ssize_t
 odp_random_data(uint8_t *buf, ssize_t len, odp_bool_t use_entropy ODP_UNUSED)
 {
diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index 91f4ee7..9c2f9e7 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -81,6 +81,11 @@ int odp_term_global(void)
return -1;
}
 
+   if (odp_crypto_term_global()) {
+   ODP_ERR(ODP crypto term failed.\n);
+   return -1;
+   }
+
return 0;
 }
 
-- 
2.1.0


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


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

2015-02-16 Thread Mike Holmes
v2:
Addresses the only comment to replace
static const char shm_name[] 
with
const char SHM_DEFAULT_NAME[]

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

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

-- 
2.1.0


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


[lng-odp] [PATCH v2 05/10] linux-generic: queue: add term_global

2015-02-16 Thread Mike Holmes
From: Yan Sonming yan.songm...@linaro.org

Signed-off-by: Yan Songming yan.songm...@linaro.org
Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 platform/linux-generic/include/odp_internal.h |  1 +
 platform/linux-generic/odp_init.c |  5 +
 platform/linux-generic/odp_queue.c| 25 +
 3 files changed, 31 insertions(+)

diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index d244c75..202c914 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -48,6 +48,7 @@ int odp_classification_init_global(void);
 int odp_classification_term_global(void);
 
 int odp_queue_init_global(void);
+int odp_queue_term_global(void);
 
 int odp_crypto_init_global(void);
 int odp_crypto_term_global(void);
diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index 2788e46..93fdc2c 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -96,6 +96,11 @@ int odp_term_global(void)
return -1;
}
 
+   if (odp_queue_term_global()) {
+   ODP_ERR(ODP queue term failed.\n);
+   return -1;
+   }
+
return 0;
 }
 
diff --git a/platform/linux-generic/odp_queue.c 
b/platform/linux-generic/odp_queue.c
index 76bf4d7..0aa0e9c 100644
--- a/platform/linux-generic/odp_queue.c
+++ b/platform/linux-generic/odp_queue.c
@@ -128,6 +128,31 @@ int odp_queue_init_global(void)
return 0;
 }
 
+int odp_queue_term_global(void)
+{
+   odp_shm_t shm;
+   int ret = 0;
+   queue_entry_t *queue;
+   int i;
+
+   for (i = 0; i  ODP_CONFIG_QUEUES; i++) {
+   queue = queue_tbl-queue[i];
+   LOCK(queue-s.lock);
+   if (queue-s.status != QUEUE_STATUS_FREE) {
+   ODP_ERR(Not destroyed queue: %s\n, queue-s.name);
+   ret = -1;
+   }
+   UNLOCK(queue-s.lock);
+   }
+
+   shm = odp_shm_lookup(odp_queues);
+   if (shm == ODP_SHM_INVALID)
+   return -1;
+   ret = odp_shm_free(shm);
+
+   return ret;
+}
+
 odp_queue_type_t odp_queue_type(odp_queue_t handle)
 {
queue_entry_t *queue;
-- 
2.1.0


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


[lng-odp] [PATCH v2 08/10] linux-generic: shm: add term_global

2015-02-16 Thread Mike Holmes
From: Yan Sonming yan.songm...@linaro.org

Signed-off-by: Yan Songming yan.songm...@linaro.org
Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 platform/linux-generic/include/odp_internal.h | 1 +
 platform/linux-generic/odp_init.c | 5 +
 platform/linux-generic/odp_shared_memory.c| 8 
 3 files changed, 14 insertions(+)

diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index d0cd085..a7bb4a2 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -37,6 +37,7 @@ int odp_thread_term_local(void);
 int odp_thread_term_global(void);
 
 int odp_shm_init_global(void);
+int odp_shm_term_global(void);
 int odp_shm_init_local(void);
 
 int odp_buffer_pool_init_global(void);
diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index 9141b56..69569f1 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -111,6 +111,11 @@ int odp_term_global(void)
return -1;
}
 
+   if (odp_shm_term_global()) {
+   ODP_ERR(ODP shm term failed.\n);
+   return -1;
+   }
+
return 0;
 }
 
diff --git a/platform/linux-generic/odp_shared_memory.c 
b/platform/linux-generic/odp_shared_memory.c
index dbaec22..251bf97 100644
--- a/platform/linux-generic/odp_shared_memory.c
+++ b/platform/linux-generic/odp_shared_memory.c
@@ -96,6 +96,14 @@ int odp_shm_init_global(void)
return 0;
 }
 
+int odp_shm_term_global(void)
+{
+   int ret = 0;
+
+   ret = munmap(odp_shm_tbl, sizeof(odp_shm_table_t));
+   return ret;
+}
+
 
 int odp_shm_init_local(void)
 {
-- 
2.1.0


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


[lng-odp] [PATCH v2 09/10] linux-generic: schedule: add term_local

2015-02-16 Thread Mike Holmes
From: Yan Sonming yan.songm...@linaro.org

Signed-off-by: Yan Sonming yan.songm...@linaro.org
Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 platform/linux-generic/include/odp_internal.h | 1 +
 platform/linux-generic/odp_init.c | 5 +
 platform/linux-generic/odp_schedule.c | 6 ++
 3 files changed, 12 insertions(+)

diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index a7bb4a2..7f45a3e 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -59,6 +59,7 @@ int odp_crypto_term_global(void);
 int odp_schedule_init_global(void);
 int odp_schedule_term_global(void);
 int odp_schedule_init_local(void);
+int odp_schedule_term_local(void);
 
 int odp_timer_init_global(void);
 int odp_timer_disarm_all(void);
diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index 69569f1..732bd8f 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -146,5 +146,10 @@ int odp_init_local(void)
 
 int odp_term_local(void)
 {
+   if (odp_schedule_term_local()) {
+   ODP_ERR(ODP schedule local term failed.\n);
+   return -1;
+   }
+
return (odp_thread_term_local()  0) ? 1 : 0;
 }
diff --git a/platform/linux-generic/odp_schedule.c 
b/platform/linux-generic/odp_schedule.c
index be5149b..33bd6e2 100644
--- a/platform/linux-generic/odp_schedule.c
+++ b/platform/linux-generic/odp_schedule.c
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
+#include string.h
 #include odp/schedule.h
 #include odp_schedule_internal.h
 #include odp/align.h
@@ -188,6 +189,11 @@ int odp_schedule_init_local(void)
return 0;
 }
 
+int odp_schedule_term_local(void)
+{
+   memset(sched_local, 0, sizeof(sched_local_t));
+   return 0;
+}
 
 void odp_schedule_mask_set(odp_queue_t queue, int prio)
 {
-- 
2.1.0


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


[lng-odp] [PATCH v2 04/10] linux-generic: schedule: add term_global

2015-02-16 Thread Mike Holmes
From: Yan Sonming yan.songm...@linaro.org

Signed-off-by: Yan Sonming yan.songm...@linaro.org
Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 platform/linux-generic/include/odp_internal.h |  1 +
 platform/linux-generic/odp_init.c |  5 +
 platform/linux-generic/odp_schedule.c | 25 +
 3 files changed, 31 insertions(+)

diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index 0120c53..d244c75 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -53,6 +53,7 @@ int odp_crypto_init_global(void);
 int odp_crypto_term_global(void);
 
 int odp_schedule_init_global(void);
+int odp_schedule_term_global(void);
 int odp_schedule_init_local(void);
 
 int odp_timer_init_global(void);
diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index cdce239..2788e46 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -91,6 +91,11 @@ int odp_term_global(void)
return -1;
}
 
+   if (odp_schedule_term_global()) {
+   ODP_ERR(ODP schedule term failed.\n);
+   return -1;
+   }
+
return 0;
 }
 
diff --git a/platform/linux-generic/odp_schedule.c 
b/platform/linux-generic/odp_schedule.c
index 3427082..be5149b 100644
--- a/platform/linux-generic/odp_schedule.c
+++ b/platform/linux-generic/odp_schedule.c
@@ -144,6 +144,31 @@ int odp_schedule_init_global(void)
return 0;
 }
 
+int odp_schedule_term_global(void)
+{
+   odp_shm_t shm;
+   int ret = 0;
+   int i, j;
+
+   for (i = 0; i  ODP_CONFIG_SCHED_PRIOS; i++) {
+   for (j = 0; j  QUEUES_PER_PRIO; j++)
+   odp_queue_destroy(sched-pri_queue[i][j]);
+   }
+
+   if (odp_pool_destroy(sched-pool) != 0) {
+   ODP_ERR(Sched term: Pool destroy fail.\n);
+   return -1;
+   }
+
+   shm = odp_shm_lookup(odp_scheduler);
+   if (shm == ODP_SHM_INVALID) {
+   ODP_ERR(Sched term: Shm lookup fail.\n);
+   return -1;
+   }
+   ret = odp_shm_free(shm);
+
+   return ret;
+}
 
 int odp_schedule_init_local(void)
 {
-- 
2.1.0


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


[lng-odp] [PATCH v2 01/10] linux-generic: classification: add term_global

2015-02-16 Thread Mike Holmes
From: Yan Sonming yan.songm...@linaro.org

Signed-off-by: Yan Sonming yan.songm...@linaro.org
Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 platform/linux-generic/include/odp_internal.h |  1 +
 platform/linux-generic/odp_classification.c   | 25 +
 platform/linux-generic/odp_init.c |  6 +-
 3 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index cd1adeb..40c040f 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -44,6 +44,7 @@ int odp_pktio_init_global(void);
 int odp_pktio_init_local(void);
 
 int odp_classification_init_global(void);
+int odp_classification_term_global(void);
 
 int odp_queue_init_global(void);
 
diff --git a/platform/linux-generic/odp_classification.c 
b/platform/linux-generic/odp_classification.c
index a7344f8..7d9f73a 100644
--- a/platform/linux-generic/odp_classification.c
+++ b/platform/linux-generic/odp_classification.c
@@ -128,6 +128,31 @@ error:
return -1;
 }
 
+int odp_classification_term_global(void)
+{
+   odp_shm_t cos_shm;
+   odp_shm_t pmr_shm;
+   odp_shm_t pmr_set_shm;
+   int ret = 0;
+
+   cos_shm = odp_shm_lookup(shm_odp_cos_tbl);
+   if (cos_shm == ODP_SHM_INVALID)
+   return -1;
+   ret = odp_shm_free(cos_shm);
+
+   pmr_shm = odp_shm_lookup(shm_odp_pmr_tbl);
+   if (pmr_shm == ODP_SHM_INVALID)
+   return -1;
+   ret = odp_shm_free(pmr_shm);
+
+   pmr_set_shm = odp_shm_lookup(shm_odp_pmr_set_tbl);
+   if (pmr_set_shm == ODP_SHM_INVALID)
+   return -1;
+   ret = odp_shm_free(pmr_set_shm);
+
+   return ret;
+}
+
 odp_cos_t odp_cos_create(const char *name)
 {
int i;
diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index cd8dc46..91f4ee7 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -76,7 +76,11 @@ int odp_init_global(odp_init_t *params  ODP_UNUSED,
 
 int odp_term_global(void)
 {
-   ODP_UNIMPLEMENTED();
+   if (odp_classification_term_global()) {
+   ODP_ERR(ODP classificatio term failed.\n);
+   return -1;
+   }
+
return 0;
 }
 
-- 
2.1.0


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


Re: [lng-odp] [PATCH 06/10] linux-generic: buffer_pool: add term_global

2015-02-16 Thread Mike Holmes
V2 sent

On 2 February 2015 at 05:25, Maxim Uvarov maxim.uva...@linaro.org wrote:

 On 01/30/2015 05:46 AM, Mike Holmes wrote:

 From: Yan Sonming yan.songm...@linaro.org

 Signed-off-by: Yan Songming yan.songm...@linaro.org
 Signed-off-by: Mike Holmes mike.hol...@linaro.org
 ---
   platform/linux-generic/include/odp_internal.h |  1 +
   platform/linux-generic/odp_buffer_pool.c  | 31
 ++-
   platform/linux-generic/odp_init.c |  5 +
   3 files changed, 36 insertions(+), 1 deletion(-)

 diff --git a/platform/linux-generic/include/odp_internal.h
 b/platform/linux-generic/include/odp_internal.h
 index 4790481..cdd6a9b 100644
 --- a/platform/linux-generic/include/odp_internal.h
 +++ b/platform/linux-generic/include/odp_internal.h
 @@ -34,6 +34,7 @@ int odp_shm_init_global(void);
   int odp_shm_init_local(void);
 int odp_buffer_pool_init_global(void);
 +int odp_buffer_pool_term_global(void);
 int odp_pktio_init_global(void);
   int odp_pktio_term_global(void);
 diff --git a/platform/linux-generic/odp_buffer_pool.c
 b/platform/linux-generic/odp_buffer_pool.c
 index 3e13e6f..2634bff 100644
 --- a/platform/linux-generic/odp_buffer_pool.c
 +++ b/platform/linux-generic/odp_buffer_pool.c
 @@ -55,6 +55,7 @@ typedef struct pool_table_t {
 /* The pool table */
   static pool_table_t *pool_tbl;
 +static const char shm_name[] = odp_buffer_pools;


 const char SHM_DEFAULT_NAME[] is better here.


  /* Pool entry pointers (for inlining) */
   void *pool_entry_ptr[ODP_CONFIG_POOLS];
 @@ -67,7 +68,7 @@ int odp_buffer_pool_init_global(void)
 uint32_t i;
 odp_shm_t shm;
   - shm = odp_shm_reserve(odp_buffer_pools,
 +   shm = odp_shm_reserve(shm_name,
   sizeof(pool_table_t),
   sizeof(pool_entry_t), 0);
   @@ -95,6 +96,34 @@ int odp_buffer_pool_init_global(void)
 return 0;
   }
   +int odp_buffer_pool_term_global(void)
 +{
 +   odp_shm_t shm;
 +   int i;
 +   pool_entry_t *pool;
 +   int ret = 0;
 +
 +   for (i = 0; i  ODP_CONFIG_POOLS; i++) {
 +   pool = get_pool_entry(i);
 +
 +   POOL_LOCK(pool-s.lock);
 +   if (pool-s.pool_shm != ODP_SHM_INVALID) {
 +   ODP_ERR(Not destroyed pool: %s\n, pool-s.name
 );
 +   ret = -1;
 +   }
 +   POOL_UNLOCK(pool-s.lock);
 +   }
 +   if (ret)
 +   return ret;
 +
 +   shm = odp_shm_lookup(shm_name);
 +   if (shm == ODP_SHM_INVALID)
 +   return -1;
 +   ret = odp_shm_free(shm);
 +
 +   return ret;
 +}
 +
   /**
* Pool creation
*/
 diff --git a/platform/linux-generic/odp_init.c
 b/platform/linux-generic/odp_init.c
 index d381fd4..f5be742 100644
 --- a/platform/linux-generic/odp_init.c
 +++ b/platform/linux-generic/odp_init.c
 @@ -97,6 +97,11 @@ int odp_term_global(void)
 return -1;
 }
   + if (odp_buffer_pool_term_global()) {
 +   ODP_ERR(ODP buffer pool term failed.\n);
 +   return -1;
 +   }
 +
 return 0;
   }




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




-- 
*Mike Holmes*
Linaro  Sr Technical Manager
LNG - ODP
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 832] odp_term_global is unimplemented

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

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

   What|Removed |Added

   Assignee|taras.kondrat...@linaro.org |mike.hol...@linaro.org

--- Comment #2 from Mike Holmes mike.hol...@linaro.org ---
https://patches.linaro.org/44726/

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


Re: [lng-odp] [PATCH 4/6] linux-generic: remove header file garbage

2015-02-16 Thread Maxim Uvarov

On 02/16/2015 08:31 PM, Bill Fischofer wrote:

Why do we want to get rid of the C++ compatibility syntax here?


C files do not have it, it's only for .h

Maxim.



On Mon, Feb 16, 2015 at 7:43 PM, Taras Kondratiuk 
taras.kondrat...@linaro.org mailto:taras.kondrat...@linaro.org wrote:


On 02/11/2015 09:10 AM, Maxim Uvarov wrote:
 Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
mailto:maxim.uva...@linaro.org
 ---
  platform/linux-generic/odp_impl.c | 14 --
  1 file changed, 14 deletions(-)

 diff --git a/platform/linux-generic/odp_impl.c
b/platform/linux-generic/odp_impl.c
 index f0a582e..3ad7e53 100644
 --- a/platform/linux-generic/odp_impl.c
 +++ b/platform/linux-generic/odp_impl.c
 @@ -5,16 +5,6 @@
   */


 -/**
 - * @file
 - *
 - * ODP Implementation information
 - */
 -
 -#ifdef __cplusplus
 -extern C {
 -#endif
 -

Why this isn't a part of a first patch?

  #include odp/version.h

  #define  ODP_VERSION_IMPL 0
 @@ -24,7 +14,3 @@ const char *odp_version_impl_str(void)
  {
   return ODP_VERSION_IMPL_STR;
  }
 -
 -#ifdef __cplusplus
 -}
 -#endif



--
Taras Kondratiuk

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





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


[lng-odp] [PATCH] api: debug: fix clang _ODP_STATIC_ASSERT

2015-02-16 Thread Mike Holmes
Clang has its own definition of Static_assert

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

Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 include/odp/api/debug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/odp/api/debug.h b/include/odp/api/debug.h
index 5949680..660569f 100644
--- a/include/odp/api/debug.h
+++ b/include/odp/api/debug.h
@@ -22,7 +22,7 @@ extern C {
  *  @{
  */
 
-#ifdef __GNUC__
+#if defined(__GNUC__)  !defined(__clang__)
 
 
 #if __GNUC__  4 || (__GNUC__ == 4  (__GNUC_MINOR__  6))
-- 
2.1.0


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


[lng-odp] [Bug 1203] Clang build now fails with _ODP_STATIC_ASSERT

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

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

   What|Removed |Added

 Status|UNCONFIRMED |IN_PROGRESS
 Ever confirmed|0   |1

--- Comment #1 from Mike Holmes mike.hol...@linaro.org ---
https://patches.linaro.org/44725/

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


[lng-odp] [Bug 1203] Clang build now fails with _ODP_STATIC_ASSERT

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

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

   What|Removed |Added

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

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


[lng-odp] [Bug 779] ODP cannot be compiled with g++ out of the box

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

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

   What|Removed |Added

 Status|UNCONFIRMED |IN_PROGRESS
 Ever confirmed|0   |1

--- Comment #3 from Mike Holmes mike.hol...@linaro.org ---
Patches posted by Simon Kagstrom

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


[lng-odp] [PATCH v2 07/10] linux-generic: thread: add term_global

2015-02-16 Thread Mike Holmes
From: Yan Sonming yan.songm...@linaro.org

Signed-off-by: Yan Songming yan.songm...@linaro.org
Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 platform/linux-generic/include/odp_internal.h |  1 +
 platform/linux-generic/odp_init.c |  5 +
 platform/linux-generic/odp_thread.c   | 13 +
 3 files changed, 19 insertions(+)

diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index 59c65e2..d0cd085 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -34,6 +34,7 @@ int odp_system_info_init(void);
 int odp_thread_init_global(void);
 int odp_thread_init_local(void);
 int odp_thread_term_local(void);
+int odp_thread_term_global(void);
 
 int odp_shm_init_global(void);
 int odp_shm_init_local(void);
diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index 58faa59..9141b56 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -106,6 +106,11 @@ int odp_term_global(void)
return -1;
}
 
+   if (odp_thread_term_global()) {
+   ODP_ERR(ODP thread term failed.\n);
+   return -1;
+   }
+
return 0;
 }
 
diff --git a/platform/linux-generic/odp_thread.c 
b/platform/linux-generic/odp_thread.c
index f6c900b..1f483a1 100644
--- a/platform/linux-generic/odp_thread.c
+++ b/platform/linux-generic/odp_thread.c
@@ -65,6 +65,19 @@ int odp_thread_init_global(void)
return 0;
 }
 
+int odp_thread_term_global(void)
+{
+   odp_shm_t shm;
+   int ret = 0;
+
+   shm = odp_shm_lookup(odp_thread_globals);
+   if (shm == ODP_SHM_INVALID)
+   return -1;
+   ret = odp_shm_free(shm);
+
+   return ret;
+}
+
 
 static int thread_id(void)
 {
-- 
2.1.0


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


[lng-odp] [PATCH v2 06/10] linux-generic: buffer_pool: add term_global

2015-02-16 Thread Mike Holmes
From: Yan Sonming yan.songm...@linaro.org

Signed-off-by: Yan Songming yan.songm...@linaro.org
Signed-off-by: Mike Holmes mike.hol...@linaro.org
---
 platform/linux-generic/include/odp_internal.h |  1 +
 platform/linux-generic/odp_buffer_pool.c  | 31 ++-
 platform/linux-generic/odp_init.c |  5 +
 3 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index 202c914..59c65e2 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -39,6 +39,7 @@ int odp_shm_init_global(void);
 int odp_shm_init_local(void);
 
 int odp_buffer_pool_init_global(void);
+int odp_buffer_pool_term_global(void);
 
 int odp_pktio_init_global(void);
 int odp_pktio_term_global(void);
diff --git a/platform/linux-generic/odp_buffer_pool.c 
b/platform/linux-generic/odp_buffer_pool.c
index f8e35b4..bb384bc 100644
--- a/platform/linux-generic/odp_buffer_pool.c
+++ b/platform/linux-generic/odp_buffer_pool.c
@@ -55,6 +55,7 @@ typedef struct pool_table_t {
 
 /* The pool table */
 static pool_table_t *pool_tbl;
+static const char SHM_DEFAULT_NAME[] = odp_buffer_pools;
 
 /* Pool entry pointers (for inlining) */
 void *pool_entry_ptr[ODP_CONFIG_POOLS];
@@ -67,7 +68,7 @@ int odp_buffer_pool_init_global(void)
uint32_t i;
odp_shm_t shm;
 
-   shm = odp_shm_reserve(odp_buffer_pools,
+   shm = odp_shm_reserve(SHM_DEFAULT_NAME,
  sizeof(pool_table_t),
  sizeof(pool_entry_t), 0);
 
@@ -95,6 +96,34 @@ int odp_buffer_pool_init_global(void)
return 0;
 }
 
+int odp_buffer_pool_term_global(void)
+{
+   odp_shm_t shm;
+   int i;
+   pool_entry_t *pool;
+   int ret = 0;
+
+   for (i = 0; i  ODP_CONFIG_POOLS; i++) {
+   pool = get_pool_entry(i);
+
+   POOL_LOCK(pool-s.lock);
+   if (pool-s.pool_shm != ODP_SHM_INVALID) {
+   ODP_ERR(Not destroyed pool: %s\n, pool-s.name);
+   ret = -1;
+   }
+   POOL_UNLOCK(pool-s.lock);
+   }
+   if (ret)
+   return ret;
+
+   shm = odp_shm_lookup(SHM_DEFAULT_NAME);
+   if (shm == ODP_SHM_INVALID)
+   return -1;
+   ret = odp_shm_free(shm);
+
+   return ret;
+}
+
 /**
  * Pool creation
  */
diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index 93fdc2c..58faa59 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -101,6 +101,11 @@ int odp_term_global(void)
return -1;
}
 
+   if (odp_buffer_pool_term_global()) {
+   ODP_ERR(ODP buffer pool term failed.\n);
+   return -1;
+   }
+
return 0;
 }
 
-- 
2.1.0


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


[lng-odp] [Bug 832] odp_term_global is unimplemented

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

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

   What|Removed |Added

 Status|CONFIRMED   |IN_PROGRESS

--- Comment #1 from Mike Holmes mike.hol...@linaro.org ---
https://patches.linaro.org/44726/

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


[lng-odp] [Bug 831] odp_term_local is unimplemented

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

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

   What|Removed |Added

 Status|CONFIRMED   |IN_PROGRESS
   Assignee|taras.kondrat...@linaro.org |mike.hol...@linaro.org

--- Comment #1 from Mike Holmes mike.hol...@linaro.org ---
https://patches.linaro.org/44726/

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


Re: [lng-odp] [PATCH] linux-generic: setup_pktio_entry() null terminate pkio name

2015-02-16 Thread Mike Holmes
On 16 February 2015 at 10:27, Maxim Uvarov maxim.uva...@linaro.org wrote:

 Pktio code uses snprintf instead of strncpy for name copying.

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

 CID 85426:  Buffer not null terminated  (BUFFER_SIZE_WARNING)
 Calling strncpy with a maximum size argument of 16 bytes on
 destination array pktio_entry-s.name of size 16 bytes might
 leave the destination string unterminated.

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


Reviewed-by: Mike Holmes mike.hol...@linaro.org


 ---
  platform/linux-generic/odp_packet_io.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/platform/linux-generic/odp_packet_io.c
 b/platform/linux-generic/odp_packet_io.c
 index 559b230..c5d0569 100644
 --- a/platform/linux-generic/odp_packet_io.c
 +++ b/platform/linux-generic/odp_packet_io.c
 @@ -251,7 +251,7 @@ static odp_pktio_t setup_pktio_entry(const char *dev,
 odp_pool_t pool)
 id = ODP_PKTIO_INVALID;
 ODP_ERR(Unable to init any I/O type.\n);
 } else {
 -   strncpy(pktio_entry-s.name, dev, IFNAMSIZ);
 +   snprintf(pktio_entry-s.name, IFNAMSIZ, %s, dev);
 unlock_entry_classifier(pktio_entry);
 }

 --
 1.8.5.1.163.gd7aced9


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




-- 
*Mike Holmes*
Linaro  Sr Technical Manager
LNG - ODP
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1048] odp_timer test is not C99 compliant

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

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

   What|Removed |Added

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

--- Comment #3 from Mike Holmes mike.hol...@linaro.org ---
no longer present in 0.10

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


[lng-odp] [Bug 1117] CID 56899: Resource leak in examples

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

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

   What|Removed |Added

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

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


[lng-odp] [Bug 1117] CID 56899: Resource leak in examples

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

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

   What|Removed |Added

 CC||lng-odp@lists.linaro.org

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


Re: [lng-odp] ordered queues in linux-generic?

2015-02-16 Thread Venkatesh Vivekanandan
On 16 February 2015 at 16:03, Ola Liljedahl ola.liljed...@linaro.org
wrote:

 And what's the state of ordered queues in odp-dpdk?


Looks like it is not implemented in linux-generic yet. I don't see the code
atleast other than #define. So, it is not there in odp-dpdk as well.



 -- Ola

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

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


Re: [lng-odp] [Bug 300] __Static_assert in linux generic is a C11 feature

2015-02-16 Thread Simon Kågström
On 2015-02-16 18:19, bugzilla-dae...@bugs.linaro.org wrote:
 Mike Holmes mailto:mike.hol...@linaro.org changed bug 300
 https://bugs.linaro.org/show_bug.cgi?id=300
 What  Removed Added
 Resolution--- WONTFIX
 StatusCONFIRMED   RESOLVED
 
 *Comment # 5 https://bugs.linaro.org/show_bug.cgi?id=300#c5 on bug 300
 https://bugs.linaro.org/show_bug.cgi?id=300 from Mike Holmes
 mailto:mike.hol...@linaro.org *
 
 pedantic has not been adopted for the ODP build flags, this will not be fixed
 at this time

This is another thing which doesn't work when including ODP headers from
C++ code. A patch to fix it can be found below, but might not be what
you want to do.

// Simon

commit 6997dddc8658eee3de7a18de6a510365d2783253
Author: Simon Kagstrom simon.kagst...@netinsight.net
Date:   Tue Feb 17 08:08:04 2015 +0100

debug: Use static_assert(cond,msg) for C++ code

diff --git a/include/odp/api/debug.h b/include/odp/api/debug.h
index 5949680..cb9de64 100644
--- a/include/odp/api/debug.h
+++ b/include/odp/api/debug.h
@@ -14,8 +14,8 @@


 #ifdef __cplusplus
-extern C {
-#endif
+#define _ODP_STATIC_ASSERT(cond, msg)  static_assert(cond, msg)
+#else

 /** @addtogroup odp_ver_abt_log_dbg
  *  Macros that allows different messages.
@@ -50,9 +50,6 @@ extern C {
 /**
  * @}
  */
-
-#ifdef __cplusplus
-}
 #endif

 #endif

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


Re: [lng-odp] [PATCH 5/6] linux-generic: kill odp_impl.c

2015-02-16 Thread Maxim Uvarov

On 02/16/2015 02:45 PM, Taras Kondratiuk wrote:

On 02/11/2015 09:10 AM, Maxim Uvarov wrote:

Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
---
  platform/linux-generic/Makefile.am   |  1 -
  platform/linux-generic/odp_impl.c| 16 
  platform/linux-generic/odp_version.c |  8 
  3 files changed, 8 insertions(+), 17 deletions(-)
  delete mode 100644 platform/linux-generic/odp_impl.c

If odp_impl.c is removed, then why clean-up patches #1 and #4 are
needed?

The idea was to fix artifacts in #1 and #4 and here do just replacement 
of code chunks to different file.
For me it's match more clear when all this changes are in one patch: 
[PATCHv4] api: fix odp_version_api_str()


Now I'm very confusing what I have to do with that patch series. Should 
I merge some patches or simple fix extern C in

first one and resend?

Maxim.



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


[lng-odp] [PATCHv2 3/5] linux-generic: kill version_types.h

2015-02-16 Thread Maxim Uvarov
Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
---
 platform/linux-generic/Makefile.am |  3 +--
 .../linux-generic/include/odp/plat/version_types.h | 30 --
 platform/linux-generic/include/odp/version.h   | 13 +-
 platform/linux-generic/odp_version.c   |  2 +-
 4 files changed, 14 insertions(+), 34 deletions(-)
 delete mode 100644 platform/linux-generic/include/odp/plat/version_types.h

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 16adccc..f1580d5 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -61,8 +61,7 @@ odpplatinclude_HEADERS = \
  
$(top_srcdir)/platform/linux-generic/include/odp/plat/schedule_types.h \
  
$(top_srcdir)/platform/linux-generic/include/odp/plat/shared_memory_types.h \
  
$(top_srcdir)/platform/linux-generic/include/odp/plat/strong_types.h \
- 
$(top_srcdir)/platform/linux-generic/include/odp/plat/timer_types.h \
- 
$(top_srcdir)/platform/linux-generic/include/odp/plat/version_types.h
+ 
$(top_srcdir)/platform/linux-generic/include/odp/plat/timer_types.h
 
 odpapiincludedir= $(includedir)/odp/api
 odpapiinclude_HEADERS = \
diff --git a/platform/linux-generic/include/odp/plat/version_types.h 
b/platform/linux-generic/include/odp/plat/version_types.h
deleted file mode 100644
index e3327eb..000
--- a/platform/linux-generic/include/odp/plat/version_types.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (c) 2015, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef ODP_VERSION_TYPESH_
-#define ODP_VERSION_TYPESH_
-
-#ifdef __cplusplus
-extern C {
-#endif
-
-/** @internal Version string expand */
-#define ODP_VERSION_STR_EXPAND(x)  #x
-
-/** @internal Version to string */
-#define ODP_VERSION_TO_STR(x)  ODP_VERSION_STR_EXPAND(x)
-
-/** @internal API version string */
-#define ODP_VERSION_API_STR \
-ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) . \
-ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) . \
-ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/platform/linux-generic/include/odp/version.h 
b/platform/linux-generic/include/odp/version.h
index c98cb30..b5071e5 100644
--- a/platform/linux-generic/include/odp/version.h
+++ b/platform/linux-generic/include/odp/version.h
@@ -17,7 +17,18 @@
 extern C {
 #endif
 
-#include odp/plat/version_types.h
+/** @internal Version string expand */
+#define ODP_VERSION_STR_EXPAND(x)  #x
+
+/** @internal Version to string */
+#define ODP_VERSION_TO_STR(x)  ODP_VERSION_STR_EXPAND(x)
+
+/** @internal API version string */
+#define ODP_VERSION_API_STR \
+ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) . \
+ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) . \
+ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR)
+
 #include odp/api/version.h
 
 #ifdef __cplusplus
diff --git a/platform/linux-generic/odp_version.c 
b/platform/linux-generic/odp_version.c
index 0a57b5e..2a7cd6e 100644
--- a/platform/linux-generic/odp_version.c
+++ b/platform/linux-generic/odp_version.c
@@ -9,7 +9,7 @@
 #endif
 
 #include odp/api/version.h
-#include odp/plat/version_types.h
+#include odp/version.h
 
 const char *odp_version_api_str(void)
 {
-- 
1.8.5.1.163.gd7aced9


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


[lng-odp] [PATCHv2 5/5] linux-generic: move imp API number def to header file

2015-02-16 Thread Maxim Uvarov
Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
---
 platform/linux-generic/include/odp/version.h | 3 +++
 platform/linux-generic/odp_version.c | 3 ---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/platform/linux-generic/include/odp/version.h 
b/platform/linux-generic/include/odp/version.h
index b5071e5..8a95221 100644
--- a/platform/linux-generic/include/odp/version.h
+++ b/platform/linux-generic/include/odp/version.h
@@ -31,6 +31,9 @@ ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR)
 
 #include odp/api/version.h
 
+#define  ODP_VERSION_IMPL 0
+#define  ODP_VERSION_IMPL_STR ODP_VERSION_TO_STR(ODP_VERSION_IMPL)
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/platform/linux-generic/odp_version.c 
b/platform/linux-generic/odp_version.c
index d54580c..776f4da 100644
--- a/platform/linux-generic/odp_version.c
+++ b/platform/linux-generic/odp_version.c
@@ -16,9 +16,6 @@ const char *odp_version_api_str(void)
return ODP_VERSION_API_STR;
 }
 
-#define  ODP_VERSION_IMPL 0
-#define  ODP_VERSION_IMPL_STR ODP_VERSION_TO_STR(ODP_VERSION_IMPL)
-
 const char *odp_version_impl_str(void)
 {
return ODP_VERSION_IMPL_STR;
-- 
1.8.5.1.163.gd7aced9


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


[lng-odp] [PATCHv2 4/5] linux-generic: kill odp_impl.c

2015-02-16 Thread Maxim Uvarov
Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
---
 platform/linux-generic/Makefile.am   |  1 -
 platform/linux-generic/odp_impl.c| 15 ---
 platform/linux-generic/odp_version.c |  8 
 3 files changed, 8 insertions(+), 16 deletions(-)
 delete mode 100644 platform/linux-generic/odp_impl.c

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index f1580d5..b77b05b 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -143,7 +143,6 @@ __LIB__libodp_la_SOURCES = \
   odp_errno.c \
   odp_event.c \
   odp_init.c \
-  odp_impl.c \
   odp_linux.c \
   odp_packet.c \
   odp_packet_flags.c \
diff --git a/platform/linux-generic/odp_impl.c 
b/platform/linux-generic/odp_impl.c
deleted file mode 100644
index 39deb39..000
--- a/platform/linux-generic/odp_impl.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Copyright (c) 2014, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include odp/version.h
-
-#define  ODP_VERSION_IMPL 0
-#define  ODP_VERSION_IMPL_STR ODP_VERSION_TO_STR(ODP_VERSION_IMPL)
-
-const char *odp_version_impl_str(void)
-{
-   return ODP_VERSION_IMPL_STR;
-}
diff --git a/platform/linux-generic/odp_version.c 
b/platform/linux-generic/odp_version.c
index 2a7cd6e..d54580c 100644
--- a/platform/linux-generic/odp_version.c
+++ b/platform/linux-generic/odp_version.c
@@ -15,3 +15,11 @@ const char *odp_version_api_str(void)
 {
return ODP_VERSION_API_STR;
 }
+
+#define  ODP_VERSION_IMPL 0
+#define  ODP_VERSION_IMPL_STR ODP_VERSION_TO_STR(ODP_VERSION_IMPL)
+
+const char *odp_version_impl_str(void)
+{
+   return ODP_VERSION_IMPL_STR;
+}
-- 
1.8.5.1.163.gd7aced9


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


[lng-odp] [PATCHv2 2/5] linux-generic: move api version to c file

2015-02-16 Thread Maxim Uvarov
Api version is defined as non static. Move it to c file.

Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
---
 platform/linux-generic/Makefile.am   |  1 +
 platform/linux-generic/include/odp/version.h | 14 --
 platform/linux-generic/odp_version.c | 17 +
 3 files changed, 18 insertions(+), 14 deletions(-)
 create mode 100644 platform/linux-generic/odp_version.c

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index c24d59d..16adccc 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -161,4 +161,5 @@ __LIB__libodp_la_SOURCES = \
   odp_ticketlock.c \
   odp_time.c \
   odp_timer.c \
+  odp_version.c \
   odp_weak.c
diff --git a/platform/linux-generic/include/odp/version.h 
b/platform/linux-generic/include/odp/version.h
index f29320a..c98cb30 100644
--- a/platform/linux-generic/include/odp/version.h
+++ b/platform/linux-generic/include/odp/version.h
@@ -18,20 +18,6 @@ extern C {
 #endif
 
 #include odp/plat/version_types.h
-
-/** @ingroup odp_ver_abt_log_dbg
- *  @{
- */
-
-static inline const char *odp_version_api_str(void)
-{
-   return ODP_VERSION_API_STR;
-}
-
-/**
- * @}
- */
-
 #include odp/api/version.h
 
 #ifdef __cplusplus
diff --git a/platform/linux-generic/odp_version.c 
b/platform/linux-generic/odp_version.c
new file mode 100644
index 000..0a57b5e
--- /dev/null
+++ b/platform/linux-generic/odp_version.c
@@ -0,0 +1,17 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include odp/api/version.h
+#include odp/plat/version_types.h
+
+const char *odp_version_api_str(void)
+{
+   return ODP_VERSION_API_STR;
+}
-- 
1.8.5.1.163.gd7aced9


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


Re: [lng-odp] [PATCH 0/6] correction for odp_imp/api/verions

2015-02-16 Thread Maxim Uvarov

On 02/16/2015 04:07 PM, Taras Kondratiuk wrote:

On 02/16/2015 02:07 PM, Maxim Uvarov wrote:

On 02/16/2015 02:58 PM, Taras Kondratiuk wrote:

On 02/11/2015 09:09 AM, Maxim Uvarov wrote:

Patch 1 and 2 have to go before current tag. Others can go latter.


Maxim Uvarov (6):
linux-generic: imp.c: remove header defines from c file
linux-generic: move api version to c file
linux-generic: kill version_types.h
linux-generic: remove header file garbage
linux-generic: kill odp_impl.c
linux-generic: move imp API number def to header file

This series is confusing.
It is not clear from cover letter why is it needed.
Commit names or descriptions also doesn't help to understand this.

The series is split into too many patches which are logically
dependent. To understand what this series is doing one have to merge
patches in mind or apply them locally. Some patches seems to be
redundant. This looks like one logical change which can be one patch of
digestible size.


Taras, I sent before:
[PATCHv4] api: fix odp_version_api_str()

After that Anders said that he would like to see all changed sliced to
separate patches. So that I did that.

Hmm. I don't see Anders' reply on that patch.

There was discussion with me, Mike and Anders about splitting my patch 
on Connect. After that I sent spitted version of this patch.


Maxim.

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


[lng-odp] [PATCHv2 0/5] correction for odp_imp/api/versions

2015-02-16 Thread Maxim Uvarov
v2: in patch 1 remove extern C and doxygen file description from C file,
as Taras asked.


Maxim Uvarov (5):
  linux-generic: imp.c: remove header defines from c file
  linux-generic: move api version to c file
  linux-generic: kill version_types.h
  linux-generic: kill odp_impl.c
  linux-generic: move imp API number def to header file

 platform/linux-generic/Makefile.am |  5 ++--
 .../linux-generic/include/odp/plat/version_types.h | 30 ---
 platform/linux-generic/include/odp/version.h   | 24 +++
 platform/linux-generic/odp_impl.c  | 35 --
 platform/linux-generic/odp_version.c   | 22 ++
 5 files changed, 36 insertions(+), 80 deletions(-)
 delete mode 100644 platform/linux-generic/include/odp/plat/version_types.h
 delete mode 100644 platform/linux-generic/odp_impl.c
 create mode 100644 platform/linux-generic/odp_version.c

-- 
1.8.5.1.163.gd7aced9


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


Re: [lng-odp] [PATCH v3 1/3] api: pool: Added packet pool parameters

2015-02-16 Thread Maxim Uvarov

Merged,

Maxim.

On 02/13/2015 06:32 AM, Petri Savolainen wrote:

Completed odp_pool_param_t definition with packet pool parameters.

* seg_len
   Control number of packet data bytes that are stored in the first
   segment of a packet.

* num
   Define maximum number of packets (that are 'len' bytes or smaller).

* len
   Required packet length that the pool must provide 'num' packets

Signed-off-by: Petri Savolainen petri.savolai...@linaro.org
---
  include/odp/api/pool.h | 24 +++-
  1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/include/odp/api/pool.h b/include/odp/api/pool.h
index b8c0f2e..66dc70e 100644
--- a/include/odp/api/pool.h
+++ b/include/odp/api/pool.h
@@ -60,13 +60,27 @@ typedef struct odp_pool_param_t {
 of 8. */
uint32_t num;   /** Number of buffers in the pool */
} buf;
-/* Reserved for packet and timeout specific params
struct {
-   uint32_t seg_size;
-   uint32_t seg_align;
-   uint32_t num;
+   uint32_t seg_len;   /** Minimum number of packet data
+bytes that are stored in the
+first segment of a packet.
+The maximum value is defined by
+ODP_CONFIG_PACKET_SEG_LEN_MAX.
+Use 0 for default. */
+   uint32_t __res1;/* Keep struct identical to buf,
+  until implementation is fixed */
+   uint32_t num;   /** The number of packets that the
+pool must provide that are
+packet lenght 'len' bytes or
+smaller. */
+   uint32_t len;   /** Minimum packet length that the
+pool must provide 'num'
+packets. The number of packets
+may be less than 'num' when
+packets are larger than 'len'.
+Use 0 for default.
+*/
} pkt;
-*/
struct {
uint32_t __res1; /* Keep struct identical to buf, */
uint32_t __res2; /* until pool implementation is fixed*/



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


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

2015-02-16 Thread Maxim Uvarov

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

On Wed, 11 Feb 2015 06:47:35 +0300
Maxim Uvarov maxim.uva...@linaro.org wrote:


On 02/10/2015 10:37 PM, Mike Holmes wrote:

We want to delete the api_test  directory, its content should be a
validation or performance test as appropriate.
I think miscellaneous might be better for this type of tests,
presumably we may get some other corner case items giving

test/validation
test/performance
and
test/miscellaneous

so this looks good to me and I can make it part of CI if we move
the directory to test/miscellaneous

Yes, tests looks good and can be applied after that rework.

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

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

// Simon


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


Maxim.


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



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


Re: [lng-odp] [PATCH 0/6] correction for odp_imp/api/verions

2015-02-16 Thread Taras Kondratiuk
On 02/16/2015 02:07 PM, Maxim Uvarov wrote:
 On 02/16/2015 02:58 PM, Taras Kondratiuk wrote:
 On 02/11/2015 09:09 AM, Maxim Uvarov wrote:
 Patch 1 and 2 have to go before current tag. Others can go latter.


 Maxim Uvarov (6):
linux-generic: imp.c: remove header defines from c file
linux-generic: move api version to c file
linux-generic: kill version_types.h
linux-generic: remove header file garbage
linux-generic: kill odp_impl.c
linux-generic: move imp API number def to header file
 This series is confusing.
 It is not clear from cover letter why is it needed.
 Commit names or descriptions also doesn't help to understand this.

 The series is split into too many patches which are logically
 dependent. To understand what this series is doing one have to merge
 patches in mind or apply them locally. Some patches seems to be
 redundant. This looks like one logical change which can be one patch of
 digestible size.

 Taras, I sent before:
 [PATCHv4] api: fix odp_version_api_str()
 
 After that Anders said that he would like to see all changed sliced to 
 separate patches. So that I did that.

Hmm. I don't see Anders' reply on that patch.

-- 
Taras Kondratiuk

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


[lng-odp] [Bug 1023] odp_classification_datamodel.h:95:3: error: redefinition of typedef 'cos_t' is a C11 feature

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

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

   What|Removed |Added

  Component|General ODP API or  |Classification
   |linux-generic   |
   |implimentation  |
 CC||lng-odp@lists.linaro.org

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


Re: [lng-odp] [PATCH] linux-generic: pktio check for NULL entry

2015-02-16 Thread Maxim Uvarov
That patch was not reviewed.

Maxim.

On 2 February 2015 at 15:43, Maxim Uvarov maxim.uva...@linaro.org wrote:

 CID: 85427
 https://bugs.linaro.org/show_bug.cgi?id=1175
 get_pktio_entry() can return NULL entry then it can be derefenced
 inside is_free(entry).

 Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
 ---
  platform/linux-generic/include/odp_packet_io_internal.h | 8 ++--
  platform/linux-generic/odp_packet_io.c  | 2 +-
  2 files changed, 7 insertions(+), 3 deletions(-)

 diff --git a/platform/linux-generic/include/odp_packet_io_internal.h
 b/platform/linux-generic/include/odp_packet_io_internal.h
 index 488818c..2c766f0 100644
 --- a/platform/linux-generic/include/odp_packet_io_internal.h
 +++ b/platform/linux-generic/include/odp_packet_io_internal.h
 @@ -22,6 +22,7 @@ extern C {
  #include odp_packet_socket.h
  #include odp_classification_datamodel.h
  #include odp_align_internal.h
 +#include odp_debug_internal.h

  #include odp/config.h
  #include odp/hints.h
 @@ -67,10 +68,13 @@ extern void *pktio_entry_ptr[];

  static inline pktio_entry_t *get_pktio_entry(odp_pktio_t id)
  {
 -   if (odp_unlikely(id == ODP_PKTIO_INVALID ||
 -id  ODP_CONFIG_PKTIO_ENTRIES))
 +   if (odp_unlikely(id == ODP_PKTIO_INVALID))
 return NULL;

 +   if (odp_unlikely(id  ODP_CONFIG_PKTIO_ENTRIES))
 +   ODP_ABORT(pktio limit %d/%d exceed\n,
 + id, ODP_CONFIG_PKTIO_ENTRIES);
 +
 return pktio_entry_ptr[id - 1];
  }
  #ifdef __cplusplus
 diff --git a/platform/linux-generic/odp_packet_io.c
 b/platform/linux-generic/odp_packet_io.c
 index bdb690e..cfb8d00 100644
 --- a/platform/linux-generic/odp_packet_io.c
 +++ b/platform/linux-generic/odp_packet_io.c
 @@ -320,7 +320,7 @@ odp_pktio_t odp_pktio_lookup(const char *dev)

 for (i = 1; i = ODP_CONFIG_PKTIO_ENTRIES; ++i) {
 entry = get_pktio_entry(i);
 -   if (is_free(entry))
 +   if (!entry || is_free(entry))
 continue;

 lock_entry(entry);
 --
 1.8.5.1.163.gd7aced9


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


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

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

--- Comment #1 from Maxim Uvarov maxim.uva...@linaro.org ---
https://patches.linaro.org/44122/

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


[lng-odp] [PATCH] linux-generic: setup_pktio_entry() null terminate pkio name

2015-02-16 Thread Maxim Uvarov
Pktio code uses snprintf instead of strncpy for name copying.

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

CID 85426:  Buffer not null terminated  (BUFFER_SIZE_WARNING)
Calling strncpy with a maximum size argument of 16 bytes on
destination array pktio_entry-s.name of size 16 bytes might
leave the destination string unterminated.

Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
---
 platform/linux-generic/odp_packet_io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/platform/linux-generic/odp_packet_io.c 
b/platform/linux-generic/odp_packet_io.c
index 559b230..c5d0569 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -251,7 +251,7 @@ static odp_pktio_t setup_pktio_entry(const char *dev, 
odp_pool_t pool)
id = ODP_PKTIO_INVALID;
ODP_ERR(Unable to init any I/O type.\n);
} else {
-   strncpy(pktio_entry-s.name, dev, IFNAMSIZ);
+   snprintf(pktio_entry-s.name, IFNAMSIZ, %s, dev);
unlock_entry_classifier(pktio_entry);
}
 
-- 
1.8.5.1.163.gd7aced9


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


[lng-odp] [Bug 1055] CID 85426: setup_pktio_entry: Memory - illegal accesses

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

--- Comment #3 from Maxim Uvarov maxim.uva...@linaro.org ---
https://patches.linaro.org/44719/

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


[lng-odp] ordered queues in linux-generic?

2015-02-16 Thread Ola Liljedahl
And what's the state of ordered queues in odp-dpdk?

-- Ola

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


Re: [lng-odp] [PATCH 1/6] linux-generic: imp.c: remove header defines from c file

2015-02-16 Thread Taras Kondratiuk
On 02/11/2015 09:10 AM, Maxim Uvarov wrote:
 Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
 ---
  platform/linux-generic/odp_impl.c | 5 -
  1 file changed, 5 deletions(-)
 
 diff --git a/platform/linux-generic/odp_impl.c 
 b/platform/linux-generic/odp_impl.c
 index ca3224d..f0a582e 100644
 --- a/platform/linux-generic/odp_impl.c
 +++ b/platform/linux-generic/odp_impl.c
 @@ -11,9 +11,6 @@
   * ODP Implementation information
   */
  
 -#ifndef ODP_IMPL_H_
 -#define ODP_IMPL_H_
 -
  #ifdef __cplusplus
  extern C {
  #endif

extern C should be also removed.

 @@ -31,5 +28,3 @@ const char *odp_version_impl_str(void)
  #ifdef __cplusplus
  }
  #endif
 -
 -#endif
 


-- 
Taras Kondratiuk

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


Re: [lng-odp] [PATCH v3 3/3] api: config: Renamed ODP_CONFIG_PACKET_BUF_LEN_MIN

2015-02-16 Thread Ola Liljedahl
On 13 February 2015 at 04:32, Petri Savolainen
petri.savolai...@linaro.org wrote:
 Renamed ODP_CONFIG_PACKET_BUF_LEN_MIN to ODP_CONFIG_PACKET_SEG_LEN_MIN.
 The packet pool parameter pkt.seg_len is rounded up into this value.

 Added ODP_CONFIG_PACKET_SEG_LEN_MAX to define the maximum segment
 length supported by the implementation. This is the maximum valid
 value for pkt.seg_len.

 If ODP_CONFIG_PACKET_SEG_LEN_MIN equals _SEG_LEN_MAX, the
 implementation supports only one segment length value.
As I have voiced before, I think config.h is a weird beast. Is it an
output from the ODP implementation? Is it an input to the ODP
implementation should it be recompiled? Is it both? Which config items
can be changed by the user? Why are there references to linux-generic
in the current config.h?

When all of these questions arise, something is fishy.

Let's look ahead. ODP is installed as a development library (e.g. deb
package libodp-dev), possibly with a well-defined ABI. Applications
might be dynamically linked to some target-specific ODP
implementation. How does the application get to know about internal
limitations in the actual ODP implementation (e.g. max number of
shared memory segments or maximum packet size)? By calling an API at
run-time which returns the requested value. What happens if the
application requests something (e.g. too large segment or packet size)
which cannot be supported by the implementation? The relevant API
(e.g. create_pool) returns a well-defined error.

No need for elaborate computations in the application in order to
satisfy implementation specific limitations.

-- Ola


 Signed-off-by: Petri Savolainen petri.savolai...@linaro.org
 ---
  include/odp/api/config.h | 20 
 +++-
  platform/linux-generic/include/odp_buffer_internal.h | 12 ++--
  platform/linux-generic/odp_buffer_pool.c |  4 ++--
  test/validation/buffer/odp_packet_test.c |  2 +-
  4 files changed, 24 insertions(+), 14 deletions(-)

 diff --git a/include/odp/api/config.h b/include/odp/api/config.h
 index bd69b98..3ac9e2c 100644
 --- a/include/odp/api/config.h
 +++ b/include/odp/api/config.h
 @@ -92,9 +92,9 @@ extern C {
  /**
   * Minimum packet segment length
   *
 - * This defines the minimum packet segment length in bytes. The user defined
 - * buffer size (in odp_buffer_pool_param_t) in buffer pool creation will be
 - * rounded up into this value.
 + * This defines the minimum packet segment buffer length in bytes. The user
 + * defined segment length (seg_len in odp_pool_param_t) will be rounded up 
 into
 + * this value.
   *
   * @internal In linux-generic implementation:
   * - The value MUST be a multiple of 8.
 @@ -103,7 +103,17 @@ extern C {
   *   with the default headroom shown above and is a multiple of both 64 and 
 128,
   *   which are the most common cache line sizes.
   */
 -#define ODP_CONFIG_PACKET_BUF_LEN_MIN (1664)
 +#define ODP_CONFIG_PACKET_SEG_LEN_MIN (1664)
 +
 +/**
 + * Maximum packet segment length
 + *
 + * This defines the maximum packet segment buffer length in bytes. The user
 + * defined segment length (seg_len in odp_pool_param_t) must not be larger 
 than
 + * this.
 + *
 + */
 +#define ODP_CONFIG_PACKET_SEG_LEN_MAX ODP_CONFIG_PACKET_SEG_LEN_MIN

  /**
   * Maximum packet buffer length
 @@ -117,7 +127,7 @@ extern C {
   * - The value MUST be an integral number of segments
   * - The value SHOULD be large enough to accommodate jumbo packets (9K)
   */
 -#define ODP_CONFIG_PACKET_BUF_LEN_MAX (ODP_CONFIG_PACKET_BUF_LEN_MIN*6)
 +#define ODP_CONFIG_PACKET_BUF_LEN_MAX (ODP_CONFIG_PACKET_SEG_LEN_MIN*6)

  /**
   * @}
 diff --git a/platform/linux-generic/include/odp_buffer_internal.h 
 b/platform/linux-generic/include/odp_buffer_internal.h
 index f199e2e..c532e35 100644
 --- a/platform/linux-generic/include/odp_buffer_internal.h
 +++ b/platform/linux-generic/include/odp_buffer_internal.h
 @@ -50,18 +50,18 @@ extern C {
 ((x) = 65536 ? 16 : \
  (0/0)

 -_ODP_STATIC_ASSERT(ODP_CONFIG_PACKET_BUF_LEN_MIN = 256,
 - ODP Segment size must be a minimum of 256 bytes);
 +_ODP_STATIC_ASSERT(ODP_CONFIG_PACKET_SEG_LEN_MIN = 256,
 +  ODP Segment size must be a minimum of 256 bytes);

 -_ODP_STATIC_ASSERT((ODP_CONFIG_PACKET_BUF_LEN_MIN % ODP_CACHE_LINE_SIZE) == 
 0,
 - ODP Segment size must be a multiple of cache line size);
 +_ODP_STATIC_ASSERT((ODP_CONFIG_PACKET_SEG_LEN_MIN % ODP_CACHE_LINE_SIZE) == 
 0,
 +  ODP Segment size must be a multiple of cache line size);

  _ODP_STATIC_ASSERT((ODP_CONFIG_PACKET_BUF_LEN_MAX %
 -  ODP_CONFIG_PACKET_BUF_LEN_MIN) == 0,
 +  ODP_CONFIG_PACKET_SEG_LEN_MIN) == 0,
   Packet max size must be a multiple of segment size);

  #define ODP_BUFFER_MAX_SEG \
 -   (ODP_CONFIG_PACKET_BUF_LEN_MAX / ODP_CONFIG_PACKET_BUF_LEN_MIN)
 +   

Re: [lng-odp] Rename linux-generic to odp-linux?

2015-02-16 Thread Maxim Uvarov

On 02/13/2015 09:55 AM, Bill Fischofer wrote:
Now that we're elevating odp-dpdk to first-line support status, it 
seems we have an oddity in our naming convention for linux-generic.  
All other ODP implementations have a name of the form odp-platform.


linux-keystone2
linux-dpdk


With this pattern it seems a better name for linux-generic would be 
odp-linux, since this implementation targets linux itself as its 
platform.




No.

Any thoughts on this?  It we want to do this we should probably do the 
rename as part of the final packaging for v1.0.


Bill


No renaming is bad idea. It's always hard to follow history in git after 
renaming.


Maxim.




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



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


Re: [lng-odp] [PATCH 4/6] linux-generic: remove header file garbage

2015-02-16 Thread Taras Kondratiuk
On 02/11/2015 09:10 AM, Maxim Uvarov wrote:
 Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
 ---
  platform/linux-generic/odp_impl.c | 14 --
  1 file changed, 14 deletions(-)
 
 diff --git a/platform/linux-generic/odp_impl.c 
 b/platform/linux-generic/odp_impl.c
 index f0a582e..3ad7e53 100644
 --- a/platform/linux-generic/odp_impl.c
 +++ b/platform/linux-generic/odp_impl.c
 @@ -5,16 +5,6 @@
   */
  
  
 -/**
 - * @file
 - *
 - * ODP Implementation information
 - */
 -
 -#ifdef __cplusplus
 -extern C {
 -#endif
 -

Why this isn't a part of a first patch?

  #include odp/version.h
  
  #define  ODP_VERSION_IMPL 0
 @@ -24,7 +14,3 @@ const char *odp_version_impl_str(void)
  {
   return ODP_VERSION_IMPL_STR;
  }
 -
 -#ifdef __cplusplus
 -}
 -#endif
 


-- 
Taras Kondratiuk

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


Re: [lng-odp] [PATCH 5/6] linux-generic: kill odp_impl.c

2015-02-16 Thread Taras Kondratiuk
On 02/11/2015 09:10 AM, Maxim Uvarov wrote:
 Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
 ---
  platform/linux-generic/Makefile.am   |  1 -
  platform/linux-generic/odp_impl.c| 16 
  platform/linux-generic/odp_version.c |  8 
  3 files changed, 8 insertions(+), 17 deletions(-)
  delete mode 100644 platform/linux-generic/odp_impl.c

If odp_impl.c is removed, then why clean-up patches #1 and #4 are
needed?

-- 
Taras Kondratiuk

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


Re: [lng-odp] [PATCH 6/6] linux-generic: move imp API number def to header file

2015-02-16 Thread Taras Kondratiuk
On 02/11/2015 09:10 AM, Maxim Uvarov wrote:
 Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
 ---
  platform/linux-generic/include/odp/version.h | 3 +++
  platform/linux-generic/odp_version.c | 3 ---
  2 files changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/platform/linux-generic/include/odp/version.h 
 b/platform/linux-generic/include/odp/version.h
 index b5071e5..8a95221 100644
 --- a/platform/linux-generic/include/odp/version.h
 +++ b/platform/linux-generic/include/odp/version.h
 @@ -31,6 +31,9 @@ ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR)
  
  #include odp/api/version.h
  
 +#define  ODP_VERSION_IMPL 0
 +#define  ODP_VERSION_IMPL_STR ODP_VERSION_TO_STR(ODP_VERSION_IMPL)
 +

These macros are not part of an ODP API. Why they are moved here?

  #ifdef __cplusplus
  }
  #endif
 diff --git a/platform/linux-generic/odp_version.c 
 b/platform/linux-generic/odp_version.c
 index d54580c..776f4da 100644
 --- a/platform/linux-generic/odp_version.c
 +++ b/platform/linux-generic/odp_version.c
 @@ -16,9 +16,6 @@ const char *odp_version_api_str(void)
   return ODP_VERSION_API_STR;
  }
  
 -#define  ODP_VERSION_IMPL 0
 -#define  ODP_VERSION_IMPL_STR ODP_VERSION_TO_STR(ODP_VERSION_IMPL)
 -
  const char *odp_version_impl_str(void)
  {
   return ODP_VERSION_IMPL_STR;
 


-- 
Taras Kondratiuk

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


Re: [lng-odp] [PATCH 1/6] linux-generic: imp.c: remove header defines from c file

2015-02-16 Thread Maxim Uvarov

On 02/16/2015 01:59 PM, Taras Kondratiuk wrote:

On 02/11/2015 09:10 AM, Maxim Uvarov wrote:

Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
---
  platform/linux-generic/odp_impl.c | 5 -
  1 file changed, 5 deletions(-)

diff --git a/platform/linux-generic/odp_impl.c 
b/platform/linux-generic/odp_impl.c
index ca3224d..f0a582e 100644
--- a/platform/linux-generic/odp_impl.c
+++ b/platform/linux-generic/odp_impl.c
@@ -11,9 +11,6 @@
   * ODP Implementation information
   */
  
-#ifndef ODP_IMPL_H_

-#define ODP_IMPL_H_
-
  #ifdef __cplusplus
  extern C {
  #endif

extern C should be also removed.


obviously, yes.  It was removed in fist patch which includes everything. 
Will do it here. Thanks.


Maxim.




@@ -31,5 +28,3 @@ const char *odp_version_impl_str(void)
  #ifdef __cplusplus
  }
  #endif
-
-#endif






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


Re: [lng-odp] [PATCH 0/6] correction for odp_imp/api/verions

2015-02-16 Thread Taras Kondratiuk
On 02/11/2015 09:09 AM, Maxim Uvarov wrote:
 Patch 1 and 2 have to go before current tag. Others can go latter.
 
 
 Maxim Uvarov (6):
   linux-generic: imp.c: remove header defines from c file
   linux-generic: move api version to c file
   linux-generic: kill version_types.h
   linux-generic: remove header file garbage
   linux-generic: kill odp_impl.c
   linux-generic: move imp API number def to header file

This series is confusing.
It is not clear from cover letter why is it needed.
Commit names or descriptions also doesn't help to understand this.

The series is split into too many patches which are logically
dependent. To understand what this series is doing one have to merge
patches in mind or apply them locally. Some patches seems to be
redundant. This looks like one logical change which can be one patch of
digestible size.

-- 
Taras Kondratiuk

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


Re: [lng-odp] [PATCH 6/6] linux-generic: move imp API number def to header file

2015-02-16 Thread Maxim Uvarov

On 02/16/2015 02:48 PM, Taras Kondratiuk wrote:

On 02/11/2015 09:10 AM, Maxim Uvarov wrote:

Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org
---
  platform/linux-generic/include/odp/version.h | 3 +++
  platform/linux-generic/odp_version.c | 3 ---
  2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/platform/linux-generic/include/odp/version.h 
b/platform/linux-generic/include/odp/version.h
index b5071e5..8a95221 100644
--- a/platform/linux-generic/include/odp/version.h
+++ b/platform/linux-generic/include/odp/version.h
@@ -31,6 +31,9 @@ ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR)
  
  #include odp/api/version.h
  
+#define  ODP_VERSION_IMPL 0

+#define  ODP_VERSION_IMPL_STR ODP_VERSION_TO_STR(ODP_VERSION_IMPL)
+

These macros are not part of an ODP API. Why they are moved here?


Right, it's not ODP API. It's platfrom/linux-generic.


Maxim.



  #ifdef __cplusplus
  }
  #endif
diff --git a/platform/linux-generic/odp_version.c 
b/platform/linux-generic/odp_version.c
index d54580c..776f4da 100644
--- a/platform/linux-generic/odp_version.c
+++ b/platform/linux-generic/odp_version.c
@@ -16,9 +16,6 @@ const char *odp_version_api_str(void)
return ODP_VERSION_API_STR;
  }
  
-#define  ODP_VERSION_IMPL 0

-#define  ODP_VERSION_IMPL_STR ODP_VERSION_TO_STR(ODP_VERSION_IMPL)
-
  const char *odp_version_impl_str(void)
  {
return ODP_VERSION_IMPL_STR;






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


Re: [lng-odp] [PATCH 0/6] correction for odp_imp/api/verions

2015-02-16 Thread Maxim Uvarov

On 02/16/2015 02:58 PM, Taras Kondratiuk wrote:

On 02/11/2015 09:09 AM, Maxim Uvarov wrote:

Patch 1 and 2 have to go before current tag. Others can go latter.


Maxim Uvarov (6):
   linux-generic: imp.c: remove header defines from c file
   linux-generic: move api version to c file
   linux-generic: kill version_types.h
   linux-generic: remove header file garbage
   linux-generic: kill odp_impl.c
   linux-generic: move imp API number def to header file

This series is confusing.
It is not clear from cover letter why is it needed.
Commit names or descriptions also doesn't help to understand this.

The series is split into too many patches which are logically
dependent. To understand what this series is doing one have to merge
patches in mind or apply them locally. Some patches seems to be
redundant. This looks like one logical change which can be one patch of
digestible size.


Taras, I sent before:
[PATCHv4] api: fix odp_version_api_str()

After that Anders said that he would like to see all changed sliced to 
separate patches. So that I did that.


Maxim.





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