[lng-odp] Mem pool creation in Cavium/NXP implementations

2017-06-14 Thread Honnappa Nagarahalli
Hi Bala/Nikhil,
I was wondering when is the memory pool created in your
implementation of ODP? The programming model is that the application
creates the memory pool and passes that pool to the pkt I/O during
packet I/O open call. Do you actually create the pool when the
application calls odp_pool_create? Or is the pool created during
packet I/O open?

Appreciate your answers.

Thank you,
Honnappa


Re: [lng-odp] [PATCH API-NEXT v1 4/4] travis: add scalable scheduler in CI

2017-06-14 Thread Honnappa Nagarahalli
This should be the only patch to review. Don't know why GitHub sent
other patches in this series.

On 14 June 2017 at 20:00, Github ODP bot  wrote:
> From: Honnappa Nagarahalli 
>
> Added running tests with scalable scheduler to CI
>
> Change-Id: I4c3c76098360accd665938b424f5d05dcb66493e
> Signed-off-by: Honnappa Nagarahalli 
> Reviewed-by: Brian Brooks 
> ---
> /** Email created from pull request 50 (nagarahalli:api-next-travis)
>  ** https://github.com/Linaro/odp/pull/50
>  ** Patch: https://github.com/Linaro/odp/pull/50.patch
>  ** Base sha: 4f97e500a097928e308a415c32a88465adc5f5cc
>  ** Merge commit sha: 95322c7b65a45928baf62cc6dd993c3a3bcdfe3a
>  **/
>  .travis.yml | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/.travis.yml b/.travis.yml
> index d1ca5a66..018ca972 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -61,6 +61,7 @@ env:
>  - CONF="--disable-abi-compat"
>  - CONF="--enable-schedule-sp"
>  - CONF="--enable-schedule-iquery"
> +- CONF="--enable-schedule-scalable"
>
>  install:
>  - echo 1000 | sudo tee /proc/sys/vm/nr_hugepages
>


[lng-odp] [PATCH API-NEXT v1 2/4] linux-gen: packet: fix gcc errors with single segment pool

2017-06-14 Thread Github ODP bot
From: Matias Elo 

Fix (invalid) gcc errors when CONFIG_PACKET_MAX_SEGS is set to one.
https://bugs.linaro.org/show_bug.cgi?id=3013

Signed-off-by: Matias Elo 
Reviewed-and-tested-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 50 (nagarahalli:api-next-travis)
 ** https://github.com/Linaro/odp/pull/50
 ** Patch: https://github.com/Linaro/odp/pull/50.patch
 ** Base sha: 4f97e500a097928e308a415c32a88465adc5f5cc
 ** Merge commit sha: 95322c7b65a45928baf62cc6dd993c3a3bcdfe3a
 **/
 platform/linux-generic/odp_packet.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/platform/linux-generic/odp_packet.c 
b/platform/linux-generic/odp_packet.c
index 01a82854..eb66af2d 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -791,7 +791,8 @@ static inline int move_data_to_head(odp_packet_hdr_t 
*pkt_hdr, int segs)
 
free_len = BASE_LEN - len;
 
-   for (src_seg = dst_seg + 1; src_seg < segs; src_seg++) {
+   for (src_seg = dst_seg + 1; CONFIG_PACKET_MAX_SEGS > 1 &&
+src_seg < segs; src_seg++) {
len = fill_seg_head(pkt_hdr, dst_seg, src_seg,
free_len);
moved += len;
@@ -915,7 +916,7 @@ int odp_packet_extend_head(odp_packet_t *pkt, uint32_t len,
 
pkt_hdr = new_hdr;
*pkt= packet_handle(pkt_hdr);
-   } else if (free_segs) {
+   } else if (CONFIG_PACKET_MAX_SEGS > 1 && free_segs) {
new_hdr = pkt_hdr->buf_hdr.seg[free_segs].hdr;
packet_seg_copy_md(new_hdr, pkt_hdr);
 



[lng-odp] [PATCH API-NEXT v1 4/4] travis: add scalable scheduler in CI

2017-06-14 Thread Github ODP bot
From: Honnappa Nagarahalli 

Added running tests with scalable scheduler to CI

Change-Id: I4c3c76098360accd665938b424f5d05dcb66493e
Signed-off-by: Honnappa Nagarahalli 
Reviewed-by: Brian Brooks 
---
/** Email created from pull request 50 (nagarahalli:api-next-travis)
 ** https://github.com/Linaro/odp/pull/50
 ** Patch: https://github.com/Linaro/odp/pull/50.patch
 ** Base sha: 4f97e500a097928e308a415c32a88465adc5f5cc
 ** Merge commit sha: 95322c7b65a45928baf62cc6dd993c3a3bcdfe3a
 **/
 .travis.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.travis.yml b/.travis.yml
index d1ca5a66..018ca972 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -61,6 +61,7 @@ env:
 - CONF="--disable-abi-compat"
 - CONF="--enable-schedule-sp"
 - CONF="--enable-schedule-iquery"
+- CONF="--enable-schedule-scalable"
 
 install:
 - echo 1000 | sudo tee /proc/sys/vm/nr_hugepages



[lng-odp] [PATCH API-NEXT v1 3/4] test: pktio: use capability to set test pool packet length

2017-06-14 Thread Github ODP bot
From: Matias Elo 

Test used to fail if odp_pool_capability_t.pkt.max_len < PKT_BUF_SIZE.
https://bugs.linaro.org/show_bug.cgi?id=3013

Signed-off-by: Matias Elo 
Reviewed-and-tested-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 50 (nagarahalli:api-next-travis)
 ** https://github.com/Linaro/odp/pull/50
 ** Patch: https://github.com/Linaro/odp/pull/50.patch
 ** Base sha: 4f97e500a097928e308a415c32a88465adc5f5cc
 ** Merge commit sha: 95322c7b65a45928baf62cc6dd993c3a3bcdfe3a
 **/
 test/common_plat/validation/api/pktio/pktio.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/test/common_plat/validation/api/pktio/pktio.c 
b/test/common_plat/validation/api/pktio/pktio.c
index d3eb838f..43fe515a 100644
--- a/test/common_plat/validation/api/pktio/pktio.c
+++ b/test/common_plat/validation/api/pktio/pktio.c
@@ -123,20 +123,23 @@ static inline void _pktio_wait_linkup(odp_pktio_t pktio)
 
 static void set_pool_len(odp_pool_param_t *params, odp_pool_capability_t *capa)
 {
+   uint32_t len;
uint32_t seg_len;
 
+   len = (capa->pkt.max_len && capa->pkt.max_len < PKT_BUF_SIZE) ?
+   capa->pkt.max_len : PKT_BUF_SIZE;
seg_len = capa->pkt.max_seg_len ? capa->pkt.max_seg_len : PKT_BUF_SIZE;
 
switch (pool_segmentation) {
case PKT_POOL_SEGMENTED:
/* Force segment to minimum size */
params->pkt.seg_len = 0;
-   params->pkt.len = PKT_BUF_SIZE;
+   params->pkt.len = len;
break;
case PKT_POOL_UNSEGMENTED:
default:
params->pkt.seg_len = seg_len;
-   params->pkt.len = PKT_BUF_SIZE;
+   params->pkt.len = len;
break;
}
 }



[lng-odp] [PATCH API-NEXT v1 0/4] Add scalable scheduler for travis CI

2017-06-14 Thread Github ODP bot


github
/** Email created from pull request 50 (nagarahalli:api-next-travis)
 ** https://github.com/Linaro/odp/pull/50
 ** Patch: https://github.com/Linaro/odp/pull/50.patch
 ** Base sha: 4f97e500a097928e308a415c32a88465adc5f5cc
 ** Merge commit sha: 95322c7b65a45928baf62cc6dd993c3a3bcdfe3a
 **/
/github

checkpatch.pl
total: 0 errors, 0 warnings, 0 checks, 19 lines checked


to_send-p-000.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 17 lines checked


to_send-p-001.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 25 lines checked


to_send-p-002.patch has no obvious style problems and is ready for submission.
ERROR: Remove Gerrit Change-Id's before submitting upstream.
#9: 
Change-Id: I4c3c76098360accd665938b424f5d05dcb66493e

total: 1 errors, 0 warnings, 0 checks, 7 lines checked


to_send-p-003.patch has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
/checkpatch.pl


[lng-odp] [PATCH API-NEXT v1 1/4] linux-gen: packet: fix odp_packet_free_multi() with single segment pool

2017-06-14 Thread Github ODP bot
From: Matias Elo 

Previously the implementation would use wrong handles and crash if
CONFIG_PACKET_MAX_SEGS was set to one.
https://bugs.linaro.org/show_bug.cgi?id=3013

Signed-off-by: Matias Elo 
Reviewed-and-tested-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 50 (nagarahalli:api-next-travis)
 ** https://github.com/Linaro/odp/pull/50
 ** Patch: https://github.com/Linaro/odp/pull/50.patch
 ** Base sha: 4f97e500a097928e308a415c32a88465adc5f5cc
 ** Merge commit sha: 95322c7b65a45928baf62cc6dd993c3a3bcdfe3a
 **/
 platform/linux-generic/odp_packet.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/platform/linux-generic/odp_packet.c 
b/platform/linux-generic/odp_packet.c
index 6799c6ef..01a82854 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -581,11 +581,16 @@ void odp_packet_free(odp_packet_t pkt)
 
 void odp_packet_free_multi(const odp_packet_t pkt[], int num)
 {
+   odp_buffer_t buf[num * CONFIG_PACKET_MAX_SEGS];
+   int i;
+
if (CONFIG_PACKET_MAX_SEGS == 1) {
-   buffer_free_multi((const odp_buffer_t * const)pkt, num);
+   for (i = 0; i < num; i++)
+   buf[i] = buffer_handle(packet_hdr(pkt[i]));
+
+   buffer_free_multi(buf, num);
} else {
-   odp_buffer_t buf[num * CONFIG_PACKET_MAX_SEGS];
-   int i, j;
+   int j;
int bufs = 0;
 
for (i = 0; i < num; i++) {



[lng-odp] [Bug 3026] pktio_ipc_run test can fail due to segfault

2017-06-14 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=3026

Maxim Uvarov  changed:

   What|Removed |Added

Summary|pktio_ips_run test can fail |pktio_ipc_run test can fail
   |due to segfault |due to segfault

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

[lng-odp] [API-NEXT PATCH v4] timer: allow timer processing to run on worker cores

2017-06-14 Thread Brian Brooks
Run timer pool processing on worker cores if the application hints
that the scheduler will be used. This reduces the latency and jitter
of the point at which timer pool processing begins. See [1] for details.

[1] 
https://docs.google.com/document/d/1sY7rOxqCNu-bMqjBiT5_keAIohrX1ZW-eL0oGLAQ4OM/edit?usp=sharing

Signed-off-by: Brian Brooks 
Reviewed-by: Ola Liljedahl 
Reviewed-by: Honnappa Nagarahalli 
---

** There is a false positive checkpatch.pl warning **

v4:
 - Rebase against Bill's feature init patch

v3:
 - Add rate limiting by scheduling rounds

v2:
 - Reword 'worker_timers' to 'use_scheduler'
 - Use time instead of ticks

 platform/linux-generic/include/odp_internal.h  |   2 +-
 .../linux-generic/include/odp_timer_internal.h |  24 +
 platform/linux-generic/odp_init.c  |   2 +-
 platform/linux-generic/odp_schedule.c  |   3 +
 platform/linux-generic/odp_schedule_iquery.c   |   3 +
 platform/linux-generic/odp_schedule_sp.c   |   3 +
 platform/linux-generic/odp_timer.c | 112 +++--
 7 files changed, 138 insertions(+), 11 deletions(-)

diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index 90e2a629..404792cf 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -108,7 +108,7 @@ int odp_queue_term_global(void);
 int odp_crypto_init_global(void);
 int odp_crypto_term_global(void);
 
-int odp_timer_init_global(void);
+int odp_timer_init_global(const odp_init_t *params);
 int odp_timer_term_global(void);
 int odp_timer_disarm_all(void);
 
diff --git a/platform/linux-generic/include/odp_timer_internal.h 
b/platform/linux-generic/include/odp_timer_internal.h
index 91b12c54..67ee9fef 100644
--- a/platform/linux-generic/include/odp_timer_internal.h
+++ b/platform/linux-generic/include/odp_timer_internal.h
@@ -20,6 +20,12 @@
 #include 
 #include 
 
+/* Minimum number of nanoseconds between checking timer pools. */
+#define CONFIG_TIMER_RUN_RATELIMIT_NS 100
+
+/* Minimum number of scheduling rounds between checking timer pools. */
+#define CONFIG_TIMER_RUN_RATELIMIT_ROUNDS 1
+
 /**
  * Internal Timeout header
  */
@@ -35,4 +41,22 @@ typedef struct {
odp_timer_t timer;
 } odp_timeout_hdr_t;
 
+/*
+ * Whether to run timer pool processing 'inline' (on worker cores) or in
+ * background threads (thread-per-timerpool).
+ *
+ * If the application will use both scheduler and timer this flag is set
+ * to true, otherwise false. This application conveys this information via
+ * the 'not_used' bits in odp_init_t which are passed to odp_global_init().
+ */
+extern odp_bool_t inline_timers;
+
+unsigned _timer_run(void);
+
+/* Static inline wrapper to minimize modification of schedulers. */
+static inline unsigned timer_run(void)
+{
+   return inline_timers ? _timer_run() : 0;
+}
+
 #endif
diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index 62a1fbc2..8c17cbb0 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -241,7 +241,7 @@ int odp_init_global(odp_instance_t *instance,
}
stage = PKTIO_INIT;
 
-   if (odp_timer_init_global()) {
+   if (odp_timer_init_global(params)) {
ODP_ERR("ODP timer init failed.\n");
goto init_failed;
}
diff --git a/platform/linux-generic/odp_schedule.c 
b/platform/linux-generic/odp_schedule.c
index 011d4dc4..04d09981 100644
--- a/platform/linux-generic/odp_schedule.c
+++ b/platform/linux-generic/odp_schedule.c
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /* Number of priority levels  */
 #define NUM_PRIO 8
@@ -998,6 +999,8 @@ static int schedule_loop(odp_queue_t *out_queue, uint64_t 
wait,
int ret;
 
while (1) {
+   timer_run();
+
ret = do_schedule(out_queue, out_ev, max_num);
 
if (ret)
diff --git a/platform/linux-generic/odp_schedule_iquery.c 
b/platform/linux-generic/odp_schedule_iquery.c
index bdf1a460..f7c411f6 100644
--- a/platform/linux-generic/odp_schedule_iquery.c
+++ b/platform/linux-generic/odp_schedule_iquery.c
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /* Number of priority levels */
 #define NUM_SCHED_PRIO 8
@@ -719,6 +720,8 @@ static int schedule_loop(odp_queue_t *out_queue, uint64_t 
wait,
odp_time_t next, wtime;
 
while (1) {
+   timer_run();
+
count = do_schedule(out_queue, out_ev, max_num);
 
if (count)
diff --git a/platform/linux-generic/odp_schedule_sp.c 
b/platform/linux-generic/odp_schedule_sp.c
index 91d70e3a..252d128d 100644
--- a/platform/linux-generic/odp_schedule_sp.c
+++ b/platform/linux-generic/odp_schedule_sp.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define 

Re: [lng-odp] [NEXT PATCH] changelog: add bug 3039 to list of bug fixes for v1.15

2017-06-14 Thread Maxim Uvarov
Merged.

Maxim.

On 06/14/17 20:12, Bill Fischofer wrote:
> Signed-off-by: Bill Fischofer 
> ---
>  CHANGELOG | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/CHANGELOG b/CHANGELOG
> index 25e90347..866e51e9 100644
> --- a/CHANGELOG
> +++ b/CHANGELOG
> @@ -255,6 +255,9 @@ Travis: time main test out of boundaries
>   https://bugs.linaro.org/show_bug.cgi?id=3027[Bug 3027]
>  Compilation failures using GCC 7 series
>  
> + https://bugs.linaro.org/show_bug.cgi?id=3039[Bug 3039]
> +Socket pktio recv fails on large number of packet
> +
>  === Known Issues
>   https://bugs.linaro.org/show_bug.cgi?id=3024[Bug 3024]
>  odp_traffic_mngr example is broken
> 



[lng-odp] [Linaro/odp] 5b8a65: changelog: add bug 3039 to list of bug fixes for v...

2017-06-14 Thread GitHub
  Branch: refs/heads/next
  Home:   https://github.com/Linaro/odp
  Commit: 5b8a65b8c1e8bfbc4fc76e8622052ca74ed0f736
  
https://github.com/Linaro/odp/commit/5b8a65b8c1e8bfbc4fc76e8622052ca74ed0f736
  Author: Bill Fischofer 
  Date:   2017-06-14 (Wed, 14 Jun 2017)

  Changed paths:
M CHANGELOG

  Log Message:
  ---
  changelog: add bug 3039 to list of bug fixes for v1.15

Signed-off-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 




Re: [lng-odp] [API-NEXT PATCH] linux-gen: queue: clean up after modular interface

2017-06-14 Thread Dmitry Eremin-Solenikov
On 12.06.2017 14:11, Petri Savolainen wrote:
> Clean up function and parameter naming after modular interface
> patch. Queue_t type is referred as "queue internal": queue_int or
> q_int. Term "handle" is reserved for API level handles (e.g.
> odp_queue_t, odp_pktio_t, etc) through out linux-gen implementation.


q_int/queue_int is a matter of preference, the rest should definitely go in.

-- 
With best wishes
Dmitry


Re: [lng-odp] [API-NEXT PATCH v2 2/3] api: ipsec: change IPSEC result to packet

2017-06-14 Thread Dmitry Eremin-Solenikov
On 14.06.2017 17:08, Petri Savolainen wrote:
> Input and output of IPSEC operations are packets. Parameter and
> result structures are cleaner when packet arrays are direct
> parameters to functions. Also API is more flexible for
> application and API pipelining when output is packets with
> additional metadata. Application or API pipeline stages which
> do not care about IPSEC results may work on basic packet metadata.
> 
> IPSEC result event type changes from ODP_EVENT_IPSEC_RESULT to
> ODP_EVENT_PACKET. Event subtype (ODP_EVENT_PACKET_IPSEC) can be
> used to identify packets with IPSEC metadata.
> 
> Signed-off-by: Petri Savolainen 
> ---
>  include/odp/api/spec/ipsec.h   | 412 
> +
>  platform/linux-generic/odp_ipsec.c |  67 --
>  2 files changed, 279 insertions(+), 200 deletions(-)

[skipped]

>   */
> -int odp_ipsec_in(const odp_ipsec_op_param_t *input,
> -  odp_ipsec_op_result_t *output);
> +int odp_ipsec_in(const odp_packet_t pkt_in[], int num_in,
> +  odp_packet_t pkt_out[], int *num_out,
> +  const odp_ipsec_in_param_t *param);

Any reason for having arrays here (and further) instead of pointers?


-- 
With best wishes
Dmitry


[lng-odp] [PATCH API-NEXT 2/2] validation: test correctness of events subtype implementation

2017-06-14 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov 
---
 test/common_plat/validation/api/buffer/buffer.c | 37 +++--
 test/common_plat/validation/api/packet/packet.c |  5 
 test/common_plat/validation/api/timer/timer.c   | 14 --
 3 files changed, 39 insertions(+), 17 deletions(-)

diff --git a/test/common_plat/validation/api/buffer/buffer.c 
b/test/common_plat/validation/api/buffer/buffer.c
index 7c723d4f4df4..8fca8a1f0840 100644
--- a/test/common_plat/validation/api/buffer/buffer.c
+++ b/test/common_plat/validation/api/buffer/buffer.c
@@ -48,7 +48,8 @@ void buffer_test_pool_alloc(void)
odp_buffer_t buffer[num];
odp_event_t ev;
int index;
-   char wrong_type = 0, wrong_size = 0, wrong_align = 0;
+   odp_bool_t wrong_type = false, wrong_subtype = false;
+   odp_bool_t wrong_size = false, wrong_align = false;
odp_pool_param_t params;
 
odp_pool_param_init();
@@ -71,14 +72,16 @@ void buffer_test_pool_alloc(void)
 
ev = odp_buffer_to_event(buffer[index]);
if (odp_event_type(ev) != ODP_EVENT_BUFFER)
-   wrong_type = 1;
+   wrong_type = true;
+   if (odp_event_subtype(ev) != ODP_EVENT_NO_SUBTYPE)
+   wrong_subtype = true;
if (odp_buffer_size(buffer[index]) < BUF_SIZE)
-   wrong_size = 1;
+   wrong_size = true;
 
addr = (uintptr_t)odp_buffer_addr(buffer[index]);
 
if ((addr % BUF_ALIGN) != 0)
-   wrong_align = 1;
+   wrong_align = true;
 
if (wrong_type || wrong_size || wrong_align)
odp_buffer_print(buffer[index]);
@@ -90,9 +93,10 @@ void buffer_test_pool_alloc(void)
index--;
 
/* Check that the pool had correct buffers */
-   CU_ASSERT(wrong_type == 0);
-   CU_ASSERT(wrong_size == 0);
-   CU_ASSERT(wrong_align == 0);
+   CU_ASSERT(!wrong_type);
+   CU_ASSERT(!wrong_subtype);
+   CU_ASSERT(!wrong_size);
+   CU_ASSERT(!wrong_align);
 
for (; index >= 0; index--)
odp_buffer_free(buffer[index]);
@@ -123,7 +127,8 @@ void buffer_test_pool_alloc_multi(void)
odp_buffer_t buffer[num + 1];
odp_event_t ev;
int index;
-   char wrong_type = 0, wrong_size = 0, wrong_align = 0;
+   odp_bool_t wrong_type = false, wrong_subtype = false;
+   odp_bool_t wrong_size = false, wrong_align = false;
odp_pool_param_t params;
 
odp_pool_param_init();
@@ -146,14 +151,16 @@ void buffer_test_pool_alloc_multi(void)
 
ev = odp_buffer_to_event(buffer[index]);
if (odp_event_type(ev) != ODP_EVENT_BUFFER)
-   wrong_type = 1;
+   wrong_type = true;
+   if (odp_event_subtype(ev) != ODP_EVENT_NO_SUBTYPE)
+   wrong_subtype = true;
if (odp_buffer_size(buffer[index]) < BUF_SIZE)
-   wrong_size = 1;
+   wrong_size = true;
 
addr = (uintptr_t)odp_buffer_addr(buffer[index]);
 
if ((addr % BUF_ALIGN) != 0)
-   wrong_align = 1;
+   wrong_align = true;
 
if (wrong_type || wrong_size || wrong_align)
odp_buffer_print(buffer[index]);
@@ -163,9 +170,10 @@ void buffer_test_pool_alloc_multi(void)
CU_ASSERT(index == num);
 
/* Check that the pool had correct buffers */
-   CU_ASSERT(wrong_type == 0);
-   CU_ASSERT(wrong_size == 0);
-   CU_ASSERT(wrong_align == 0);
+   CU_ASSERT(!wrong_type);
+   CU_ASSERT(!wrong_subtype);
+   CU_ASSERT(!wrong_size);
+   CU_ASSERT(!wrong_align);
 
odp_buffer_free_multi(buffer, num);
 
@@ -248,6 +256,7 @@ void buffer_test_management_basic(void)
CU_ASSERT(odp_buffer_is_valid(raw_buffer) == 1);
CU_ASSERT(odp_buffer_pool(raw_buffer) != ODP_POOL_INVALID);
CU_ASSERT(odp_event_type(ev) == ODP_EVENT_BUFFER);
+   CU_ASSERT(odp_event_subtype(ev) == ODP_EVENT_NO_SUBTYPE);
CU_ASSERT(odp_buffer_size(raw_buffer) >= BUF_SIZE);
CU_ASSERT(odp_buffer_addr(raw_buffer) != NULL);
odp_buffer_print(raw_buffer);
diff --git a/test/common_plat/validation/api/packet/packet.c 
b/test/common_plat/validation/api/packet/packet.c
index 284aaeb5ae56..3d55eff7479f 100644
--- a/test/common_plat/validation/api/packet/packet.c
+++ b/test/common_plat/validation/api/packet/packet.c
@@ -260,6 +260,8 @@ void packet_test_alloc_free(void)
CU_ASSERT(odp_packet_len(packet) == packet_len);
CU_ASSERT(odp_event_type(odp_packet_to_event(packet)) ==
ODP_EVENT_PACKET);
+   CU_ASSERT(odp_event_subtype(odp_packet_to_event(packet)) ==
+ ODP_EVENT_PACKET_BASIC);

[lng-odp] [PATCH API-NEXT 1/2] linux-generic: events subtype implementation

2017-06-14 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov 
---
 platform/linux-generic/include/odp_buffer_inlines.h  |  2 ++
 platform/linux-generic/include/odp_buffer_internal.h |  3 +++
 platform/linux-generic/odp_event.c   |  5 +
 platform/linux-generic/odp_packet.c  |  1 +
 platform/linux-generic/odp_pool.c| 11 +++
 5 files changed, 22 insertions(+)

diff --git a/platform/linux-generic/include/odp_buffer_inlines.h 
b/platform/linux-generic/include/odp_buffer_inlines.h
index cf817d907ab5..4c0e73390948 100644
--- a/platform/linux-generic/include/odp_buffer_inlines.h
+++ b/platform/linux-generic/include/odp_buffer_inlines.h
@@ -21,6 +21,8 @@ extern "C" {
 
 odp_event_type_t _odp_buffer_event_type(odp_buffer_t buf);
 void _odp_buffer_event_type_set(odp_buffer_t buf, int ev);
+odp_event_subtype_t _odp_buffer_event_subtype(odp_buffer_t buf);
+void _odp_buffer_event_subtype_set(odp_buffer_t buf, int ev);
 int odp_buffer_snprint(char *str, uint32_t n, odp_buffer_t buf);
 
 static inline odp_buffer_t odp_hdr_to_buf(odp_buffer_hdr_t *hdr)
diff --git a/platform/linux-generic/include/odp_buffer_internal.h 
b/platform/linux-generic/include/odp_buffer_internal.h
index 076abe96e072..dadf285e796d 100644
--- a/platform/linux-generic/include/odp_buffer_internal.h
+++ b/platform/linux-generic/include/odp_buffer_internal.h
@@ -96,6 +96,9 @@ struct odp_buffer_hdr_t {
/* Event type. Maybe different than pool type (crypto compl event) */
int8_tevent_type;
 
+   /* Event subtype. Should be ODP_EVENT_NO_SUBTYPE except packets. */
+   int8_tevent_subtype;
+
/* Burst table */
struct odp_buffer_hdr_t *burst[BUFFER_BURST_SIZE];
 
diff --git a/platform/linux-generic/odp_event.c 
b/platform/linux-generic/odp_event.c
index d71f4464af48..3cd4a73cbefb 100644
--- a/platform/linux-generic/odp_event.c
+++ b/platform/linux-generic/odp_event.c
@@ -19,6 +19,11 @@ odp_event_type_t odp_event_type(odp_event_t event)
return _odp_buffer_event_type(odp_buffer_from_event(event));
 }
 
+odp_event_subtype_t odp_event_subtype(odp_event_t event)
+{
+   return _odp_buffer_event_subtype(odp_buffer_from_event(event));
+}
+
 void odp_event_free(odp_event_t event)
 {
switch (odp_event_type(event)) {
diff --git a/platform/linux-generic/odp_packet.c 
b/platform/linux-generic/odp_packet.c
index eb66af2d3b9c..3789feca45f9 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -268,6 +268,7 @@ static inline void packet_init(odp_packet_hdr_t *pkt_hdr, 
uint32_t len)
 CONFIG_PACKET_TAILROOM;
 
pkt_hdr->input = ODP_PKTIO_INVALID;
+   pkt_hdr->buf_hdr.event_subtype = ODP_EVENT_PACKET_BASIC;
 }
 
 static inline void init_segments(odp_packet_hdr_t *pkt_hdr[], int num)
diff --git a/platform/linux-generic/odp_pool.c 
b/platform/linux-generic/odp_pool.c
index 9dba734130b4..23b80698d3b0 100644
--- a/platform/linux-generic/odp_pool.c
+++ b/platform/linux-generic/odp_pool.c
@@ -259,6 +259,7 @@ static void init_buffers(pool_t *pool)
buf_hdr->size = seg_size;
buf_hdr->type = type;
buf_hdr->event_type = type;
+   buf_hdr->event_subtype = ODP_EVENT_NO_SUBTYPE;
buf_hdr->pool_hdl = pool->pool_hdl;
buf_hdr->uarea_addr = uarea;
/* Show user requested size through API */
@@ -566,6 +567,16 @@ void _odp_buffer_event_type_set(odp_buffer_t buf, int ev)
buf_hdl_to_hdr(buf)->event_type = ev;
 }
 
+odp_event_subtype_t _odp_buffer_event_subtype(odp_buffer_t buf)
+{
+   return buf_hdl_to_hdr(buf)->event_subtype;
+}
+
+void _odp_buffer_event_subtype_set(odp_buffer_t buf, int ev)
+{
+   buf_hdl_to_hdr(buf)->event_subtype = ev;
+}
+
 odp_pool_t odp_pool_lookup(const char *name)
 {
uint32_t i;
-- 
2.11.0



[lng-odp] [PATCH API-NEXT 0/2] event subtype implementation

2017-06-14 Thread Dmitry Eremin-Solenikov
Applies on top of [API-NEXT PATCH v2 0/3] IPSEC packet event

These patches provide event subtype implementation and tests. Ideally they
should be merged together with event subtypes API definitions.

Dmitry Eremin-Solenikov (2):
  linux-generic: events subtype implementation
  validation: test correctness of events subtype implementation

 .../linux-generic/include/odp_buffer_inlines.h |  2 ++
 .../linux-generic/include/odp_buffer_internal.h|  3 ++
 platform/linux-generic/odp_event.c |  5 +++
 platform/linux-generic/odp_packet.c|  1 +
 platform/linux-generic/odp_pool.c  | 11 +++
 test/common_plat/validation/api/buffer/buffer.c| 37 ++
 test/common_plat/validation/api/packet/packet.c|  5 +++
 test/common_plat/validation/api/timer/timer.c  | 14 ++--
 8 files changed, 61 insertions(+), 17 deletions(-)

-- 
2.11.0



[lng-odp] [NEXT PATCH] changelog: add bug 3039 to list of bug fixes for v1.15

2017-06-14 Thread Bill Fischofer
Signed-off-by: Bill Fischofer 
---
 CHANGELOG | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CHANGELOG b/CHANGELOG
index 25e90347..866e51e9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -255,6 +255,9 @@ Travis: time main test out of boundaries
  https://bugs.linaro.org/show_bug.cgi?id=3027[Bug 3027]
 Compilation failures using GCC 7 series
 
+ https://bugs.linaro.org/show_bug.cgi?id=3039[Bug 3039]
+Socket pktio recv fails on large number of packet
+
 === Known Issues
  https://bugs.linaro.org/show_bug.cgi?id=3024[Bug 3024]
 odp_traffic_mngr example is broken
-- 
2.11.0



Re: [lng-odp] ODP-465

2017-06-14 Thread Bill Fischofer
That would make sense to me. I'd note the reasoning in the card.

On Wed, Jun 14, 2017 at 11:00 AM, Honnappa Nagarahalli
 wrote:
> Ok, does it make sense to close it for now stating it is addressed
> already for ODP and will take a relook when ODP-Cloud takes shape?
>
> Thanks,
> Honnappa
>
> On 14 June 2017 at 10:54, Bill Fischofer  wrote:
>> This ticket is somewhat dated as we have an ABI that covers AArch64 as
>> well as other architectures. The intent here was to cover any needed
>> work to define an optimized ABI for AArch64. The need for that will be
>> determined based on measurements as the cloud-deployable ODP takes
>> shape.
>>
>> On Wed, Jun 14, 2017 at 10:52 AM, Honnappa Nagarahalli
>>  wrote:
>>> Hi Bill,
>>>  I am trying to understand this Jira ticket. My understanding is
>>> that we have already defined the ABI for ODP. Is this Jira ticket
>>> indicating that it is not defined for AArch64?
>>>
>>> Thank you,
>>> Honnappa


[lng-odp] [Linaro/odp] 373f97: linux-gen: socket: remove limits for maximum RX/TX...

2017-06-14 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/Linaro/odp
  Commit: 373f97f88d327ca0e211df33d6fcaad0b9188a1c
  
https://github.com/Linaro/odp/commit/373f97f88d327ca0e211df33d6fcaad0b9188a1c
  Author: Matias Elo 
  Date:   2017-06-14 (Wed, 14 Jun 2017)

  Changed paths:
M platform/linux-generic/include/odp_packet_socket.h
M platform/linux-generic/pktio/socket.c

  Log Message:
  ---
  linux-gen: socket: remove limits for maximum RX/TX burst size

Remove unnecessary limits for maximum RX/TX burst size.

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

Signed-off-by: Matias Elo 
Reviewed-and-tested-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 


  Commit: 248ebf35eaf51d962e9d14a4e2c541d3cbc96268
  
https://github.com/Linaro/odp/commit/248ebf35eaf51d962e9d14a4e2c541d3cbc96268
  Author: Matias Elo 
  Date:   2017-06-14 (Wed, 14 Jun 2017)

  Changed paths:
M platform/linux-generic/pktio/socket.c

  Log Message:
  ---
  linux-gen: socket: streamline sock_mmsg_recv() function

Use the same main code path when operating with or without classifier.

Signed-off-by: Matias Elo 
Reviewed-and-tested-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 


Compare: https://github.com/Linaro/odp/compare/7cf390d11e69...248ebf35eaf5


[lng-odp] [Bug 3039] Socket pktio recv fails on large number of packet

2017-06-14 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=3039

--- Comment #2 from Maxim Uvarov  ---
https://github.com/Linaro/odp/commit/373f97f88d327ca0e211df33d6fcaad0b9188a1c
refs/heads/master
2017-06-14T18:07:51+03:00
Matias Elo matias@nokia.com
linux-gen: socket: remove limits for maximum RX/TX burst size

Remove unnecessary limits for maximum RX/TX burst size.

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

Signed-off-by: Matias Elo 
Reviewed-and-tested-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 

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

Re: [lng-odp] ODP-465

2017-06-14 Thread Honnappa Nagarahalli
Ok, does it make sense to close it for now stating it is addressed
already for ODP and will take a relook when ODP-Cloud takes shape?

Thanks,
Honnappa

On 14 June 2017 at 10:54, Bill Fischofer  wrote:
> This ticket is somewhat dated as we have an ABI that covers AArch64 as
> well as other architectures. The intent here was to cover any needed
> work to define an optimized ABI for AArch64. The need for that will be
> determined based on measurements as the cloud-deployable ODP takes
> shape.
>
> On Wed, Jun 14, 2017 at 10:52 AM, Honnappa Nagarahalli
>  wrote:
>> Hi Bill,
>>  I am trying to understand this Jira ticket. My understanding is
>> that we have already defined the ABI for ODP. Is this Jira ticket
>> indicating that it is not defined for AArch64?
>>
>> Thank you,
>> Honnappa


Re: [lng-odp] ODP-465

2017-06-14 Thread Bill Fischofer
This ticket is somewhat dated as we have an ABI that covers AArch64 as
well as other architectures. The intent here was to cover any needed
work to define an optimized ABI for AArch64. The need for that will be
determined based on measurements as the cloud-deployable ODP takes
shape.

On Wed, Jun 14, 2017 at 10:52 AM, Honnappa Nagarahalli
 wrote:
> Hi Bill,
>  I am trying to understand this Jira ticket. My understanding is
> that we have already defined the ABI for ODP. Is this Jira ticket
> indicating that it is not defined for AArch64?
>
> Thank you,
> Honnappa


[lng-odp] ODP-465

2017-06-14 Thread Honnappa Nagarahalli
Hi Bill,
 I am trying to understand this Jira ticket. My understanding is
that we have already defined the ABI for ODP. Is this Jira ticket
indicating that it is not defined for AArch64?

Thank you,
Honnappa


Re: [lng-odp] [API-NEXT PATCH v2 1/3] api: event: add subtype to expand event type

2017-06-14 Thread Bill Fischofer
On Wed, Jun 14, 2017 at 9:08 AM, Petri Savolainen
 wrote:
> Event subtype gives more detailed information about the event.
> Two subtypes (basic and IPSEC packet) are introduced initially.
> Later on, other packet producing APIs (crypto, comp, etc) may
> also produce packet events with additional subtypes.
>
> Signed-off-by: Petri Savolainen 
> ---
>  include/odp/api/spec/event.h   | 80 
> --
>  include/odp/arch/default/api/abi/event.h   |  9 ++-
>  .../include/odp/api/plat/event_types.h |  8 ++-
>  3 files changed, 89 insertions(+), 8 deletions(-)
>
> diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h
> index f22efce5..ac92c339 100644
> --- a/include/odp/api/spec/event.h
> +++ b/include/odp/api/spec/event.h
> @@ -37,21 +37,91 @@ extern "C" {
>
>  /**
>   * @typedef odp_event_type_t
> - * ODP event types:
> - * ODP_EVENT_BUFFER, ODP_EVENT_PACKET, ODP_EVENT_TIMEOUT,
> - * ODP_EVENT_CRYPTO_COMPL, ODP_EVENT_IPSEC_RESULT, ODP_EVENT_IPSEC_STATUS
> + * Event type
> + *
> + * Event type specifies purpose and general format of an event. It can be
> + * checked with odp_event_type() or odp_event_types(). Each event type has
> + * functions (e.g. odp_buffer_from_event()) to convert between the generic 
> event
> + * handle (odp_event_t) and the type specific handle (e.g. odp_buffer_t).
> + * Results are undefined, if conversion function of a wrong event type is 
> used.
> + * Application cannot change event type by chaining conversion functions.
> + *
> + * List of event types:
> + * - ODP_EVENT_BUFFER
> + * - Buffer event (odp_buffer_t) for simple data storage and message 
> passing
> + * - ODP_EVENT_PACKET
> + * - Packet event (odp_packet_t) containing packet data and plenty of
> + *   packet processing related metadata
> + * - ODP_EVENT_TIMEOUT
> + * - Timeout event (odp_timeout_t) from a timer
> + * - ODP_EVENT_CRYPTO_COMPL
> + * - Crypto completion event (odp_crypto_compl_t)
> + * - ODP_EVENT_IPSEC_STATUS
> + * - IPSEC status update event (odp_ipsec_status_t)
>   */
>
>  /**
> - * Get event type
> + * @typedef odp_event_subtype_t
> + * Event subtype
>   *
> - * @param eventEvent handle
> + * Event subtype expands event type specification by providing more detailed
> + * purpose and format of an event. It can be checked with 
> odp_event_subtype() or
> + * odp_event_types(). Each event subtype may define specific functions
> + * (e.g. odp_ipsec_packet_from_event()) to convert between the generic event
> + * handle (odp_event_t) and event type specific handle (e.g. odp_packet_t). 
> When
> + * subtype is known, these subtype specific functions should be preffer over 
> the

Typo: preferred

> + * event type general function (e.g. odp_packet_from_event()). Results are
> + * undefined, if conversion function of a wrong event subtype is used.
> + * Application cannot change event subtype by chaining conversion functions.
> + *
> + *  List of event subtypes:
> + * - ODP_EVENT_PACKET_BASIC
> + * - Packet event (odp_packet_t) with basic packet metadata
> + * - ODP_EVENT_PACKET_IPSEC
> + * - Packet event (odp_packet_t) generated as a result of an IPsec
> + *   operation. It contains IPSEC specific metadata in addition to the 
> basic
> + *   packet metadata.
> + * - ODP_EVENT_NO_SUBTYPE
> + * - An event type does not have any subtypes defined
> + */
> +
> +/**
> + * Event type of an event
> + *
> + * Event type specifies purpose and general format of an event.
> + *
> + * @param  eventEvent handle
>   *
>   * @return Event type
>   */
>  odp_event_type_t odp_event_type(odp_event_t event);
>
>  /**
> + * Event subtype of an event
> + *
> + * Event subtype expands event type specification by providing more detailed
> + * purpose and format of an event.
> + *
> + * @param  eventEvent handle
> + *
> + * @return Event subtype
> + */
> +odp_event_subtype_t odp_event_subtype(odp_event_t event);
> +
> +/**
> + * Event type and subtype of an event
> + *
> + * Returns event type and outputs event subtype.
> + *
> + * @param  eventEvent handle
> + * @param[out] subtype  Pointer to event subtype for output
> + *
> + * @return Event type
> + */
> +odp_event_type_t odp_event_types(odp_event_t event,
> +odp_event_subtype_t *subtype);
> +
> +/**
>   * Get printable value for an odp_event_t
>   *
>   * @param hdl  odp_event_t handle to be printed
> diff --git a/include/odp/arch/default/api/abi/event.h 
> b/include/odp/arch/default/api/abi/event.h
> index 87220d63..ab3c0f75 100644
> --- a/include/odp/arch/default/api/abi/event.h
> +++ b/include/odp/arch/default/api/abi/event.h
> @@ -29,10 +29,15 @@ typedef enum odp_event_type_t {
> ODP_EVENT_PACKET   = 2,
> ODP_EVENT_TIMEOUT  = 3,
> ODP_EVENT_CRYPTO_COMPL = 4,
> -   ODP_EVENT_IPSEC_RESULT = 5,
> -   

Re: [lng-odp] [API-NEXT PATCH 1/2] api: ipsec: change IPSEC result to packet

2017-06-14 Thread Dmitry Eremin-Solenikov
On 14.06.2017 12:53, Dmitry Eremin-Solenikov wrote:
> On 09.06.2017 15:32, Savolainen, Petri (Nokia - FI/Espoo) wrote:
 @@ -934,41 +926,70 @@ typedef struct odp_ipsec_op_status_t {
  } odp_ipsec_op_status_t;

  /**
 - * IPSEC operation input parameters
 + * IPSEC outbound operation options
 + *
 + * These may be used to override some SA level options
   */
 -typedef struct odp_ipsec_op_param_t {
 -  /** Number of packets to be processed */
 -  int num_pkt;
 +typedef struct odp_ipsec_out_opt_t {
 +  /** Fragmentation mode */
 +  odp_ipsec_frag_mode_t mode;
 +
 +} odp_ipsec_out_opt_t;
>>>
>>> Maybe we can just inline this into out_param_t ?
>>> With this in/out split, it should be quite straightforward change from
>>> the API point of view.
>>
>>
>> The thing is that it's a pointer to an odp_ipsec_out_opt_t array, so 
>> application needs the type above. Otherwise, we'd need to define maximum of 
>> opts in the API, which would be the same as maximum number of packets. API 
>> doesn't need to limit the burst size.
> 
> I would suggest to move odp_ipsec_out_opt_t contents completely into the
> odp_ipsec_out_param_t. One would have to fill it in every param, however
> this might result in simpler code. This is just an idea for you to
> consider, not a requirement of course.

I got what you meant. Please ignore this comment.


-- 
With best wishes
Dmitry


[lng-odp] [API-NEXT PATCH v2 2/3] api: ipsec: change IPSEC result to packet

2017-06-14 Thread Petri Savolainen
Input and output of IPSEC operations are packets. Parameter and
result structures are cleaner when packet arrays are direct
parameters to functions. Also API is more flexible for
application and API pipelining when output is packets with
additional metadata. Application or API pipeline stages which
do not care about IPSEC results may work on basic packet metadata.

IPSEC result event type changes from ODP_EVENT_IPSEC_RESULT to
ODP_EVENT_PACKET. Event subtype (ODP_EVENT_PACKET_IPSEC) can be
used to identify packets with IPSEC metadata.

Signed-off-by: Petri Savolainen 
---
 include/odp/api/spec/ipsec.h   | 412 +
 platform/linux-generic/odp_ipsec.c |  67 --
 2 files changed, 279 insertions(+), 200 deletions(-)

diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h
index 65f0b066..372ef462 100644
--- a/include/odp/api/spec/ipsec.h
+++ b/include/odp/api/spec/ipsec.h
@@ -552,16 +552,18 @@ typedef enum odp_ipsec_frag_mode_t {
 
 /**
  * Packet lookup mode
+ *
+ * Lookup mode controls how an SA participates in SA lookup offload.
+ * Inbound operations perform SA lookup if application does not provide a SA as
+ * a parameter. In inline mode, a lookup miss directs the packet back to normal
+ * packet input interface processing. SA lookup failure status 
(error.sa_lookup)
+ * is reported through odp_ipsec_packet_result_t.
  */
 typedef enum odp_ipsec_lookup_mode_t {
-   /** Inbound SA lookup is disabled. */
+   /** Inbound SA lookup is disabled for the SA. */
ODP_IPSEC_LOOKUP_DISABLED = 0,
 
-   /** Inbound SA lookup is enabled. Lookup matches only SPI value.
-*  In inline mode, a lookup miss directs the packet back to normal
-*  packet input interface processing. In other modes, the SA lookup
-*  failure status (error.sa_lookup) is reported through
-*  odp_ipsec_packet_result_t. */
+   /** Inbound SA lookup is enabled. Lookup matches only SPI value. */
ODP_IPSEC_LOOKUP_SPI,
 
/** Inbound SA lookup is enabled. Lookup matches both SPI value and
@@ -572,13 +574,13 @@ typedef enum odp_ipsec_lookup_mode_t {
 } odp_ipsec_lookup_mode_t;
 
 /**
- * Result event pipeline configuration
+ * IPSEC pipeline configuration
  */
 typedef enum odp_ipsec_pipeline_t {
-   /** Do not pipeline */
+   /** Do not pipeline. Send all resulting events to the application. */
ODP_IPSEC_PIPELINE_NONE = 0,
 
-   /** Send IPSEC result events to the classifier.
+   /** Send resulting packets to the classifier
 *
 *  IPSEC capability 'pipeline_cls' determines if pipelined
 *  classification is supported. */
@@ -659,9 +661,9 @@ typedef struct odp_ipsec_sa_param_t {
 */
uint32_t mtu;
 
-   /** Select pipelined destination for IPSEC result events
+   /** Select pipelined destination for resulting events
 *
-*  Asynchronous and inline modes generate result events. Select where
+*  Asynchronous and inline modes generate events. Select where
 *  those events are sent. Inbound SAs may choose to use pipelined
 *  classification. The default value is ODP_IPSEC_PIPELINE_NONE.
 */
@@ -670,18 +672,19 @@ typedef struct odp_ipsec_sa_param_t {
/** Destination queue for IPSEC events
 *
 *  Operations in asynchronous or inline mode enqueue resulting events
-*  into this queue.
+*  into this queue. The default queue ('default_queue') is used when
+*  SA is not known.
 */
odp_queue_t dest_queue;
 
-   /** Classifier destination CoS for IPSEC result events
+   /** Classifier destination CoS for resulting packets
 *
-*  Result events for successfully decapsulated packets are sent to
-*  classification through this CoS. Other result events are sent to
-*  'dest_queue'. This field is considered only when 'pipeline' is
+*  Successfully decapsulated packets are sent to classification
+*  through this CoS. Other resulting events are sent to 'dest_queue'.
+*  This field is considered only when 'pipeline' is
 *  ODP_IPSEC_PIPELINE_CLS. The CoS must not be shared between any pktio
 *  interface default CoS. The maximum number of different CoS supported
-*  is defined by IPsec capability max_cls_cos.
+*  is defined by IPSEC capability max_cls_cos.
 */
odp_cos_t dest_cos;
 
@@ -850,17 +853,6 @@ int odp_ipsec_sa_destroy(odp_ipsec_sa_t sa);
  */
 uint64_t odp_ipsec_sa_to_u64(odp_ipsec_sa_t sa);
 
-/**
- * IPSEC operation level options
- *
- * These may be used to override some SA level options
- */
-typedef struct odp_ipsec_op_opt_t {
-   /** Fragmentation mode */
-   odp_ipsec_frag_mode_t mode;
-
-} odp_ipsec_op_opt_t;
-
 /** IPSEC operation status has no errors */
 #define ODP_IPSEC_OK 0
 
@@ -870,7 +862,8 @@ typedef 

[lng-odp] [API-NEXT PATCH v2 1/3] api: event: add subtype to expand event type

2017-06-14 Thread Petri Savolainen
Event subtype gives more detailed information about the event.
Two subtypes (basic and IPSEC packet) are introduced initially.
Later on, other packet producing APIs (crypto, comp, etc) may
also produce packet events with additional subtypes.

Signed-off-by: Petri Savolainen 
---
 include/odp/api/spec/event.h   | 80 --
 include/odp/arch/default/api/abi/event.h   |  9 ++-
 .../include/odp/api/plat/event_types.h |  8 ++-
 3 files changed, 89 insertions(+), 8 deletions(-)

diff --git a/include/odp/api/spec/event.h b/include/odp/api/spec/event.h
index f22efce5..ac92c339 100644
--- a/include/odp/api/spec/event.h
+++ b/include/odp/api/spec/event.h
@@ -37,21 +37,91 @@ extern "C" {
 
 /**
  * @typedef odp_event_type_t
- * ODP event types:
- * ODP_EVENT_BUFFER, ODP_EVENT_PACKET, ODP_EVENT_TIMEOUT,
- * ODP_EVENT_CRYPTO_COMPL, ODP_EVENT_IPSEC_RESULT, ODP_EVENT_IPSEC_STATUS
+ * Event type
+ *
+ * Event type specifies purpose and general format of an event. It can be
+ * checked with odp_event_type() or odp_event_types(). Each event type has
+ * functions (e.g. odp_buffer_from_event()) to convert between the generic 
event
+ * handle (odp_event_t) and the type specific handle (e.g. odp_buffer_t).
+ * Results are undefined, if conversion function of a wrong event type is used.
+ * Application cannot change event type by chaining conversion functions.
+ *
+ * List of event types:
+ * - ODP_EVENT_BUFFER
+ * - Buffer event (odp_buffer_t) for simple data storage and message 
passing
+ * - ODP_EVENT_PACKET
+ * - Packet event (odp_packet_t) containing packet data and plenty of
+ *   packet processing related metadata
+ * - ODP_EVENT_TIMEOUT
+ * - Timeout event (odp_timeout_t) from a timer
+ * - ODP_EVENT_CRYPTO_COMPL
+ * - Crypto completion event (odp_crypto_compl_t)
+ * - ODP_EVENT_IPSEC_STATUS
+ * - IPSEC status update event (odp_ipsec_status_t)
  */
 
 /**
- * Get event type
+ * @typedef odp_event_subtype_t
+ * Event subtype
  *
- * @param eventEvent handle
+ * Event subtype expands event type specification by providing more detailed
+ * purpose and format of an event. It can be checked with odp_event_subtype() 
or
+ * odp_event_types(). Each event subtype may define specific functions
+ * (e.g. odp_ipsec_packet_from_event()) to convert between the generic event
+ * handle (odp_event_t) and event type specific handle (e.g. odp_packet_t). 
When
+ * subtype is known, these subtype specific functions should be preffer over 
the
+ * event type general function (e.g. odp_packet_from_event()). Results are
+ * undefined, if conversion function of a wrong event subtype is used.
+ * Application cannot change event subtype by chaining conversion functions.
+ *
+ *  List of event subtypes:
+ * - ODP_EVENT_PACKET_BASIC
+ * - Packet event (odp_packet_t) with basic packet metadata
+ * - ODP_EVENT_PACKET_IPSEC
+ * - Packet event (odp_packet_t) generated as a result of an IPsec
+ *   operation. It contains IPSEC specific metadata in addition to the 
basic
+ *   packet metadata.
+ * - ODP_EVENT_NO_SUBTYPE
+ * - An event type does not have any subtypes defined
+ */
+
+/**
+ * Event type of an event
+ *
+ * Event type specifies purpose and general format of an event.
+ *
+ * @param  eventEvent handle
  *
  * @return Event type
  */
 odp_event_type_t odp_event_type(odp_event_t event);
 
 /**
+ * Event subtype of an event
+ *
+ * Event subtype expands event type specification by providing more detailed
+ * purpose and format of an event.
+ *
+ * @param  eventEvent handle
+ *
+ * @return Event subtype
+ */
+odp_event_subtype_t odp_event_subtype(odp_event_t event);
+
+/**
+ * Event type and subtype of an event
+ *
+ * Returns event type and outputs event subtype.
+ *
+ * @param  eventEvent handle
+ * @param[out] subtype  Pointer to event subtype for output
+ *
+ * @return Event type
+ */
+odp_event_type_t odp_event_types(odp_event_t event,
+odp_event_subtype_t *subtype);
+
+/**
  * Get printable value for an odp_event_t
  *
  * @param hdl  odp_event_t handle to be printed
diff --git a/include/odp/arch/default/api/abi/event.h 
b/include/odp/arch/default/api/abi/event.h
index 87220d63..ab3c0f75 100644
--- a/include/odp/arch/default/api/abi/event.h
+++ b/include/odp/arch/default/api/abi/event.h
@@ -29,10 +29,15 @@ typedef enum odp_event_type_t {
ODP_EVENT_PACKET   = 2,
ODP_EVENT_TIMEOUT  = 3,
ODP_EVENT_CRYPTO_COMPL = 4,
-   ODP_EVENT_IPSEC_RESULT = 5,
-   ODP_EVENT_IPSEC_STATUS = 6
+   ODP_EVENT_IPSEC_STATUS = 5
 } odp_event_type_t;
 
+typedef enum odp_event_subtype_t {
+   ODP_EVENT_NO_SUBTYPE   = 0,
+   ODP_EVENT_PACKET_BASIC = 1,
+   ODP_EVENT_PACKET_IPSEC = 2
+} odp_event_subtype_t;
+
 /**
  * @}
  */
diff --git a/platform/linux-generic/include/odp/api/plat/event_types.h 

[lng-odp] [API-NEXT PATCH v2 3/3] api: ipsec: disable event is the last event

2017-06-14 Thread Petri Savolainen
Disable event is guaranteed to be the last event for the SA,
so that application can use it for SA destroy synchronization.

Signed-off-by: Petri Savolainen 
---
 include/odp/api/spec/ipsec.h | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h
index 372ef462..e602e4b8 100644
--- a/include/odp/api/spec/ipsec.h
+++ b/include/odp/api/spec/ipsec.h
@@ -818,7 +818,10 @@ odp_ipsec_sa_t odp_ipsec_sa_create(const 
odp_ipsec_sa_param_t *param);
  *
  * When in synchronous operation mode, the call will return when it's possible
  * to destroy the SA. In asynchronous mode, the same is indicated by an
- * ODP_EVENT_IPSEC_STATUS event sent to the queue specified for the SA.
+ * ODP_EVENT_IPSEC_STATUS event sent to the queue specified for the SA. The
+ * status event is guaranteed to be the last event for the SA, i.e. all
+ * in-progress operations have completed and resulting events (including status
+ * events) have been enqueued before it.
  *
  * @param sa  IPSEC SA to be disabled
  *
-- 
2.13.0



[lng-odp] [API-NEXT PATCH v2 0/3] IPSEC packet event

2017-06-14 Thread Petri Savolainen
Applies on top of: "[API-NEXT PATCH v2 0/2] IPsec API update"

Input and output of IPSEC operations are packets. Parameter and
result structures are cleaner when packet arrays are direct
parameters to functions. Also API is more flexible for
application or API pipelining when output is packets with
additional metadata. Application or API pipeline stages which
do not care about IPSEC results may work on basic packet metadata.

v2:
  * Introduce event subtype
* event type "packet" is the same for all packets
* event subtype "packet_ipsec" indicates that a packet contain IPSEC results
  * Added output packet format description, which was accidentally left out
from previous version (moved text from deleted result type to
odp_ipsec_in() / odp_ipsec_out() documentation)


Petri Savolainen (3):
  api: event: add subtype to expand event type
  api: ipsec: change IPSEC result to packet
  api: ipsec: disable event is the last event

 include/odp/api/spec/event.h   |  80 +++-
 include/odp/api/spec/ipsec.h   | 417 -
 include/odp/arch/default/api/abi/event.h   |   9 +-
 .../include/odp/api/plat/event_types.h |   8 +-
 platform/linux-generic/odp_ipsec.c |  67 +++-
 5 files changed, 372 insertions(+), 209 deletions(-)

-- 
2.13.0



[lng-odp] [PATCH API-NEXT v2 2/2] test: l2fwd pass under coverage

2017-06-14 Thread Github ODP bot
From: Maxim Uvarov 

env variable TEST=coverage is set, use it to not fail
under gcov run which is really slow.

Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 49 (muvarov:api-next_travis_fixes)
 ** https://github.com/Linaro/odp/pull/49
 ** Patch: https://github.com/Linaro/odp/pull/49.patch
 ** Base sha: 4f97e500a097928e308a415c32a88465adc5f5cc
 ** Merge commit sha: 3380e6fad8d778fc892b47ce2b0cbaafb29fa219
 **/
 test/common_plat/performance/odp_l2fwd_run.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/common_plat/performance/odp_l2fwd_run.sh 
b/test/common_plat/performance/odp_l2fwd_run.sh
index dd42ede9..2c03fbcc 100755
--- a/test/common_plat/performance/odp_l2fwd_run.sh
+++ b/test/common_plat/performance/odp_l2fwd_run.sh
@@ -96,6 +96,9 @@ run_l2fwd()
ret=1
elif [ $ret -eq 0 ]; then
PASS_PPS=5000
+   if [ ${TEST} = "coverage" ]
+   PASS_PPS=10
+   fi
MAX_PPS=$(awk '/TEST RESULT/ {print $3}' $LOG)
if [ "$MAX_PPS" -lt "$PASS_PPS" ]; then
echo "FAIL: pps below threshold $MAX_PPS < $PASS_PPS"



[lng-odp] [PATCH API-NEXT v2 1/2] travis: add sudo for missing tests

2017-06-14 Thread Github ODP bot
From: Maxim Uvarov 

Add sudo to make tests run which require root. Also do not run
tests in parallel for coverage case. It's already very slow and
performance tests eat all cpu time. So the is situation where tests
can not fit in any reasonable limit frames.

Signed-off-by: Maxim Uvarov 
---
/** Email created from pull request 49 (muvarov:api-next_travis_fixes)
 ** https://github.com/Linaro/odp/pull/49
 ** Patch: https://github.com/Linaro/odp/pull/49.patch
 ** Base sha: 4f97e500a097928e308a415c32a88465adc5f5cc
 ** Merge commit sha: 3380e6fad8d778fc892b47ce2b0cbaafb29fa219
 **/
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index d1ca5a66..df25d658 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -130,7 +130,7 @@ jobs:
   script:
   - ./bootstrap
   - ./configure --prefix=$HOME/odp-install 
--enable-test-cpp --enable-test-vald --enable-test-helper --enable-test-perf 
--enable-user-guides --enable-test-perf-proc --enable-test-example 
--with-dpdk-path=`pwd`/dpdk/${TARGET} --with-netmap-path=`pwd`/netmap 
CFLAGS="-O0 -coverage" CXXFLAGS="-O0 -coverage" LDFLAGS="--coverage"
-  - make check -j $(nproc)
+  - sudo 
LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" make check
   - find . -type f -iname '*.[ch]' -not -path ".git/*" 
-execdir gcov {} \; ; bash <(curl -s https://codecov.io/bash) -X coveragepy
 - stage: test
   env: TEST=distcheck
@@ -138,7 +138,7 @@ jobs:
   script:
   - ./bootstrap
   - ./configure
-  - make distcheck
+  - sudo 
LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" make distcheck
 - stage: test
   env: TEST=doxygen
   compiler: gcc



[lng-odp] [PATCH API-NEXT v2 0/2] travis: add sudo for missing tests

2017-06-14 Thread Github ODP bot
Add sudo to make tests run which require root. Also do not run
tests in parallel for coverage case. It's already very slow and
performance tests eat all cpu time. So the is situation where tests
can not fit in any reasonable limit frames.
Signed-off-by: Maxim Uvarov maxim.uva...@linaro.org

github
/** Email created from pull request 49 (muvarov:api-next_travis_fixes)
 ** https://github.com/Linaro/odp/pull/49
 ** Patch: https://github.com/Linaro/odp/pull/49.patch
 ** Base sha: 4f97e500a097928e308a415c32a88465adc5f5cc
 ** Merge commit sha: 3380e6fad8d778fc892b47ce2b0cbaafb29fa219
 **/
/github

checkpatch.pl
total: 0 errors, 0 warnings, 0 checks, 16 lines checked


to_send-p-000.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 9 lines checked


to_send-p-001.patch has no obvious style problems and is ready for submission.
/checkpatch.pl


[lng-odp] [Bug 3045] New: remove temporary files general problem

2017-06-14 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=3045

Bug ID: 3045
   Summary: remove temporary files general problem
   Product: OpenDataPlane - linux- generic reference
   Version: v1.14.0.0
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: General ODP
  Assignee: maxim.uva...@linaro.org
  Reporter: maxim.uva...@linaro.org
CC: lng-odp@lists.linaro.org
  Target Milestone: ---

Odp has to clean up all temporary files which is used for shared memory between
processes. Shared files names are linked to pid. And pids can overlap. Also
permissions to that files can be different if run was from different user. For
now ipc is good (at least one of 4-5 times) reproducible in travis CI.

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

Re: [lng-odp] [PATCH 1/2] linux-gen: socket: remove limits for maximum RX/TX burst size

2017-06-14 Thread Bill Fischofer
On Wed, Jun 14, 2017 at 4:20 AM, Elo, Matias (Nokia - FI/Espoo)
 wrote:
>
>> On 13 Jun 2017, at 16:57, Dmitry Eremin-Solenikov 
>>  wrote:
>>
>> On 13.06.2017 16:16, Elo, Matias (Nokia - FI/Espoo) wrote:
>>>
 On 13 Jun 2017, at 16:00, Bill Fischofer  wrote:

 Is the bug reported here detected by the validation or one of the
 performance tests? Does this now show the issue fixed?
>>>
>>> The pktio validation test uses burst size of 4 so it doesn't detect this 
>>> issue. This fix can be tested for example with odp_l2fwd by increasing the 
>>> MAX_PKT_BURST define value.
>>>
>>
>> Can you extend the testsuite adding a test for this bug?
>
>
> Sure, I can do that. If there are no issues in these two patches could they 
> be merged as is, so they can be a part of the upcoming release? I would then 
> send the validation test improvement as a separate patch.

ODP v1.15 is effectively closed, but not yet tagged. I've added this
to the agenda for today's ARCH call.

>
> -Matias
>


Re: [lng-odp] [API-NEXT PATCH 1/2] api: ipsec: change IPSEC result to packet

2017-06-14 Thread Dmitry Eremin-Solenikov
On 09.06.2017 15:32, Savolainen, Petri (Nokia - FI/Espoo) wrote:
>>> @@ -934,41 +926,70 @@ typedef struct odp_ipsec_op_status_t {
>>>  } odp_ipsec_op_status_t;
>>>
>>>  /**
>>> - * IPSEC operation input parameters
>>> + * IPSEC outbound operation options
>>> + *
>>> + * These may be used to override some SA level options
>>>   */
>>> -typedef struct odp_ipsec_op_param_t {
>>> -   /** Number of packets to be processed */
>>> -   int num_pkt;
>>> +typedef struct odp_ipsec_out_opt_t {
>>> +   /** Fragmentation mode */
>>> +   odp_ipsec_frag_mode_t mode;
>>> +
>>> +} odp_ipsec_out_opt_t;
>>
>> Maybe we can just inline this into out_param_t ?
>> With this in/out split, it should be quite straightforward change from
>> the API point of view.
> 
> 
> The thing is that it's a pointer to an odp_ipsec_out_opt_t array, so 
> application needs the type above. Otherwise, we'd need to define maximum of 
> opts in the API, which would be the same as maximum number of packets. API 
> doesn't need to limit the burst size.

I would suggest to move odp_ipsec_out_opt_t contents completely into the
odp_ipsec_out_param_t. One would have to fill it in every param, however
this might result in simpler code. This is just an idea for you to
consider, not a requirement of course.

-- 
With best wishes
Dmitry


Re: [lng-odp] [PATCH 1/2] linux-gen: socket: remove limits for maximum RX/TX burst size

2017-06-14 Thread Elo, Matias (Nokia - FI/Espoo)

> On 13 Jun 2017, at 16:57, Dmitry Eremin-Solenikov 
>  wrote:
> 
> On 13.06.2017 16:16, Elo, Matias (Nokia - FI/Espoo) wrote:
>> 
>>> On 13 Jun 2017, at 16:00, Bill Fischofer  wrote:
>>> 
>>> Is the bug reported here detected by the validation or one of the
>>> performance tests? Does this now show the issue fixed?
>> 
>> The pktio validation test uses burst size of 4 so it doesn't detect this 
>> issue. This fix can be tested for example with odp_l2fwd by increasing the 
>> MAX_PKT_BURST define value.
>> 
> 
> Can you extend the testsuite adding a test for this bug?


Sure, I can do that. If there are no issues in these two patches could they be 
merged as is, so they can be a part of the upcoming release? I would then send 
the validation test improvement as a separate patch.

-Matias