[lng-odp] [PATCH] ipsec: corrected create_ipsec_cache_entry's out_pool argument handle type

2015-01-06 Thread Jerin Jacob
Signed-off-by: Jerin Jacob 
---
 example/ipsec/odp_ipsec_cache.c | 2 +-
 example/ipsec/odp_ipsec_cache.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/example/ipsec/odp_ipsec_cache.c b/example/ipsec/odp_ipsec_cache.c
index 7a0c813..4447163 100644
--- a/example/ipsec/odp_ipsec_cache.c
+++ b/example/ipsec/odp_ipsec_cache.c
@@ -41,7 +41,7 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa,
 crypto_api_mode_e api_mode,
 bool in,
 odp_queue_t completionq,
-odp_buffer_t out_pool)
+odp_buffer_pool_t out_pool)
 {
odp_crypto_session_params_t params;
ipsec_cache_entry_t *entry;
diff --git a/example/ipsec/odp_ipsec_cache.h b/example/ipsec/odp_ipsec_cache.h
index 2cbaabd..8d9d393 100644
--- a/example/ipsec/odp_ipsec_cache.h
+++ b/example/ipsec/odp_ipsec_cache.h
@@ -90,7 +90,7 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa,
 crypto_api_mode_e api_mode,
 bool in,
 odp_queue_t completionq,
-odp_buffer_t out_pool);
+odp_buffer_pool_t out_pool);
 
 /**
  * Find a matching IPsec cache entry for input packet
-- 
1.9.3


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


Re: [lng-odp] [PATCH] OVS-ODP: ODP v0.6.0 support

2015-01-06 Thread Ciprian Barbu
On Mon, Jan 5, 2015 at 9:19 PM, Zoltan Kiss  wrote:
> This is only compile tested, and there are a few questions in the patch.
>
> Signed-off-by: Zoltan Kiss 
> ---
> diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
> index 96126a1..571b66e 100644
> --- a/lib/netdev-odp.c
> +++ b/lib/netdev-odp.c
> @@ -45,7 +45,7 @@
>  #include "unaligned.h"
>  #include "timeval.h"
>  #include "unixctl.h"
> -#include "vlog.h"
> +#include "openvswitch/vlog.h"
>
>  VLOG_DEFINE_THIS_MODULE(odp);
>
> @@ -94,7 +94,7 @@ struct netdev_rxq_odp {
>  void
>  free_odp_buf(struct ofpbuf *b)
>  {
> -odph_packet_free(b->odp_pkt);
> +odp_packet_free(b->odp_pkt);
>  odp_buffer_free(b->odp_ofpbuf);
>  }
>
> @@ -129,26 +129,26 @@ odp_init(int argc, char *argv[])
>  static int
>  odp_class_init(void)
>  {
> -void *pool_base;
>  odp_shm_t shm;
> +odp_buffer_pool_param_t params;
>  int result = 0;
>
>  /* create packet pool */
>  shm = odp_shm_reserve("shm_packet_pool", SHM_PKT_POOL_SIZE,
>ODP_CACHE_LINE_SIZE, 0);
> -pool_base = odp_shm_addr(shm);
>
> -if (odp_unlikely(pool_base == NULL)) {
> +if (odp_unlikely(shm == ODP_SHM_INVALID)) {
>  VLOG_ERR("Error: ODP packet pool mem alloc failed\n");
>  out_of_memory();
>  return -1;
>  }
>
> -pool = odp_buffer_pool_create("packet_pool", pool_base,
> -  SHM_PKT_POOL_SIZE,
> -  SHM_PKT_POOL_BUF_SIZE,
> -  ODP_CACHE_LINE_SIZE,
> -  ODP_BUFFER_TYPE_PACKET);
> +params.buf_size = SHM_PKT_POOL_BUF_SIZE;
> +params.buf_align = ODP_CACHE_LINE_SIZE;
> +params.num_bufs = SHM_PKT_POOL_SIZE / SHM_PKT_POOL_BUF_SIZE;
> +params.buf_type = ODP_BUFFER_TYPE_PACKET;
> +
> +pool = odp_buffer_pool_create("packet_pool", shm, ¶ms);
>
>  if (pool == ODP_BUFFER_POOL_INVALID) {
>  VLOG_ERR("Error: packet pool create failed.\n");
> @@ -159,19 +159,18 @@ odp_class_init(void)
>  /* create ofpbuf pool */
>  shm = odp_shm_reserve("shm_ofpbuf_pool", SHM_OFPBUF_POOL_SIZE,
>ODP_CACHE_LINE_SIZE, 0);
> -pool_base = odp_shm_addr(shm);
>
> -if (odp_unlikely(pool_base == NULL)) {
> +if (odp_unlikely(shm == ODP_SHM_INVALID)) {
>  VLOG_ERR("Error: ODP packet pool mem alloc failed\n");
>  out_of_memory();
>  return -1;
>  }
>
> -ofpbuf_pool = odp_buffer_pool_create("ofpbuf_pool", pool_base,
> - SHM_OFPBUF_POOL_SIZE,
> - SHM_OFPBUF_POOL_BUF_SIZE,
> - ODP_CACHE_LINE_SIZE,
> - ODP_BUFFER_TYPE_RAW);
> +params.buf_size = SHM_OFPBUF_POOL_BUF_SIZE;
> +params.num_bufs = SHM_OFPBUF_POOL_SIZE / SHM_OFPBUF_POOL_BUF_SIZE;
> +params.buf_type = ODP_BUFFER_TYPE_RAW;
> +
> +ofpbuf_pool = odp_buffer_pool_create("ofpbuf_pool", shm, ¶ms);
>
>  if (ofpbuf_pool == ODP_BUFFER_POOL_INVALID) {
>  VLOG_ERR("Error: ofpbuf pool create failed.\n");
> @@ -182,19 +181,17 @@ odp_class_init(void)
>  /* create pool for structures */
>  shm = odp_shm_reserve("shm_struct_pool", SHM_STRUCT_POOL_SIZE,
>ODP_CACHE_LINE_SIZE, 0);
> -pool_base = odp_shm_addr(shm);
>
> -if (odp_unlikely(pool_base == NULL)) {
> +if (odp_unlikely(shm == ODP_SHM_INVALID)) {
>  VLOG_ERR("Error: ODP packet pool mem alloc failed\n");
>  out_of_memory();
>  return -1;
>  }
>
> -struct_pool = odp_buffer_pool_create("struct_pool", pool_base,
> - SHM_STRUCT_POOL_SIZE,
> - SHM_STRUCT_POOL_BUF_SIZE,
> - ODP_CACHE_LINE_SIZE,
> - ODP_BUFFER_TYPE_RAW);
> +params.buf_size = SHM_STRUCT_POOL_BUF_SIZE;
> +params.num_bufs = SHM_STRUCT_POOL_SIZE / SHM_STRUCT_POOL_BUF_SIZE;
> +
> +   struct_pool = odp_buffer_pool_create("struct_pool", shm, ¶ms);
>
>  if (struct_pool == ODP_BUFFER_POOL_INVALID) {
>  VLOG_ERR("Error: packet pool create failed.\n");
> @@ -247,15 +244,15 @@ netdev_odp_construct(struct netdev *netdev_)
>  }
>
>  netdev->pkt_pool = pool;
> -pkt = odph_packet_alloc(netdev->pkt_pool);
> -if (!odph_packet_is_valid(pkt)) {
> +pkt = odp_packet_alloc(netdev->pkt_pool, 0);
> +if (!odp_packet_is_valid(pkt)) {
>  out_of_memory();
>  goto out_err;
>  }
>
> -netdev->max_frame_len = odph_packet_buf_size(pkt);
> +netdev->max_frame_len = odp_buffer_size(odp_packet_to_buffer(pkt));
>
> -odph_packet_free(pkt);
> +odp_packet_free(pkt);
>
>  ovs_mutex_init(&netdev->mutex);
>
> @@ -304,7 +301,7 @@ static int drop_err_pkts(odp_packet_t pkt_tbl[], unsigned 
> len)
>  p

Re: [lng-odp] [PATCH] validation: init: don't execute termination if init failed

2015-01-06 Thread Mike Holmes
Applied

On 5 January 2015 at 18:52, Anders Roxell  wrote:

> On 2014-12-29 18:53, Taras Kondratiuk wrote:
> > Signed-off-by: Taras Kondratiuk 
>
> Reviewed-by: Anders Roxell 
>
> > ---
> >  test/validation/odp_init.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/test/validation/odp_init.c b/test/validation/odp_init.c
> > index 5a17ce9..5277d68 100644
> > --- a/test/validation/odp_init.c
> > +++ b/test/validation/odp_init.c
> > @@ -14,7 +14,7 @@ static void test_odp_init_global(void)
> >  {
> >   int status;
> >   status = odp_init_global(NULL, NULL);
> > - CU_ASSERT(status == 0);
> > + CU_ASSERT_FATAL(status == 0);
> >
> >   status = odp_term_global();
> >   CU_ASSERT(status == 0);
> > --
> > 1.9.1
> >
> >
> > ___
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > http://lists.linaro.org/mailman/listinfo/lng-odp
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>



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


Re: [lng-odp] [PATCH] validation: system: copy model with snprintf

2015-01-06 Thread Mike Holmes
Applied

On 5 January 2015 at 18:50, Anders Roxell  wrote:

> On 2014-12-24 16:44, Mike Holmes wrote:
> > CID 85015:  Copy into fixed size buffer (STRING_OVERFLOW)
> >
> > Signed-off-by: Mike Holmes 
>
> Reviewed-by: Anders Roxell 
>
> > ---
> >  test/validation/odp_system.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/test/validation/odp_system.c b/test/validation/odp_system.c
> > index 2afd4a7..b5742c4 100644
> > --- a/test/validation/odp_system.c
> > +++ b/test/validation/odp_system.c
> > @@ -28,7 +28,7 @@ static void test_odp_sys_cpu_model_str(void)
> >  {
> >   char model[128];
> >
> > - strcpy(model, odp_sys_cpu_model_str());
> > + snprintf(model, 128, "%s", odp_sys_cpu_model_str());
> >   CU_ASSERT(strlen(model) > 0);
> >   CU_ASSERT(strlen(model) < 127);
> >  }
> > --
> > 2.1.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


Re: [lng-odp] [PATCH] linux-generic: bugfix: correct seglen calculation

2015-01-06 Thread Mike Holmes
Applied - added Geoffreys sign off to the commit.

On 4 January 2015 at 09:20, Bill Fischofer 
wrote:

> seglen computation did not account for seg_offset (problem and fix
> identified
> by Geoffrey Blake).
>
> Signed-off-by: Bill Fischofer 
> ---
>  platform/linux-generic/include/odp_buffer_inlines.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/platform/linux-generic/include/odp_buffer_inlines.h
> b/platform/linux-generic/include/odp_buffer_inlines.h
> index f880445..ade2878 100644
> --- a/platform/linux-generic/include/odp_buffer_inlines.h
> +++ b/platform/linux-generic/include/odp_buffer_inlines.h
> @@ -136,7 +136,7 @@ static inline void *buffer_map(odp_buffer_hdr_t *buf,
>
> if (seglen != NULL) {
> uint32_t buf_left = limit - offset;
> -   *seglen = buf_left < buf->segsize ?
> +   *seglen = seg_offset + buf_left <= buf->segsize ?
> buf_left : buf->segsize - seg_offset;
> }
>
> --
> 2.1.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


Re: [lng-odp] [PATCH] validation: add odp_schedule_pause and odp_schedule_resume tests

2015-01-06 Thread Ciprian Barbu
On Wed, Dec 17, 2014 at 5:09 PM, Jerin Jacob
 wrote:
> On Wed, Dec 17, 2014 at 03:10:11PM +0200, Ciprian Barbu wrote:
>> Signed-off-by: Ciprian Barbu 
>> ---
>>  test/validation/odp_schedule.c | 63 
>> ++
>>  1 file changed, 58 insertions(+), 5 deletions(-)
>>
>> diff --git a/test/validation/odp_schedule.c b/test/validation/odp_schedule.c
>> index 31be742..bdbcf77 100644
>> --- a/test/validation/odp_schedule.c
>> +++ b/test/validation/odp_schedule.c
>> @@ -11,9 +11,11 @@
>>  #define MSG_POOL_SIZE(4*1024*1024)
>>  #define QUEUES_PER_PRIO  16
>>  #define BUF_SIZE 64
>> -#define TEST_NUM_BUFS100
>> +#define NUM_BUFS 100
>>  #define BURST_BUF_SIZE   4
>> -#define TEST_NUM_BUFS_EXCL   1
>> +#define NUM_BUFS_EXCL1
>> +#define NUM_BUFS_PAUSE   1000
>> +#define NUM_BUFS_BEFORE_PAUSE10
>>
>>  #define GLOBALS_SHM_NAME "test_globals"
>>  #define MSG_POOL_NAME"msg_pool"
>> @@ -229,7 +231,7 @@ static void schedule_common(odp_schedule_sync_t sync, 
>> int num_queues,
>>   args.sync = sync;
>>   args.num_queues = num_queues;
>>   args.num_prio = num_prio;
>> - args.num_bufs = TEST_NUM_BUFS;
>> + args.num_bufs = NUM_BUFS;
>>   args.num_cores = 1;
>>   args.enable_schd_multi = enable_schd_multi;
>>   args.enable_excl_atomic = 0;/* Not needed with a single core */
>> @@ -261,9 +263,9 @@ static void parallel_execute(odp_schedule_sync_t sync, 
>> int num_queues,
>>   thr_args->num_queues = num_queues;
>>   thr_args->num_prio = num_prio;
>>   if (enable_excl_atomic)
>> - thr_args->num_bufs = TEST_NUM_BUFS_EXCL;
>> + thr_args->num_bufs = NUM_BUFS_EXCL;
>>   else
>> - thr_args->num_bufs = TEST_NUM_BUFS;
>> + thr_args->num_bufs = NUM_BUFS;
>>   thr_args->num_cores = globals->core_count;
>>   thr_args->enable_schd_multi = enable_schd_multi;
>>   thr_args->enable_excl_atomic = enable_excl_atomic;
>> @@ -459,6 +461,56 @@ static void test_schedule_multi_1q_mt_a_excl(void)
>>ENABLE_EXCL_ATOMIC);
>>  }
>>
>> +static void test_schedule_pause_resume(void)
>> +{
>> + odp_queue_t queue;
>> + odp_buffer_t buf;
>> + odp_queue_t from;
>> + int i;
>> + int local_bufs = 0;
>> +
>> + queue = odp_queue_lookup("sched_0_0_n");
>> + CU_ASSERT(queue != ODP_QUEUE_INVALID);
>> +
>> + pool = odp_buffer_pool_lookup(MSG_POOL_NAME);
>> + CU_ASSERT_FATAL(pool != ODP_BUFFER_POOL_INVALID);
>> +
>> +
>> + for (i = 0; i < NUM_BUFS_PAUSE; i++) {
>> + buf = odp_buffer_alloc(pool);
>> + CU_ASSERT(buf != ODP_BUFFER_INVALID);
>> + odp_queue_enq(queue, buf);
>> + }
>> +
>> + for (i = 0; i < NUM_BUFS_BEFORE_PAUSE; i++) {
>> + buf = odp_schedule(&from, ODP_SCHED_NO_WAIT);
>> + CU_ASSERT(from == queue);
>> + odp_buffer_free(buf);
>> + }
>> +
>> + odp_schedule_pause();
>> +
>> + while (1) {
>> + buf = odp_schedule(&from, ODP_SCHED_NO_WAIT);
>> + if (buf == ODP_BUFFER_INVALID)
>> + break;
>> +
>> + CU_ASSERT(from == queue);
>> + odp_buffer_free(buf);
>> + local_bufs++;
>> + }
>> +
>> + CU_ASSERT(local_bufs < NUM_BUFS_PAUSE - NUM_BUFS_BEFORE_PAUSE);
>
> Whats is the expected behavior here, Shouldn't it be CU_ASSERT(local_bufs == 
> 0) ?
> meaning, the complete pause ?

Sorry about the delay, I've been playing around with mutt and I must
have accidentally marked this email as read.
The explanation here is that after pausing the scheduling, there might
still be locally reserved buffers (see the odp_schedule_pause
documentation). For linux-generic for instance the scheduler dequeues
buffers in bursts, odp_scheduler_pause only stops further dequeues,
buffers may still be in the 'reservoirs'. With that in mind, the check
above makes sure that after pausing only a limited number of packets
are still scheduled, or else said pausing seems to work, not all
packets being drained.

>
>> +
>> + odp_schedule_resume();
>> +
>> + for (i = local_bufs + NUM_BUFS_BEFORE_PAUSE; i < NUM_BUFS_PAUSE; i++) {
>> + buf = odp_schedule(&from, ODP_SCHED_WAIT);
>> + CU_ASSERT(from == queue);
>> + odp_buffer_free(buf);
>> + }
>> +}
>> +
>>  static int create_queues(void)
>>  {
>>   int i, j, prios;
>> @@ -594,6 +646,7 @@ struct CU_TestInfo test_odp_schedule[] = {
>>   {"schedule_multi_mq_mt_prio_a", test_schedule_multi_mq_mt_prio_a},
>>   {"schedule_multi_mq_mt_prio_o", test_schedule_multi_mq_mt_prio_o},
>>   {"schedule_multi_1q_mt_a_excl", test_schedule_multi_1q_mt_a_excl},
>> + {"schedule_pause_resume",   test_schedule_pause_resume},
>>   CU_TEST_INFO_NULL,
>>  };
>>
>> --
>> 1.8.3.2
>>
>>
>> ___

Re: [lng-odp] [PATCH] validation: add odp_schedule_pause and odp_schedule_resume tests

2015-01-06 Thread Bill Fischofer
Caches should be transparent.  While this may be needed here, it's a poor
set of semantics to expose as part of the formal APIs.  This is definitely
something we need to address.  My suggestion is that a odp_schedule_pause()
should cause an implicit cache flush if the implementation is using a
scheduling cache.  That way any cache being used is truly transparent and
moreover there won't be unnecessary delays in event processing since who
knows how long a pause may last?  Clearly it won't be brief since otherwise
the application would not have bothered with a pause/resume in the first
place.

On Tue, Jan 6, 2015 at 7:17 AM, Ciprian Barbu 
wrote:

> On Wed, Dec 17, 2014 at 5:09 PM, Jerin Jacob
>  wrote:
> > On Wed, Dec 17, 2014 at 03:10:11PM +0200, Ciprian Barbu wrote:
> >> Signed-off-by: Ciprian Barbu 
> >> ---
> >>  test/validation/odp_schedule.c | 63
> ++
> >>  1 file changed, 58 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/test/validation/odp_schedule.c
> b/test/validation/odp_schedule.c
> >> index 31be742..bdbcf77 100644
> >> --- a/test/validation/odp_schedule.c
> >> +++ b/test/validation/odp_schedule.c
> >> @@ -11,9 +11,11 @@
> >>  #define MSG_POOL_SIZE(4*1024*1024)
> >>  #define QUEUES_PER_PRIO  16
> >>  #define BUF_SIZE 64
> >> -#define TEST_NUM_BUFS100
> >> +#define NUM_BUFS 100
> >>  #define BURST_BUF_SIZE   4
> >> -#define TEST_NUM_BUFS_EXCL   1
> >> +#define NUM_BUFS_EXCL1
> >> +#define NUM_BUFS_PAUSE   1000
> >> +#define NUM_BUFS_BEFORE_PAUSE10
> >>
> >>  #define GLOBALS_SHM_NAME "test_globals"
> >>  #define MSG_POOL_NAME"msg_pool"
> >> @@ -229,7 +231,7 @@ static void schedule_common(odp_schedule_sync_t
> sync, int num_queues,
> >>   args.sync = sync;
> >>   args.num_queues = num_queues;
> >>   args.num_prio = num_prio;
> >> - args.num_bufs = TEST_NUM_BUFS;
> >> + args.num_bufs = NUM_BUFS;
> >>   args.num_cores = 1;
> >>   args.enable_schd_multi = enable_schd_multi;
> >>   args.enable_excl_atomic = 0;/* Not needed with a single core
> */
> >> @@ -261,9 +263,9 @@ static void parallel_execute(odp_schedule_sync_t
> sync, int num_queues,
> >>   thr_args->num_queues = num_queues;
> >>   thr_args->num_prio = num_prio;
> >>   if (enable_excl_atomic)
> >> - thr_args->num_bufs = TEST_NUM_BUFS_EXCL;
> >> + thr_args->num_bufs = NUM_BUFS_EXCL;
> >>   else
> >> - thr_args->num_bufs = TEST_NUM_BUFS;
> >> + thr_args->num_bufs = NUM_BUFS;
> >>   thr_args->num_cores = globals->core_count;
> >>   thr_args->enable_schd_multi = enable_schd_multi;
> >>   thr_args->enable_excl_atomic = enable_excl_atomic;
> >> @@ -459,6 +461,56 @@ static void test_schedule_multi_1q_mt_a_excl(void)
> >>ENABLE_EXCL_ATOMIC);
> >>  }
> >>
> >> +static void test_schedule_pause_resume(void)
> >> +{
> >> + odp_queue_t queue;
> >> + odp_buffer_t buf;
> >> + odp_queue_t from;
> >> + int i;
> >> + int local_bufs = 0;
> >> +
> >> + queue = odp_queue_lookup("sched_0_0_n");
> >> + CU_ASSERT(queue != ODP_QUEUE_INVALID);
> >> +
> >> + pool = odp_buffer_pool_lookup(MSG_POOL_NAME);
> >> + CU_ASSERT_FATAL(pool != ODP_BUFFER_POOL_INVALID);
> >> +
> >> +
> >> + for (i = 0; i < NUM_BUFS_PAUSE; i++) {
> >> + buf = odp_buffer_alloc(pool);
> >> + CU_ASSERT(buf != ODP_BUFFER_INVALID);
> >> + odp_queue_enq(queue, buf);
> >> + }
> >> +
> >> + for (i = 0; i < NUM_BUFS_BEFORE_PAUSE; i++) {
> >> + buf = odp_schedule(&from, ODP_SCHED_NO_WAIT);
> >> + CU_ASSERT(from == queue);
> >> + odp_buffer_free(buf);
> >> + }
> >> +
> >> + odp_schedule_pause();
> >> +
> >> + while (1) {
> >> + buf = odp_schedule(&from, ODP_SCHED_NO_WAIT);
> >> + if (buf == ODP_BUFFER_INVALID)
> >> + break;
> >> +
> >> + CU_ASSERT(from == queue);
> >> + odp_buffer_free(buf);
> >> + local_bufs++;
> >> + }
> >> +
> >> + CU_ASSERT(local_bufs < NUM_BUFS_PAUSE - NUM_BUFS_BEFORE_PAUSE);
> >
> > Whats is the expected behavior here, Shouldn't it be
> CU_ASSERT(local_bufs == 0) ?
> > meaning, the complete pause ?
>
> Sorry about the delay, I've been playing around with mutt and I must
> have accidentally marked this email as read.
> The explanation here is that after pausing the scheduling, there might
> still be locally reserved buffers (see the odp_schedule_pause
> documentation). For linux-generic for instance the scheduler dequeues
> buffers in bursts, odp_scheduler_pause only stops further dequeues,
> buffers may still be in the 'reservoirs'. With that in mind, the check
> above makes sure that after pausing only a limited number of packets
> are still schedule

Re: [lng-odp] [PATCH] validation: add odp_schedule_pause and odp_schedule_resume tests

2015-01-06 Thread Mike Holmes
Should a bug be made to track a needed change or is it important for 1.0
and needs to be in the delta doc ?

On 6 January 2015 at 08:40, Bill Fischofer 
wrote:

> Caches should be transparent.  While this may be needed here, it's a poor
> set of semantics to expose as part of the formal APIs.  This is definitely
> something we need to address.  My suggestion is that a odp_schedule_pause()
> should cause an implicit cache flush if the implementation is using a
> scheduling cache.  That way any cache being used is truly transparent and
> moreover there won't be unnecessary delays in event processing since who
> knows how long a pause may last?  Clearly it won't be brief since otherwise
> the application would not have bothered with a pause/resume in the first
> place.
>
> On Tue, Jan 6, 2015 at 7:17 AM, Ciprian Barbu 
> wrote:
>
>> On Wed, Dec 17, 2014 at 5:09 PM, Jerin Jacob
>>  wrote:
>> > On Wed, Dec 17, 2014 at 03:10:11PM +0200, Ciprian Barbu wrote:
>> >> Signed-off-by: Ciprian Barbu 
>> >> ---
>> >>  test/validation/odp_schedule.c | 63
>> ++
>> >>  1 file changed, 58 insertions(+), 5 deletions(-)
>> >>
>> >> diff --git a/test/validation/odp_schedule.c
>> b/test/validation/odp_schedule.c
>> >> index 31be742..bdbcf77 100644
>> >> --- a/test/validation/odp_schedule.c
>> >> +++ b/test/validation/odp_schedule.c
>> >> @@ -11,9 +11,11 @@
>> >>  #define MSG_POOL_SIZE(4*1024*1024)
>> >>  #define QUEUES_PER_PRIO  16
>> >>  #define BUF_SIZE 64
>> >> -#define TEST_NUM_BUFS100
>> >> +#define NUM_BUFS 100
>> >>  #define BURST_BUF_SIZE   4
>> >> -#define TEST_NUM_BUFS_EXCL   1
>> >> +#define NUM_BUFS_EXCL1
>> >> +#define NUM_BUFS_PAUSE   1000
>> >> +#define NUM_BUFS_BEFORE_PAUSE10
>> >>
>> >>  #define GLOBALS_SHM_NAME "test_globals"
>> >>  #define MSG_POOL_NAME"msg_pool"
>> >> @@ -229,7 +231,7 @@ static void schedule_common(odp_schedule_sync_t
>> sync, int num_queues,
>> >>   args.sync = sync;
>> >>   args.num_queues = num_queues;
>> >>   args.num_prio = num_prio;
>> >> - args.num_bufs = TEST_NUM_BUFS;
>> >> + args.num_bufs = NUM_BUFS;
>> >>   args.num_cores = 1;
>> >>   args.enable_schd_multi = enable_schd_multi;
>> >>   args.enable_excl_atomic = 0;/* Not needed with a single core
>> */
>> >> @@ -261,9 +263,9 @@ static void parallel_execute(odp_schedule_sync_t
>> sync, int num_queues,
>> >>   thr_args->num_queues = num_queues;
>> >>   thr_args->num_prio = num_prio;
>> >>   if (enable_excl_atomic)
>> >> - thr_args->num_bufs = TEST_NUM_BUFS_EXCL;
>> >> + thr_args->num_bufs = NUM_BUFS_EXCL;
>> >>   else
>> >> - thr_args->num_bufs = TEST_NUM_BUFS;
>> >> + thr_args->num_bufs = NUM_BUFS;
>> >>   thr_args->num_cores = globals->core_count;
>> >>   thr_args->enable_schd_multi = enable_schd_multi;
>> >>   thr_args->enable_excl_atomic = enable_excl_atomic;
>> >> @@ -459,6 +461,56 @@ static void test_schedule_multi_1q_mt_a_excl(void)
>> >>ENABLE_EXCL_ATOMIC);
>> >>  }
>> >>
>> >> +static void test_schedule_pause_resume(void)
>> >> +{
>> >> + odp_queue_t queue;
>> >> + odp_buffer_t buf;
>> >> + odp_queue_t from;
>> >> + int i;
>> >> + int local_bufs = 0;
>> >> +
>> >> + queue = odp_queue_lookup("sched_0_0_n");
>> >> + CU_ASSERT(queue != ODP_QUEUE_INVALID);
>> >> +
>> >> + pool = odp_buffer_pool_lookup(MSG_POOL_NAME);
>> >> + CU_ASSERT_FATAL(pool != ODP_BUFFER_POOL_INVALID);
>> >> +
>> >> +
>> >> + for (i = 0; i < NUM_BUFS_PAUSE; i++) {
>> >> + buf = odp_buffer_alloc(pool);
>> >> + CU_ASSERT(buf != ODP_BUFFER_INVALID);
>> >> + odp_queue_enq(queue, buf);
>> >> + }
>> >> +
>> >> + for (i = 0; i < NUM_BUFS_BEFORE_PAUSE; i++) {
>> >> + buf = odp_schedule(&from, ODP_SCHED_NO_WAIT);
>> >> + CU_ASSERT(from == queue);
>> >> + odp_buffer_free(buf);
>> >> + }
>> >> +
>> >> + odp_schedule_pause();
>> >> +
>> >> + while (1) {
>> >> + buf = odp_schedule(&from, ODP_SCHED_NO_WAIT);
>> >> + if (buf == ODP_BUFFER_INVALID)
>> >> + break;
>> >> +
>> >> + CU_ASSERT(from == queue);
>> >> + odp_buffer_free(buf);
>> >> + local_bufs++;
>> >> + }
>> >> +
>> >> + CU_ASSERT(local_bufs < NUM_BUFS_PAUSE - NUM_BUFS_BEFORE_PAUSE);
>> >
>> > Whats is the expected behavior here, Shouldn't it be
>> CU_ASSERT(local_bufs == 0) ?
>> > meaning, the complete pause ?
>>
>> Sorry about the delay, I've been playing around with mutt and I must
>> have accidentally marked this email as read.
>> The explanation here is that after pausing the scheduling, there might
>> still be locally reserved buffers (see the odp_schedule_pause
>> documentation

Re: [lng-odp] [PATCH] ipsec: corrected create_ipsec_cache_entry's out_pool argument handle type

2015-01-06 Thread Mike Holmes
Thanks Jerin

I can change this on commit but the short log might be better with the
approximate directory listed first

example: ipsec: corrected create_ipsec_cache_entry's out_pool argument
handle type

On 6 January 2015 at 06:16, Jerin Jacob 
wrote:

> Signed-off-by: Jerin Jacob 
> ---
>  example/ipsec/odp_ipsec_cache.c | 2 +-
>  example/ipsec/odp_ipsec_cache.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/example/ipsec/odp_ipsec_cache.c
> b/example/ipsec/odp_ipsec_cache.c
> index 7a0c813..4447163 100644
> --- a/example/ipsec/odp_ipsec_cache.c
> +++ b/example/ipsec/odp_ipsec_cache.c
> @@ -41,7 +41,7 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa,
>  crypto_api_mode_e api_mode,
>  bool in,
>  odp_queue_t completionq,
> -odp_buffer_t out_pool)
> +odp_buffer_pool_t out_pool)
>  {
> odp_crypto_session_params_t params;
> ipsec_cache_entry_t *entry;
> diff --git a/example/ipsec/odp_ipsec_cache.h
> b/example/ipsec/odp_ipsec_cache.h
> index 2cbaabd..8d9d393 100644
> --- a/example/ipsec/odp_ipsec_cache.h
> +++ b/example/ipsec/odp_ipsec_cache.h
> @@ -90,7 +90,7 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa,
>  crypto_api_mode_e api_mode,
>  bool in,
>  odp_queue_t completionq,
> -odp_buffer_t out_pool);
> +odp_buffer_pool_t out_pool);
>
>  /**
>   * Find a matching IPsec cache entry for input packet
> --
> 1.9.3
>
>
> ___
> 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


Re: [lng-odp] [PATCH] validation: add odp_schedule_pause and odp_schedule_resume tests

2015-01-06 Thread Bill Fischofer
I think it's something we need to discuss during the sync call.

On Tue, Jan 6, 2015 at 7:48 AM, Mike Holmes  wrote:

> Should a bug be made to track a needed change or is it important for 1.0
> and needs to be in the delta doc ?
>
> On 6 January 2015 at 08:40, Bill Fischofer 
> wrote:
>
>> Caches should be transparent.  While this may be needed here, it's a poor
>> set of semantics to expose as part of the formal APIs.  This is definitely
>> something we need to address.  My suggestion is that a odp_schedule_pause()
>> should cause an implicit cache flush if the implementation is using a
>> scheduling cache.  That way any cache being used is truly transparent and
>> moreover there won't be unnecessary delays in event processing since who
>> knows how long a pause may last?  Clearly it won't be brief since otherwise
>> the application would not have bothered with a pause/resume in the first
>> place.
>>
>> On Tue, Jan 6, 2015 at 7:17 AM, Ciprian Barbu 
>> wrote:
>>
>>> On Wed, Dec 17, 2014 at 5:09 PM, Jerin Jacob
>>>  wrote:
>>> > On Wed, Dec 17, 2014 at 03:10:11PM +0200, Ciprian Barbu wrote:
>>> >> Signed-off-by: Ciprian Barbu 
>>> >> ---
>>> >>  test/validation/odp_schedule.c | 63
>>> ++
>>> >>  1 file changed, 58 insertions(+), 5 deletions(-)
>>> >>
>>> >> diff --git a/test/validation/odp_schedule.c
>>> b/test/validation/odp_schedule.c
>>> >> index 31be742..bdbcf77 100644
>>> >> --- a/test/validation/odp_schedule.c
>>> >> +++ b/test/validation/odp_schedule.c
>>> >> @@ -11,9 +11,11 @@
>>> >>  #define MSG_POOL_SIZE(4*1024*1024)
>>> >>  #define QUEUES_PER_PRIO  16
>>> >>  #define BUF_SIZE 64
>>> >> -#define TEST_NUM_BUFS100
>>> >> +#define NUM_BUFS 100
>>> >>  #define BURST_BUF_SIZE   4
>>> >> -#define TEST_NUM_BUFS_EXCL   1
>>> >> +#define NUM_BUFS_EXCL1
>>> >> +#define NUM_BUFS_PAUSE   1000
>>> >> +#define NUM_BUFS_BEFORE_PAUSE10
>>> >>
>>> >>  #define GLOBALS_SHM_NAME "test_globals"
>>> >>  #define MSG_POOL_NAME"msg_pool"
>>> >> @@ -229,7 +231,7 @@ static void schedule_common(odp_schedule_sync_t
>>> sync, int num_queues,
>>> >>   args.sync = sync;
>>> >>   args.num_queues = num_queues;
>>> >>   args.num_prio = num_prio;
>>> >> - args.num_bufs = TEST_NUM_BUFS;
>>> >> + args.num_bufs = NUM_BUFS;
>>> >>   args.num_cores = 1;
>>> >>   args.enable_schd_multi = enable_schd_multi;
>>> >>   args.enable_excl_atomic = 0;/* Not needed with a single
>>> core */
>>> >> @@ -261,9 +263,9 @@ static void parallel_execute(odp_schedule_sync_t
>>> sync, int num_queues,
>>> >>   thr_args->num_queues = num_queues;
>>> >>   thr_args->num_prio = num_prio;
>>> >>   if (enable_excl_atomic)
>>> >> - thr_args->num_bufs = TEST_NUM_BUFS_EXCL;
>>> >> + thr_args->num_bufs = NUM_BUFS_EXCL;
>>> >>   else
>>> >> - thr_args->num_bufs = TEST_NUM_BUFS;
>>> >> + thr_args->num_bufs = NUM_BUFS;
>>> >>   thr_args->num_cores = globals->core_count;
>>> >>   thr_args->enable_schd_multi = enable_schd_multi;
>>> >>   thr_args->enable_excl_atomic = enable_excl_atomic;
>>> >> @@ -459,6 +461,56 @@ static void
>>> test_schedule_multi_1q_mt_a_excl(void)
>>> >>ENABLE_EXCL_ATOMIC);
>>> >>  }
>>> >>
>>> >> +static void test_schedule_pause_resume(void)
>>> >> +{
>>> >> + odp_queue_t queue;
>>> >> + odp_buffer_t buf;
>>> >> + odp_queue_t from;
>>> >> + int i;
>>> >> + int local_bufs = 0;
>>> >> +
>>> >> + queue = odp_queue_lookup("sched_0_0_n");
>>> >> + CU_ASSERT(queue != ODP_QUEUE_INVALID);
>>> >> +
>>> >> + pool = odp_buffer_pool_lookup(MSG_POOL_NAME);
>>> >> + CU_ASSERT_FATAL(pool != ODP_BUFFER_POOL_INVALID);
>>> >> +
>>> >> +
>>> >> + for (i = 0; i < NUM_BUFS_PAUSE; i++) {
>>> >> + buf = odp_buffer_alloc(pool);
>>> >> + CU_ASSERT(buf != ODP_BUFFER_INVALID);
>>> >> + odp_queue_enq(queue, buf);
>>> >> + }
>>> >> +
>>> >> + for (i = 0; i < NUM_BUFS_BEFORE_PAUSE; i++) {
>>> >> + buf = odp_schedule(&from, ODP_SCHED_NO_WAIT);
>>> >> + CU_ASSERT(from == queue);
>>> >> + odp_buffer_free(buf);
>>> >> + }
>>> >> +
>>> >> + odp_schedule_pause();
>>> >> +
>>> >> + while (1) {
>>> >> + buf = odp_schedule(&from, ODP_SCHED_NO_WAIT);
>>> >> + if (buf == ODP_BUFFER_INVALID)
>>> >> + break;
>>> >> +
>>> >> + CU_ASSERT(from == queue);
>>> >> + odp_buffer_free(buf);
>>> >> + local_bufs++;
>>> >> + }
>>> >> +
>>> >> + CU_ASSERT(local_bufs < NUM_BUFS_PAUSE - NUM_BUFS_BEFORE_PAUSE);
>>> >
>>> > Whats is the expected behavior here, Shouldn't it be
>>> CU_ASSERT(local_bufs == 0) ?
>>> > meaning, the complete pause ?
>>>
>>> Sorry about the delay, I'

[lng-odp] UberConference Reminder

2015-01-06 Thread UberConference
UberConference Reminder___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] validation: buffer: fix invalid packet segment macro

2015-01-06 Thread Mike Holmes
Applied

On 30 December 2014 at 01:02, Bala  wrote:

> Reviewed-by: Bala Manoharan 
>
> On Monday 29 December 2014 10:23 PM, Taras Kondratiuk wrote:
>
>> ODP_PACKET_SEG_INVALID is a correct macro for an invalid packet segment.
>>
>> Signed-off-by: Taras Kondratiuk 
>> ---
>>   test/validation/buffer/odp_packet_test.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/test/validation/buffer/odp_packet_test.c
>> b/test/validation/buffer/odp_packet_test.c
>> index 57a9aa9..d073b49 100644
>> --- a/test/validation/buffer/odp_packet_test.c
>> +++ b/test/validation/buffer/odp_packet_test.c
>> @@ -267,7 +267,7 @@ static void _verify_tailroom_shift(odp_packet_t pkt,
>> tail_orig = odp_packet_tail(pkt);
>> seg = odp_packet_last_seg(pkt);
>> -   CU_ASSERT(seg != ODP_SEGMENT_INVALID);
>> +   CU_ASSERT(seg != ODP_PACKET_SEG_INVALID);
>> seg_data_len = odp_packet_seg_data_len(pkt, seg);
>> if (shift >= 0) {
>> @@ -309,7 +309,7 @@ static void packet_tailroom(void)
>> uint32_t push_val, pull_val;
>> segment = odp_packet_last_seg(pkt);
>> -   CU_ASSERT(segment != ODP_SEGMENT_INVALID);
>> +   CU_ASSERT(segment != ODP_PACKET_SEG_INVALID);
>> room = odp_packet_tailroom(pkt);
>>   #if ODP_CONFIG_PACKET_TAILROOM != 0 /* Avoid 'always true' warning */
>> CU_ASSERT(room >= ODP_CONFIG_PACKET_TAILROOM);
>>
>
>
> ___
> 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


Re: [lng-odp] [PATCH] OVS-ODP: ODP v0.6.0 support

2015-01-06 Thread Zoltan Kiss



On 05/01/15 20:26, Bill Fischofer wrote:



On Mon, Jan 5, 2015 at 1:19 PM, Zoltan Kiss mailto:zoltan.k...@linaro.org>> wrote:

This is only compile tested, and there are a few questions in the patch.

Signed-off-by: Zoltan Kiss mailto:zoltan.k...@linaro.org>>
---
diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
index 96126a1..571b66e 100644
--- a/lib/netdev-odp.c
+++ b/lib/netdev-odp.c



@@ -129,26 +129,26 @@ odp_init(int argc, char *argv[])
  static int
  odp_class_init(void)
  {
-void *pool_base;
  odp_shm_t shm;
+odp_buffer_pool_param_t params;
  int result = 0;

  /* create packet pool */
  shm = odp_shm_reserve("shm_packet_pool", SHM_PKT_POOL_SIZE,
ODP_CACHE_LINE_SIZE, 0);
-pool_base = odp_shm_addr(shm);

-if (odp_unlikely(pool_base == NULL)) {
+if (odp_unlikely(shm == ODP_SHM_INVALID)) {
  VLOG_ERR("Error: ODP packet pool mem alloc failed\n");
  out_of_memory();
  return -1;
  }

-pool = odp_buffer_pool_create("packet_pool", pool_base,
-  SHM_PKT_POOL_SIZE,
-  SHM_PKT_POOL_BUF_SIZE,
-  ODP_CACHE_LINE_SIZE,
-  ODP_BUFFER_TYPE_PACKET);
+params.buf_size = SHM_PKT_POOL_BUF_SIZE;
+params.buf_align = ODP_CACHE_LINE_SIZE;
+params.num_bufs = SHM_PKT_POOL_SIZE / SHM_PKT_POOL_BUF_SIZE;
+params.buf_type = ODP_BUFFER_TYPE_PACKET;
+
+pool = odp_buffer_pool_create("packet_pool", shm, ¶ms);

You really shouldn't be attempting to allocate your own SHM here.
Instead, delete the odp_shm_reserve() calls and pass ODP_SHM_NULL as the
second parameter to odp_buffer_pool_create() and ODP will allocate the
memory for you.  There is no architected way to determine how large a
SHM you need to allocate to successfully do it the other way, so this
provision of the API is of somewhat questionable utility.


Ok, I'll use it that way.




  if (struct_pool == ODP_BUFFER_POOL_INVALID) {
  VLOG_ERR("Error: packet pool create failed.\n");
@@ -247,15 +244,15 @@ netdev_odp_construct(struct netdev *netdev_)
  }

  netdev->pkt_pool = pool;
-pkt = odph_packet_alloc(netdev->pkt_pool);
-if (!odph_packet_is_valid(pkt)) {
+pkt = odp_packet_alloc(netdev->pkt_pool, 0);
+if (!odp_packet_is_valid(pkt)) {
  out_of_memory();
  goto out_err;
  }


It's more efficient to say if (pkt == ODP_PACKET_INVALID) here for this
test.


-netdev->max_frame_len = odph_packet_buf_size(pkt);
+netdev->max_frame_len = odp_buffer_size(odp_packet_to_buffer(pkt));


Need more context as to what you're trying to determine here.  If you
want to know what's the largest size packet you can receive that's
ODP_CONFIG_PACKET_BUF_LEN_MAX


This was written by Ciprian, but as far as I saw the only reason to 
allocate this packet is to determine the maximum packet size for this 
particular pool, not absolute maximum.

odp_buffer_pool_info is better for this goal.



@@ -334,19 +331,21 @@ clone_pkts(struct netdev_odp *dev, struct
dpif_packet **pkts,
  dropped++;
  continue;
  }
-pkt = odph_packet_alloc(dev->pkt_pool);
+pkt = odp_packet_alloc(dev->pkt_pool, size);

-if (OVS_UNLIKELY(!odph_packet_is_valid(pkt))) {
+if (OVS_UNLIKELY(pkt == ODP_PACKET_INVALID)) {
  VLOG_WARN_RL(&rl, "Could not allocate packet");
  dropped += cnt -i;
  break;
  }

-odp_packet_init(pkt);
-odp_packet_set_l2_offset(pkt, 0);
+odp_packet_reset(pkt, 0);
+odp_packet_l2_offset_set(pkt, 0);

-memcpy(odp_packet_l2(pkt), ofpbuf_data(&pkts[i]->ofpbuf),
size);
-odp_packet_parse(pkt, size, 0);
+memcpy(odp_packet_l2_ptr(pkt, NULL),
ofpbuf_data(&pkts[i]->ofpbuf),
+  size);
+/* TODO: is this OK? */


You shouldn't use memcpy on packets.  Instead, to set the length and
copy the packet this should be:





 odp_packet_push_tail(pkt, size);
 odp_packet_copydata_in(pkt, 0, size,
ofpbuf_data(&pkts[i]->ofpbuf));

+_odp_packet_parse(pkt);


This is an internal API and should not be called by an ODP app.  It
should be an ODP API but Petri hasn't approved it as such, hence it
can't be used.
If this came in on an ODP interface, then we don't need to parse it as 
Ciprian wrote in an another mail, because it was parsed during reception.
But if it came from another kind of port (I'm not sure that's possible 
at the moment, but I think we will need that), we need to parse here.





@@ -649,10 +648,12 @@ netdev_odp_rxq

[lng-odp] [PATCH] Add weak ODP_ABORT

2015-01-06 Thread Mike Holmes
Adding a weak definition of ODP_ABORT allows applications spawning threads to
intercept those threads calling abort.

In the case of the unit testing this allows the unit test framework to cleanly
exit the test, maintain the pass / fail statistics and continue with the next 
test.


Mike Holmes (1):
  api: odp_debug: make ODP_ABORT a weak symbol

 platform/linux-generic/include/api/odp_debug.h  | 14 ++
 platform/linux-generic/include/api/odp_hints.h  |  5 +
 platform/linux-generic/include/odp_debug_internal.h |  4 ++--
 platform/linux-generic/odp_weak.c   |  5 +
 4 files changed, 26 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] api: odp_debug: make ODP_ABORT a weak symbol

2015-01-06 Thread Mike Holmes
Add a weak definition of ODP_ABORT so that it may be overridden by an
application.

Signed-off-by: Mike Holmes 
---
 platform/linux-generic/include/api/odp_debug.h  | 14 ++
 platform/linux-generic/include/api/odp_hints.h  |  5 +
 platform/linux-generic/include/odp_debug_internal.h |  4 ++--
 platform/linux-generic/odp_weak.c   |  5 +
 4 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/platform/linux-generic/include/api/odp_debug.h 
b/platform/linux-generic/include/api/odp_debug.h
index a4ce1d9..dd4eb89 100644
--- a/platform/linux-generic/include/api/odp_debug.h
+++ b/platform/linux-generic/include/api/odp_debug.h
@@ -12,6 +12,7 @@
 #ifndef ODP_DEBUG_H_
 #define ODP_DEBUG_H_
 
+#include 
 
 #ifdef __cplusplus
 extern "C" {
@@ -75,6 +76,19 @@ typedef enum odp_log_level {
  */
 extern int odp_override_log(odp_log_level_e level, const char *fmt, ...);
 
+/**
+ * ODP abort function
+ *
+ * Where a fatal event can be identified within the ODP implementation an
+ * ODP_ASSERT may used which can be controlled via ODP_DEBUG. In cases where
+ * an abort must always be called ODP_ABORT may be called directly. In
+ * both cases these macros will call odp_override_abort
+ * ODP platform MUST provide a default *weak* implementation of this function.
+ * Application MAY override the function if needed by providing a strong
+ * function.
+ * @note This function must never return.
+ */
+extern void odp_override_abort(void) ODP_NORETURN;
 
 
 /**
diff --git a/platform/linux-generic/include/api/odp_hints.h 
b/platform/linux-generic/include/api/odp_hints.h
index 7f04886..7eb9e36 100644
--- a/platform/linux-generic/include/api/odp_hints.h
+++ b/platform/linux-generic/include/api/odp_hints.h
@@ -32,6 +32,11 @@ extern "C" {
 #define ODP_WEAK_SYMBOL __attribute__((__weak__))
 
 /**
+ * Function never returns
+ */
+#define ODP_NORETURN__attribute__((__noreturn__))
+
+/**
  * Hot code section
  */
 #define ODP_HOT_CODE__attribute__((__hot__))
diff --git a/platform/linux-generic/include/odp_debug_internal.h 
b/platform/linux-generic/include/odp_debug_internal.h
index f6180d1..bbbe591 100644
--- a/platform/linux-generic/include/odp_debug_internal.h
+++ b/platform/linux-generic/include/odp_debug_internal.h
@@ -53,7 +53,7 @@ extern "C" {
 #define ODP_ASSERT(cond, msg) \
do { if ((ODP_DEBUG == 1) && (!(cond))) { \
ODP_ERR("%s\n", msg); \
-   abort(); } \
+   odp_override_abort(); } \
} while (0)
 
 /**
@@ -85,7 +85,7 @@ extern "C" {
 #define ODP_ABORT(fmt, ...) \
do { \
ODP_LOG(ODP_LOG_ABORT, fmt, ##__VA_ARGS__); \
-   abort(); \
+   odp_override_abort(); \
} while (0)
 
 /**
diff --git a/platform/linux-generic/odp_weak.c 
b/platform/linux-generic/odp_weak.c
index fccbc3f..ce87119 100644
--- a/platform/linux-generic/odp_weak.c
+++ b/platform/linux-generic/odp_weak.c
@@ -21,3 +21,8 @@ ODP_WEAK_SYMBOL int odp_override_log(odp_log_level_e level 
ODP_UNUSED,
 
return r;
 }
+
+ODP_WEAK_SYMBOL void odp_override_abort(void)
+{
+   abort();
+}
-- 
2.1.0


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


Re: [lng-odp] [PATCHv3 2/3] api: odp_timer.h: updated API, lock-less implementation

2015-01-06 Thread Ola Liljedahl
Weird. I did remote update and rebase origin/master before generating
the patch (I had to fix a couple of conflicts to get it to build).

Where do you get compilation error(s)?


On 6 January 2015 at 05:10, Bill Fischofer  wrote:
> If I try to manually apply this patch then it doesn't compile.  It does not
> appear that this patch is properly versioned against the current ODP tip.
>
> On Mon, Jan 5, 2015 at 12:55 PM, Bill Fischofer 
> wrote:
>>
>> This patch doesn't seem to apply on the current ODP tip.
>>
>> Bill
>>
>> On Mon, Jan 5, 2015 at 12:23 PM, Ola Liljedahl 
>> wrote:
>>>
>>> Signed-off-by: Ola Liljedahl 
>>>
>>> (This document/code contribution attached is provided under the terms of
>>> agreement LES-LTM-21309)
>>> The timer API is updated according to
>>>
>>> https://docs.google.com/a/linaro.org/document/d/1bfY_J8ecLJPsFTmYftb0NVmGnB9qkEc_NpcJ87yfaD8
>>> A major change is that timers are allocated and freed separately from
>>> timeouts being set and cancelled. The life-length of a timer normally
>>> corresponds to the life-length of the associated stateful flow while
>>> the life-length of a timeout corresponds to individual packets being
>>> transmitted and received.
>>> The reference timer implementation is lock-less for platforms with
>>> support for 128-bit (16-byte) atomic exchange and CAS operations.
>>> Otherwise a lock-based implementation (using as many locks as desired)
>>> is used but some operations (e.g. reset reusing existing timeout buffer)
>>> may still be lock-less.
>>> Updated the example example/timer/odp_timer_test.c according to the
>>> updated API.
>>> Updated the API according to Petri's review comments.
>>> ---
>>>  example/timer/odp_timer_test.c |  177 ++--
>>>  platform/linux-generic/include/api/odp_timer.h |  318 --
>>>  .../linux-generic/include/odp_timer_internal.h |   59 +-
>>>  platform/linux-generic/odp_timer.c | 1064
>>> ++--
>>>  4 files changed, 1139 insertions(+), 479 deletions(-)
>>>
>>> diff --git a/example/timer/odp_timer_test.c
>>> b/example/timer/odp_timer_test.c
>>> index 2acf2fc..71f72b4 100644
>>> --- a/example/timer/odp_timer_test.c
>>> +++ b/example/timer/odp_timer_test.c
>>> @@ -26,7 +26,6 @@
>>>
>>>
>>>  #define MAX_WORKERS   32/**< Max worker threads */
>>> -#define MSG_POOL_SIZE (4*1024*1024) /**< Message pool size */
>>>  #define MSG_NUM_BUFS  1 /**< Number of timers */
>>>
>>>
>>> @@ -44,69 +43,119 @@ typedef struct {
>>>  /** @private Barrier for test synchronisation */
>>>  static odp_barrier_t test_barrier;
>>>
>>> -/** @private Timer handle*/
>>> -static odp_timer_t test_timer;
>>> +/** @private Buffer pool handle */
>>> +static odp_buffer_pool_t pool;
>>>
>>> +/** @private Timer pool handle */
>>> +static odp_timer_pool_t tp;
>>> +
>>> +/** @private Number of timeouts to receive */
>>> +static odp_atomic_u32_t remain;
>>> +
>>> +/** @private Timer set status ASCII strings */
>>> +static const char *timerset2str(odp_timer_set_t val)
>>> +{
>>> +   switch (val) {
>>> +   case ODP_TIMER_SET_SUCCESS:
>>> +   return "success";
>>> +   case ODP_TIMER_SET_TOOEARLY:
>>> +   return "too early";
>>> +   case ODP_TIMER_SET_TOOLATE:
>>> +   return "too late";
>>> +   case ODP_TIMER_SET_NOBUF:
>>> +   return "no buffer";
>>> +   default:
>>> +   return "?";
>>> +   }
>>> +};
>>> +
>>> +/** @private Helper struct for timers */
>>> +struct test_timer {
>>> +   odp_timer_t tim;
>>> +   odp_buffer_t buf;
>>> +};
>>> +
>>> +/** @private Array of all timer helper structs */
>>> +static struct test_timer tt[256];
>>>
>>>  /** @private test timeout */
>>>  static void test_abs_timeouts(int thr, test_args_t *args)
>>>  {
>>> -   uint64_t tick;
>>> uint64_t period;
>>> uint64_t period_ns;
>>> odp_queue_t queue;
>>> -   odp_buffer_t buf;
>>> -   int num;
>>> +   uint64_t tick;
>>> +   struct test_timer *ttp;
>>>
>>> EXAMPLE_DBG("  [%i] test_timeouts\n", thr);
>>>
>>> queue = odp_queue_lookup("timer_queue");
>>>
>>> period_ns = args->period_us*ODP_TIME_USEC;
>>> -   period= odp_timer_ns_to_tick(test_timer, period_ns);
>>> +   period= odp_timer_ns_to_tick(tp, period_ns);
>>>
>>> EXAMPLE_DBG("  [%i] period %"PRIu64" ticks,  %"PRIu64" ns\n",
>>> thr,
>>> period, period_ns);
>>>
>>> -   tick = odp_timer_current_tick(test_timer);
>>> -
>>> -   EXAMPLE_DBG("  [%i] current tick %"PRIu64"\n", thr, tick);
>>> +   EXAMPLE_DBG("  [%i] current tick %"PRIu64"\n", thr,
>>> +   odp_timer_current_tick(tp));
>>>
>>> -   tick += period;
>>> -
>>> -   if (odp_timer_absolute_tmo(test_timer, tick, queue,
>>> ODP_BUFFER_INVALID)
>>> -   == ODP_TIMER_TMO_INVALID){
>>> -   EXAMPLE_DBG("Timeout request failed\n");
>>> 

Re: [lng-odp] [PATCHv3 2/3] api: odp_timer.h: updated API, lock-less implementation

2015-01-06 Thread Ola Liljedahl
On 6 January 2015 at 21:52, Mike Holmes  wrote:
>
> Using patch:
> lng-odp_PATCHv3_2-3_api_odp_timer.h_updated_API,_lock-less_implementation.mbox
>   Trying to apply patch
> Applying: api: odp_timer.h: updated API, lock-less implementation
> error: patch failed: example/timer/odp_timer_test.c:193
These are my lines 192-193 in this file:

test_abs_timeouts(thr, args);

But your version of example/timer/odp_timer_test.c is probably different.

> error: example/timer/odp_timer_test.c: patch does not apply
> Patch failed at 0001 api: odp_timer.h: updated API, lock-less implementation
> The copy of the patch that failed is found in:
>/home/mike/git/check-odp/build/odp-apply/.git/rebase-apply/patch
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
> Applying: api: odp_timer.h: updated API, lock-less implementation
> fatal: sha1 information is lacking or useless
> (example/timer/odp_timer_test.c).
> Repository lacks necessary blobs to fall back on 3-way merge.
> Cannot fall back to three-way merge.
> Patch failed at 0001 api: odp_timer.h: updated API, lock-less implementation
> The copy of the patch that failed is found in:
>/home/mike/git/check-odp/build/odp-apply/.git/rebase-apply/patch
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
>   Error: Patch failed to apply
>
>
> Using patch: lng-odp_PATCHv3_3-3_test_odp_timer.h_cunit_test.mbox
>   Trying to apply patch
>   Patch applied
> WARNING: line over 80 characters
> #174: FILE: test/validation/odp_timer.c:86:
> + printf("Wrong tick: expected %"PRIu64" actual %"PRIu64"\n",
>
> WARNING: line over 80 characters
> #289: FILE: test/validation/odp_timer.c:201:
> + CU_FAIL("Failed to set timer (tooearly/toolate)");
Well we don't care about line too long when it is caused string
constants. checkpatch complains when you break a string constant into
pieces so you can't win.

>
> total: 0 errors, 2 warnings, 0 checks, 372 lines checked
>
> NOTE: Ignored message types: DEPRECATED_VARIABLE NEW_TYPEDEFS
>
> /home/mike/incoming/ola/lng-odp_PATCHv3_3-3_test_odp_timer.h_cunit_test.mbox
> has style problems, please review.
>
> If any of these errors are false positives, please report
> them to the maintainer, see CHECKPATCH in MAINTAINERS.
>   Building with patch
> make[2]: *** [odp_timer.o] Error 1
> make[1]: *** [all-recursive] Error 1
> make: *** [all-recursive] Error 1
>
How can I make sure I have the "tip" in my branch?
My timer-branch is derived from another branch (atomic_int.h) which is
in turn derived from another branch (atomic.h) which is branched from
master. So somewhere in this chain things might have gotten confused.

>
>
> On 6 January 2015 at 15:43, Ola Liljedahl  wrote:
>>
>> Weird. I did remote update and rebase origin/master before generating
>> the patch (I had to fix a couple of conflicts to get it to build).
>>
>> Where do you get compilation error(s)?
>>
>>
>> On 6 January 2015 at 05:10, Bill Fischofer 
>> wrote:
>> > If I try to manually apply this patch then it doesn't compile.  It does
>> > not
>> > appear that this patch is properly versioned against the current ODP
>> > tip.
>> >
>> > On Mon, Jan 5, 2015 at 12:55 PM, Bill Fischofer
>> > 
>> > wrote:
>> >>
>> >> This patch doesn't seem to apply on the current ODP tip.
>> >>
>> >> Bill
>> >>
>> >> On Mon, Jan 5, 2015 at 12:23 PM, Ola Liljedahl
>> >> 
>> >> wrote:
>> >>>
>> >>> Signed-off-by: Ola Liljedahl 
>> >>>
>> >>> (This document/code contribution attached is provided under the terms
>> >>> of
>> >>> agreement LES-LTM-21309)
>> >>> The timer API is updated according to
>> >>>
>> >>>
>> >>> https://docs.google.com/a/linaro.org/document/d/1bfY_J8ecLJPsFTmYftb0NVmGnB9qkEc_NpcJ87yfaD8
>> >>> A major change is that timers are allocated and freed separately from
>> >>> timeouts being set and cancelled. The life-length of a timer normally
>> >>> corresponds to the life-length of the associated stateful flow while
>> >>> the life-length of a timeout corresponds to individual packets being
>> >>> transmitted and received.
>> >>> The reference timer implementation is lock-less for platforms with
>> >>> support for 128-bit (16-byte) atomic exchange and CAS operations.
>> >>> Otherwise a lock-based implementation (using as many locks as desired)
>> >>> is used but some operations (e.g. reset reusing existing timeout
>> >>> buffer)
>> >>> may still be lock-less.
>> >>> Updated the example example/timer/odp_timer_test.c according to the
>> >>> updated API.
>> >>> Updated the API according to Petri's review comments.
>> >>> ---
>> >>>  example/timer/odp_timer_test.c |  177 ++--
>> >>>  platform/linux-generic/include/api/odp_timer.h |  318 --
>> >>>  .../linux-generic

Re: [lng-odp] [PATCH v2] configure.ac: align help text

2015-01-06 Thread Anders Roxell
On 2014-12-29 13:17, Mike Holmes wrote:
> The help text is not formatted into columns correctly, fix it.
> 
> Signed-off-by: Mike Holmes 

Reviewed-by: Anders Roxell 

it lines up the help text, however I think we need to improve the
help text to match the rest of the help text

Cheers,
Anders

> ---
> v2: align even more
> 
>  configure.ac | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index f0ce7e0..7219a47 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -65,7 +65,7 @@ AM_CONDITIONAL([SDK_INSTALL_PATH_], [test 
> "x${SDK_INSTALL_PATH_}" = "x1"])
>  # Enable/disable Unit tests
>  ##
>  AC_ARG_ENABLE([cunit],
> -[  --enable-cunit Enable/disable cunit],
> +[  --enable-cunit  Enable/disable cunit],
>  [if test x$enableval = xyes; then
>  cunit_support=yes
>  fi])
> @@ -86,7 +86,7 @@ AC_HELP_STRING([--with-cunit-path=DIR Path to Cunit libs 
> and headers],
>  ##
>  ODP_DEBUG_PRINT=1
>  AC_ARG_ENABLE([debug-print],
> -[  --enable-debug-print Enable/disable debug print],
> +[  --enable-debug-printEnable/disable debug print],
>  [if ! test "x$enableval" = "xyes"; then
>  ODP_DEBUG_PRINT=0
>  fi])
> @@ -97,7 +97,7 @@ ODP_CFLAGS="$ODP_CFLAGS -DODP_DEBUG_PRINT=$ODP_DEBUG_PRINT"
>  ##
>  ODP_DEBUG=1
>  AC_ARG_ENABLE([debug],
> -[  --enable-debug Enable/disable debug],
> +[  --enable-debug  Enable/disable debug],
>  [if ! test "x$enableval" = "xyes"; then
>  ODP_DEBUG=0
>  fi])
> -- 
> 2.1.0
> 
> 
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp


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


[lng-odp] [PATCH] linux-generic: packets: bugfix: set l2_offset in _odp_packet_parse()

2015-01-06 Thread Bill Fischofer
Signed-off-by: Bill Fischofer 
---
 platform/linux-generic/odp_packet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/platform/linux-generic/odp_packet.c 
b/platform/linux-generic/odp_packet.c
index eb0767a..257abec 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -778,7 +778,7 @@ int _odp_packet_parse(odp_packet_t pkt)
pkt_hdr->error_flags.all  = 0;
pkt_hdr->input_flags.all  = 0;
pkt_hdr->output_flags.all = 0;
-   pkt_hdr->l2_offset= ODP_PACKET_OFFSET_INVALID;
+   pkt_hdr->l2_offset= 0;
pkt_hdr->l3_offset= ODP_PACKET_OFFSET_INVALID;
pkt_hdr->l4_offset= ODP_PACKET_OFFSET_INVALID;
pkt_hdr->payload_offset   = ODP_PACKET_OFFSET_INVALID;
-- 
2.1.0


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


Re: [lng-odp] [PATCH] linux-generic: packets: bugfix: set l2_offset in _odp_packet_parse()

2015-01-06 Thread Bill Fischofer
This patch corrects a bug identified by Stuart.  _odp_packet_parse() was
not setting l2_offset to anything other than ODP_PACKET_OFFSET_INVALID,
which caused downstream issues for callers of odp_packet_l2_ptr().  It
should be part of v0.7.

Bill

On Tue, Jan 6, 2015 at 4:12 PM, Bill Fischofer 
wrote:

> Signed-off-by: Bill Fischofer 
> ---
>  platform/linux-generic/odp_packet.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/platform/linux-generic/odp_packet.c
> b/platform/linux-generic/odp_packet.c
> index eb0767a..257abec 100644
> --- a/platform/linux-generic/odp_packet.c
> +++ b/platform/linux-generic/odp_packet.c
> @@ -778,7 +778,7 @@ int _odp_packet_parse(odp_packet_t pkt)
> pkt_hdr->error_flags.all  = 0;
> pkt_hdr->input_flags.all  = 0;
> pkt_hdr->output_flags.all = 0;
> -   pkt_hdr->l2_offset= ODP_PACKET_OFFSET_INVALID;
> +   pkt_hdr->l2_offset= 0;
> pkt_hdr->l3_offset= ODP_PACKET_OFFSET_INVALID;
> pkt_hdr->l4_offset= ODP_PACKET_OFFSET_INVALID;
> pkt_hdr->payload_offset   = ODP_PACKET_OFFSET_INVALID;
> --
> 2.1.0
>
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] OVS-ODP: ODP v0.6.0 support

2015-01-06 Thread Bill Fischofer
On Tue, Jan 6, 2015 at 12:27 PM, Zoltan Kiss  wrote:

>
>
> On 05/01/15 20:26, Bill Fischofer wrote:
>
>>
>>
>> On Mon, Jan 5, 2015 at 1:19 PM, Zoltan Kiss > > wrote:
>>
>> This is only compile tested, and there are a few questions in the
>> patch.
>>
>> Signed-off-by: Zoltan Kiss > >
>> ---
>> diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
>> index 96126a1..571b66e 100644
>> --- a/lib/netdev-odp.c
>> +++ b/lib/netdev-odp.c
>>
>
>  @@ -129,26 +129,26 @@ odp_init(int argc, char *argv[])
>>   static int
>>   odp_class_init(void)
>>   {
>> -void *pool_base;
>>   odp_shm_t shm;
>> +odp_buffer_pool_param_t params;
>>   int result = 0;
>>
>>   /* create packet pool */
>>   shm = odp_shm_reserve("shm_packet_pool", SHM_PKT_POOL_SIZE,
>> ODP_CACHE_LINE_SIZE, 0);
>> -pool_base = odp_shm_addr(shm);
>>
>> -if (odp_unlikely(pool_base == NULL)) {
>> +if (odp_unlikely(shm == ODP_SHM_INVALID)) {
>>   VLOG_ERR("Error: ODP packet pool mem alloc failed\n");
>>   out_of_memory();
>>   return -1;
>>   }
>>
>> -pool = odp_buffer_pool_create("packet_pool", pool_base,
>> -  SHM_PKT_POOL_SIZE,
>> -  SHM_PKT_POOL_BUF_SIZE,
>> -  ODP_CACHE_LINE_SIZE,
>> -  ODP_BUFFER_TYPE_PACKET);
>> +params.buf_size = SHM_PKT_POOL_BUF_SIZE;
>> +params.buf_align = ODP_CACHE_LINE_SIZE;
>> +params.num_bufs = SHM_PKT_POOL_SIZE / SHM_PKT_POOL_BUF_SIZE;
>> +params.buf_type = ODP_BUFFER_TYPE_PACKET;
>> +
>> +pool = odp_buffer_pool_create("packet_pool", shm, ¶ms);
>>
>> You really shouldn't be attempting to allocate your own SHM here.
>> Instead, delete the odp_shm_reserve() calls and pass ODP_SHM_NULL as the
>> second parameter to odp_buffer_pool_create() and ODP will allocate the
>> memory for you.  There is no architected way to determine how large a
>> SHM you need to allocate to successfully do it the other way, so this
>> provision of the API is of somewhat questionable utility.
>>
>
> Ok, I'll use it that way.
>
>
>>
>>   if (struct_pool == ODP_BUFFER_POOL_INVALID) {
>>   VLOG_ERR("Error: packet pool create failed.\n");
>> @@ -247,15 +244,15 @@ netdev_odp_construct(struct netdev *netdev_)
>>   }
>>
>>   netdev->pkt_pool = pool;
>> -pkt = odph_packet_alloc(netdev->pkt_pool);
>> -if (!odph_packet_is_valid(pkt)) {
>> +pkt = odp_packet_alloc(netdev->pkt_pool, 0);
>> +if (!odp_packet_is_valid(pkt)) {
>>   out_of_memory();
>>   goto out_err;
>>   }
>>
>>
>> It's more efficient to say if (pkt == ODP_PACKET_INVALID) here for this
>> test.
>>
>>
>> -netdev->max_frame_len = odph_packet_buf_size(pkt);
>> +netdev->max_frame_len = odp_buffer_size(odp_packet_to_
>> buffer(pkt));
>>
>>
>> Need more context as to what you're trying to determine here.  If you
>> want to know what's the largest size packet you can receive that's
>> ODP_CONFIG_PACKET_BUF_LEN_MAX
>>
>
> This was written by Ciprian, but as far as I saw the only reason to
> allocate this packet is to determine the maximum packet size for this
> particular pool, not absolute maximum.
> odp_buffer_pool_info is better for this goal.
>
>
Yes, odp_buffer_pool_info() will return the buf_size associated with the
pool, which will tell you that.  Note to Petri: Please note that
applications need to know the packet size associated with a buffer pool,
not the packet segment size. If you want to separately specify packet
segment size on the odp_buffer_pool_param_t, we still need the packet size
as well.


>
>
>  @@ -334,19 +331,21 @@ clone_pkts(struct netdev_odp *dev, struct
>> dpif_packet **pkts,
>>   dropped++;
>>   continue;
>>   }
>> -pkt = odph_packet_alloc(dev->pkt_pool);
>> +pkt = odp_packet_alloc(dev->pkt_pool, size);
>>
>> -if (OVS_UNLIKELY(!odph_packet_is_valid(pkt))) {
>> +if (OVS_UNLIKELY(pkt == ODP_PACKET_INVALID)) {
>>   VLOG_WARN_RL(&rl, "Could not allocate packet");
>>   dropped += cnt -i;
>>   break;
>>   }
>>
>> -odp_packet_init(pkt);
>> -odp_packet_set_l2_offset(pkt, 0);
>> +odp_packet_reset(pkt, 0);
>> +odp_packet_l2_offset_set(pkt, 0);
>>
>> -memcpy(odp_packet_l2(pkt), ofpbuf_data(&pkts[i]->ofpbuf),
>> size);
>> -odp_packet_parse(pkt, size, 0);
>> +memcpy(odp_packet_l2_ptr(pkt, NULL),
>> ofpbuf_data(&pkts[i]->ofpbuf),
>> +  size);
>> +/* TODO: is this 

[lng-odp] [PATCH v2] example: ipsec: corrected create_ipsec_cache_entry's out_pool argument handle type

2015-01-06 Thread Jerin Jacob
Signed-off-by: Jerin Jacob 
---
 example/ipsec/odp_ipsec_cache.c | 2 +-
 example/ipsec/odp_ipsec_cache.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/example/ipsec/odp_ipsec_cache.c b/example/ipsec/odp_ipsec_cache.c
index 7a0c813..4447163 100644
--- a/example/ipsec/odp_ipsec_cache.c
+++ b/example/ipsec/odp_ipsec_cache.c
@@ -41,7 +41,7 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa,
 crypto_api_mode_e api_mode,
 bool in,
 odp_queue_t completionq,
-odp_buffer_t out_pool)
+odp_buffer_pool_t out_pool)
 {
odp_crypto_session_params_t params;
ipsec_cache_entry_t *entry;
diff --git a/example/ipsec/odp_ipsec_cache.h b/example/ipsec/odp_ipsec_cache.h
index 2cbaabd..8d9d393 100644
--- a/example/ipsec/odp_ipsec_cache.h
+++ b/example/ipsec/odp_ipsec_cache.h
@@ -90,7 +90,7 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa,
 crypto_api_mode_e api_mode,
 bool in,
 odp_queue_t completionq,
-odp_buffer_t out_pool);
+odp_buffer_pool_t out_pool);
 
 /**
  * Find a matching IPsec cache entry for input packet
-- 
1.9.3


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


Re: [lng-odp] [PATCH v2] example: ipsec: corrected create_ipsec_cache_entry's out_pool argument handle type

2015-01-06 Thread Bill Fischofer
On Tue, Jan 6, 2015 at 9:29 PM, Jerin Jacob 
wrote:

> Signed-off-by: Jerin Jacob 
>

Reviewed-by: Bill Fischofer 


> ---
>  example/ipsec/odp_ipsec_cache.c | 2 +-
>  example/ipsec/odp_ipsec_cache.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/example/ipsec/odp_ipsec_cache.c
> b/example/ipsec/odp_ipsec_cache.c
> index 7a0c813..4447163 100644
> --- a/example/ipsec/odp_ipsec_cache.c
> +++ b/example/ipsec/odp_ipsec_cache.c
> @@ -41,7 +41,7 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa,
>  crypto_api_mode_e api_mode,
>  bool in,
>  odp_queue_t completionq,
> -odp_buffer_t out_pool)
> +odp_buffer_pool_t out_pool)
>  {
> odp_crypto_session_params_t params;
> ipsec_cache_entry_t *entry;
> diff --git a/example/ipsec/odp_ipsec_cache.h
> b/example/ipsec/odp_ipsec_cache.h
> index 2cbaabd..8d9d393 100644
> --- a/example/ipsec/odp_ipsec_cache.h
> +++ b/example/ipsec/odp_ipsec_cache.h
> @@ -90,7 +90,7 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa,
>  crypto_api_mode_e api_mode,
>  bool in,
>  odp_queue_t completionq,
> -odp_buffer_t out_pool);
> +odp_buffer_pool_t out_pool);
>
>  /**
>   * Find a matching IPsec cache entry for input packet
> --
> 1.9.3
>
>
> ___
> 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