diff mbox

[PATCHv2,1/3] test/example changes for v1.0 buffer pool APIs

Message ID 1416526024-26384-1-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer Nov. 20, 2014, 11:27 p.m. UTC
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 example/generator/odp_generator.c | 22 +++++----------
 example/ipsec/odp_ipsec.c         | 57 +++++++++++++--------------------------
 example/l2fwd/odp_l2fwd.c         | 19 +++++--------
 example/odp_example/odp_example.c | 18 +++++--------
 example/packet/odp_pktio.c        | 19 +++++--------
 example/timer/odp_timer_test.c    | 13 ++++-----
 test/api_test/odp_timer_ping.c    | 19 +++++++------
 7 files changed, 60 insertions(+), 107 deletions(-)

Comments

Anders Roxell Nov. 21, 2014, 12:06 a.m. UTC | #1
Again Bill,

I complained about this in your last patch set [1] as well!
You shall be able to build every patch.

[1] http://lists.linaro.org/pipermail/lng-odp/2014-November/004999.html

On 21 November 2014 00:27, Bill Fischofer <bill.fischofer@linaro.org> wrote:
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
>  example/generator/odp_generator.c | 22 +++++----------
>  example/ipsec/odp_ipsec.c         | 57 +++++++++++++--------------------------
>  example/l2fwd/odp_l2fwd.c         | 19 +++++--------
>  example/odp_example/odp_example.c | 18 +++++--------
>  example/packet/odp_pktio.c        | 19 +++++--------
>  example/timer/odp_timer_test.c    | 13 ++++-----
>  test/api_test/odp_timer_ping.c    | 19 +++++++------
>  7 files changed, 60 insertions(+), 107 deletions(-)
>
> diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
> index e2e0ba4..50e6c04 100644
> --- a/example/generator/odp_generator.c
> +++ b/example/generator/odp_generator.c
> @@ -57,8 +57,7 @@ typedef struct {
>         int number;             /**< packets number to be sent */
>         int payload;            /**< data len */
>         int timeout;            /**< wait time */
> -       int interval;           /**< wait interval ms between sending
> -                                    each packet */
> +       int interval;           /**< wait interval ms between sending each packet */
>  } appl_args_t;
>
>  /**
> @@ -516,11 +515,11 @@ int main(int argc, char *argv[])
>         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>         odp_buffer_pool_t pool;
>         int num_workers;
> -       void *pool_base;
>         int i;
>         int first_core;
>         int core_count;
>         odp_shm_t shm;
> +       odp_buffer_pool_param_t params;
>
>         /* Init ODP before calling anything else */
>         if (odp_init_global(NULL, NULL)) {
> @@ -583,20 +582,13 @@ int main(int argc, char *argv[])
>         printf("First core:         %i\n\n", first_core);
>
>         /* 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);
> +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> +       params.buf_align = 0;
> +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
> +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>
> -       if (pool_base == NULL) {
> -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
> -               exit(EXIT_FAILURE);
> -       }
> +       pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL, &params);
>
> -       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);
>         if (pool == ODP_BUFFER_POOL_INVALID) {
>                 EXAMPLE_ERR("Error: packet pool create failed.\n");
>                 exit(EXIT_FAILURE);
> diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
> index ec115fc..b5d518c 100644
> --- a/example/ipsec/odp_ipsec.c
> +++ b/example/ipsec/odp_ipsec.c
> @@ -367,8 +367,7 @@ static
>  void ipsec_init_pre(void)
>  {
>         odp_queue_param_t qparam;
> -       void *pool_base;
> -       odp_shm_t shm;
> +       odp_buffer_pool_param_t params;
>
>         /*
>          * Create queues
> @@ -401,16 +400,12 @@ void ipsec_init_pre(void)
>         }
>
>         /* Create output buffer pool */
> -       shm = odp_shm_reserve("shm_out_pool",
> -                             SHM_OUT_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
> -
> -       pool_base = odp_shm_addr(shm);
> +       params.buf_size  = SHM_OUT_POOL_BUF_SIZE;
> +       params.buf_align = 0;
> +       params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
> +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>
> -       out_pool = odp_buffer_pool_create("out_pool", pool_base,
> -                                         SHM_OUT_POOL_SIZE,
> -                                         SHM_OUT_POOL_BUF_SIZE,
> -                                         ODP_CACHE_LINE_SIZE,
> -                                         ODP_BUFFER_TYPE_PACKET);
> +       out_pool = odp_buffer_pool_create("out_pool", ODP_SHM_NULL, &params);
>
>         if (ODP_BUFFER_POOL_INVALID == out_pool) {
>                 EXAMPLE_ERR("Error: message pool create failed.\n");
> @@ -1175,12 +1170,12 @@ main(int argc, char *argv[])
>  {
>         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>         int num_workers;
> -       void *pool_base;
>         int i;
>         int first_core;
>         int core_count;
>         int stream_count;
>         odp_shm_t shm;
> +       odp_buffer_pool_param_t params;
>
>         /* Init ODP before calling anything else */
>         if (odp_init_global(NULL, NULL)) {
> @@ -1240,42 +1235,28 @@ main(int argc, char *argv[])
>         printf("First core:         %i\n\n", first_core);
>
>         /* Create packet buffer pool */
> -       shm = odp_shm_reserve("shm_packet_pool",
> -                             SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
> +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> +       params.buf_align = 0;
> +       params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
> +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>
> -       pool_base = odp_shm_addr(shm);
> -
> -       if (NULL == pool_base) {
> -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
> -               exit(EXIT_FAILURE);
> -       }
> +       pkt_pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL,
> +                                         &params);
>
> -       pkt_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);
>         if (ODP_BUFFER_POOL_INVALID == pkt_pool) {
>                 EXAMPLE_ERR("Error: packet pool create failed.\n");
>                 exit(EXIT_FAILURE);
>         }
>
>         /* Create context buffer pool */
> -       shm = odp_shm_reserve("shm_ctx_pool",
> -                             SHM_CTX_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
> -
> -       pool_base = odp_shm_addr(shm);
> +       params.buf_size  = SHM_CTX_POOL_BUF_SIZE;
> +       params.buf_align = 0;
> +       params.num_bufs  = SHM_CTX_POOL_BUF_COUNT;
> +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
>
> -       if (NULL == pool_base) {
> -               EXAMPLE_ERR("Error: context pool mem alloc failed.\n");
> -               exit(EXIT_FAILURE);
> -       }
> +       ctx_pool = odp_buffer_pool_create("ctx_pool", ODP_SHM_NULL,
> +                                         &params);
>
> -       ctx_pool = odp_buffer_pool_create("ctx_pool", pool_base,
> -                                         SHM_CTX_POOL_SIZE,
> -                                         SHM_CTX_POOL_BUF_SIZE,
> -                                         ODP_CACHE_LINE_SIZE,
> -                                         ODP_BUFFER_TYPE_RAW);
>         if (ODP_BUFFER_POOL_INVALID == ctx_pool) {
>                 EXAMPLE_ERR("Error: context pool create failed.\n");
>                 exit(EXIT_FAILURE);
> diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c
> index ebac8c5..3c1fd6a 100644
> --- a/example/l2fwd/odp_l2fwd.c
> +++ b/example/l2fwd/odp_l2fwd.c
> @@ -314,12 +314,12 @@ int main(int argc, char *argv[])
>  {
>         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>         odp_buffer_pool_t pool;
> -       void *pool_base;
>         int i;
>         int first_core;
>         int core_count;
>         odp_pktio_t pktio;
>         odp_shm_t shm;
> +       odp_buffer_pool_param_t params;
>
>         /* Init ODP before calling anything else */
>         if (odp_init_global(NULL, NULL)) {
> @@ -383,20 +383,13 @@ int main(int argc, char *argv[])
>         printf("First core:         %i\n\n", first_core);
>
>         /* 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);
> +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> +       params.buf_align = 0;
> +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
> +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>
> -       if (pool_base == NULL) {
> -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
> -               exit(EXIT_FAILURE);
> -       }
> +       pool = odp_buffer_pool_create("packet pool", ODP_SHM_NULL, &params);
>
> -       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);
>         if (pool == ODP_BUFFER_POOL_INVALID) {
>                 EXAMPLE_ERR("Error: packet pool create failed.\n");
>                 exit(EXIT_FAILURE);
> diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c
> index 9e7f090..bc67342 100644
> --- a/example/odp_example/odp_example.c
> +++ b/example/odp_example/odp_example.c
> @@ -954,13 +954,13 @@ int main(int argc, char *argv[])
>         test_args_t args;
>         int num_workers;
>         odp_buffer_pool_t pool;
> -       void *pool_base;
>         odp_queue_t queue;
>         int i, j;
>         int prios;
>         int first_core;
>         odp_shm_t shm;
>         test_globals_t *globals;
> +       odp_buffer_pool_param_t params;
>
>         printf("\nODP example starts\n\n");
>
> @@ -1042,19 +1042,13 @@ int main(int argc, char *argv[])
>         /*
>          * Create message pool
>          */
> -       shm = odp_shm_reserve("msg_pool",
> -                             MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
>
> -       pool_base = odp_shm_addr(shm);
> +       params.buf_size  = sizeof(test_message_t);
> +       params.buf_align = 0;
> +       params.num_bufs  = MSG_POOL_SIZE/sizeof(test_message_t);
> +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
>
> -       if (pool_base == NULL) {
> -               EXAMPLE_ERR("Shared memory reserve failed.\n");
> -               return -1;
> -       }
> -
> -       pool = odp_buffer_pool_create("msg_pool", pool_base, MSG_POOL_SIZE,
> -                                     sizeof(test_message_t),
> -                                     ODP_CACHE_LINE_SIZE, ODP_BUFFER_TYPE_RAW);
> +       pool = odp_buffer_pool_create("msg_pool", ODP_SHM_NULL, &params);
>
>         if (pool == ODP_BUFFER_POOL_INVALID) {
>                 EXAMPLE_ERR("Pool create failed.\n");
> diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
> index 3e08b34..e0632cb 100644
> --- a/example/packet/odp_pktio.c
> +++ b/example/packet/odp_pktio.c
> @@ -296,11 +296,11 @@ int main(int argc, char *argv[])
>         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>         odp_buffer_pool_t pool;
>         int num_workers;
> -       void *pool_base;
>         int i;
>         int first_core;
>         int core_count;
>         odp_shm_t shm;
> +       odp_buffer_pool_param_t params;
>
>         /* Init ODP before calling anything else */
>         if (odp_init_global(NULL, NULL)) {
> @@ -354,20 +354,13 @@ int main(int argc, char *argv[])
>         printf("First core:         %i\n\n", first_core);
>
>         /* 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);
> +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> +       params.buf_align = 0;
> +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
> +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>
> -       if (pool_base == NULL) {
> -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
> -               exit(EXIT_FAILURE);
> -       }
> +       pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL, &params);
>
> -       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);
>         if (pool == ODP_BUFFER_POOL_INVALID) {
>                 EXAMPLE_ERR("Error: packet pool create failed.\n");
>                 exit(EXIT_FAILURE);
> diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
> index 9968bfe..0d6e31a 100644
> --- a/example/timer/odp_timer_test.c
> +++ b/example/timer/odp_timer_test.c
> @@ -244,12 +244,12 @@ int main(int argc, char *argv[])
>         test_args_t args;
>         int num_workers;
>         odp_buffer_pool_t pool;
> -       void *pool_base;
>         odp_queue_t queue;
>         int first_core;
>         uint64_t cycles, ns;
>         odp_queue_param_t param;
>         odp_shm_t shm;
> +       odp_buffer_pool_param_t params;
>
>         printf("\nODP timer example starts\n");
>
> @@ -313,12 +313,13 @@ int main(int argc, char *argv[])
>          */
>         shm = odp_shm_reserve("msg_pool",
>                               MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
> -       pool_base = odp_shm_addr(shm);
>
> -       pool = odp_buffer_pool_create("msg_pool", pool_base, MSG_POOL_SIZE,
> -                                     0,
> -                                     ODP_CACHE_LINE_SIZE,
> -                                     ODP_BUFFER_TYPE_TIMEOUT);
> +       params.buf_size  = 0;
> +       params.buf_align = 0;
> +       params.num_bufs  = MSG_POOL_SIZE;
> +       params.buf_type  = ODP_BUFFER_TYPE_TIMEOUT;
> +
> +       pool = odp_buffer_pool_create("msg_pool", shm, &params);
>
>         if (pool == ODP_BUFFER_POOL_INVALID) {
>                 EXAMPLE_ERR("Pool create failed.\n");
> diff --git a/test/api_test/odp_timer_ping.c b/test/api_test/odp_timer_ping.c
> index 7704181..1566f4f 100644
> --- a/test/api_test/odp_timer_ping.c
> +++ b/test/api_test/odp_timer_ping.c
> @@ -319,9 +319,8 @@ int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED)
>         ping_arg_t pingarg;
>         odp_queue_t queue;
>         odp_buffer_pool_t pool;
> -       void *pool_base;
>         int i;
> -       odp_shm_t shm;
> +       odp_buffer_pool_param_t params;
>
>         if (odp_test_global_init() != 0)
>                 return -1;
> @@ -334,14 +333,14 @@ int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED)
>         /*
>          * Create message pool
>          */
> -       shm = odp_shm_reserve("msg_pool",
> -                             MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
> -       pool_base = odp_shm_addr(shm);
> -
> -       pool = odp_buffer_pool_create("msg_pool", pool_base, MSG_POOL_SIZE,
> -                                     BUF_SIZE,
> -                                     ODP_CACHE_LINE_SIZE,
> -                                     ODP_BUFFER_TYPE_RAW);
> +
> +       params.buf_size  = BUF_SIZE;
> +       params.buf_align = 0;
> +       params.num_bufs  = MSG_POOL_SIZE/BUF_SIZE;
> +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
> +
> +       pool = odp_buffer_pool_create("msg_pool", ODP_SHM_NULL, &params);
> +
>         if (pool == ODP_BUFFER_POOL_INVALID) {
>                 LOG_ERR("Pool create failed.\n");
>                 return -1;
> --
> 1.8.3.2
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Bill Fischofer Nov. 21, 2014, 12:13 a.m. UTC | #2
Not sure I understand.  They build just fine for me.  What problem are you
seeing?

Bill

On Thursday, November 20, 2014, Anders Roxell <anders.roxell@linaro.org>
wrote:

> Again Bill,
>
> I complained about this in your last patch set [1] as well!
> You shall be able to build every patch.
>
> [1] http://lists.linaro.org/pipermail/lng-odp/2014-November/004999.html
>
> On 21 November 2014 00:27, Bill Fischofer <bill.fischofer@linaro.org
> <javascript:;>> wrote:
> > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org <javascript:;>>
> > ---
> >  example/generator/odp_generator.c | 22 +++++----------
> >  example/ipsec/odp_ipsec.c         | 57
> +++++++++++++--------------------------
> >  example/l2fwd/odp_l2fwd.c         | 19 +++++--------
> >  example/odp_example/odp_example.c | 18 +++++--------
> >  example/packet/odp_pktio.c        | 19 +++++--------
> >  example/timer/odp_timer_test.c    | 13 ++++-----
> >  test/api_test/odp_timer_ping.c    | 19 +++++++------
> >  7 files changed, 60 insertions(+), 107 deletions(-)
> >
> > diff --git a/example/generator/odp_generator.c
> b/example/generator/odp_generator.c
> > index e2e0ba4..50e6c04 100644
> > --- a/example/generator/odp_generator.c
> > +++ b/example/generator/odp_generator.c
> > @@ -57,8 +57,7 @@ typedef struct {
> >         int number;             /**< packets number to be sent */
> >         int payload;            /**< data len */
> >         int timeout;            /**< wait time */
> > -       int interval;           /**< wait interval ms between sending
> > -                                    each packet */
> > +       int interval;           /**< wait interval ms between sending
> each packet */
> >  } appl_args_t;
> >
> >  /**
> > @@ -516,11 +515,11 @@ int main(int argc, char *argv[])
> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
> >         odp_buffer_pool_t pool;
> >         int num_workers;
> > -       void *pool_base;
> >         int i;
> >         int first_core;
> >         int core_count;
> >         odp_shm_t shm;
> > +       odp_buffer_pool_param_t params;
> >
> >         /* Init ODP before calling anything else */
> >         if (odp_init_global(NULL, NULL)) {
> > @@ -583,20 +582,13 @@ int main(int argc, char *argv[])
> >         printf("First core:         %i\n\n", first_core);
> >
> >         /* 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);
> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> > +       params.buf_align = 0;
> > +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
> >
> > -       if (pool_base == NULL) {
> > -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
> > -               exit(EXIT_FAILURE);
> > -       }
> > +       pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL,
> &params);
> >
> > -       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);
> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
> >                 exit(EXIT_FAILURE);
> > diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
> > index ec115fc..b5d518c 100644
> > --- a/example/ipsec/odp_ipsec.c
> > +++ b/example/ipsec/odp_ipsec.c
> > @@ -367,8 +367,7 @@ static
> >  void ipsec_init_pre(void)
> >  {
> >         odp_queue_param_t qparam;
> > -       void *pool_base;
> > -       odp_shm_t shm;
> > +       odp_buffer_pool_param_t params;
> >
> >         /*
> >          * Create queues
> > @@ -401,16 +400,12 @@ void ipsec_init_pre(void)
> >         }
> >
> >         /* Create output buffer pool */
> > -       shm = odp_shm_reserve("shm_out_pool",
> > -                             SHM_OUT_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
> > -
> > -       pool_base = odp_shm_addr(shm);
> > +       params.buf_size  = SHM_OUT_POOL_BUF_SIZE;
> > +       params.buf_align = 0;
> > +       params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
> >
> > -       out_pool = odp_buffer_pool_create("out_pool", pool_base,
> > -                                         SHM_OUT_POOL_SIZE,
> > -                                         SHM_OUT_POOL_BUF_SIZE,
> > -                                         ODP_CACHE_LINE_SIZE,
> > -                                         ODP_BUFFER_TYPE_PACKET);
> > +       out_pool = odp_buffer_pool_create("out_pool", ODP_SHM_NULL,
> &params);
> >
> >         if (ODP_BUFFER_POOL_INVALID == out_pool) {
> >                 EXAMPLE_ERR("Error: message pool create failed.\n");
> > @@ -1175,12 +1170,12 @@ main(int argc, char *argv[])
> >  {
> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
> >         int num_workers;
> > -       void *pool_base;
> >         int i;
> >         int first_core;
> >         int core_count;
> >         int stream_count;
> >         odp_shm_t shm;
> > +       odp_buffer_pool_param_t params;
> >
> >         /* Init ODP before calling anything else */
> >         if (odp_init_global(NULL, NULL)) {
> > @@ -1240,42 +1235,28 @@ main(int argc, char *argv[])
> >         printf("First core:         %i\n\n", first_core);
> >
> >         /* Create packet buffer pool */
> > -       shm = odp_shm_reserve("shm_packet_pool",
> > -                             SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> > +       params.buf_align = 0;
> > +       params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
> >
> > -       pool_base = odp_shm_addr(shm);
> > -
> > -       if (NULL == pool_base) {
> > -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
> > -               exit(EXIT_FAILURE);
> > -       }
> > +       pkt_pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL,
> > +                                         &params);
> >
> > -       pkt_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);
> >         if (ODP_BUFFER_POOL_INVALID == pkt_pool) {
> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
> >                 exit(EXIT_FAILURE);
> >         }
> >
> >         /* Create context buffer pool */
> > -       shm = odp_shm_reserve("shm_ctx_pool",
> > -                             SHM_CTX_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
> > -
> > -       pool_base = odp_shm_addr(shm);
> > +       params.buf_size  = SHM_CTX_POOL_BUF_SIZE;
> > +       params.buf_align = 0;
> > +       params.num_bufs  = SHM_CTX_POOL_BUF_COUNT;
> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
> >
> > -       if (NULL == pool_base) {
> > -               EXAMPLE_ERR("Error: context pool mem alloc failed.\n");
> > -               exit(EXIT_FAILURE);
> > -       }
> > +       ctx_pool = odp_buffer_pool_create("ctx_pool", ODP_SHM_NULL,
> > +                                         &params);
> >
> > -       ctx_pool = odp_buffer_pool_create("ctx_pool", pool_base,
> > -                                         SHM_CTX_POOL_SIZE,
> > -                                         SHM_CTX_POOL_BUF_SIZE,
> > -                                         ODP_CACHE_LINE_SIZE,
> > -                                         ODP_BUFFER_TYPE_RAW);
> >         if (ODP_BUFFER_POOL_INVALID == ctx_pool) {
> >                 EXAMPLE_ERR("Error: context pool create failed.\n");
> >                 exit(EXIT_FAILURE);
> > diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c
> > index ebac8c5..3c1fd6a 100644
> > --- a/example/l2fwd/odp_l2fwd.c
> > +++ b/example/l2fwd/odp_l2fwd.c
> > @@ -314,12 +314,12 @@ int main(int argc, char *argv[])
> >  {
> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
> >         odp_buffer_pool_t pool;
> > -       void *pool_base;
> >         int i;
> >         int first_core;
> >         int core_count;
> >         odp_pktio_t pktio;
> >         odp_shm_t shm;
> > +       odp_buffer_pool_param_t params;
> >
> >         /* Init ODP before calling anything else */
> >         if (odp_init_global(NULL, NULL)) {
> > @@ -383,20 +383,13 @@ int main(int argc, char *argv[])
> >         printf("First core:         %i\n\n", first_core);
> >
> >         /* 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);
> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> > +       params.buf_align = 0;
> > +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
> >
> > -       if (pool_base == NULL) {
> > -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
> > -               exit(EXIT_FAILURE);
> > -       }
> > +       pool = odp_buffer_pool_create("packet pool", ODP_SHM_NULL,
> &params);
> >
> > -       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);
> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
> >                 exit(EXIT_FAILURE);
> > diff --git a/example/odp_example/odp_example.c
> b/example/odp_example/odp_example.c
> > index 9e7f090..bc67342 100644
> > --- a/example/odp_example/odp_example.c
> > +++ b/example/odp_example/odp_example.c
> > @@ -954,13 +954,13 @@ int main(int argc, char *argv[])
> >         test_args_t args;
> >         int num_workers;
> >         odp_buffer_pool_t pool;
> > -       void *pool_base;
> >         odp_queue_t queue;
> >         int i, j;
> >         int prios;
> >         int first_core;
> >         odp_shm_t shm;
> >         test_globals_t *globals;
> > +       odp_buffer_pool_param_t params;
> >
> >         printf("\nODP example starts\n\n");
> >
> > @@ -1042,19 +1042,13 @@ int main(int argc, char *argv[])
> >         /*
> >          * Create message pool
> >          */
> > -       shm = odp_shm_reserve("msg_pool",
> > -                             MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
> >
> > -       pool_base = odp_shm_addr(shm);
> > +       params.buf_size  = sizeof(test_message_t);
> > +       params.buf_align = 0;
> > +       params.num_bufs  = MSG_POOL_SIZE/sizeof(test_message_t);
> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
> >
> > -       if (pool_base == NULL) {
> > -               EXAMPLE_ERR("Shared memory reserve failed.\n");
> > -               return -1;
> > -       }
> > -
> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
> MSG_POOL_SIZE,
> > -                                     sizeof(test_message_t),
> > -                                     ODP_CACHE_LINE_SIZE,
> ODP_BUFFER_TYPE_RAW);
> > +       pool = odp_buffer_pool_create("msg_pool", ODP_SHM_NULL, &params);
> >
> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >                 EXAMPLE_ERR("Pool create failed.\n");
> > diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
> > index 3e08b34..e0632cb 100644
> > --- a/example/packet/odp_pktio.c
> > +++ b/example/packet/odp_pktio.c
> > @@ -296,11 +296,11 @@ int main(int argc, char *argv[])
> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
> >         odp_buffer_pool_t pool;
> >         int num_workers;
> > -       void *pool_base;
> >         int i;
> >         int first_core;
> >         int core_count;
> >         odp_shm_t shm;
> > +       odp_buffer_pool_param_t params;
> >
> >         /* Init ODP before calling anything else */
> >         if (odp_init_global(NULL, NULL)) {
> > @@ -354,20 +354,13 @@ int main(int argc, char *argv[])
> >         printf("First core:         %i\n\n", first_core);
> >
> >         /* 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);
> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> > +       params.buf_align = 0;
> > +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
> >
> > -       if (pool_base == NULL) {
> > -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
> > -               exit(EXIT_FAILURE);
> > -       }
> > +       pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL,
> &params);
> >
> > -       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);
> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
> >                 exit(EXIT_FAILURE);
> > diff --git a/example/timer/odp_timer_test.c
> b/example/timer/odp_timer_test.c
> > index 9968bfe..0d6e31a 100644
> > --- a/example/timer/odp_timer_test.c
> > +++ b/example/timer/odp_timer_test.c
> > @@ -244,12 +244,12 @@ int main(int argc, char *argv[])
> >         test_args_t args;
> >         int num_workers;
> >         odp_buffer_pool_t pool;
> > -       void *pool_base;
> >         odp_queue_t queue;
> >         int first_core;
> >         uint64_t cycles, ns;
> >         odp_queue_param_t param;
> >         odp_shm_t shm;
> > +       odp_buffer_pool_param_t params;
> >
> >         printf("\nODP timer example starts\n");
> >
> > @@ -313,12 +313,13 @@ int main(int argc, char *argv[])
> >          */
> >         shm = odp_shm_reserve("msg_pool",
> >                               MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
> > -       pool_base = odp_shm_addr(shm);
> >
> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
> MSG_POOL_SIZE,
> > -                                     0,
> > -                                     ODP_CACHE_LINE_SIZE,
> > -                                     ODP_BUFFER_TYPE_TIMEOUT);
> > +       params.buf_size  = 0;
> > +       params.buf_align = 0;
> > +       params.num_bufs  = MSG_POOL_SIZE;
> > +       params.buf_type  = ODP_BUFFER_TYPE_TIMEOUT;
> > +
> > +       pool = odp_buffer_pool_create("msg_pool", shm, &params);
> >
> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >                 EXAMPLE_ERR("Pool create failed.\n");
> > diff --git a/test/api_test/odp_timer_ping.c
> b/test/api_test/odp_timer_ping.c
> > index 7704181..1566f4f 100644
> > --- a/test/api_test/odp_timer_ping.c
> > +++ b/test/api_test/odp_timer_ping.c
> > @@ -319,9 +319,8 @@ int main(int argc ODP_UNUSED, char *argv[]
> ODP_UNUSED)
> >         ping_arg_t pingarg;
> >         odp_queue_t queue;
> >         odp_buffer_pool_t pool;
> > -       void *pool_base;
> >         int i;
> > -       odp_shm_t shm;
> > +       odp_buffer_pool_param_t params;
> >
> >         if (odp_test_global_init() != 0)
> >                 return -1;
> > @@ -334,14 +333,14 @@ int main(int argc ODP_UNUSED, char *argv[]
> ODP_UNUSED)
> >         /*
> >          * Create message pool
> >          */
> > -       shm = odp_shm_reserve("msg_pool",
> > -                             MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
> > -       pool_base = odp_shm_addr(shm);
> > -
> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
> MSG_POOL_SIZE,
> > -                                     BUF_SIZE,
> > -                                     ODP_CACHE_LINE_SIZE,
> > -                                     ODP_BUFFER_TYPE_RAW);
> > +
> > +       params.buf_size  = BUF_SIZE;
> > +       params.buf_align = 0;
> > +       params.num_bufs  = MSG_POOL_SIZE/BUF_SIZE;
> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
> > +
> > +       pool = odp_buffer_pool_create("msg_pool", ODP_SHM_NULL, &params);
> > +
> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >                 LOG_ERR("Pool create failed.\n");
> >                 return -1;
> > --
> > 1.8.3.2
> >
> >
> > _______________________________________________
> > lng-odp mailing list
> > lng-odp@lists.linaro.org <javascript:;>
> > http://lists.linaro.org/mailman/listinfo/lng-odp
>
Anders Roxell Nov. 21, 2014, 12:22 a.m. UTC | #3
On 21 November 2014 01:13, Bill Fischofer <bill.fischofer@linaro.org> wrote:
> Not sure I understand.  They build just fine for me.  What problem are you
> seeing?

Can you apply patch 1/3 and then do "make" what happens then?

>
> Bill
>
>
> On Thursday, November 20, 2014, Anders Roxell <anders.roxell@linaro.org>
> wrote:
>>
>> Again Bill,
>>
>> I complained about this in your last patch set [1] as well!
>> You shall be able to build every patch.
>>
>> [1] http://lists.linaro.org/pipermail/lng-odp/2014-November/004999.html
>>
>> On 21 November 2014 00:27, Bill Fischofer <bill.fischofer@linaro.org>
>> wrote:
>> > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
>> > ---
>> >  example/generator/odp_generator.c | 22 +++++----------
>> >  example/ipsec/odp_ipsec.c         | 57
>> > +++++++++++++--------------------------
>> >  example/l2fwd/odp_l2fwd.c         | 19 +++++--------
>> >  example/odp_example/odp_example.c | 18 +++++--------
>> >  example/packet/odp_pktio.c        | 19 +++++--------
>> >  example/timer/odp_timer_test.c    | 13 ++++-----
>> >  test/api_test/odp_timer_ping.c    | 19 +++++++------
>> >  7 files changed, 60 insertions(+), 107 deletions(-)
>> >
>> > diff --git a/example/generator/odp_generator.c
>> > b/example/generator/odp_generator.c
>> > index e2e0ba4..50e6c04 100644
>> > --- a/example/generator/odp_generator.c
>> > +++ b/example/generator/odp_generator.c
>> > @@ -57,8 +57,7 @@ typedef struct {
>> >         int number;             /**< packets number to be sent */
>> >         int payload;            /**< data len */
>> >         int timeout;            /**< wait time */
>> > -       int interval;           /**< wait interval ms between sending
>> > -                                    each packet */
>> > +       int interval;           /**< wait interval ms between sending
>> > each packet */
>> >  } appl_args_t;
>> >
>> >  /**
>> > @@ -516,11 +515,11 @@ int main(int argc, char *argv[])
>> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>> >         odp_buffer_pool_t pool;
>> >         int num_workers;
>> > -       void *pool_base;
>> >         int i;
>> >         int first_core;
>> >         int core_count;
>> >         odp_shm_t shm;
>> > +       odp_buffer_pool_param_t params;
>> >
>> >         /* Init ODP before calling anything else */
>> >         if (odp_init_global(NULL, NULL)) {
>> > @@ -583,20 +582,13 @@ int main(int argc, char *argv[])
>> >         printf("First core:         %i\n\n", first_core);
>> >
>> >         /* 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);
>> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
>> > +       params.buf_align = 0;
>> > +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>> >
>> > -       if (pool_base == NULL) {
>> > -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
>> > -               exit(EXIT_FAILURE);
>> > -       }
>> > +       pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL,
>> > &params);
>> >
>> > -       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);
>> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
>> >                 exit(EXIT_FAILURE);
>> > diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
>> > index ec115fc..b5d518c 100644
>> > --- a/example/ipsec/odp_ipsec.c
>> > +++ b/example/ipsec/odp_ipsec.c
>> > @@ -367,8 +367,7 @@ static
>> >  void ipsec_init_pre(void)
>> >  {
>> >         odp_queue_param_t qparam;
>> > -       void *pool_base;
>> > -       odp_shm_t shm;
>> > +       odp_buffer_pool_param_t params;
>> >
>> >         /*
>> >          * Create queues
>> > @@ -401,16 +400,12 @@ void ipsec_init_pre(void)
>> >         }
>> >
>> >         /* Create output buffer pool */
>> > -       shm = odp_shm_reserve("shm_out_pool",
>> > -                             SHM_OUT_POOL_SIZE, ODP_CACHE_LINE_SIZE,
>> > 0);
>> > -
>> > -       pool_base = odp_shm_addr(shm);
>> > +       params.buf_size  = SHM_OUT_POOL_BUF_SIZE;
>> > +       params.buf_align = 0;
>> > +       params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
>> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>> >
>> > -       out_pool = odp_buffer_pool_create("out_pool", pool_base,
>> > -                                         SHM_OUT_POOL_SIZE,
>> > -                                         SHM_OUT_POOL_BUF_SIZE,
>> > -                                         ODP_CACHE_LINE_SIZE,
>> > -                                         ODP_BUFFER_TYPE_PACKET);
>> > +       out_pool = odp_buffer_pool_create("out_pool", ODP_SHM_NULL,
>> > &params);
>> >
>> >         if (ODP_BUFFER_POOL_INVALID == out_pool) {
>> >                 EXAMPLE_ERR("Error: message pool create failed.\n");
>> > @@ -1175,12 +1170,12 @@ main(int argc, char *argv[])
>> >  {
>> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>> >         int num_workers;
>> > -       void *pool_base;
>> >         int i;
>> >         int first_core;
>> >         int core_count;
>> >         int stream_count;
>> >         odp_shm_t shm;
>> > +       odp_buffer_pool_param_t params;
>> >
>> >         /* Init ODP before calling anything else */
>> >         if (odp_init_global(NULL, NULL)) {
>> > @@ -1240,42 +1235,28 @@ main(int argc, char *argv[])
>> >         printf("First core:         %i\n\n", first_core);
>> >
>> >         /* Create packet buffer pool */
>> > -       shm = odp_shm_reserve("shm_packet_pool",
>> > -                             SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE,
>> > 0);
>> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
>> > +       params.buf_align = 0;
>> > +       params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
>> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>> >
>> > -       pool_base = odp_shm_addr(shm);
>> > -
>> > -       if (NULL == pool_base) {
>> > -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
>> > -               exit(EXIT_FAILURE);
>> > -       }
>> > +       pkt_pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL,
>> > +                                         &params);
>> >
>> > -       pkt_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);
>> >         if (ODP_BUFFER_POOL_INVALID == pkt_pool) {
>> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
>> >                 exit(EXIT_FAILURE);
>> >         }
>> >
>> >         /* Create context buffer pool */
>> > -       shm = odp_shm_reserve("shm_ctx_pool",
>> > -                             SHM_CTX_POOL_SIZE, ODP_CACHE_LINE_SIZE,
>> > 0);
>> > -
>> > -       pool_base = odp_shm_addr(shm);
>> > +       params.buf_size  = SHM_CTX_POOL_BUF_SIZE;
>> > +       params.buf_align = 0;
>> > +       params.num_bufs  = SHM_CTX_POOL_BUF_COUNT;
>> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
>> >
>> > -       if (NULL == pool_base) {
>> > -               EXAMPLE_ERR("Error: context pool mem alloc failed.\n");
>> > -               exit(EXIT_FAILURE);
>> > -       }
>> > +       ctx_pool = odp_buffer_pool_create("ctx_pool", ODP_SHM_NULL,
>> > +                                         &params);
>> >
>> > -       ctx_pool = odp_buffer_pool_create("ctx_pool", pool_base,
>> > -                                         SHM_CTX_POOL_SIZE,
>> > -                                         SHM_CTX_POOL_BUF_SIZE,
>> > -                                         ODP_CACHE_LINE_SIZE,
>> > -                                         ODP_BUFFER_TYPE_RAW);
>> >         if (ODP_BUFFER_POOL_INVALID == ctx_pool) {
>> >                 EXAMPLE_ERR("Error: context pool create failed.\n");
>> >                 exit(EXIT_FAILURE);
>> > diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c
>> > index ebac8c5..3c1fd6a 100644
>> > --- a/example/l2fwd/odp_l2fwd.c
>> > +++ b/example/l2fwd/odp_l2fwd.c
>> > @@ -314,12 +314,12 @@ int main(int argc, char *argv[])
>> >  {
>> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>> >         odp_buffer_pool_t pool;
>> > -       void *pool_base;
>> >         int i;
>> >         int first_core;
>> >         int core_count;
>> >         odp_pktio_t pktio;
>> >         odp_shm_t shm;
>> > +       odp_buffer_pool_param_t params;
>> >
>> >         /* Init ODP before calling anything else */
>> >         if (odp_init_global(NULL, NULL)) {
>> > @@ -383,20 +383,13 @@ int main(int argc, char *argv[])
>> >         printf("First core:         %i\n\n", first_core);
>> >
>> >         /* 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);
>> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
>> > +       params.buf_align = 0;
>> > +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>> >
>> > -       if (pool_base == NULL) {
>> > -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
>> > -               exit(EXIT_FAILURE);
>> > -       }
>> > +       pool = odp_buffer_pool_create("packet pool", ODP_SHM_NULL,
>> > &params);
>> >
>> > -       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);
>> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
>> >                 exit(EXIT_FAILURE);
>> > diff --git a/example/odp_example/odp_example.c
>> > b/example/odp_example/odp_example.c
>> > index 9e7f090..bc67342 100644
>> > --- a/example/odp_example/odp_example.c
>> > +++ b/example/odp_example/odp_example.c
>> > @@ -954,13 +954,13 @@ int main(int argc, char *argv[])
>> >         test_args_t args;
>> >         int num_workers;
>> >         odp_buffer_pool_t pool;
>> > -       void *pool_base;
>> >         odp_queue_t queue;
>> >         int i, j;
>> >         int prios;
>> >         int first_core;
>> >         odp_shm_t shm;
>> >         test_globals_t *globals;
>> > +       odp_buffer_pool_param_t params;
>> >
>> >         printf("\nODP example starts\n\n");
>> >
>> > @@ -1042,19 +1042,13 @@ int main(int argc, char *argv[])
>> >         /*
>> >          * Create message pool
>> >          */
>> > -       shm = odp_shm_reserve("msg_pool",
>> > -                             MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
>> >
>> > -       pool_base = odp_shm_addr(shm);
>> > +       params.buf_size  = sizeof(test_message_t);
>> > +       params.buf_align = 0;
>> > +       params.num_bufs  = MSG_POOL_SIZE/sizeof(test_message_t);
>> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
>> >
>> > -       if (pool_base == NULL) {
>> > -               EXAMPLE_ERR("Shared memory reserve failed.\n");
>> > -               return -1;
>> > -       }
>> > -
>> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
>> > MSG_POOL_SIZE,
>> > -                                     sizeof(test_message_t),
>> > -                                     ODP_CACHE_LINE_SIZE,
>> > ODP_BUFFER_TYPE_RAW);
>> > +       pool = odp_buffer_pool_create("msg_pool", ODP_SHM_NULL,
>> > &params);
>> >
>> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>> >                 EXAMPLE_ERR("Pool create failed.\n");
>> > diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
>> > index 3e08b34..e0632cb 100644
>> > --- a/example/packet/odp_pktio.c
>> > +++ b/example/packet/odp_pktio.c
>> > @@ -296,11 +296,11 @@ int main(int argc, char *argv[])
>> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>> >         odp_buffer_pool_t pool;
>> >         int num_workers;
>> > -       void *pool_base;
>> >         int i;
>> >         int first_core;
>> >         int core_count;
>> >         odp_shm_t shm;
>> > +       odp_buffer_pool_param_t params;
>> >
>> >         /* Init ODP before calling anything else */
>> >         if (odp_init_global(NULL, NULL)) {
>> > @@ -354,20 +354,13 @@ int main(int argc, char *argv[])
>> >         printf("First core:         %i\n\n", first_core);
>> >
>> >         /* 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);
>> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
>> > +       params.buf_align = 0;
>> > +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>> >
>> > -       if (pool_base == NULL) {
>> > -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
>> > -               exit(EXIT_FAILURE);
>> > -       }
>> > +       pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL,
>> > &params);
>> >
>> > -       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);
>> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
>> >                 exit(EXIT_FAILURE);
>> > diff --git a/example/timer/odp_timer_test.c
>> > b/example/timer/odp_timer_test.c
>> > index 9968bfe..0d6e31a 100644
>> > --- a/example/timer/odp_timer_test.c
>> > +++ b/example/timer/odp_timer_test.c
>> > @@ -244,12 +244,12 @@ int main(int argc, char *argv[])
>> >         test_args_t args;
>> >         int num_workers;
>> >         odp_buffer_pool_t pool;
>> > -       void *pool_base;
>> >         odp_queue_t queue;
>> >         int first_core;
>> >         uint64_t cycles, ns;
>> >         odp_queue_param_t param;
>> >         odp_shm_t shm;
>> > +       odp_buffer_pool_param_t params;
>> >
>> >         printf("\nODP timer example starts\n");
>> >
>> > @@ -313,12 +313,13 @@ int main(int argc, char *argv[])
>> >          */
>> >         shm = odp_shm_reserve("msg_pool",
>> >                               MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
>> > -       pool_base = odp_shm_addr(shm);
>> >
>> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
>> > MSG_POOL_SIZE,
>> > -                                     0,
>> > -                                     ODP_CACHE_LINE_SIZE,
>> > -                                     ODP_BUFFER_TYPE_TIMEOUT);
>> > +       params.buf_size  = 0;
>> > +       params.buf_align = 0;
>> > +       params.num_bufs  = MSG_POOL_SIZE;
>> > +       params.buf_type  = ODP_BUFFER_TYPE_TIMEOUT;
>> > +
>> > +       pool = odp_buffer_pool_create("msg_pool", shm, &params);
>> >
>> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>> >                 EXAMPLE_ERR("Pool create failed.\n");
>> > diff --git a/test/api_test/odp_timer_ping.c
>> > b/test/api_test/odp_timer_ping.c
>> > index 7704181..1566f4f 100644
>> > --- a/test/api_test/odp_timer_ping.c
>> > +++ b/test/api_test/odp_timer_ping.c
>> > @@ -319,9 +319,8 @@ int main(int argc ODP_UNUSED, char *argv[]
>> > ODP_UNUSED)
>> >         ping_arg_t pingarg;
>> >         odp_queue_t queue;
>> >         odp_buffer_pool_t pool;
>> > -       void *pool_base;
>> >         int i;
>> > -       odp_shm_t shm;
>> > +       odp_buffer_pool_param_t params;
>> >
>> >         if (odp_test_global_init() != 0)
>> >                 return -1;
>> > @@ -334,14 +333,14 @@ int main(int argc ODP_UNUSED, char *argv[]
>> > ODP_UNUSED)
>> >         /*
>> >          * Create message pool
>> >          */
>> > -       shm = odp_shm_reserve("msg_pool",
>> > -                             MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
>> > -       pool_base = odp_shm_addr(shm);
>> > -
>> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
>> > MSG_POOL_SIZE,
>> > -                                     BUF_SIZE,
>> > -                                     ODP_CACHE_LINE_SIZE,
>> > -                                     ODP_BUFFER_TYPE_RAW);
>> > +
>> > +       params.buf_size  = BUF_SIZE;
>> > +       params.buf_align = 0;
>> > +       params.num_bufs  = MSG_POOL_SIZE/BUF_SIZE;
>> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
>> > +
>> > +       pool = odp_buffer_pool_create("msg_pool", ODP_SHM_NULL,
>> > &params);
>> > +
>> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>> >                 LOG_ERR("Pool create failed.\n");
>> >                 return -1;
>> > --
>> > 1.8.3.2
>> >
>> >
>> > _______________________________________________
>> > lng-odp mailing list
>> > lng-odp@lists.linaro.org
>> > http://lists.linaro.org/mailman/listinfo/lng-odp
Bill Fischofer Nov. 21, 2014, 12:23 a.m. UTC | #4
The three parts are for review convenience.  They are a single patch.


On Thursday, November 20, 2014, Anders Roxell <anders.roxell@linaro.org>
wrote:

> On 21 November 2014 01:13, Bill Fischofer <bill.fischofer@linaro.org
> <javascript:;>> wrote:
> > Not sure I understand.  They build just fine for me.  What problem are
> you
> > seeing?
>
> Can you apply patch 1/3 and then do "make" what happens then?
>
> >
> > Bill
> >
> >
> > On Thursday, November 20, 2014, Anders Roxell <anders.roxell@linaro.org
> <javascript:;>>
> > wrote:
> >>
> >> Again Bill,
> >>
> >> I complained about this in your last patch set [1] as well!
> >> You shall be able to build every patch.
> >>
> >> [1] http://lists.linaro.org/pipermail/lng-odp/2014-November/004999.html
> >>
> >> On 21 November 2014 00:27, Bill Fischofer <bill.fischofer@linaro.org
> <javascript:;>>
> >> wrote:
> >> > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org
> <javascript:;>>
> >> > ---
> >> >  example/generator/odp_generator.c | 22 +++++----------
> >> >  example/ipsec/odp_ipsec.c         | 57
> >> > +++++++++++++--------------------------
> >> >  example/l2fwd/odp_l2fwd.c         | 19 +++++--------
> >> >  example/odp_example/odp_example.c | 18 +++++--------
> >> >  example/packet/odp_pktio.c        | 19 +++++--------
> >> >  example/timer/odp_timer_test.c    | 13 ++++-----
> >> >  test/api_test/odp_timer_ping.c    | 19 +++++++------
> >> >  7 files changed, 60 insertions(+), 107 deletions(-)
> >> >
> >> > diff --git a/example/generator/odp_generator.c
> >> > b/example/generator/odp_generator.c
> >> > index e2e0ba4..50e6c04 100644
> >> > --- a/example/generator/odp_generator.c
> >> > +++ b/example/generator/odp_generator.c
> >> > @@ -57,8 +57,7 @@ typedef struct {
> >> >         int number;             /**< packets number to be sent */
> >> >         int payload;            /**< data len */
> >> >         int timeout;            /**< wait time */
> >> > -       int interval;           /**< wait interval ms between sending
> >> > -                                    each packet */
> >> > +       int interval;           /**< wait interval ms between sending
> >> > each packet */
> >> >  } appl_args_t;
> >> >
> >> >  /**
> >> > @@ -516,11 +515,11 @@ int main(int argc, char *argv[])
> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
> >> >         odp_buffer_pool_t pool;
> >> >         int num_workers;
> >> > -       void *pool_base;
> >> >         int i;
> >> >         int first_core;
> >> >         int core_count;
> >> >         odp_shm_t shm;
> >> > +       odp_buffer_pool_param_t params;
> >> >
> >> >         /* Init ODP before calling anything else */
> >> >         if (odp_init_global(NULL, NULL)) {
> >> > @@ -583,20 +582,13 @@ int main(int argc, char *argv[])
> >> >         printf("First core:         %i\n\n", first_core);
> >> >
> >> >         /* 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);
> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> >> > +       params.buf_align = 0;
> >> > +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
> >> >
> >> > -       if (pool_base == NULL) {
> >> > -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
> >> > -               exit(EXIT_FAILURE);
> >> > -       }
> >> > +       pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL,
> >> > &params);
> >> >
> >> > -       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);
> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
> >> >                 exit(EXIT_FAILURE);
> >> > diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
> >> > index ec115fc..b5d518c 100644
> >> > --- a/example/ipsec/odp_ipsec.c
> >> > +++ b/example/ipsec/odp_ipsec.c
> >> > @@ -367,8 +367,7 @@ static
> >> >  void ipsec_init_pre(void)
> >> >  {
> >> >         odp_queue_param_t qparam;
> >> > -       void *pool_base;
> >> > -       odp_shm_t shm;
> >> > +       odp_buffer_pool_param_t params;
> >> >
> >> >         /*
> >> >          * Create queues
> >> > @@ -401,16 +400,12 @@ void ipsec_init_pre(void)
> >> >         }
> >> >
> >> >         /* Create output buffer pool */
> >> > -       shm = odp_shm_reserve("shm_out_pool",
> >> > -                             SHM_OUT_POOL_SIZE, ODP_CACHE_LINE_SIZE,
> >> > 0);
> >> > -
> >> > -       pool_base = odp_shm_addr(shm);
> >> > +       params.buf_size  = SHM_OUT_POOL_BUF_SIZE;
> >> > +       params.buf_align = 0;
> >> > +       params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
> >> >
> >> > -       out_pool = odp_buffer_pool_create("out_pool", pool_base,
> >> > -                                         SHM_OUT_POOL_SIZE,
> >> > -                                         SHM_OUT_POOL_BUF_SIZE,
> >> > -                                         ODP_CACHE_LINE_SIZE,
> >> > -                                         ODP_BUFFER_TYPE_PACKET);
> >> > +       out_pool = odp_buffer_pool_create("out_pool", ODP_SHM_NULL,
> >> > &params);
> >> >
> >> >         if (ODP_BUFFER_POOL_INVALID == out_pool) {
> >> >                 EXAMPLE_ERR("Error: message pool create failed.\n");
> >> > @@ -1175,12 +1170,12 @@ main(int argc, char *argv[])
> >> >  {
> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
> >> >         int num_workers;
> >> > -       void *pool_base;
> >> >         int i;
> >> >         int first_core;
> >> >         int core_count;
> >> >         int stream_count;
> >> >         odp_shm_t shm;
> >> > +       odp_buffer_pool_param_t params;
> >> >
> >> >         /* Init ODP before calling anything else */
> >> >         if (odp_init_global(NULL, NULL)) {
> >> > @@ -1240,42 +1235,28 @@ main(int argc, char *argv[])
> >> >         printf("First core:         %i\n\n", first_core);
> >> >
> >> >         /* Create packet buffer pool */
> >> > -       shm = odp_shm_reserve("shm_packet_pool",
> >> > -                             SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE,
> >> > 0);
> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> >> > +       params.buf_align = 0;
> >> > +       params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
> >> >
> >> > -       pool_base = odp_shm_addr(shm);
> >> > -
> >> > -       if (NULL == pool_base) {
> >> > -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
> >> > -               exit(EXIT_FAILURE);
> >> > -       }
> >> > +       pkt_pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL,
> >> > +                                         &params);
> >> >
> >> > -       pkt_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);
> >> >         if (ODP_BUFFER_POOL_INVALID == pkt_pool) {
> >> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
> >> >                 exit(EXIT_FAILURE);
> >> >         }
> >> >
> >> >         /* Create context buffer pool */
> >> > -       shm = odp_shm_reserve("shm_ctx_pool",
> >> > -                             SHM_CTX_POOL_SIZE, ODP_CACHE_LINE_SIZE,
> >> > 0);
> >> > -
> >> > -       pool_base = odp_shm_addr(shm);
> >> > +       params.buf_size  = SHM_CTX_POOL_BUF_SIZE;
> >> > +       params.buf_align = 0;
> >> > +       params.num_bufs  = SHM_CTX_POOL_BUF_COUNT;
> >> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
> >> >
> >> > -       if (NULL == pool_base) {
> >> > -               EXAMPLE_ERR("Error: context pool mem alloc
> failed.\n");
> >> > -               exit(EXIT_FAILURE);
> >> > -       }
> >> > +       ctx_pool = odp_buffer_pool_create("ctx_pool", ODP_SHM_NULL,
> >> > +                                         &params);
> >> >
> >> > -       ctx_pool = odp_buffer_pool_create("ctx_pool", pool_base,
> >> > -                                         SHM_CTX_POOL_SIZE,
> >> > -                                         SHM_CTX_POOL_BUF_SIZE,
> >> > -                                         ODP_CACHE_LINE_SIZE,
> >> > -                                         ODP_BUFFER_TYPE_RAW);
> >> >         if (ODP_BUFFER_POOL_INVALID == ctx_pool) {
> >> >                 EXAMPLE_ERR("Error: context pool create failed.\n");
> >> >                 exit(EXIT_FAILURE);
> >> > diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c
> >> > index ebac8c5..3c1fd6a 100644
> >> > --- a/example/l2fwd/odp_l2fwd.c
> >> > +++ b/example/l2fwd/odp_l2fwd.c
> >> > @@ -314,12 +314,12 @@ int main(int argc, char *argv[])
> >> >  {
> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
> >> >         odp_buffer_pool_t pool;
> >> > -       void *pool_base;
> >> >         int i;
> >> >         int first_core;
> >> >         int core_count;
> >> >         odp_pktio_t pktio;
> >> >         odp_shm_t shm;
> >> > +       odp_buffer_pool_param_t params;
> >> >
> >> >         /* Init ODP before calling anything else */
> >> >         if (odp_init_global(NULL, NULL)) {
> >> > @@ -383,20 +383,13 @@ int main(int argc, char *argv[])
> >> >         printf("First core:         %i\n\n", first_core);
> >> >
> >> >         /* 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);
> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> >> > +       params.buf_align = 0;
> >> > +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
> >> >
> >> > -       if (pool_base == NULL) {
> >> > -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
> >> > -               exit(EXIT_FAILURE);
> >> > -       }
> >> > +       pool = odp_buffer_pool_create("packet pool", ODP_SHM_NULL,
> >> > &params);
> >> >
> >> > -       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);
> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
> >> >                 exit(EXIT_FAILURE);
> >> > diff --git a/example/odp_example/odp_example.c
> >> > b/example/odp_example/odp_example.c
> >> > index 9e7f090..bc67342 100644
> >> > --- a/example/odp_example/odp_example.c
> >> > +++ b/example/odp_example/odp_example.c
> >> > @@ -954,13 +954,13 @@ int main(int argc, char *argv[])
> >> >         test_args_t args;
> >> >         int num_workers;
> >> >         odp_buffer_pool_t pool;
> >> > -       void *pool_base;
> >> >         odp_queue_t queue;
> >> >         int i, j;
> >> >         int prios;
> >> >         int first_core;
> >> >         odp_shm_t shm;
> >> >         test_globals_t *globals;
> >> > +       odp_buffer_pool_param_t params;
> >> >
> >> >         printf("\nODP example starts\n\n");
> >> >
> >> > @@ -1042,19 +1042,13 @@ int main(int argc, char *argv[])
> >> >         /*
> >> >          * Create message pool
> >> >          */
> >> > -       shm = odp_shm_reserve("msg_pool",
> >> > -                             MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
> >> >
> >> > -       pool_base = odp_shm_addr(shm);
> >> > +       params.buf_size  = sizeof(test_message_t);
> >> > +       params.buf_align = 0;
> >> > +       params.num_bufs  = MSG_POOL_SIZE/sizeof(test_message_t);
> >> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
> >> >
> >> > -       if (pool_base == NULL) {
> >> > -               EXAMPLE_ERR("Shared memory reserve failed.\n");
> >> > -               return -1;
> >> > -       }
> >> > -
> >> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
> >> > MSG_POOL_SIZE,
> >> > -                                     sizeof(test_message_t),
> >> > -                                     ODP_CACHE_LINE_SIZE,
> >> > ODP_BUFFER_TYPE_RAW);
> >> > +       pool = odp_buffer_pool_create("msg_pool", ODP_SHM_NULL,
> >> > &params);
> >> >
> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >> >                 EXAMPLE_ERR("Pool create failed.\n");
> >> > diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
> >> > index 3e08b34..e0632cb 100644
> >> > --- a/example/packet/odp_pktio.c
> >> > +++ b/example/packet/odp_pktio.c
> >> > @@ -296,11 +296,11 @@ int main(int argc, char *argv[])
> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
> >> >         odp_buffer_pool_t pool;
> >> >         int num_workers;
> >> > -       void *pool_base;
> >> >         int i;
> >> >         int first_core;
> >> >         int core_count;
> >> >         odp_shm_t shm;
> >> > +       odp_buffer_pool_param_t params;
> >> >
> >> >         /* Init ODP before calling anything else */
> >> >         if (odp_init_global(NULL, NULL)) {
> >> > @@ -354,20 +354,13 @@ int main(int argc, char *argv[])
> >> >         printf("First core:         %i\n\n", first_core);
> >> >
> >> >         /* 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);
> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> >> > +       params.buf_align = 0;
> >> > +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
> >> >
> >> > -       if (pool_base == NULL) {
> >> > -               EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
> >> > -               exit(EXIT_FAILURE);
> >> > -       }
> >> > +       pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL,
> >> > &params);
> >> >
> >> > -       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);
> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
> >> >                 exit(EXIT_FAILURE);
> >> > diff --git a/example/timer/odp_timer_test.c
> >> > b/example/timer/odp_timer_test.c
> >> > index 9968bfe..0d6e31a 100644
> >> > --- a/example/timer/odp_timer_test.c
> >> > +++ b/example/timer/odp_timer_test.c
> >> > @@ -244,12 +244,12 @@ int main(int argc, char *argv[])
> >> >         test_args_t args;
> >> >         int num_workers;
> >> >         odp_buffer_pool_t pool;
> >> > -       void *pool_base;
> >> >         odp_queue_t queue;
> >> >         int first_core;
> >> >         uint64_t cycles, ns;
> >> >         odp_queue_param_t param;
> >> >         odp_shm_t shm;
> >> > +       odp_buffer_pool_param_t params;
> >> >
> >> >         printf("\nODP timer example starts\n");
> >> >
> >> > @@ -313,12 +313,13 @@ int main(int argc, char *argv[])
> >> >          */
> >> >         shm = odp_shm_reserve("msg_pool",
> >> >                               MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
> >> > -       pool_base = odp_shm_addr(shm);
> >> >
> >> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
> >> > MSG_POOL_SIZE,
> >> > -                                     0,
> >> > -                                     ODP_CACHE_LINE_SIZE,
> >> > -                                     ODP_BUFFER_TYPE_TIMEOUT);
> >> > +       params.buf_size  = 0;
> >> > +       params.buf_align = 0;
> >> > +       params.num_bufs  = MSG_POOL_SIZE;
> >> > +       params.buf_type  = ODP_BUFFER_TYPE_TIMEOUT;
> >> > +
> >> > +       pool = odp_buffer_pool_create("msg_pool", shm, &params);
> >> >
> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >> >                 EXAMPLE_ERR("Pool create failed.\n");
> >> > diff --git a/test/api_test/odp_timer_ping.c
> >> > b/test/api_test/odp_timer_ping.c
> >> > index 7704181..1566f4f 100644
> >> > --- a/test/api_test/odp_timer_ping.c
> >> > +++ b/test/api_test/odp_timer_ping.c
> >> > @@ -319,9 +319,8 @@ int main(int argc ODP_UNUSED, char *argv[]
> >> > ODP_UNUSED)
> >> >         ping_arg_t pingarg;
> >> >         odp_queue_t queue;
> >> >         odp_buffer_pool_t pool;
> >> > -       void *pool_base;
> >> >         int i;
> >> > -       odp_shm_t shm;
> >> > +       odp_buffer_pool_param_t params;
> >> >
> >> >         if (odp_test_global_init() != 0)
> >> >                 return -1;
> >> > @@ -334,14 +333,14 @@ int main(int argc ODP_UNUSED, char *argv[]
> >> > ODP_UNUSED)
> >> >         /*
> >> >          * Create message pool
> >> >          */
> >> > -       shm = odp_shm_reserve("msg_pool",
> >> > -                             MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
> >> > -       pool_base = odp_shm_addr(shm);
> >> > -
> >> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
> >> > MSG_POOL_SIZE,
> >> > -                                     BUF_SIZE,
> >> > -                                     ODP_CACHE_LINE_SIZE,
> >> > -                                     ODP_BUFFER_TYPE_RAW);
> >> > +
> >> > +       params.buf_size  = BUF_SIZE;
> >> > +       params.buf_align = 0;
> >> > +       params.num_bufs  = MSG_POOL_SIZE/BUF_SIZE;
> >> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
> >> > +
> >> > +       pool = odp_buffer_pool_create("msg_pool", ODP_SHM_NULL,
> >> > &params);
> >> > +
> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >> >                 LOG_ERR("Pool create failed.\n");
> >> >                 return -1;
> >> > --
> >> > 1.8.3.2
> >> >
> >> >
> >> > _______________________________________________
> >> > lng-odp mailing list
> >> > lng-odp@lists.linaro.org <javascript:;>
> >> > http://lists.linaro.org/mailman/listinfo/lng-odp
>
Anders Roxell Nov. 21, 2014, 12:35 a.m. UTC | #5
On 21 Nov 2014 01:23, "Bill Fischofer" <bill.fischofer@linaro.org> wrote:
>
> The three parts are for review convenience.  They are a single patch.

Then please add RFC to the subject!

>
>
> On Thursday, November 20, 2014, Anders Roxell <anders.roxell@linaro.org>
wrote:
>>
>> On 21 November 2014 01:13, Bill Fischofer <bill.fischofer@linaro.org>
wrote:
>> > Not sure I understand.  They build just fine for me.  What problem are
you
>> > seeing?
>>
>> Can you apply patch 1/3 and then do "make" what happens then?
>>
>> >
>> > Bill
>> >
>> >
>> > On Thursday, November 20, 2014, Anders Roxell <anders.roxell@linaro.org
>
>> > wrote:
>> >>
>> >> Again Bill,
>> >>
>> >> I complained about this in your last patch set [1] as well!
>> >> You shall be able to build every patch.
>> >>
>> >> [1]
http://lists.linaro.org/pipermail/lng-odp/2014-November/004999.html
>> >>
>> >> On 21 November 2014 00:27, Bill Fischofer <bill.fischofer@linaro.org>
>> >> wrote:
>> >> > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
>> >> > ---
>> >> >  example/generator/odp_generator.c | 22 +++++----------
>> >> >  example/ipsec/odp_ipsec.c         | 57
>> >> > +++++++++++++--------------------------
>> >> >  example/l2fwd/odp_l2fwd.c         | 19 +++++--------
>> >> >  example/odp_example/odp_example.c | 18 +++++--------
>> >> >  example/packet/odp_pktio.c        | 19 +++++--------
>> >> >  example/timer/odp_timer_test.c    | 13 ++++-----
>> >> >  test/api_test/odp_timer_ping.c    | 19 +++++++------
>> >> >  7 files changed, 60 insertions(+), 107 deletions(-)
>> >> >
>> >> > diff --git a/example/generator/odp_generator.c
>> >> > b/example/generator/odp_generator.c
>> >> > index e2e0ba4..50e6c04 100644
>> >> > --- a/example/generator/odp_generator.c
>> >> > +++ b/example/generator/odp_generator.c
>> >> > @@ -57,8 +57,7 @@ typedef struct {
>> >> >         int number;             /**< packets number to be sent */
>> >> >         int payload;            /**< data len */
>> >> >         int timeout;            /**< wait time */
>> >> > -       int interval;           /**< wait interval ms between
sending
>> >> > -                                    each packet */
>> >> > +       int interval;           /**< wait interval ms between
sending
>> >> > each packet */
>> >> >  } appl_args_t;
>> >> >
>> >> >  /**
>> >> > @@ -516,11 +515,11 @@ int main(int argc, char *argv[])
>> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>> >> >         odp_buffer_pool_t pool;
>> >> >         int num_workers;
>> >> > -       void *pool_base;
>> >> >         int i;
>> >> >         int first_core;
>> >> >         int core_count;
>> >> >         odp_shm_t shm;
>> >> > +       odp_buffer_pool_param_t params;
>> >> >
>> >> >         /* Init ODP before calling anything else */
>> >> >         if (odp_init_global(NULL, NULL)) {
>> >> > @@ -583,20 +582,13 @@ int main(int argc, char *argv[])
>> >> >         printf("First core:         %i\n\n", first_core);
>> >> >
>> >> >         /* 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);
>> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
>> >> > +       params.buf_align = 0;
>> >> > +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>> >> >
>> >> > -       if (pool_base == NULL) {
>> >> > -               EXAMPLE_ERR("Error: packet pool mem alloc
failed.\n");
>> >> > -               exit(EXIT_FAILURE);
>> >> > -       }
>> >> > +       pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL,
>> >> > &params);
>> >> >
>> >> > -       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);
>> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>> >> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
>> >> >                 exit(EXIT_FAILURE);
>> >> > diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
>> >> > index ec115fc..b5d518c 100644
>> >> > --- a/example/ipsec/odp_ipsec.c
>> >> > +++ b/example/ipsec/odp_ipsec.c
>> >> > @@ -367,8 +367,7 @@ static
>> >> >  void ipsec_init_pre(void)
>> >> >  {
>> >> >         odp_queue_param_t qparam;
>> >> > -       void *pool_base;
>> >> > -       odp_shm_t shm;
>> >> > +       odp_buffer_pool_param_t params;
>> >> >
>> >> >         /*
>> >> >          * Create queues
>> >> > @@ -401,16 +400,12 @@ void ipsec_init_pre(void)
>> >> >         }
>> >> >
>> >> >         /* Create output buffer pool */
>> >> > -       shm = odp_shm_reserve("shm_out_pool",
>> >> > -                             SHM_OUT_POOL_SIZE,
ODP_CACHE_LINE_SIZE,
>> >> > 0);
>> >> > -
>> >> > -       pool_base = odp_shm_addr(shm);
>> >> > +       params.buf_size  = SHM_OUT_POOL_BUF_SIZE;
>> >> > +       params.buf_align = 0;
>> >> > +       params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
>> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>> >> >
>> >> > -       out_pool = odp_buffer_pool_create("out_pool", pool_base,
>> >> > -                                         SHM_OUT_POOL_SIZE,
>> >> > -                                         SHM_OUT_POOL_BUF_SIZE,
>> >> > -                                         ODP_CACHE_LINE_SIZE,
>> >> > -                                         ODP_BUFFER_TYPE_PACKET);
>> >> > +       out_pool = odp_buffer_pool_create("out_pool", ODP_SHM_NULL,
>> >> > &params);
>> >> >
>> >> >         if (ODP_BUFFER_POOL_INVALID == out_pool) {
>> >> >                 EXAMPLE_ERR("Error: message pool create failed.\n");
>> >> > @@ -1175,12 +1170,12 @@ main(int argc, char *argv[])
>> >> >  {
>> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>> >> >         int num_workers;
>> >> > -       void *pool_base;
>> >> >         int i;
>> >> >         int first_core;
>> >> >         int core_count;
>> >> >         int stream_count;
>> >> >         odp_shm_t shm;
>> >> > +       odp_buffer_pool_param_t params;
>> >> >
>> >> >         /* Init ODP before calling anything else */
>> >> >         if (odp_init_global(NULL, NULL)) {
>> >> > @@ -1240,42 +1235,28 @@ main(int argc, char *argv[])
>> >> >         printf("First core:         %i\n\n", first_core);
>> >> >
>> >> >         /* Create packet buffer pool */
>> >> > -       shm = odp_shm_reserve("shm_packet_pool",
>> >> > -                             SHM_PKT_POOL_SIZE,
ODP_CACHE_LINE_SIZE,
>> >> > 0);
>> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
>> >> > +       params.buf_align = 0;
>> >> > +       params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
>> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>> >> >
>> >> > -       pool_base = odp_shm_addr(shm);
>> >> > -
>> >> > -       if (NULL == pool_base) {
>> >> > -               EXAMPLE_ERR("Error: packet pool mem alloc
failed.\n");
>> >> > -               exit(EXIT_FAILURE);
>> >> > -       }
>> >> > +       pkt_pool = odp_buffer_pool_create("packet_pool",
ODP_SHM_NULL,
>> >> > +                                         &params);
>> >> >
>> >> > -       pkt_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);
>> >> >         if (ODP_BUFFER_POOL_INVALID == pkt_pool) {
>> >> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
>> >> >                 exit(EXIT_FAILURE);
>> >> >         }
>> >> >
>> >> >         /* Create context buffer pool */
>> >> > -       shm = odp_shm_reserve("shm_ctx_pool",
>> >> > -                             SHM_CTX_POOL_SIZE,
ODP_CACHE_LINE_SIZE,
>> >> > 0);
>> >> > -
>> >> > -       pool_base = odp_shm_addr(shm);
>> >> > +       params.buf_size  = SHM_CTX_POOL_BUF_SIZE;
>> >> > +       params.buf_align = 0;
>> >> > +       params.num_bufs  = SHM_CTX_POOL_BUF_COUNT;
>> >> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
>> >> >
>> >> > -       if (NULL == pool_base) {
>> >> > -               EXAMPLE_ERR("Error: context pool mem alloc
failed.\n");
>> >> > -               exit(EXIT_FAILURE);
>> >> > -       }
>> >> > +       ctx_pool = odp_buffer_pool_create("ctx_pool", ODP_SHM_NULL,
>> >> > +                                         &params);
>> >> >
>> >> > -       ctx_pool = odp_buffer_pool_create("ctx_pool", pool_base,
>> >> > -                                         SHM_CTX_POOL_SIZE,
>> >> > -                                         SHM_CTX_POOL_BUF_SIZE,
>> >> > -                                         ODP_CACHE_LINE_SIZE,
>> >> > -                                         ODP_BUFFER_TYPE_RAW);
>> >> >         if (ODP_BUFFER_POOL_INVALID == ctx_pool) {
>> >> >                 EXAMPLE_ERR("Error: context pool create failed.\n");
>> >> >                 exit(EXIT_FAILURE);
>> >> > diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c
>> >> > index ebac8c5..3c1fd6a 100644
>> >> > --- a/example/l2fwd/odp_l2fwd.c
>> >> > +++ b/example/l2fwd/odp_l2fwd.c
>> >> > @@ -314,12 +314,12 @@ int main(int argc, char *argv[])
>> >> >  {
>> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>> >> >         odp_buffer_pool_t pool;
>> >> > -       void *pool_base;
>> >> >         int i;
>> >> >         int first_core;
>> >> >         int core_count;
>> >> >         odp_pktio_t pktio;
>> >> >         odp_shm_t shm;
>> >> > +       odp_buffer_pool_param_t params;
>> >> >
>> >> >         /* Init ODP before calling anything else */
>> >> >         if (odp_init_global(NULL, NULL)) {
>> >> > @@ -383,20 +383,13 @@ int main(int argc, char *argv[])
>> >> >         printf("First core:         %i\n\n", first_core);
>> >> >
>> >> >         /* 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);
>> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
>> >> > +       params.buf_align = 0;
>> >> > +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>> >> >
>> >> > -       if (pool_base == NULL) {
>> >> > -               EXAMPLE_ERR("Error: packet pool mem alloc
failed.\n");
>> >> > -               exit(EXIT_FAILURE);
>> >> > -       }
>> >> > +       pool = odp_buffer_pool_create("packet pool", ODP_SHM_NULL,
>> >> > &params);
>> >> >
>> >> > -       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);
>> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>> >> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
>> >> >                 exit(EXIT_FAILURE);
>> >> > diff --git a/example/odp_example/odp_example.c
>> >> > b/example/odp_example/odp_example.c
>> >> > index 9e7f090..bc67342 100644
>> >> > --- a/example/odp_example/odp_example.c
>> >> > +++ b/example/odp_example/odp_example.c
>> >> > @@ -954,13 +954,13 @@ int main(int argc, char *argv[])
>> >> >         test_args_t args;
>> >> >         int num_workers;
>> >> >         odp_buffer_pool_t pool;
>> >> > -       void *pool_base;
>> >> >         odp_queue_t queue;
>> >> >         int i, j;
>> >> >         int prios;
>> >> >         int first_core;
>> >> >         odp_shm_t shm;
>> >> >         test_globals_t *globals;
>> >> > +       odp_buffer_pool_param_t params;
>> >> >
>> >> >         printf("\nODP example starts\n\n");
>> >> >
>> >> > @@ -1042,19 +1042,13 @@ int main(int argc, char *argv[])
>> >> >         /*
>> >> >          * Create message pool
>> >> >          */
>> >> > -       shm = odp_shm_reserve("msg_pool",
>> >> > -                             MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE,
0);
>> >> >
>> >> > -       pool_base = odp_shm_addr(shm);
>> >> > +       params.buf_size  = sizeof(test_message_t);
>> >> > +       params.buf_align = 0;
>> >> > +       params.num_bufs  = MSG_POOL_SIZE/sizeof(test_message_t);
>> >> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
>> >> >
>> >> > -       if (pool_base == NULL) {
>> >> > -               EXAMPLE_ERR("Shared memory reserve failed.\n");
>> >> > -               return -1;
>> >> > -       }
>> >> > -
>> >> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
>> >> > MSG_POOL_SIZE,
>> >> > -                                     sizeof(test_message_t),
>> >> > -                                     ODP_CACHE_LINE_SIZE,
>> >> > ODP_BUFFER_TYPE_RAW);
>> >> > +       pool = odp_buffer_pool_create("msg_pool", ODP_SHM_NULL,
>> >> > &params);
>> >> >
>> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>> >> >                 EXAMPLE_ERR("Pool create failed.\n");
>> >> > diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
>> >> > index 3e08b34..e0632cb 100644
>> >> > --- a/example/packet/odp_pktio.c
>> >> > +++ b/example/packet/odp_pktio.c
>> >> > @@ -296,11 +296,11 @@ int main(int argc, char *argv[])
>> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>> >> >         odp_buffer_pool_t pool;
>> >> >         int num_workers;
>> >> > -       void *pool_base;
>> >> >         int i;
>> >> >         int first_core;
>> >> >         int core_count;
>> >> >         odp_shm_t shm;
>> >> > +       odp_buffer_pool_param_t params;
>> >> >
>> >> >         /* Init ODP before calling anything else */
>> >> >         if (odp_init_global(NULL, NULL)) {
>> >> > @@ -354,20 +354,13 @@ int main(int argc, char *argv[])
>> >> >         printf("First core:         %i\n\n", first_core);
>> >> >
>> >> >         /* 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);
>> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
>> >> > +       params.buf_align = 0;
>> >> > +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>> >> >
>> >> > -       if (pool_base == NULL) {
>> >> > -               EXAMPLE_ERR("Error: packet pool mem alloc
failed.\n");
>> >> > -               exit(EXIT_FAILURE);
>> >> > -       }
>> >> > +       pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL,
>> >> > &params);
>> >> >
>> >> > -       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);
>> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>> >> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
>> >> >                 exit(EXIT_FAILURE);
>> >> > diff --git a/example/timer/odp_timer_test.c
>> >> > b/example/timer/odp_timer_test.c
>> >> > index 9968bfe..0d6e31a 100644
>> >> > --- a/example/timer/odp_timer_test.c
>> >> > +++ b/example/timer/odp_timer_test.c
>> >> > @@ -244,12 +244,12 @@ int main(int argc, char *argv[])
>> >> >         test_args_t args;
>> >> >         int num_workers;
>> >> >         odp_buffer_pool_t pool;
>> >> > -       void *pool_base;
>> >> >         odp_queue_t queue;
>> >> >         int first_core;
>> >> >         uint64_t cycles, ns;
>> >> >         odp_queue_param_t param;
>> >> >         odp_shm_t shm;
>> >> > +       odp_buffer_pool_param_t params;
>> >> >
>> >> >         printf("\nODP timer example starts\n");
>> >> >
>> >> > @@ -313,12 +313,13 @@ int main(int argc, char *argv[])
>> >> >          */
>> >> >         shm = odp_shm_reserve("msg_pool",
>> >> >                               MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE,
0);
>> >> > -       pool_base = odp_shm_addr(shm);
>> >> >
>> >> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
>> >> > MSG_POOL_SIZE,
>> >> > -                                     0,
>> >> > -                                     ODP_CACHE_LINE_SIZE,
>> >> > -                                     ODP_BUFFER_TYPE_TIMEOUT);
>> >> > +       params.buf_size  = 0;
>> >> > +       params.buf_align = 0;
>> >> > +       params.num_bufs  = MSG_POOL_SIZE;
>> >> > +       params.buf_type  = ODP_BUFFER_TYPE_TIMEOUT;
>> >> > +
>> >> > +       pool = odp_buffer_pool_create("msg_pool", shm, &params);
>> >> >
>> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>> >> >                 EXAMPLE_ERR("Pool create failed.\n");
>> >> > diff --git a/test/api_test/odp_timer_ping.c
>> >> > b/test/api_test/odp_timer_ping.c
>> >> > index 7704181..1566f4f 100644
>> >> > --- a/test/api_test/odp_timer_ping.c
>> >> > +++ b/test/api_test/odp_timer_ping.c
>> >> > @@ -319,9 +319,8 @@ int main(int argc ODP_UNUSED, char *argv[]
>> >> > ODP_UNUSED)
>> >> >         ping_arg_t pingarg;
>> >> >         odp_queue_t queue;
>> >> >         odp_buffer_pool_t pool;
>> >> > -       void *pool_base;
>> >> >         int i;
>> >> > -       odp_shm_t shm;
>> >> > +       odp_buffer_pool_param_t params;
>> >> >
>> >> >         if (odp_test_global_init() != 0)
>> >> >                 return -1;
>> >> > @@ -334,14 +333,14 @@ int main(int argc ODP_UNUSED, char *argv[]
>> >> > ODP_UNUSED)
>> >> >         /*
>> >> >          * Create message pool
>> >> >          */
>> >> > -       shm = odp_shm_reserve("msg_pool",
>> >> > -                             MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE,
0);
>> >> > -       pool_base = odp_shm_addr(shm);
>> >> > -
>> >> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
>> >> > MSG_POOL_SIZE,
>> >> > -                                     BUF_SIZE,
>> >> > -                                     ODP_CACHE_LINE_SIZE,
>> >> > -                                     ODP_BUFFER_TYPE_RAW);
>> >> > +
>> >> > +       params.buf_size  = BUF_SIZE;
>> >> > +       params.buf_align = 0;
>> >> > +       params.num_bufs  = MSG_POOL_SIZE/BUF_SIZE;
>> >> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
>> >> > +
>> >> > +       pool = odp_buffer_pool_create("msg_pool", ODP_SHM_NULL,
>> >> > &params);
>> >> > +
>> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>> >> >                 LOG_ERR("Pool create failed.\n");
>> >> >                 return -1;
>> >> > --
>> >> > 1.8.3.2
>> >> >
>> >> >
>> >> > _______________________________________________
>> >> > lng-odp mailing list
>> >> > lng-odp@lists.linaro.org
>> >> > http://lists.linaro.org/mailman/listinfo/lng-odp
Bill Fischofer Nov. 21, 2014, 12:45 a.m. UTC | #6
OK, I'm confused here.  The patches to effect API changes are large because
they need to change three things:

1. The .h files that define the API.
2. The revised implementation of the API.
3. The example/test programs that use the API.

None of these can be separated and result in a buildable system.  However
when I first submitted one of these changes I was told it was too large and
needed to be broken up, which is why they're now being posted in parts for
review convenience.

We just need to be consistent here.  I can repost this as a single patch,
but today we agreed that we wouldn't do that so that Petri could review the
.h files separately.

I'm off tomorrow, so perhaps you and Petri can agree on how these are to be
posted and I'll be happy to follow whatever packaging method you'd like.
This is important because all of these API change patches will have the
same issue.

Thanks.

Bill

On Thu, Nov 20, 2014 at 6:35 PM, Anders Roxell <anders.roxell@linaro.org>
wrote:

>
> On 21 Nov 2014 01:23, "Bill Fischofer" <bill.fischofer@linaro.org> wrote:
> >
> > The three parts are for review convenience.  They are a single patch.
>
> Then please add RFC to the subject!
>
> >
> >
> > On Thursday, November 20, 2014, Anders Roxell <anders.roxell@linaro.org>
> wrote:
> >>
> >> On 21 November 2014 01:13, Bill Fischofer <bill.fischofer@linaro.org>
> wrote:
> >> > Not sure I understand.  They build just fine for me.  What problem
> are you
> >> > seeing?
> >>
> >> Can you apply patch 1/3 and then do "make" what happens then?
> >>
> >> >
> >> > Bill
> >> >
> >> >
> >> > On Thursday, November 20, 2014, Anders Roxell <
> anders.roxell@linaro.org>
> >> > wrote:
> >> >>
> >> >> Again Bill,
> >> >>
> >> >> I complained about this in your last patch set [1] as well!
> >> >> You shall be able to build every patch.
> >> >>
> >> >> [1]
> http://lists.linaro.org/pipermail/lng-odp/2014-November/004999.html
> >> >>
> >> >> On 21 November 2014 00:27, Bill Fischofer <bill.fischofer@linaro.org
> >
> >> >> wrote:
> >> >> > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> >> >> > ---
> >> >> >  example/generator/odp_generator.c | 22 +++++----------
> >> >> >  example/ipsec/odp_ipsec.c         | 57
> >> >> > +++++++++++++--------------------------
> >> >> >  example/l2fwd/odp_l2fwd.c         | 19 +++++--------
> >> >> >  example/odp_example/odp_example.c | 18 +++++--------
> >> >> >  example/packet/odp_pktio.c        | 19 +++++--------
> >> >> >  example/timer/odp_timer_test.c    | 13 ++++-----
> >> >> >  test/api_test/odp_timer_ping.c    | 19 +++++++------
> >> >> >  7 files changed, 60 insertions(+), 107 deletions(-)
> >> >> >
> >> >> > diff --git a/example/generator/odp_generator.c
> >> >> > b/example/generator/odp_generator.c
> >> >> > index e2e0ba4..50e6c04 100644
> >> >> > --- a/example/generator/odp_generator.c
> >> >> > +++ b/example/generator/odp_generator.c
> >> >> > @@ -57,8 +57,7 @@ typedef struct {
> >> >> >         int number;             /**< packets number to be sent */
> >> >> >         int payload;            /**< data len */
> >> >> >         int timeout;            /**< wait time */
> >> >> > -       int interval;           /**< wait interval ms between
> sending
> >> >> > -                                    each packet */
> >> >> > +       int interval;           /**< wait interval ms between
> sending
> >> >> > each packet */
> >> >> >  } appl_args_t;
> >> >> >
> >> >> >  /**
> >> >> > @@ -516,11 +515,11 @@ int main(int argc, char *argv[])
> >> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
> >> >> >         odp_buffer_pool_t pool;
> >> >> >         int num_workers;
> >> >> > -       void *pool_base;
> >> >> >         int i;
> >> >> >         int first_core;
> >> >> >         int core_count;
> >> >> >         odp_shm_t shm;
> >> >> > +       odp_buffer_pool_param_t params;
> >> >> >
> >> >> >         /* Init ODP before calling anything else */
> >> >> >         if (odp_init_global(NULL, NULL)) {
> >> >> > @@ -583,20 +582,13 @@ int main(int argc, char *argv[])
> >> >> >         printf("First core:         %i\n\n", first_core);
> >> >> >
> >> >> >         /* 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);
> >> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> >> >> > +       params.buf_align = 0;
> >> >> > +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
> >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
> >> >> >
> >> >> > -       if (pool_base == NULL) {
> >> >> > -               EXAMPLE_ERR("Error: packet pool mem alloc
> failed.\n");
> >> >> > -               exit(EXIT_FAILURE);
> >> >> > -       }
> >> >> > +       pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL,
> >> >> > &params);
> >> >> >
> >> >> > -       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);
> >> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >> >> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
> >> >> >                 exit(EXIT_FAILURE);
> >> >> > diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
> >> >> > index ec115fc..b5d518c 100644
> >> >> > --- a/example/ipsec/odp_ipsec.c
> >> >> > +++ b/example/ipsec/odp_ipsec.c
> >> >> > @@ -367,8 +367,7 @@ static
> >> >> >  void ipsec_init_pre(void)
> >> >> >  {
> >> >> >         odp_queue_param_t qparam;
> >> >> > -       void *pool_base;
> >> >> > -       odp_shm_t shm;
> >> >> > +       odp_buffer_pool_param_t params;
> >> >> >
> >> >> >         /*
> >> >> >          * Create queues
> >> >> > @@ -401,16 +400,12 @@ void ipsec_init_pre(void)
> >> >> >         }
> >> >> >
> >> >> >         /* Create output buffer pool */
> >> >> > -       shm = odp_shm_reserve("shm_out_pool",
> >> >> > -                             SHM_OUT_POOL_SIZE,
> ODP_CACHE_LINE_SIZE,
> >> >> > 0);
> >> >> > -
> >> >> > -       pool_base = odp_shm_addr(shm);
> >> >> > +       params.buf_size  = SHM_OUT_POOL_BUF_SIZE;
> >> >> > +       params.buf_align = 0;
> >> >> > +       params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
> >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
> >> >> >
> >> >> > -       out_pool = odp_buffer_pool_create("out_pool", pool_base,
> >> >> > -                                         SHM_OUT_POOL_SIZE,
> >> >> > -                                         SHM_OUT_POOL_BUF_SIZE,
> >> >> > -                                         ODP_CACHE_LINE_SIZE,
> >> >> > -                                         ODP_BUFFER_TYPE_PACKET);
> >> >> > +       out_pool = odp_buffer_pool_create("out_pool", ODP_SHM_NULL,
> >> >> > &params);
> >> >> >
> >> >> >         if (ODP_BUFFER_POOL_INVALID == out_pool) {
> >> >> >                 EXAMPLE_ERR("Error: message pool create
> failed.\n");
> >> >> > @@ -1175,12 +1170,12 @@ main(int argc, char *argv[])
> >> >> >  {
> >> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
> >> >> >         int num_workers;
> >> >> > -       void *pool_base;
> >> >> >         int i;
> >> >> >         int first_core;
> >> >> >         int core_count;
> >> >> >         int stream_count;
> >> >> >         odp_shm_t shm;
> >> >> > +       odp_buffer_pool_param_t params;
> >> >> >
> >> >> >         /* Init ODP before calling anything else */
> >> >> >         if (odp_init_global(NULL, NULL)) {
> >> >> > @@ -1240,42 +1235,28 @@ main(int argc, char *argv[])
> >> >> >         printf("First core:         %i\n\n", first_core);
> >> >> >
> >> >> >         /* Create packet buffer pool */
> >> >> > -       shm = odp_shm_reserve("shm_packet_pool",
> >> >> > -                             SHM_PKT_POOL_SIZE,
> ODP_CACHE_LINE_SIZE,
> >> >> > 0);
> >> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> >> >> > +       params.buf_align = 0;
> >> >> > +       params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
> >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
> >> >> >
> >> >> > -       pool_base = odp_shm_addr(shm);
> >> >> > -
> >> >> > -       if (NULL == pool_base) {
> >> >> > -               EXAMPLE_ERR("Error: packet pool mem alloc
> failed.\n");
> >> >> > -               exit(EXIT_FAILURE);
> >> >> > -       }
> >> >> > +       pkt_pool = odp_buffer_pool_create("packet_pool",
> ODP_SHM_NULL,
> >> >> > +                                         &params);
> >> >> >
> >> >> > -       pkt_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);
> >> >> >         if (ODP_BUFFER_POOL_INVALID == pkt_pool) {
> >> >> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
> >> >> >                 exit(EXIT_FAILURE);
> >> >> >         }
> >> >> >
> >> >> >         /* Create context buffer pool */
> >> >> > -       shm = odp_shm_reserve("shm_ctx_pool",
> >> >> > -                             SHM_CTX_POOL_SIZE,
> ODP_CACHE_LINE_SIZE,
> >> >> > 0);
> >> >> > -
> >> >> > -       pool_base = odp_shm_addr(shm);
> >> >> > +       params.buf_size  = SHM_CTX_POOL_BUF_SIZE;
> >> >> > +       params.buf_align = 0;
> >> >> > +       params.num_bufs  = SHM_CTX_POOL_BUF_COUNT;
> >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
> >> >> >
> >> >> > -       if (NULL == pool_base) {
> >> >> > -               EXAMPLE_ERR("Error: context pool mem alloc
> failed.\n");
> >> >> > -               exit(EXIT_FAILURE);
> >> >> > -       }
> >> >> > +       ctx_pool = odp_buffer_pool_create("ctx_pool", ODP_SHM_NULL,
> >> >> > +                                         &params);
> >> >> >
> >> >> > -       ctx_pool = odp_buffer_pool_create("ctx_pool", pool_base,
> >> >> > -                                         SHM_CTX_POOL_SIZE,
> >> >> > -                                         SHM_CTX_POOL_BUF_SIZE,
> >> >> > -                                         ODP_CACHE_LINE_SIZE,
> >> >> > -                                         ODP_BUFFER_TYPE_RAW);
> >> >> >         if (ODP_BUFFER_POOL_INVALID == ctx_pool) {
> >> >> >                 EXAMPLE_ERR("Error: context pool create
> failed.\n");
> >> >> >                 exit(EXIT_FAILURE);
> >> >> > diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c
> >> >> > index ebac8c5..3c1fd6a 100644
> >> >> > --- a/example/l2fwd/odp_l2fwd.c
> >> >> > +++ b/example/l2fwd/odp_l2fwd.c
> >> >> > @@ -314,12 +314,12 @@ int main(int argc, char *argv[])
> >> >> >  {
> >> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
> >> >> >         odp_buffer_pool_t pool;
> >> >> > -       void *pool_base;
> >> >> >         int i;
> >> >> >         int first_core;
> >> >> >         int core_count;
> >> >> >         odp_pktio_t pktio;
> >> >> >         odp_shm_t shm;
> >> >> > +       odp_buffer_pool_param_t params;
> >> >> >
> >> >> >         /* Init ODP before calling anything else */
> >> >> >         if (odp_init_global(NULL, NULL)) {
> >> >> > @@ -383,20 +383,13 @@ int main(int argc, char *argv[])
> >> >> >         printf("First core:         %i\n\n", first_core);
> >> >> >
> >> >> >         /* 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);
> >> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> >> >> > +       params.buf_align = 0;
> >> >> > +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
> >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
> >> >> >
> >> >> > -       if (pool_base == NULL) {
> >> >> > -               EXAMPLE_ERR("Error: packet pool mem alloc
> failed.\n");
> >> >> > -               exit(EXIT_FAILURE);
> >> >> > -       }
> >> >> > +       pool = odp_buffer_pool_create("packet pool", ODP_SHM_NULL,
> >> >> > &params);
> >> >> >
> >> >> > -       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);
> >> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >> >> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
> >> >> >                 exit(EXIT_FAILURE);
> >> >> > diff --git a/example/odp_example/odp_example.c
> >> >> > b/example/odp_example/odp_example.c
> >> >> > index 9e7f090..bc67342 100644
> >> >> > --- a/example/odp_example/odp_example.c
> >> >> > +++ b/example/odp_example/odp_example.c
> >> >> > @@ -954,13 +954,13 @@ int main(int argc, char *argv[])
> >> >> >         test_args_t args;
> >> >> >         int num_workers;
> >> >> >         odp_buffer_pool_t pool;
> >> >> > -       void *pool_base;
> >> >> >         odp_queue_t queue;
> >> >> >         int i, j;
> >> >> >         int prios;
> >> >> >         int first_core;
> >> >> >         odp_shm_t shm;
> >> >> >         test_globals_t *globals;
> >> >> > +       odp_buffer_pool_param_t params;
> >> >> >
> >> >> >         printf("\nODP example starts\n\n");
> >> >> >
> >> >> > @@ -1042,19 +1042,13 @@ int main(int argc, char *argv[])
> >> >> >         /*
> >> >> >          * Create message pool
> >> >> >          */
> >> >> > -       shm = odp_shm_reserve("msg_pool",
> >> >> > -                             MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE,
> 0);
> >> >> >
> >> >> > -       pool_base = odp_shm_addr(shm);
> >> >> > +       params.buf_size  = sizeof(test_message_t);
> >> >> > +       params.buf_align = 0;
> >> >> > +       params.num_bufs  = MSG_POOL_SIZE/sizeof(test_message_t);
> >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
> >> >> >
> >> >> > -       if (pool_base == NULL) {
> >> >> > -               EXAMPLE_ERR("Shared memory reserve failed.\n");
> >> >> > -               return -1;
> >> >> > -       }
> >> >> > -
> >> >> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
> >> >> > MSG_POOL_SIZE,
> >> >> > -                                     sizeof(test_message_t),
> >> >> > -                                     ODP_CACHE_LINE_SIZE,
> >> >> > ODP_BUFFER_TYPE_RAW);
> >> >> > +       pool = odp_buffer_pool_create("msg_pool", ODP_SHM_NULL,
> >> >> > &params);
> >> >> >
> >> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >> >> >                 EXAMPLE_ERR("Pool create failed.\n");
> >> >> > diff --git a/example/packet/odp_pktio.c
> b/example/packet/odp_pktio.c
> >> >> > index 3e08b34..e0632cb 100644
> >> >> > --- a/example/packet/odp_pktio.c
> >> >> > +++ b/example/packet/odp_pktio.c
> >> >> > @@ -296,11 +296,11 @@ int main(int argc, char *argv[])
> >> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
> >> >> >         odp_buffer_pool_t pool;
> >> >> >         int num_workers;
> >> >> > -       void *pool_base;
> >> >> >         int i;
> >> >> >         int first_core;
> >> >> >         int core_count;
> >> >> >         odp_shm_t shm;
> >> >> > +       odp_buffer_pool_param_t params;
> >> >> >
> >> >> >         /* Init ODP before calling anything else */
> >> >> >         if (odp_init_global(NULL, NULL)) {
> >> >> > @@ -354,20 +354,13 @@ int main(int argc, char *argv[])
> >> >> >         printf("First core:         %i\n\n", first_core);
> >> >> >
> >> >> >         /* 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);
> >> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
> >> >> > +       params.buf_align = 0;
> >> >> > +       params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
> >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
> >> >> >
> >> >> > -       if (pool_base == NULL) {
> >> >> > -               EXAMPLE_ERR("Error: packet pool mem alloc
> failed.\n");
> >> >> > -               exit(EXIT_FAILURE);
> >> >> > -       }
> >> >> > +       pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL,
> >> >> > &params);
> >> >> >
> >> >> > -       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);
> >> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >> >> >                 EXAMPLE_ERR("Error: packet pool create failed.\n");
> >> >> >                 exit(EXIT_FAILURE);
> >> >> > diff --git a/example/timer/odp_timer_test.c
> >> >> > b/example/timer/odp_timer_test.c
> >> >> > index 9968bfe..0d6e31a 100644
> >> >> > --- a/example/timer/odp_timer_test.c
> >> >> > +++ b/example/timer/odp_timer_test.c
> >> >> > @@ -244,12 +244,12 @@ int main(int argc, char *argv[])
> >> >> >         test_args_t args;
> >> >> >         int num_workers;
> >> >> >         odp_buffer_pool_t pool;
> >> >> > -       void *pool_base;
> >> >> >         odp_queue_t queue;
> >> >> >         int first_core;
> >> >> >         uint64_t cycles, ns;
> >> >> >         odp_queue_param_t param;
> >> >> >         odp_shm_t shm;
> >> >> > +       odp_buffer_pool_param_t params;
> >> >> >
> >> >> >         printf("\nODP timer example starts\n");
> >> >> >
> >> >> > @@ -313,12 +313,13 @@ int main(int argc, char *argv[])
> >> >> >          */
> >> >> >         shm = odp_shm_reserve("msg_pool",
> >> >> >                               MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE,
> 0);
> >> >> > -       pool_base = odp_shm_addr(shm);
> >> >> >
> >> >> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
> >> >> > MSG_POOL_SIZE,
> >> >> > -                                     0,
> >> >> > -                                     ODP_CACHE_LINE_SIZE,
> >> >> > -                                     ODP_BUFFER_TYPE_TIMEOUT);
> >> >> > +       params.buf_size  = 0;
> >> >> > +       params.buf_align = 0;
> >> >> > +       params.num_bufs  = MSG_POOL_SIZE;
> >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_TIMEOUT;
> >> >> > +
> >> >> > +       pool = odp_buffer_pool_create("msg_pool", shm, &params);
> >> >> >
> >> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >> >> >                 EXAMPLE_ERR("Pool create failed.\n");
> >> >> > diff --git a/test/api_test/odp_timer_ping.c
> >> >> > b/test/api_test/odp_timer_ping.c
> >> >> > index 7704181..1566f4f 100644
> >> >> > --- a/test/api_test/odp_timer_ping.c
> >> >> > +++ b/test/api_test/odp_timer_ping.c
> >> >> > @@ -319,9 +319,8 @@ int main(int argc ODP_UNUSED, char *argv[]
> >> >> > ODP_UNUSED)
> >> >> >         ping_arg_t pingarg;
> >> >> >         odp_queue_t queue;
> >> >> >         odp_buffer_pool_t pool;
> >> >> > -       void *pool_base;
> >> >> >         int i;
> >> >> > -       odp_shm_t shm;
> >> >> > +       odp_buffer_pool_param_t params;
> >> >> >
> >> >> >         if (odp_test_global_init() != 0)
> >> >> >                 return -1;
> >> >> > @@ -334,14 +333,14 @@ int main(int argc ODP_UNUSED, char *argv[]
> >> >> > ODP_UNUSED)
> >> >> >         /*
> >> >> >          * Create message pool
> >> >> >          */
> >> >> > -       shm = odp_shm_reserve("msg_pool",
> >> >> > -                             MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE,
> 0);
> >> >> > -       pool_base = odp_shm_addr(shm);
> >> >> > -
> >> >> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
> >> >> > MSG_POOL_SIZE,
> >> >> > -                                     BUF_SIZE,
> >> >> > -                                     ODP_CACHE_LINE_SIZE,
> >> >> > -                                     ODP_BUFFER_TYPE_RAW);
> >> >> > +
> >> >> > +       params.buf_size  = BUF_SIZE;
> >> >> > +       params.buf_align = 0;
> >> >> > +       params.num_bufs  = MSG_POOL_SIZE/BUF_SIZE;
> >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
> >> >> > +
> >> >> > +       pool = odp_buffer_pool_create("msg_pool", ODP_SHM_NULL,
> >> >> > &params);
> >> >> > +
> >> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
> >> >> >                 LOG_ERR("Pool create failed.\n");
> >> >> >                 return -1;
> >> >> > --
> >> >> > 1.8.3.2
> >> >> >
> >> >> >
> >> >> > _______________________________________________
> >> >> > lng-odp mailing list
> >> >> > lng-odp@lists.linaro.org
> >> >> > http://lists.linaro.org/mailman/listinfo/lng-odp
>
Taras Kondratiuk Nov. 21, 2014, 11:58 a.m. UTC | #7
On 11/21/2014 01:27 AM, Bill Fischofer wrote:
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
>   example/generator/odp_generator.c | 22 +++++----------
>   example/ipsec/odp_ipsec.c         | 57 +++++++++++++--------------------------
>   example/l2fwd/odp_l2fwd.c         | 19 +++++--------
>   example/odp_example/odp_example.c | 18 +++++--------
>   example/packet/odp_pktio.c        | 19 +++++--------
>   example/timer/odp_timer_test.c    | 13 ++++-----
>   test/api_test/odp_timer_ping.c    | 19 +++++++------
>   7 files changed, 60 insertions(+), 107 deletions(-)

Changes to test/validation/ are missing.
Looks like you don't have CUnit enabled in your build configuration.
Maxim Uvarov Nov. 21, 2014, 12:15 p.m. UTC | #8
On 11/21/2014 03:45 AM, Bill Fischofer wrote:
> OK, I'm confused here.  The patches to effect API changes are large 
> because they need to change three things:
>
> 1. The .h files that define the API.
> 2. The revised implementation of the API.
> 3. The example/test programs that use the API.
>
> None of these can be separated and result in a buildable system.  
> However when I first submitted one of these changes I was told it was 
> too large and needed to be broken up, which is why they're now being 
> posted in parts for review convenience.

That is very common situation. It's better to provide small patches for 
review. And I can merge them on applying.
To give me a hint that several patches have to be merged together you 
can name them like this:
"test/example changes for v1.0 buffer pool APIs - part1: API"
"test/example changes for v1.0 buffer pool APIs - part2: Implementation"
"test/example changes for v1.0 buffer pool APIs - part3: Tests"

Maxim.

>
> We just need to be consistent here.  I can repost this as a single 
> patch, but today we agreed that we wouldn't do that so that Petri 
> could review the .h files separately.
>
> I'm off tomorrow, so perhaps you and Petri can agree on how these are 
> to be posted and I'll be happy to follow whatever packaging method 
> you'd like.  This is important because all of these API change patches 
> will have the same issue.
>
> Thanks.
>
> Bill
>
> On Thu, Nov 20, 2014 at 6:35 PM, Anders Roxell 
> <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>> wrote:
>
>
>     On 21 Nov 2014 01:23, "Bill Fischofer" <bill.fischofer@linaro.org
>     <mailto:bill.fischofer@linaro.org>> wrote:
>     >
>     > The three parts are for review convenience.  They are a single
>     patch.
>
>     Then please add RFC to the subject!
>
>     >
>     >
>     > On Thursday, November 20, 2014, Anders Roxell
>     <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>> wrote:
>     >>
>     >> On 21 November 2014 01:13, Bill Fischofer
>     <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>> wrote:
>     >> > Not sure I understand.  They build just fine for me.  What
>     problem are you
>     >> > seeing?
>     >>
>     >> Can you apply patch 1/3 and then do "make" what happens then?
>     >>
>     >> >
>     >> > Bill
>     >> >
>     >> >
>     >> > On Thursday, November 20, 2014, Anders Roxell
>     <anders.roxell@linaro.org <mailto:anders.roxell@linaro.org>>
>     >> > wrote:
>     >> >>
>     >> >> Again Bill,
>     >> >>
>     >> >> I complained about this in your last patch set [1] as well!
>     >> >> You shall be able to build every patch.
>     >> >>
>     >> >> [1]
>     http://lists.linaro.org/pipermail/lng-odp/2014-November/004999.html
>     >> >>
>     >> >> On 21 November 2014 00:27, Bill Fischofer
>     <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>>
>     >> >> wrote:
>     >> >> > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org
>     <mailto:bill.fischofer@linaro.org>>
>     >> >> > ---
>     >> >> > example/generator/odp_generator.c | 22 +++++----------
>     >> >> >  example/ipsec/odp_ipsec.c    | 57
>     >> >> > +++++++++++++--------------------------
>     >> >> >  example/l2fwd/odp_l2fwd.c    | 19 +++++--------
>     >> >> > example/odp_example/odp_example.c | 18 +++++--------
>     >> >> >  example/packet/odp_pktio.c     | 19 +++++--------
>     >> >> > example/timer/odp_timer_test.c    | 13 ++++-----
>     >> >> > test/api_test/odp_timer_ping.c    | 19 +++++++------
>     >> >> >  7 files changed, 60 insertions(+), 107 deletions(-)
>     >> >> >
>     >> >> > diff --git a/example/generator/odp_generator.c
>     >> >> > b/example/generator/odp_generator.c
>     >> >> > index e2e0ba4..50e6c04 100644
>     >> >> > --- a/example/generator/odp_generator.c
>     >> >> > +++ b/example/generator/odp_generator.c
>     >> >> > @@ -57,8 +57,7 @@ typedef struct {
>     >> >> >         int number;  /**< packets number to be sent */
>     >> >> >         int payload; /**< data len */
>     >> >> >         int timeout; /**< wait time */
>     >> >> > -       int interval;  /**< wait interval ms between sending
>     >> >> > -       each packet */
>     >> >> > +       int interval;  /**< wait interval ms between sending
>     >> >> > each packet */
>     >> >> >  } appl_args_t;
>     >> >> >
>     >> >> >  /**
>     >> >> > @@ -516,11 +515,11 @@ int main(int argc, char *argv[])
>     >> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>     >> >> >         odp_buffer_pool_t pool;
>     >> >> >         int num_workers;
>     >> >> > -       void *pool_base;
>     >> >> >         int i;
>     >> >> >         int first_core;
>     >> >> >         int core_count;
>     >> >> >         odp_shm_t shm;
>     >> >> > +       odp_buffer_pool_param_t params;
>     >> >> >
>     >> >> >         /* Init ODP before calling anything else */
>     >> >> >         if (odp_init_global(NULL, NULL)) {
>     >> >> > @@ -583,20 +582,13 @@ int main(int argc, char *argv[])
>     >> >> >         printf("First core:      %i\n\n", first_core);
>     >> >> >
>     >> >> >         /* 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);
>     >> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
>     >> >> > +       params.buf_align = 0;
>     >> >> > +       params.num_bufs  =
>     SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>     >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>     >> >> >
>     >> >> > -       if (pool_base == NULL) {
>     >> >> > -  EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
>     >> >> > -  exit(EXIT_FAILURE);
>     >> >> > -       }
>     >> >> > +       pool = odp_buffer_pool_create("packet_pool",
>     ODP_SHM_NULL,
>     >> >> > &params);
>     >> >> >
>     >> >> > -       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);
>     >> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>     >> >> >  EXAMPLE_ERR("Error: packet pool create failed.\n");
>     >> >> >  exit(EXIT_FAILURE);
>     >> >> > diff --git a/example/ipsec/odp_ipsec.c
>     b/example/ipsec/odp_ipsec.c
>     >> >> > index ec115fc..b5d518c 100644
>     >> >> > --- a/example/ipsec/odp_ipsec.c
>     >> >> > +++ b/example/ipsec/odp_ipsec.c
>     >> >> > @@ -367,8 +367,7 @@ static
>     >> >> >  void ipsec_init_pre(void)
>     >> >> >  {
>     >> >> >         odp_queue_param_t qparam;
>     >> >> > -       void *pool_base;
>     >> >> > -       odp_shm_t shm;
>     >> >> > +       odp_buffer_pool_param_t params;
>     >> >> >
>     >> >> >         /*
>     >> >> >          * Create queues
>     >> >> > @@ -401,16 +400,12 @@ void ipsec_init_pre(void)
>     >> >> >         }
>     >> >> >
>     >> >> >         /* Create output buffer pool */
>     >> >> > -       shm = odp_shm_reserve("shm_out_pool",
>     >> >> > -  SHM_OUT_POOL_SIZE, ODP_CACHE_LINE_SIZE,
>     >> >> > 0);
>     >> >> > -
>     >> >> > -       pool_base = odp_shm_addr(shm);
>     >> >> > +       params.buf_size  = SHM_OUT_POOL_BUF_SIZE;
>     >> >> > +       params.buf_align = 0;
>     >> >> > +       params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
>     >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>     >> >> >
>     >> >> > -       out_pool = odp_buffer_pool_create("out_pool",
>     pool_base,
>     >> >> > -            SHM_OUT_POOL_SIZE,
>     >> >> > -            SHM_OUT_POOL_BUF_SIZE,
>     >> >> > -            ODP_CACHE_LINE_SIZE,
>     >> >> > -            ODP_BUFFER_TYPE_PACKET);
>     >> >> > +       out_pool = odp_buffer_pool_create("out_pool",
>     ODP_SHM_NULL,
>     >> >> > &params);
>     >> >> >
>     >> >> >         if (ODP_BUFFER_POOL_INVALID == out_pool) {
>     >> >> >  EXAMPLE_ERR("Error: message pool create failed.\n");
>     >> >> > @@ -1175,12 +1170,12 @@ main(int argc, char *argv[])
>     >> >> >  {
>     >> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>     >> >> >         int num_workers;
>     >> >> > -       void *pool_base;
>     >> >> >         int i;
>     >> >> >         int first_core;
>     >> >> >         int core_count;
>     >> >> >         int stream_count;
>     >> >> >         odp_shm_t shm;
>     >> >> > +       odp_buffer_pool_param_t params;
>     >> >> >
>     >> >> >         /* Init ODP before calling anything else */
>     >> >> >         if (odp_init_global(NULL, NULL)) {
>     >> >> > @@ -1240,42 +1235,28 @@ main(int argc, char *argv[])
>     >> >> >         printf("First core:      %i\n\n", first_core);
>     >> >> >
>     >> >> >         /* Create packet buffer pool */
>     >> >> > -       shm = odp_shm_reserve("shm_packet_pool",
>     >> >> > -  SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE,
>     >> >> > 0);
>     >> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
>     >> >> > +       params.buf_align = 0;
>     >> >> > +       params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
>     >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>     >> >> >
>     >> >> > -       pool_base = odp_shm_addr(shm);
>     >> >> > -
>     >> >> > -       if (NULL == pool_base) {
>     >> >> > -  EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
>     >> >> > -  exit(EXIT_FAILURE);
>     >> >> > -       }
>     >> >> > +       pkt_pool = odp_buffer_pool_create("packet_pool",
>     ODP_SHM_NULL,
>     >> >> > +            &params);
>     >> >> >
>     >> >> > -       pkt_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);
>     >> >> >         if (ODP_BUFFER_POOL_INVALID == pkt_pool) {
>     >> >> >  EXAMPLE_ERR("Error: packet pool create failed.\n");
>     >> >> >  exit(EXIT_FAILURE);
>     >> >> >         }
>     >> >> >
>     >> >> >         /* Create context buffer pool */
>     >> >> > -       shm = odp_shm_reserve("shm_ctx_pool",
>     >> >> > -  SHM_CTX_POOL_SIZE, ODP_CACHE_LINE_SIZE,
>     >> >> > 0);
>     >> >> > -
>     >> >> > -       pool_base = odp_shm_addr(shm);
>     >> >> > +       params.buf_size  = SHM_CTX_POOL_BUF_SIZE;
>     >> >> > +       params.buf_align = 0;
>     >> >> > +       params.num_bufs  = SHM_CTX_POOL_BUF_COUNT;
>     >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
>     >> >> >
>     >> >> > -       if (NULL == pool_base) {
>     >> >> > -  EXAMPLE_ERR("Error: context pool mem alloc failed.\n");
>     >> >> > -  exit(EXIT_FAILURE);
>     >> >> > -       }
>     >> >> > +       ctx_pool = odp_buffer_pool_create("ctx_pool",
>     ODP_SHM_NULL,
>     >> >> > +            &params);
>     >> >> >
>     >> >> > -       ctx_pool = odp_buffer_pool_create("ctx_pool",
>     pool_base,
>     >> >> > -            SHM_CTX_POOL_SIZE,
>     >> >> > -            SHM_CTX_POOL_BUF_SIZE,
>     >> >> > -            ODP_CACHE_LINE_SIZE,
>     >> >> > -            ODP_BUFFER_TYPE_RAW);
>     >> >> >         if (ODP_BUFFER_POOL_INVALID == ctx_pool) {
>     >> >> >  EXAMPLE_ERR("Error: context pool create failed.\n");
>     >> >> >  exit(EXIT_FAILURE);
>     >> >> > diff --git a/example/l2fwd/odp_l2fwd.c
>     b/example/l2fwd/odp_l2fwd.c
>     >> >> > index ebac8c5..3c1fd6a 100644
>     >> >> > --- a/example/l2fwd/odp_l2fwd.c
>     >> >> > +++ b/example/l2fwd/odp_l2fwd.c
>     >> >> > @@ -314,12 +314,12 @@ int main(int argc, char *argv[])
>     >> >> >  {
>     >> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>     >> >> >         odp_buffer_pool_t pool;
>     >> >> > -       void *pool_base;
>     >> >> >         int i;
>     >> >> >         int first_core;
>     >> >> >         int core_count;
>     >> >> >         odp_pktio_t pktio;
>     >> >> >         odp_shm_t shm;
>     >> >> > +       odp_buffer_pool_param_t params;
>     >> >> >
>     >> >> >         /* Init ODP before calling anything else */
>     >> >> >         if (odp_init_global(NULL, NULL)) {
>     >> >> > @@ -383,20 +383,13 @@ int main(int argc, char *argv[])
>     >> >> >         printf("First core:      %i\n\n", first_core);
>     >> >> >
>     >> >> >         /* 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);
>     >> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
>     >> >> > +       params.buf_align = 0;
>     >> >> > +       params.num_bufs  =
>     SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>     >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>     >> >> >
>     >> >> > -       if (pool_base == NULL) {
>     >> >> > -  EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
>     >> >> > -  exit(EXIT_FAILURE);
>     >> >> > -       }
>     >> >> > +       pool = odp_buffer_pool_create("packet pool",
>     ODP_SHM_NULL,
>     >> >> > &params);
>     >> >> >
>     >> >> > -       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);
>     >> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>     >> >> >  EXAMPLE_ERR("Error: packet pool create failed.\n");
>     >> >> >  exit(EXIT_FAILURE);
>     >> >> > diff --git a/example/odp_example/odp_example.c
>     >> >> > b/example/odp_example/odp_example.c
>     >> >> > index 9e7f090..bc67342 100644
>     >> >> > --- a/example/odp_example/odp_example.c
>     >> >> > +++ b/example/odp_example/odp_example.c
>     >> >> > @@ -954,13 +954,13 @@ int main(int argc, char *argv[])
>     >> >> >         test_args_t args;
>     >> >> >         int num_workers;
>     >> >> >         odp_buffer_pool_t pool;
>     >> >> > -       void *pool_base;
>     >> >> >         odp_queue_t queue;
>     >> >> >         int i, j;
>     >> >> >         int prios;
>     >> >> >         int first_core;
>     >> >> >         odp_shm_t shm;
>     >> >> >         test_globals_t *globals;
>     >> >> > +       odp_buffer_pool_param_t params;
>     >> >> >
>     >> >> >         printf("\nODP example starts\n\n");
>     >> >> >
>     >> >> > @@ -1042,19 +1042,13 @@ int main(int argc, char *argv[])
>     >> >> >         /*
>     >> >> >          * Create message pool
>     >> >> >          */
>     >> >> > -       shm = odp_shm_reserve("msg_pool",
>     >> >> > -  MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
>     >> >> >
>     >> >> > -       pool_base = odp_shm_addr(shm);
>     >> >> > +       params.buf_size  = sizeof(test_message_t);
>     >> >> > +       params.buf_align = 0;
>     >> >> > +       params.num_bufs  =
>     MSG_POOL_SIZE/sizeof(test_message_t);
>     >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
>     >> >> >
>     >> >> > -       if (pool_base == NULL) {
>     >> >> > -  EXAMPLE_ERR("Shared memory reserve failed.\n");
>     >> >> > -               return -1;
>     >> >> > -       }
>     >> >> > -
>     >> >> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
>     >> >> > MSG_POOL_SIZE,
>     >> >> > -        sizeof(test_message_t),
>     >> >> > -        ODP_CACHE_LINE_SIZE,
>     >> >> > ODP_BUFFER_TYPE_RAW);
>     >> >> > +       pool = odp_buffer_pool_create("msg_pool",
>     ODP_SHM_NULL,
>     >> >> > &params);
>     >> >> >
>     >> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>     >> >> >  EXAMPLE_ERR("Pool create failed.\n");
>     >> >> > diff --git a/example/packet/odp_pktio.c
>     b/example/packet/odp_pktio.c
>     >> >> > index 3e08b34..e0632cb 100644
>     >> >> > --- a/example/packet/odp_pktio.c
>     >> >> > +++ b/example/packet/odp_pktio.c
>     >> >> > @@ -296,11 +296,11 @@ int main(int argc, char *argv[])
>     >> >> >         odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>     >> >> >         odp_buffer_pool_t pool;
>     >> >> >         int num_workers;
>     >> >> > -       void *pool_base;
>     >> >> >         int i;
>     >> >> >         int first_core;
>     >> >> >         int core_count;
>     >> >> >         odp_shm_t shm;
>     >> >> > +       odp_buffer_pool_param_t params;
>     >> >> >
>     >> >> >         /* Init ODP before calling anything else */
>     >> >> >         if (odp_init_global(NULL, NULL)) {
>     >> >> > @@ -354,20 +354,13 @@ int main(int argc, char *argv[])
>     >> >> >         printf("First core:      %i\n\n", first_core);
>     >> >> >
>     >> >> >         /* 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);
>     >> >> > +       params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
>     >> >> > +       params.buf_align = 0;
>     >> >> > +       params.num_bufs  =
>     SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>     >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_PACKET;
>     >> >> >
>     >> >> > -       if (pool_base == NULL) {
>     >> >> > -  EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
>     >> >> > -  exit(EXIT_FAILURE);
>     >> >> > -       }
>     >> >> > +       pool = odp_buffer_pool_create("packet_pool",
>     ODP_SHM_NULL,
>     >> >> > &params);
>     >> >> >
>     >> >> > -       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);
>     >> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>     >> >> >  EXAMPLE_ERR("Error: packet pool create failed.\n");
>     >> >> >  exit(EXIT_FAILURE);
>     >> >> > diff --git a/example/timer/odp_timer_test.c
>     >> >> > b/example/timer/odp_timer_test.c
>     >> >> > index 9968bfe..0d6e31a 100644
>     >> >> > --- a/example/timer/odp_timer_test.c
>     >> >> > +++ b/example/timer/odp_timer_test.c
>     >> >> > @@ -244,12 +244,12 @@ int main(int argc, char *argv[])
>     >> >> >         test_args_t args;
>     >> >> >         int num_workers;
>     >> >> >         odp_buffer_pool_t pool;
>     >> >> > -       void *pool_base;
>     >> >> >         odp_queue_t queue;
>     >> >> >         int first_core;
>     >> >> >         uint64_t cycles, ns;
>     >> >> >         odp_queue_param_t param;
>     >> >> >         odp_shm_t shm;
>     >> >> > +       odp_buffer_pool_param_t params;
>     >> >> >
>     >> >> >         printf("\nODP timer example starts\n");
>     >> >> >
>     >> >> > @@ -313,12 +313,13 @@ int main(int argc, char *argv[])
>     >> >> >          */
>     >> >> >         shm = odp_shm_reserve("msg_pool",
>     >> >> >  MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
>     >> >> > -       pool_base = odp_shm_addr(shm);
>     >> >> >
>     >> >> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
>     >> >> > MSG_POOL_SIZE,
>     >> >> > -        0,
>     >> >> > -        ODP_CACHE_LINE_SIZE,
>     >> >> > -        ODP_BUFFER_TYPE_TIMEOUT);
>     >> >> > +       params.buf_size  = 0;
>     >> >> > +       params.buf_align = 0;
>     >> >> > +       params.num_bufs  = MSG_POOL_SIZE;
>     >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_TIMEOUT;
>     >> >> > +
>     >> >> > +       pool = odp_buffer_pool_create("msg_pool", shm,
>     &params);
>     >> >> >
>     >> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>     >> >> >  EXAMPLE_ERR("Pool create failed.\n");
>     >> >> > diff --git a/test/api_test/odp_timer_ping.c
>     >> >> > b/test/api_test/odp_timer_ping.c
>     >> >> > index 7704181..1566f4f 100644
>     >> >> > --- a/test/api_test/odp_timer_ping.c
>     >> >> > +++ b/test/api_test/odp_timer_ping.c
>     >> >> > @@ -319,9 +319,8 @@ int main(int argc ODP_UNUSED, char *argv[]
>     >> >> > ODP_UNUSED)
>     >> >> >         ping_arg_t pingarg;
>     >> >> >         odp_queue_t queue;
>     >> >> >         odp_buffer_pool_t pool;
>     >> >> > -       void *pool_base;
>     >> >> >         int i;
>     >> >> > -       odp_shm_t shm;
>     >> >> > +       odp_buffer_pool_param_t params;
>     >> >> >
>     >> >> >         if (odp_test_global_init() != 0)
>     >> >> >                 return -1;
>     >> >> > @@ -334,14 +333,14 @@ int main(int argc ODP_UNUSED, char
>     *argv[]
>     >> >> > ODP_UNUSED)
>     >> >> >         /*
>     >> >> >          * Create message pool
>     >> >> >          */
>     >> >> > -       shm = odp_shm_reserve("msg_pool",
>     >> >> > -  MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
>     >> >> > -       pool_base = odp_shm_addr(shm);
>     >> >> > -
>     >> >> > -       pool = odp_buffer_pool_create("msg_pool", pool_base,
>     >> >> > MSG_POOL_SIZE,
>     >> >> > -        BUF_SIZE,
>     >> >> > -        ODP_CACHE_LINE_SIZE,
>     >> >> > -        ODP_BUFFER_TYPE_RAW);
>     >> >> > +
>     >> >> > +       params.buf_size  = BUF_SIZE;
>     >> >> > +       params.buf_align = 0;
>     >> >> > +       params.num_bufs  = MSG_POOL_SIZE/BUF_SIZE;
>     >> >> > +       params.buf_type  = ODP_BUFFER_TYPE_RAW;
>     >> >> > +
>     >> >> > +       pool = odp_buffer_pool_create("msg_pool",
>     ODP_SHM_NULL,
>     >> >> > &params);
>     >> >> > +
>     >> >> >         if (pool == ODP_BUFFER_POOL_INVALID) {
>     >> >> >                 LOG_ERR("Pool create failed.\n");
>     >> >> >                 return -1;
>     >> >> > --
>     >> >> > 1.8.3.2
>     >> >> >
>     >> >> >
>     >> >> > _______________________________________________
>     >> >> > lng-odp mailing list
>     >> >> > lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     >> >> > http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Bill Fischofer Nov. 21, 2014, 12:48 p.m. UTC | #9
How do I do that?  I'm just doing

./bootstrap
./configure
make

Is there another step missing?

Bill

On Fri, Nov 21, 2014 at 5:58 AM, Taras Kondratiuk <
taras.kondratiuk@linaro.org> wrote:

> On 11/21/2014 01:27 AM, Bill Fischofer wrote:
>
>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
>> ---
>>   example/generator/odp_generator.c | 22 +++++----------
>>   example/ipsec/odp_ipsec.c         | 57 +++++++++++++-----------------
>> ---------
>>   example/l2fwd/odp_l2fwd.c         | 19 +++++--------
>>   example/odp_example/odp_example.c | 18 +++++--------
>>   example/packet/odp_pktio.c        | 19 +++++--------
>>   example/timer/odp_timer_test.c    | 13 ++++-----
>>   test/api_test/odp_timer_ping.c    | 19 +++++++------
>>   7 files changed, 60 insertions(+), 107 deletions(-)
>>
>
> Changes to test/validation/ are missing.
> Looks like you don't have CUnit enabled in your build configuration.
>
Taras Kondratiuk Nov. 21, 2014, 1:15 p.m. UTC | #10
On 11/21/2014 02:48 PM, Bill Fischofer wrote:
> How do I do that?  I'm just doing
>
> ./bootstrap
> ./configure
> make
>
> Is there another step missing?

./configure --with-platform=linux-generic --enable-cunit
Anders Roxell Nov. 21, 2014, 1:20 p.m. UTC | #11
On 21 November 2014 14:15, Taras Kondratiuk <taras.kondratiuk@linaro.org> wrote:
> On 11/21/2014 02:48 PM, Bill Fischofer wrote:
>>
>> How do I do that?  I'm just doing
>>
>> ./bootstrap
>> ./configure
>> make
>>
>> Is there another step missing?
>
>
> ./configure --with-platform=linux-generic --enable-cunit

and you have to install CUnit 2.1-3

Cheers,
Anders

>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Taras Kondratiuk Nov. 21, 2014, 1:42 p.m. UTC | #12
On 11/21/2014 02:15 PM, Maxim Uvarov wrote:
> On 11/21/2014 03:45 AM, Bill Fischofer wrote:
>> OK, I'm confused here.  The patches to effect API changes are large
>> because they need to change three things:
>>
>> 1. The .h files that define the API.
>> 2. The revised implementation of the API.
>> 3. The example/test programs that use the API.
>>
>> None of these can be separated and result in a buildable system.
>> However when I first submitted one of these changes I was told it was
>> too large and needed to be broken up, which is why they're now being
>> posted in parts for review convenience.
>
> That is very common situation. It's better to provide small patches for
> review. And I can merge them on applying.
> To give me a hint that several patches have to be merged together you
> can name them like this:
> "test/example changes for v1.0 buffer pool APIs - part1: API"
> "test/example changes for v1.0 buffer pool APIs - part2: Implementation"
> "test/example changes for v1.0 buffer pool APIs - part3: Tests"

I don't think it is a good idea.
How will you merge commit messages and Reviewed-by tags?

Patches should be reviewed in the same way they are going to be merged.
If smaller patch is needed than this patch can be split by functional 
changes, but not by directories it touches.

1. Update odp_buffer_pool_create() API everywhere.
2. Add odp_buffer_pool_destroy().
3. Add odp_buffer_pool_info().

The last two are small and may be squashed.
Mike Holmes Nov. 21, 2014, 9:29 p.m. UTC | #13
If you build and install cunit <http://sourceforge.net/projects/cunit/> and
take its defaults for the install (and not install to the system as root)
 the following works for me for linux-generic

./bootstrap
./configure  --with-cunit-path=/home/<YOUR HOME DIR>/CUnitHome
make check <- will run the unit tests not just build them

On 21 November 2014 08:20, Anders Roxell <anders.roxell@linaro.org> wrote:

> On 21 November 2014 14:15, Taras Kondratiuk <taras.kondratiuk@linaro.org>
> wrote:
> > On 11/21/2014 02:48 PM, Bill Fischofer wrote:
> >>
> >> How do I do that?  I'm just doing
> >>
> >> ./bootstrap
> >> ./configure
> >> make
> >>
> >> Is there another step missing?
> >
> >
> > ./configure --with-platform=linux-generic --enable-cunit
>
> and you have to install CUnit 2.1-3
>
> Cheers,
> Anders
>
> >
> >
> > _______________________________________________
> > 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
>
Bill Fischofer Nov. 22, 2014, 3:27 a.m. UTC | #14
OK, I've enabled CUnit and am now seeing this:

crypto/odp_crypto_test_async_inp.c:356:2: error: initialization discards
‘const’ qualifier from pointer target type [-Werror]
  {ASYNC_INP_ENC_ALG_3DES_CBC, enc_alg_3des_cbc },
  ^
crypto/odp_crypto_test_async_inp.c:357:2: error: initialization discards
‘const’ qualifier from pointer target type [-Werror]
  {ASYNC_INP_DEC_ALG_3DES_CBC, dec_alg_3des_cbc },
  ^
crypto/odp_crypto_test_async_inp.c:358:2: error: initialization discards
‘const’ qualifier from pointer target type [-Werror]
  {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, enc_alg_3des_cbc_ovr_iv },
  ^
crypto/odp_crypto_test_async_inp.c:359:2: error: initialization discards
‘const’ qualifier from pointer target type [-Werror]
  {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, dec_alg_3des_cbc_ovr_iv },
  ^
crypto/odp_crypto_test_async_inp.c:360:2: error: initialization discards
‘const’ qualifier from pointer target type [-Werror]
  {ASYNC_INP_ALG_HMAC_MD5, alg_hmac_md5 },
  ^
crypto/odp_crypto_test_async_inp.c:361:2: error: initialization discards
‘const’ qualifier from pointer target type [-Werror]
  {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW, enc_alg_3des_cbc_compl_new },
  ^
cc1: all warnings being treated as errors
make[2]: *** [crypto/odp_crypto-odp_crypto_test_async_inp.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

I get this error on a vanilla clone of odp.git.  Is this something in my
environment or did a file with a compilation issue somehow get merged?

Commands I've used to build my environment:

./bootstrap
./configure --with-platform=linux-generic --enable-cunit

Thanks.

Bill

On Fri, Nov 21, 2014 at 3:29 PM, Mike Holmes <mike.holmes@linaro.org> wrote:

> If you build and install cunit <http://sourceforge.net/projects/cunit/>
> and take its defaults for the install (and not install to the system as
> root)  the following works for me for linux-generic
>
> ./bootstrap
> ./configure  --with-cunit-path=/home/<YOUR HOME DIR>/CUnitHome
> make check <- will run the unit tests not just build them
>
> On 21 November 2014 08:20, Anders Roxell <anders.roxell@linaro.org> wrote:
>
>> On 21 November 2014 14:15, Taras Kondratiuk <taras.kondratiuk@linaro.org>
>> wrote:
>> > On 11/21/2014 02:48 PM, Bill Fischofer wrote:
>> >>
>> >> How do I do that?  I'm just doing
>> >>
>> >> ./bootstrap
>> >> ./configure
>> >> make
>> >>
>> >> Is there another step missing?
>> >
>> >
>> > ./configure --with-platform=linux-generic --enable-cunit
>>
>> and you have to install CUnit 2.1-3
>>
>> Cheers,
>> Anders
>>
>> >
>> >
>> > _______________________________________________
>> > 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
>
>
Mike Holmes Nov. 22, 2014, 11:56 a.m. UTC | #15
You need to use cunit 2.1-3

On 21 November 2014 22:27, Bill Fischofer <bill.fischofer@linaro.org> wrote:

> OK, I've enabled CUnit and am now seeing this:
>
> crypto/odp_crypto_test_async_inp.c:356:2: error: initialization discards
> ‘const’ qualifier from pointer target type [-Werror]
>   {ASYNC_INP_ENC_ALG_3DES_CBC, enc_alg_3des_cbc },
>   ^
> crypto/odp_crypto_test_async_inp.c:357:2: error: initialization discards
> ‘const’ qualifier from pointer target type [-Werror]
>   {ASYNC_INP_DEC_ALG_3DES_CBC, dec_alg_3des_cbc },
>   ^
> crypto/odp_crypto_test_async_inp.c:358:2: error: initialization discards
> ‘const’ qualifier from pointer target type [-Werror]
>   {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, enc_alg_3des_cbc_ovr_iv },
>   ^
> crypto/odp_crypto_test_async_inp.c:359:2: error: initialization discards
> ‘const’ qualifier from pointer target type [-Werror]
>   {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, dec_alg_3des_cbc_ovr_iv },
>   ^
> crypto/odp_crypto_test_async_inp.c:360:2: error: initialization discards
> ‘const’ qualifier from pointer target type [-Werror]
>   {ASYNC_INP_ALG_HMAC_MD5, alg_hmac_md5 },
>   ^
> crypto/odp_crypto_test_async_inp.c:361:2: error: initialization discards
> ‘const’ qualifier from pointer target type [-Werror]
>   {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW, enc_alg_3des_cbc_compl_new },
>   ^
> cc1: all warnings being treated as errors
> make[2]: *** [crypto/odp_crypto-odp_crypto_test_async_inp.o] Error 1
> make[1]: *** [all-recursive] Error 1
> make: *** [all-recursive] Error 1
>
> I get this error on a vanilla clone of odp.git.  Is this something in my
> environment or did a file with a compilation issue somehow get merged?
>
> Commands I've used to build my environment:
>
> ./bootstrap
> ./configure --with-platform=linux-generic --enable-cunit
>
> Thanks.
>
> Bill
>
> On Fri, Nov 21, 2014 at 3:29 PM, Mike Holmes <mike.holmes@linaro.org>
> wrote:
>
>> If you build and install cunit <http://sourceforge.net/projects/cunit/>
>> and take its defaults for the install (and not install to the system as
>> root)  the following works for me for linux-generic
>>
>> ./bootstrap
>> ./configure  --with-cunit-path=/home/<YOUR HOME DIR>/CUnitHome
>> make check <- will run the unit tests not just build them
>>
>> On 21 November 2014 08:20, Anders Roxell <anders.roxell@linaro.org>
>> wrote:
>>
>>> On 21 November 2014 14:15, Taras Kondratiuk <taras.kondratiuk@linaro.org>
>>> wrote:
>>> > On 11/21/2014 02:48 PM, Bill Fischofer wrote:
>>> >>
>>> >> How do I do that?  I'm just doing
>>> >>
>>> >> ./bootstrap
>>> >> ./configure
>>> >> make
>>> >>
>>> >> Is there another step missing?
>>> >
>>> >
>>> > ./configure --with-platform=linux-generic --enable-cunit
>>>
>>> and you have to install CUnit 2.1-3
>>>
>>> Cheers,
>>> Anders
>>>
>>> >
>>> >
>>> > _______________________________________________
>>> > 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
>>
>>
>
Bill Fischofer Nov. 22, 2014, 1:31 p.m. UTC | #16
How do I do that?  Following the recommendations in the DEPENDENCIES file:

sudo apt-get install libcunit1-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcunit1-dev is already the newest version.

Bill

On Sat, Nov 22, 2014 at 5:56 AM, Mike Holmes <mike.holmes@linaro.org> wrote:

> You need to use cunit 2.1-3
>
> On 21 November 2014 22:27, Bill Fischofer <bill.fischofer@linaro.org>
> wrote:
>
>> OK, I've enabled CUnit and am now seeing this:
>>
>> crypto/odp_crypto_test_async_inp.c:356:2: error: initialization discards
>> ‘const’ qualifier from pointer target type [-Werror]
>>   {ASYNC_INP_ENC_ALG_3DES_CBC, enc_alg_3des_cbc },
>>   ^
>> crypto/odp_crypto_test_async_inp.c:357:2: error: initialization discards
>> ‘const’ qualifier from pointer target type [-Werror]
>>   {ASYNC_INP_DEC_ALG_3DES_CBC, dec_alg_3des_cbc },
>>   ^
>> crypto/odp_crypto_test_async_inp.c:358:2: error: initialization discards
>> ‘const’ qualifier from pointer target type [-Werror]
>>   {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, enc_alg_3des_cbc_ovr_iv },
>>   ^
>> crypto/odp_crypto_test_async_inp.c:359:2: error: initialization discards
>> ‘const’ qualifier from pointer target type [-Werror]
>>   {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, dec_alg_3des_cbc_ovr_iv },
>>   ^
>> crypto/odp_crypto_test_async_inp.c:360:2: error: initialization discards
>> ‘const’ qualifier from pointer target type [-Werror]
>>   {ASYNC_INP_ALG_HMAC_MD5, alg_hmac_md5 },
>>   ^
>> crypto/odp_crypto_test_async_inp.c:361:2: error: initialization discards
>> ‘const’ qualifier from pointer target type [-Werror]
>>   {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW, enc_alg_3des_cbc_compl_new },
>>   ^
>> cc1: all warnings being treated as errors
>> make[2]: *** [crypto/odp_crypto-odp_crypto_test_async_inp.o] Error 1
>> make[1]: *** [all-recursive] Error 1
>> make: *** [all-recursive] Error 1
>>
>> I get this error on a vanilla clone of odp.git.  Is this something in my
>> environment or did a file with a compilation issue somehow get merged?
>>
>> Commands I've used to build my environment:
>>
>> ./bootstrap
>> ./configure --with-platform=linux-generic --enable-cunit
>>
>> Thanks.
>>
>> Bill
>>
>> On Fri, Nov 21, 2014 at 3:29 PM, Mike Holmes <mike.holmes@linaro.org>
>> wrote:
>>
>>> If you build and install cunit <http://sourceforge.net/projects/cunit/>
>>> and take its defaults for the install (and not install to the system as
>>> root)  the following works for me for linux-generic
>>>
>>> ./bootstrap
>>> ./configure  --with-cunit-path=/home/<YOUR HOME DIR>/CUnitHome
>>> make check <- will run the unit tests not just build them
>>>
>>> On 21 November 2014 08:20, Anders Roxell <anders.roxell@linaro.org>
>>> wrote:
>>>
>>>> On 21 November 2014 14:15, Taras Kondratiuk <
>>>> taras.kondratiuk@linaro.org> wrote:
>>>> > On 11/21/2014 02:48 PM, Bill Fischofer wrote:
>>>> >>
>>>> >> How do I do that?  I'm just doing
>>>> >>
>>>> >> ./bootstrap
>>>> >> ./configure
>>>> >> make
>>>> >>
>>>> >> Is there another step missing?
>>>> >
>>>> >
>>>> > ./configure --with-platform=linux-generic --enable-cunit
>>>>
>>>> and you have to install CUnit 2.1-3
>>>>
>>>> Cheers,
>>>> Anders
>>>>
>>>> >
>>>> >
>>>> > _______________________________________________
>>>> > 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
>>>
>>>
>>
>
>
> --
> *Mike Holmes*
> Linaro  Sr Technical Manager
> LNG - ODP
>
Anders Roxell Nov. 22, 2014, 1:51 p.m. UTC | #17
On 22 Nov 2014 14:31, "Bill Fischofer" <bill.fischofer@linaro.org> wrote:
>
> How do I do that?  Following the recommendations in the DEPENDENCIES file:
>
> sudo apt-get install libcunit1-dev
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> libcunit1-dev is already the newest version.

Download cunit from here
http://sourceforge.net/projects/cunit/files/latest/download?source=files

Build and install it.
In odp's configure step say --with-cunit...  To see exactly what you should
type do
./configure --help

>
> Bill
>
> On Sat, Nov 22, 2014 at 5:56 AM, Mike Holmes <mike.holmes@linaro.org>
wrote:
>>
>> You need to use cunit 2.1-3
>>
>> On 21 November 2014 22:27, Bill Fischofer <bill.fischofer@linaro.org>
wrote:
>>>
>>> OK, I've enabled CUnit and am now seeing this:
>>>
>>> crypto/odp_crypto_test_async_inp.c:356:2: error: initialization
discards ‘const’ qualifier from pointer target type [-Werror]
>>>   {ASYNC_INP_ENC_ALG_3DES_CBC, enc_alg_3des_cbc },
>>>   ^
>>> crypto/odp_crypto_test_async_inp.c:357:2: error: initialization
discards ‘const’ qualifier from pointer target type [-Werror]
>>>   {ASYNC_INP_DEC_ALG_3DES_CBC, dec_alg_3des_cbc },
>>>   ^
>>> crypto/odp_crypto_test_async_inp.c:358:2: error: initialization
discards ‘const’ qualifier from pointer target type [-Werror]
>>>   {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, enc_alg_3des_cbc_ovr_iv },
>>>   ^
>>> crypto/odp_crypto_test_async_inp.c:359:2: error: initialization
discards ‘const’ qualifier from pointer target type [-Werror]
>>>   {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, dec_alg_3des_cbc_ovr_iv },
>>>   ^
>>> crypto/odp_crypto_test_async_inp.c:360:2: error: initialization
discards ‘const’ qualifier from pointer target type [-Werror]
>>>   {ASYNC_INP_ALG_HMAC_MD5, alg_hmac_md5 },
>>>   ^
>>> crypto/odp_crypto_test_async_inp.c:361:2: error: initialization
discards ‘const’ qualifier from pointer target type [-Werror]
>>>   {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW, enc_alg_3des_cbc_compl_new },
>>>   ^
>>> cc1: all warnings being treated as errors
>>> make[2]: *** [crypto/odp_crypto-odp_crypto_test_async_inp.o] Error 1
>>> make[1]: *** [all-recursive] Error 1
>>> make: *** [all-recursive] Error 1
>>>
>>> I get this error on a vanilla clone of odp.git.  Is this something in
my environment or did a file with a compilation issue somehow get merged?
>>>
>>> Commands I've used to build my environment:
>>>
>>> ./bootstrap
>>> ./configure --with-platform=linux-generic --enable-cunit
>>>
>>> Thanks.
>>>
>>> Bill
>>>
>>> On Fri, Nov 21, 2014 at 3:29 PM, Mike Holmes <mike.holmes@linaro.org>
wrote:
>>>>
>>>> If you build and install cunit and take its defaults for the install
(and not install to the system as root)  the following works for me for
linux-generic
>>>>
>>>> ./bootstrap
>>>> ./configure  --with-cunit-path=/home/<YOUR HOME DIR>/CUnitHome
>>>> make check <- will run the unit tests not just build them
>>>>
>>>> On 21 November 2014 08:20, Anders Roxell <anders.roxell@linaro.org>
wrote:
>>>>>
>>>>> On 21 November 2014 14:15, Taras Kondratiuk <
taras.kondratiuk@linaro.org> wrote:
>>>>> > On 11/21/2014 02:48 PM, Bill Fischofer wrote:
>>>>> >>
>>>>> >> How do I do that?  I'm just doing
>>>>> >>
>>>>> >> ./bootstrap
>>>>> >> ./configure
>>>>> >> make
>>>>> >>
>>>>> >> Is there another step missing?
>>>>> >
>>>>> >
>>>>> > ./configure --with-platform=linux-generic --enable-cunit
>>>>>
>>>>> and you have to install CUnit 2.1-3
>>>>>
>>>>> Cheers,
>>>>> Anders
>>>>>
>>>>> >
>>>>> >
>>>>> > _______________________________________________
>>>>> > 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
>>>>
>>>
>>
>>
>>
>> --
>> Mike Holmes
>> Linaro  Sr Technical Manager
>> LNG - ODP
>
>
Anders Roxell Nov. 22, 2014, 1:55 p.m. UTC | #18
On 22 November 2014 at 14:51, Anders Roxell <anders.roxell@linaro.org> wrote:
>
> On 22 Nov 2014 14:31, "Bill Fischofer" <bill.fischofer@linaro.org> wrote:
>>
>> How do I do that?  Following the recommendations in the DEPENDENCIES file:
>>
>> sudo apt-get install libcunit1-dev
>> Reading package lists... Done
>> Building dependency tree
>> Reading state information... Done
>> libcunit1-dev is already the newest version.
>
> Download cunit from here
> http://sourceforge.net/projects/cunit/files/latest/download?source=files
>
> Build and install it.
> In odp's configure step say --with-cunit...  To see exactly what you should
> type do
> ./configure --help

or if you install cunit into a standard path then you can say
--enable-cunit when you run configure...


Cheers,
Anders

>
>>
>> Bill
>>
>> On Sat, Nov 22, 2014 at 5:56 AM, Mike Holmes <mike.holmes@linaro.org>
>> wrote:
>>>
>>> You need to use cunit 2.1-3
>>>
>>> On 21 November 2014 22:27, Bill Fischofer <bill.fischofer@linaro.org>
>>> wrote:
>>>>
>>>> OK, I've enabled CUnit and am now seeing this:
>>>>
>>>> crypto/odp_crypto_test_async_inp.c:356:2: error: initialization discards
>>>> ‘const’ qualifier from pointer target type [-Werror]
>>>>   {ASYNC_INP_ENC_ALG_3DES_CBC, enc_alg_3des_cbc },
>>>>   ^
>>>> crypto/odp_crypto_test_async_inp.c:357:2: error: initialization discards
>>>> ‘const’ qualifier from pointer target type [-Werror]
>>>>   {ASYNC_INP_DEC_ALG_3DES_CBC, dec_alg_3des_cbc },
>>>>   ^
>>>> crypto/odp_crypto_test_async_inp.c:358:2: error: initialization discards
>>>> ‘const’ qualifier from pointer target type [-Werror]
>>>>   {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, enc_alg_3des_cbc_ovr_iv },
>>>>   ^
>>>> crypto/odp_crypto_test_async_inp.c:359:2: error: initialization discards
>>>> ‘const’ qualifier from pointer target type [-Werror]
>>>>   {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, dec_alg_3des_cbc_ovr_iv },
>>>>   ^
>>>> crypto/odp_crypto_test_async_inp.c:360:2: error: initialization discards
>>>> ‘const’ qualifier from pointer target type [-Werror]
>>>>   {ASYNC_INP_ALG_HMAC_MD5, alg_hmac_md5 },
>>>>   ^
>>>> crypto/odp_crypto_test_async_inp.c:361:2: error: initialization discards
>>>> ‘const’ qualifier from pointer target type [-Werror]
>>>>   {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW, enc_alg_3des_cbc_compl_new },
>>>>   ^
>>>> cc1: all warnings being treated as errors
>>>> make[2]: *** [crypto/odp_crypto-odp_crypto_test_async_inp.o] Error 1
>>>> make[1]: *** [all-recursive] Error 1
>>>> make: *** [all-recursive] Error 1
>>>>
>>>> I get this error on a vanilla clone of odp.git.  Is this something in my
>>>> environment or did a file with a compilation issue somehow get merged?
>>>>
>>>> Commands I've used to build my environment:
>>>>
>>>> ./bootstrap
>>>> ./configure --with-platform=linux-generic --enable-cunit
>>>>
>>>> Thanks.
>>>>
>>>> Bill
>>>>
>>>> On Fri, Nov 21, 2014 at 3:29 PM, Mike Holmes <mike.holmes@linaro.org>
>>>> wrote:
>>>>>
>>>>> If you build and install cunit and take its defaults for the install
>>>>> (and not install to the system as root)  the following works for me for
>>>>> linux-generic
>>>>>
>>>>> ./bootstrap
>>>>> ./configure  --with-cunit-path=/home/<YOUR HOME DIR>/CUnitHome
>>>>> make check <- will run the unit tests not just build them
>>>>>
>>>>> On 21 November 2014 08:20, Anders Roxell <anders.roxell@linaro.org>
>>>>> wrote:
>>>>>>
>>>>>> On 21 November 2014 14:15, Taras Kondratiuk
>>>>>> <taras.kondratiuk@linaro.org> wrote:
>>>>>> > On 11/21/2014 02:48 PM, Bill Fischofer wrote:
>>>>>> >>
>>>>>> >> How do I do that?  I'm just doing
>>>>>> >>
>>>>>> >> ./bootstrap
>>>>>> >> ./configure
>>>>>> >> make
>>>>>> >>
>>>>>> >> Is there another step missing?
>>>>>> >
>>>>>> >
>>>>>> > ./configure --with-platform=linux-generic --enable-cunit
>>>>>>
>>>>>> and you have to install CUnit 2.1-3
>>>>>>
>>>>>> Cheers,
>>>>>> Anders
>>>>>>
>>>>>> >
>>>>>> >
>>>>>> > _______________________________________________
>>>>>> > 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
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Mike Holmes
>>> Linaro  Sr Technical Manager
>>> LNG - ODP
>>
>>
Bill Fischofer Nov. 22, 2014, 8:33 p.m. UTC | #19
OK, that seems to work now.  Thanks.

Bill

On Sat, Nov 22, 2014 at 7:55 AM, Anders Roxell <anders.roxell@linaro.org>
wrote:

> On 22 November 2014 at 14:51, Anders Roxell <anders.roxell@linaro.org>
> wrote:
> >
> > On 22 Nov 2014 14:31, "Bill Fischofer" <bill.fischofer@linaro.org>
> wrote:
> >>
> >> How do I do that?  Following the recommendations in the DEPENDENCIES
> file:
> >>
> >> sudo apt-get install libcunit1-dev
> >> Reading package lists... Done
> >> Building dependency tree
> >> Reading state information... Done
> >> libcunit1-dev is already the newest version.
> >
> > Download cunit from here
> > http://sourceforge.net/projects/cunit/files/latest/download?source=files
> >
> > Build and install it.
> > In odp's configure step say --with-cunit...  To see exactly what you
> should
> > type do
> > ./configure --help
>
> or if you install cunit into a standard path then you can say
> --enable-cunit when you run configure...
>
>
> Cheers,
> Anders
>
> >
> >>
> >> Bill
> >>
> >> On Sat, Nov 22, 2014 at 5:56 AM, Mike Holmes <mike.holmes@linaro.org>
> >> wrote:
> >>>
> >>> You need to use cunit 2.1-3
> >>>
> >>> On 21 November 2014 22:27, Bill Fischofer <bill.fischofer@linaro.org>
> >>> wrote:
> >>>>
> >>>> OK, I've enabled CUnit and am now seeing this:
> >>>>
> >>>> crypto/odp_crypto_test_async_inp.c:356:2: error: initialization
> discards
> >>>> ‘const’ qualifier from pointer target type [-Werror]
> >>>>   {ASYNC_INP_ENC_ALG_3DES_CBC, enc_alg_3des_cbc },
> >>>>   ^
> >>>> crypto/odp_crypto_test_async_inp.c:357:2: error: initialization
> discards
> >>>> ‘const’ qualifier from pointer target type [-Werror]
> >>>>   {ASYNC_INP_DEC_ALG_3DES_CBC, dec_alg_3des_cbc },
> >>>>   ^
> >>>> crypto/odp_crypto_test_async_inp.c:358:2: error: initialization
> discards
> >>>> ‘const’ qualifier from pointer target type [-Werror]
> >>>>   {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, enc_alg_3des_cbc_ovr_iv },
> >>>>   ^
> >>>> crypto/odp_crypto_test_async_inp.c:359:2: error: initialization
> discards
> >>>> ‘const’ qualifier from pointer target type [-Werror]
> >>>>   {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, dec_alg_3des_cbc_ovr_iv },
> >>>>   ^
> >>>> crypto/odp_crypto_test_async_inp.c:360:2: error: initialization
> discards
> >>>> ‘const’ qualifier from pointer target type [-Werror]
> >>>>   {ASYNC_INP_ALG_HMAC_MD5, alg_hmac_md5 },
> >>>>   ^
> >>>> crypto/odp_crypto_test_async_inp.c:361:2: error: initialization
> discards
> >>>> ‘const’ qualifier from pointer target type [-Werror]
> >>>>   {ASYNC_INP_ENC_ALG_3DES_CBC_COMPL_NEW, enc_alg_3des_cbc_compl_new },
> >>>>   ^
> >>>> cc1: all warnings being treated as errors
> >>>> make[2]: *** [crypto/odp_crypto-odp_crypto_test_async_inp.o] Error 1
> >>>> make[1]: *** [all-recursive] Error 1
> >>>> make: *** [all-recursive] Error 1
> >>>>
> >>>> I get this error on a vanilla clone of odp.git.  Is this something in
> my
> >>>> environment or did a file with a compilation issue somehow get merged?
> >>>>
> >>>> Commands I've used to build my environment:
> >>>>
> >>>> ./bootstrap
> >>>> ./configure --with-platform=linux-generic --enable-cunit
> >>>>
> >>>> Thanks.
> >>>>
> >>>> Bill
> >>>>
> >>>> On Fri, Nov 21, 2014 at 3:29 PM, Mike Holmes <mike.holmes@linaro.org>
> >>>> wrote:
> >>>>>
> >>>>> If you build and install cunit and take its defaults for the install
> >>>>> (and not install to the system as root)  the following works for me
> for
> >>>>> linux-generic
> >>>>>
> >>>>> ./bootstrap
> >>>>> ./configure  --with-cunit-path=/home/<YOUR HOME DIR>/CUnitHome
> >>>>> make check <- will run the unit tests not just build them
> >>>>>
> >>>>> On 21 November 2014 08:20, Anders Roxell <anders.roxell@linaro.org>
> >>>>> wrote:
> >>>>>>
> >>>>>> On 21 November 2014 14:15, Taras Kondratiuk
> >>>>>> <taras.kondratiuk@linaro.org> wrote:
> >>>>>> > On 11/21/2014 02:48 PM, Bill Fischofer wrote:
> >>>>>> >>
> >>>>>> >> How do I do that?  I'm just doing
> >>>>>> >>
> >>>>>> >> ./bootstrap
> >>>>>> >> ./configure
> >>>>>> >> make
> >>>>>> >>
> >>>>>> >> Is there another step missing?
> >>>>>> >
> >>>>>> >
> >>>>>> > ./configure --with-platform=linux-generic --enable-cunit
> >>>>>>
> >>>>>> and you have to install CUnit 2.1-3
> >>>>>>
> >>>>>> Cheers,
> >>>>>> Anders
> >>>>>>
> >>>>>> >
> >>>>>> >
> >>>>>> > _______________________________________________
> >>>>>> > 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
> >>>>>
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> Mike Holmes
> >>> Linaro  Sr Technical Manager
> >>> LNG - ODP
> >>
> >>
>
diff mbox

Patch

diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
index e2e0ba4..50e6c04 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -57,8 +57,7 @@  typedef struct {
 	int number;		/**< packets number to be sent */
 	int payload;		/**< data len */
 	int timeout;		/**< wait time */
-	int interval;		/**< wait interval ms between sending
-				     each packet */
+	int interval;		/**< wait interval ms between sending each packet */
 } appl_args_t;
 
 /**
@@ -516,11 +515,11 @@  int main(int argc, char *argv[])
 	odph_linux_pthread_t thread_tbl[MAX_WORKERS];
 	odp_buffer_pool_t pool;
 	int num_workers;
-	void *pool_base;
 	int i;
 	int first_core;
 	int core_count;
 	odp_shm_t shm;
+	odp_buffer_pool_param_t params;
 
 	/* Init ODP before calling anything else */
 	if (odp_init_global(NULL, NULL)) {
@@ -583,20 +582,13 @@  int main(int argc, char *argv[])
 	printf("First core:         %i\n\n", first_core);
 
 	/* 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);
+	params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
+	params.buf_align = 0;
+	params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
+	params.buf_type  = ODP_BUFFER_TYPE_PACKET;
 
-	if (pool_base == NULL) {
-		EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
-		exit(EXIT_FAILURE);
-	}
+	pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL, &params);
 
-	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);
 	if (pool == ODP_BUFFER_POOL_INVALID) {
 		EXAMPLE_ERR("Error: packet pool create failed.\n");
 		exit(EXIT_FAILURE);
diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
index ec115fc..b5d518c 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -367,8 +367,7 @@  static
 void ipsec_init_pre(void)
 {
 	odp_queue_param_t qparam;
-	void *pool_base;
-	odp_shm_t shm;
+	odp_buffer_pool_param_t params;
 
 	/*
 	 * Create queues
@@ -401,16 +400,12 @@  void ipsec_init_pre(void)
 	}
 
 	/* Create output buffer pool */
-	shm = odp_shm_reserve("shm_out_pool",
-			      SHM_OUT_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
-
-	pool_base = odp_shm_addr(shm);
+	params.buf_size  = SHM_OUT_POOL_BUF_SIZE;
+	params.buf_align = 0;
+	params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
+	params.buf_type  = ODP_BUFFER_TYPE_PACKET;
 
-	out_pool = odp_buffer_pool_create("out_pool", pool_base,
-					  SHM_OUT_POOL_SIZE,
-					  SHM_OUT_POOL_BUF_SIZE,
-					  ODP_CACHE_LINE_SIZE,
-					  ODP_BUFFER_TYPE_PACKET);
+	out_pool = odp_buffer_pool_create("out_pool", ODP_SHM_NULL, &params);
 
 	if (ODP_BUFFER_POOL_INVALID == out_pool) {
 		EXAMPLE_ERR("Error: message pool create failed.\n");
@@ -1175,12 +1170,12 @@  main(int argc, char *argv[])
 {
 	odph_linux_pthread_t thread_tbl[MAX_WORKERS];
 	int num_workers;
-	void *pool_base;
 	int i;
 	int first_core;
 	int core_count;
 	int stream_count;
 	odp_shm_t shm;
+	odp_buffer_pool_param_t params;
 
 	/* Init ODP before calling anything else */
 	if (odp_init_global(NULL, NULL)) {
@@ -1240,42 +1235,28 @@  main(int argc, char *argv[])
 	printf("First core:         %i\n\n", first_core);
 
 	/* Create packet buffer pool */
-	shm = odp_shm_reserve("shm_packet_pool",
-			      SHM_PKT_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
+	params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
+	params.buf_align = 0;
+	params.num_bufs  = SHM_PKT_POOL_BUF_COUNT;
+	params.buf_type  = ODP_BUFFER_TYPE_PACKET;
 
-	pool_base = odp_shm_addr(shm);
-
-	if (NULL == pool_base) {
-		EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
-		exit(EXIT_FAILURE);
-	}
+	pkt_pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL,
+					  &params);
 
-	pkt_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);
 	if (ODP_BUFFER_POOL_INVALID == pkt_pool) {
 		EXAMPLE_ERR("Error: packet pool create failed.\n");
 		exit(EXIT_FAILURE);
 	}
 
 	/* Create context buffer pool */
-	shm = odp_shm_reserve("shm_ctx_pool",
-			      SHM_CTX_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
-
-	pool_base = odp_shm_addr(shm);
+	params.buf_size  = SHM_CTX_POOL_BUF_SIZE;
+	params.buf_align = 0;
+	params.num_bufs  = SHM_CTX_POOL_BUF_COUNT;
+	params.buf_type  = ODP_BUFFER_TYPE_RAW;
 
-	if (NULL == pool_base) {
-		EXAMPLE_ERR("Error: context pool mem alloc failed.\n");
-		exit(EXIT_FAILURE);
-	}
+	ctx_pool = odp_buffer_pool_create("ctx_pool", ODP_SHM_NULL,
+					  &params);
 
-	ctx_pool = odp_buffer_pool_create("ctx_pool", pool_base,
-					  SHM_CTX_POOL_SIZE,
-					  SHM_CTX_POOL_BUF_SIZE,
-					  ODP_CACHE_LINE_SIZE,
-					  ODP_BUFFER_TYPE_RAW);
 	if (ODP_BUFFER_POOL_INVALID == ctx_pool) {
 		EXAMPLE_ERR("Error: context pool create failed.\n");
 		exit(EXIT_FAILURE);
diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c
index ebac8c5..3c1fd6a 100644
--- a/example/l2fwd/odp_l2fwd.c
+++ b/example/l2fwd/odp_l2fwd.c
@@ -314,12 +314,12 @@  int main(int argc, char *argv[])
 {
 	odph_linux_pthread_t thread_tbl[MAX_WORKERS];
 	odp_buffer_pool_t pool;
-	void *pool_base;
 	int i;
 	int first_core;
 	int core_count;
 	odp_pktio_t pktio;
 	odp_shm_t shm;
+	odp_buffer_pool_param_t params;
 
 	/* Init ODP before calling anything else */
 	if (odp_init_global(NULL, NULL)) {
@@ -383,20 +383,13 @@  int main(int argc, char *argv[])
 	printf("First core:         %i\n\n", first_core);
 
 	/* 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);
+	params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
+	params.buf_align = 0;
+	params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
+	params.buf_type  = ODP_BUFFER_TYPE_PACKET;
 
-	if (pool_base == NULL) {
-		EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
-		exit(EXIT_FAILURE);
-	}
+	pool = odp_buffer_pool_create("packet pool", ODP_SHM_NULL, &params);
 
-	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);
 	if (pool == ODP_BUFFER_POOL_INVALID) {
 		EXAMPLE_ERR("Error: packet pool create failed.\n");
 		exit(EXIT_FAILURE);
diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c
index 9e7f090..bc67342 100644
--- a/example/odp_example/odp_example.c
+++ b/example/odp_example/odp_example.c
@@ -954,13 +954,13 @@  int main(int argc, char *argv[])
 	test_args_t args;
 	int num_workers;
 	odp_buffer_pool_t pool;
-	void *pool_base;
 	odp_queue_t queue;
 	int i, j;
 	int prios;
 	int first_core;
 	odp_shm_t shm;
 	test_globals_t *globals;
+	odp_buffer_pool_param_t params;
 
 	printf("\nODP example starts\n\n");
 
@@ -1042,19 +1042,13 @@  int main(int argc, char *argv[])
 	/*
 	 * Create message pool
 	 */
-	shm = odp_shm_reserve("msg_pool",
-			      MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
 
-	pool_base = odp_shm_addr(shm);
+	params.buf_size  = sizeof(test_message_t);
+	params.buf_align = 0;
+	params.num_bufs  = MSG_POOL_SIZE/sizeof(test_message_t);
+	params.buf_type  = ODP_BUFFER_TYPE_RAW;
 
-	if (pool_base == NULL) {
-		EXAMPLE_ERR("Shared memory reserve failed.\n");
-		return -1;
-	}
-
-	pool = odp_buffer_pool_create("msg_pool", pool_base, MSG_POOL_SIZE,
-				      sizeof(test_message_t),
-				      ODP_CACHE_LINE_SIZE, ODP_BUFFER_TYPE_RAW);
+	pool = odp_buffer_pool_create("msg_pool", ODP_SHM_NULL, &params);
 
 	if (pool == ODP_BUFFER_POOL_INVALID) {
 		EXAMPLE_ERR("Pool create failed.\n");
diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
index 3e08b34..e0632cb 100644
--- a/example/packet/odp_pktio.c
+++ b/example/packet/odp_pktio.c
@@ -296,11 +296,11 @@  int main(int argc, char *argv[])
 	odph_linux_pthread_t thread_tbl[MAX_WORKERS];
 	odp_buffer_pool_t pool;
 	int num_workers;
-	void *pool_base;
 	int i;
 	int first_core;
 	int core_count;
 	odp_shm_t shm;
+	odp_buffer_pool_param_t params;
 
 	/* Init ODP before calling anything else */
 	if (odp_init_global(NULL, NULL)) {
@@ -354,20 +354,13 @@  int main(int argc, char *argv[])
 	printf("First core:         %i\n\n", first_core);
 
 	/* 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);
+	params.buf_size  = SHM_PKT_POOL_BUF_SIZE;
+	params.buf_align = 0;
+	params.num_bufs  = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
+	params.buf_type  = ODP_BUFFER_TYPE_PACKET;
 
-	if (pool_base == NULL) {
-		EXAMPLE_ERR("Error: packet pool mem alloc failed.\n");
-		exit(EXIT_FAILURE);
-	}
+	pool = odp_buffer_pool_create("packet_pool", ODP_SHM_NULL, &params);
 
-	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);
 	if (pool == ODP_BUFFER_POOL_INVALID) {
 		EXAMPLE_ERR("Error: packet pool create failed.\n");
 		exit(EXIT_FAILURE);
diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index 9968bfe..0d6e31a 100644
--- a/example/timer/odp_timer_test.c
+++ b/example/timer/odp_timer_test.c
@@ -244,12 +244,12 @@  int main(int argc, char *argv[])
 	test_args_t args;
 	int num_workers;
 	odp_buffer_pool_t pool;
-	void *pool_base;
 	odp_queue_t queue;
 	int first_core;
 	uint64_t cycles, ns;
 	odp_queue_param_t param;
 	odp_shm_t shm;
+	odp_buffer_pool_param_t params;
 
 	printf("\nODP timer example starts\n");
 
@@ -313,12 +313,13 @@  int main(int argc, char *argv[])
 	 */
 	shm = odp_shm_reserve("msg_pool",
 			      MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
-	pool_base = odp_shm_addr(shm);
 
-	pool = odp_buffer_pool_create("msg_pool", pool_base, MSG_POOL_SIZE,
-				      0,
-				      ODP_CACHE_LINE_SIZE,
-				      ODP_BUFFER_TYPE_TIMEOUT);
+	params.buf_size  = 0;
+	params.buf_align = 0;
+	params.num_bufs  = MSG_POOL_SIZE;
+	params.buf_type  = ODP_BUFFER_TYPE_TIMEOUT;
+
+	pool = odp_buffer_pool_create("msg_pool", shm, &params);
 
 	if (pool == ODP_BUFFER_POOL_INVALID) {
 		EXAMPLE_ERR("Pool create failed.\n");
diff --git a/test/api_test/odp_timer_ping.c b/test/api_test/odp_timer_ping.c
index 7704181..1566f4f 100644
--- a/test/api_test/odp_timer_ping.c
+++ b/test/api_test/odp_timer_ping.c
@@ -319,9 +319,8 @@  int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED)
 	ping_arg_t pingarg;
 	odp_queue_t queue;
 	odp_buffer_pool_t pool;
-	void *pool_base;
 	int i;
-	odp_shm_t shm;
+	odp_buffer_pool_param_t params;
 
 	if (odp_test_global_init() != 0)
 		return -1;
@@ -334,14 +333,14 @@  int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED)
 	/*
 	 * Create message pool
 	 */
-	shm = odp_shm_reserve("msg_pool",
-			      MSG_POOL_SIZE, ODP_CACHE_LINE_SIZE, 0);
-	pool_base = odp_shm_addr(shm);
-
-	pool = odp_buffer_pool_create("msg_pool", pool_base, MSG_POOL_SIZE,
-				      BUF_SIZE,
-				      ODP_CACHE_LINE_SIZE,
-				      ODP_BUFFER_TYPE_RAW);
+
+	params.buf_size  = BUF_SIZE;
+	params.buf_align = 0;
+	params.num_bufs  = MSG_POOL_SIZE/BUF_SIZE;
+	params.buf_type  = ODP_BUFFER_TYPE_RAW;
+
+	pool = odp_buffer_pool_create("msg_pool", ODP_SHM_NULL, &params);
+
 	if (pool == ODP_BUFFER_POOL_INVALID) {
 		LOG_ERR("Pool create failed.\n");
 		return -1;