diff mbox

[API-NEXT,PATCHv2,09/10] example: use odp_pool_param_init routine

Message ID 1435714761-23951-9-git-send-email-bill.fischofer@linaro.org
State Superseded
Headers show

Commit Message

Bill Fischofer July 1, 2015, 1:39 a.m. UTC
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 example/classifier/odp_classifier.c | 2 +-
 example/generator/odp_generator.c   | 2 +-
 example/ipsec/odp_ipsec.c           | 4 ++--
 example/packet/odp_pktio.c          | 2 +-
 example/timer/odp_timer_test.c      | 1 +
 5 files changed, 6 insertions(+), 5 deletions(-)

Comments

Maxim Uvarov July 1, 2015, 2:57 p.m. UTC | #1
After reading this patch it looks like buffer size is good parameter to 
init function. Also if we anyway need to set up
seg_len, len and num, why not to pass that values to init?

Maxim.

On 07/01/15 04:39, Bill Fischofer wrote:
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
>   example/classifier/odp_classifier.c | 2 +-
>   example/generator/odp_generator.c   | 2 +-
>   example/ipsec/odp_ipsec.c           | 4 ++--
>   example/packet/odp_pktio.c          | 2 +-
>   example/timer/odp_timer_test.c      | 1 +
>   5 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c
> index ef95f95..e9b3700 100644
> --- a/example/classifier/odp_classifier.c
> +++ b/example/classifier/odp_classifier.c
> @@ -430,7 +430,7 @@ int main(int argc, char *argv[])
>   	printf("cpu mask:           %s\n", cpumaskstr);
>   
>   	/* Create packet pool */
> -	memset(&params, 0, sizeof(params));
> +	odp_pool_param_init(&params);
>   	params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>   	params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>   	params.pkt.num     = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
> diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
> index 484e6bc..47416b2 100644
> --- a/example/generator/odp_generator.c
> +++ b/example/generator/odp_generator.c
> @@ -649,7 +649,7 @@ int main(int argc, char *argv[])
>   	printf("cpu mask:           %s\n", cpumaskstr);
>   
>   	/* Create packet pool */
> -	memset(&params, 0, sizeof(params));
> +	odp_pool_param_init(&params);
>   	params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>   	params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>   	params.pkt.num     = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
> diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
> index da88b17..0924a6e 100644
> --- a/example/ipsec/odp_ipsec.c
> +++ b/example/ipsec/odp_ipsec.c
> @@ -348,7 +348,7 @@ void ipsec_init_pre(void)
>   	}
>   
>   	/* Create output buffer pool */
> -	memset(&params, 0, sizeof(params));
> +	odp_pool_param_init(&params);
>   	params.pkt.seg_len = SHM_OUT_POOL_BUF_SIZE;
>   	params.pkt.len     = SHM_OUT_POOL_BUF_SIZE;
>   	params.pkt.num     = SHM_PKT_POOL_BUF_COUNT;
> @@ -1294,7 +1294,7 @@ main(int argc, char *argv[])
>   	odp_barrier_init(&sync_barrier, num_workers);
>   
>   	/* Create packet buffer pool */
> -	memset(&params, 0, sizeof(params));
> +	odp_pool_param_init(&params);
>   	params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>   	params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>   	params.pkt.num     = SHM_PKT_POOL_BUF_COUNT;
> diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
> index 7430b09..c485530 100644
> --- a/example/packet/odp_pktio.c
> +++ b/example/packet/odp_pktio.c
> @@ -376,7 +376,7 @@ int main(int argc, char *argv[])
>   	printf("cpu mask:           %s\n", cpumaskstr);
>   
>   	/* Create packet pool */
> -	memset(&params, 0, sizeof(params));
> +	odp_pool_param_init(&params);
>   	params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>   	params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>   	params.pkt.num     = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
> diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
> index da7b208..ff1a8ce 100644
> --- a/example/timer/odp_timer_test.c
> +++ b/example/timer/odp_timer_test.c
> @@ -412,6 +412,7 @@ int main(int argc, char *argv[])
>   	/*
>   	 * Create pool for timeouts
>   	 */
> +	odp_pool_param_init(&params);
>   	params.tmo.num   = NUM_TMOS;
>   	params.type      = ODP_POOL_TIMEOUT;
>
Bill Fischofer July 1, 2015, 3:41 p.m. UTC | #2
The intent behind the odp_structname_init() routines (following the POSIX
model) is simply to initialize struct values to default values to handle
things like reserved fields that the application might not know about.
Extending that to provide fill in for the various subfields is really
beyond the scope of this abstraction.  I'm not sure if there's real value
in trying to do that since the application is free to set fields however it
wishes and the compiler will optimize these assignments.

On Wed, Jul 1, 2015 at 9:57 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
wrote:

> After reading this patch it looks like buffer size is good parameter to
> init function. Also if we anyway need to set up
> seg_len, len and num, why not to pass that values to init?
>
> Maxim.
>
>
> On 07/01/15 04:39, Bill Fischofer wrote:
>
>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
>> ---
>>   example/classifier/odp_classifier.c | 2 +-
>>   example/generator/odp_generator.c   | 2 +-
>>   example/ipsec/odp_ipsec.c           | 4 ++--
>>   example/packet/odp_pktio.c          | 2 +-
>>   example/timer/odp_timer_test.c      | 1 +
>>   5 files changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/example/classifier/odp_classifier.c
>> b/example/classifier/odp_classifier.c
>> index ef95f95..e9b3700 100644
>> --- a/example/classifier/odp_classifier.c
>> +++ b/example/classifier/odp_classifier.c
>> @@ -430,7 +430,7 @@ int main(int argc, char *argv[])
>>         printf("cpu mask:           %s\n", cpumaskstr);
>>         /* Create packet pool */
>> -       memset(&params, 0, sizeof(params));
>> +       odp_pool_param_init(&params);
>>         params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>>         params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>>         params.pkt.num     = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>> diff --git a/example/generator/odp_generator.c
>> b/example/generator/odp_generator.c
>> index 484e6bc..47416b2 100644
>> --- a/example/generator/odp_generator.c
>> +++ b/example/generator/odp_generator.c
>> @@ -649,7 +649,7 @@ int main(int argc, char *argv[])
>>         printf("cpu mask:           %s\n", cpumaskstr);
>>         /* Create packet pool */
>> -       memset(&params, 0, sizeof(params));
>> +       odp_pool_param_init(&params);
>>         params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>>         params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>>         params.pkt.num     = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>> diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
>> index da88b17..0924a6e 100644
>> --- a/example/ipsec/odp_ipsec.c
>> +++ b/example/ipsec/odp_ipsec.c
>> @@ -348,7 +348,7 @@ void ipsec_init_pre(void)
>>         }
>>         /* Create output buffer pool */
>> -       memset(&params, 0, sizeof(params));
>> +       odp_pool_param_init(&params);
>>         params.pkt.seg_len = SHM_OUT_POOL_BUF_SIZE;
>>         params.pkt.len     = SHM_OUT_POOL_BUF_SIZE;
>>         params.pkt.num     = SHM_PKT_POOL_BUF_COUNT;
>> @@ -1294,7 +1294,7 @@ main(int argc, char *argv[])
>>         odp_barrier_init(&sync_barrier, num_workers);
>>         /* Create packet buffer pool */
>> -       memset(&params, 0, sizeof(params));
>> +       odp_pool_param_init(&params);
>>         params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>>         params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>>         params.pkt.num     = SHM_PKT_POOL_BUF_COUNT;
>> diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
>> index 7430b09..c485530 100644
>> --- a/example/packet/odp_pktio.c
>> +++ b/example/packet/odp_pktio.c
>> @@ -376,7 +376,7 @@ int main(int argc, char *argv[])
>>         printf("cpu mask:           %s\n", cpumaskstr);
>>         /* Create packet pool */
>> -       memset(&params, 0, sizeof(params));
>> +       odp_pool_param_init(&params);
>>         params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>>         params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>>         params.pkt.num     = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>> diff --git a/example/timer/odp_timer_test.c
>> b/example/timer/odp_timer_test.c
>> index da7b208..ff1a8ce 100644
>> --- a/example/timer/odp_timer_test.c
>> +++ b/example/timer/odp_timer_test.c
>> @@ -412,6 +412,7 @@ int main(int argc, char *argv[])
>>         /*
>>          * Create pool for timeouts
>>          */
>> +       odp_pool_param_init(&params);
>>         params.tmo.num   = NUM_TMOS;
>>         params.type      = ODP_POOL_TIMEOUT;
>>
>>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov July 1, 2015, 4:11 p.m. UTC | #3
On 07/01/15 18:41, Bill Fischofer wrote:
> The intent behind the odp_structname_init() routines (following the 
> POSIX model) is simply to initialize struct values to default values 
> to handle things like reserved fields that the application might not 
> know about.

In that case init() should allocate param and give application only 
visible / changeable block of memory.


>   Extending that to provide fill in for the various subfields is 
> really beyond the scope of this abstraction.  I'm not sure if there's 
> real value in trying to do that since the application is free to set 
> fields however it wishes and the compiler will optimize these 
> assignments.
>

Yes, not really understand how that supposed to work. I.e. for example 
some platform adds internal y and x.
On pool_param_init() it will set .y = 1; .x = 2;

On next pool_param_init() it's supposed that values will be different. 
But it's not clear how that values selected. And why all that can not be 
in pool_create() itself. So I think that we need only to zero values or 
set them to invalid.
In that case param->type has to be initialized to ODP_EVENT_INVALID in 
previous patch.

Also I'm looking to odp_pool_create() and there are real seg_len and 
blk_size calculations.  Ho about that real info will be placed to params 
returned by init?

Thank you,
Maxim.

> On Wed, Jul 1, 2015 at 9:57 AM, Maxim Uvarov <maxim.uvarov@linaro.org 
> <mailto:maxim.uvarov@linaro.org>> wrote:
>
>     After reading this patch it looks like buffer size is good
>     parameter to init function. Also if we anyway need to set up
>     seg_len, len and num, why not to pass that values to init?
>
>     Maxim.
>
>
>     On 07/01/15 04:39, Bill Fischofer wrote:
>
>         Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org
>         <mailto:bill.fischofer@linaro.org>>
>         ---
>           example/classifier/odp_classifier.c | 2 +-
>           example/generator/odp_generator.c   | 2 +-
>           example/ipsec/odp_ipsec.c           | 4 ++--
>           example/packet/odp_pktio.c          | 2 +-
>           example/timer/odp_timer_test.c      | 1 +
>           5 files changed, 6 insertions(+), 5 deletions(-)
>
>         diff --git a/example/classifier/odp_classifier.c
>         b/example/classifier/odp_classifier.c
>         index ef95f95..e9b3700 100644
>         --- a/example/classifier/odp_classifier.c
>         +++ b/example/classifier/odp_classifier.c
>         @@ -430,7 +430,7 @@ int main(int argc, char *argv[])
>                 printf("cpu mask:           %s\n", cpumaskstr);
>                 /* Create packet pool */
>         -       memset(&params, 0, sizeof(params));
>         +       odp_pool_param_init(&params);
>                 params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>                 params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>                 params.pkt.num     =
>         SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>         diff --git a/example/generator/odp_generator.c
>         b/example/generator/odp_generator.c
>         index 484e6bc..47416b2 100644
>         --- a/example/generator/odp_generator.c
>         +++ b/example/generator/odp_generator.c
>         @@ -649,7 +649,7 @@ int main(int argc, char *argv[])
>                 printf("cpu mask:           %s\n", cpumaskstr);
>                 /* Create packet pool */
>         -       memset(&params, 0, sizeof(params));
>         +       odp_pool_param_init(&params);
>                 params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>                 params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>                 params.pkt.num     =
>         SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>         diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
>         index da88b17..0924a6e 100644
>         --- a/example/ipsec/odp_ipsec.c
>         +++ b/example/ipsec/odp_ipsec.c
>         @@ -348,7 +348,7 @@ void ipsec_init_pre(void)
>                 }
>                 /* Create output buffer pool */
>         -       memset(&params, 0, sizeof(params));
>         +       odp_pool_param_init(&params);
>                 params.pkt.seg_len = SHM_OUT_POOL_BUF_SIZE;
>                 params.pkt.len     = SHM_OUT_POOL_BUF_SIZE;
>                 params.pkt.num     = SHM_PKT_POOL_BUF_COUNT;
>         @@ -1294,7 +1294,7 @@ main(int argc, char *argv[])
>                 odp_barrier_init(&sync_barrier, num_workers);
>                 /* Create packet buffer pool */
>         -       memset(&params, 0, sizeof(params));
>         +       odp_pool_param_init(&params);
>                 params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>                 params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>                 params.pkt.num     = SHM_PKT_POOL_BUF_COUNT;
>         diff --git a/example/packet/odp_pktio.c
>         b/example/packet/odp_pktio.c
>         index 7430b09..c485530 100644
>         --- a/example/packet/odp_pktio.c
>         +++ b/example/packet/odp_pktio.c
>         @@ -376,7 +376,7 @@ int main(int argc, char *argv[])
>                 printf("cpu mask:           %s\n", cpumaskstr);
>                 /* Create packet pool */
>         -       memset(&params, 0, sizeof(params));
>         +       odp_pool_param_init(&params);
>                 params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>                 params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>                 params.pkt.num     =
>         SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>         diff --git a/example/timer/odp_timer_test.c
>         b/example/timer/odp_timer_test.c
>         index da7b208..ff1a8ce 100644
>         --- a/example/timer/odp_timer_test.c
>         +++ b/example/timer/odp_timer_test.c
>         @@ -412,6 +412,7 @@ int main(int argc, char *argv[])
>                 /*
>                  * Create pool for timeouts
>                  */
>         +       odp_pool_param_init(&params);
>                 params.tmo.num   = NUM_TMOS;
>                 params.type      = ODP_POOL_TIMEOUT;
>
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
Bill Fischofer July 1, 2015, 7:38 p.m. UTC | #4
The odp_pool_param_t is a struct that is part of the public API.
 odp_pool_param_init() simply sets that struct to a default value (memset's
it to 0 in linux-generic) meaning that the application need not be
concerned with whether zeros or other values represent the default values
for fields within it for any given implementation.  The application still
needs to set the fields it needs.  What it need not do is try to set fields
that are added in future releases that it may not know about.

On Wed, Jul 1, 2015 at 11:11 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
wrote:

> On 07/01/15 18:41, Bill Fischofer wrote:
>
>> The intent behind the odp_structname_init() routines (following the POSIX
>> model) is simply to initialize struct values to default values to handle
>> things like reserved fields that the application might not know about.
>>
>
> In that case init() should allocate param and give application only
> visible / changeable block of memory.
>
>
>    Extending that to provide fill in for the various subfields is really
>> beyond the scope of this abstraction.  I'm not sure if there's real value
>> in trying to do that since the application is free to set fields however it
>> wishes and the compiler will optimize these assignments.
>>
>>
> Yes, not really understand how that supposed to work. I.e. for example
> some platform adds internal y and x.
> On pool_param_init() it will set .y = 1; .x = 2;
>
> On next pool_param_init() it's supposed that values will be different. But
> it's not clear how that values selected. And why all that can not be in
> pool_create() itself. So I think that we need only to zero values or set
> them to invalid.
> In that case param->type has to be initialized to ODP_EVENT_INVALID in
> previous patch.
>
> Also I'm looking to odp_pool_create() and there are real seg_len and
> blk_size calculations.  Ho about that real info will be placed to params
> returned by init?
>
> Thank you,
> Maxim.
>
>  On Wed, Jul 1, 2015 at 9:57 AM, Maxim Uvarov <maxim.uvarov@linaro.org
>> <mailto:maxim.uvarov@linaro.org>> wrote:
>>
>>     After reading this patch it looks like buffer size is good
>>     parameter to init function. Also if we anyway need to set up
>>     seg_len, len and num, why not to pass that values to init?
>>
>>     Maxim.
>>
>>
>>     On 07/01/15 04:39, Bill Fischofer wrote:
>>
>>         Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org
>>         <mailto:bill.fischofer@linaro.org>>
>>
>>         ---
>>           example/classifier/odp_classifier.c | 2 +-
>>           example/generator/odp_generator.c   | 2 +-
>>           example/ipsec/odp_ipsec.c           | 4 ++--
>>           example/packet/odp_pktio.c          | 2 +-
>>           example/timer/odp_timer_test.c      | 1 +
>>           5 files changed, 6 insertions(+), 5 deletions(-)
>>
>>         diff --git a/example/classifier/odp_classifier.c
>>         b/example/classifier/odp_classifier.c
>>         index ef95f95..e9b3700 100644
>>         --- a/example/classifier/odp_classifier.c
>>         +++ b/example/classifier/odp_classifier.c
>>         @@ -430,7 +430,7 @@ int main(int argc, char *argv[])
>>                 printf("cpu mask:           %s\n", cpumaskstr);
>>                 /* Create packet pool */
>>         -       memset(&params, 0, sizeof(params));
>>         +       odp_pool_param_init(&params);
>>                 params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>>                 params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>>                 params.pkt.num     =
>>         SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>>         diff --git a/example/generator/odp_generator.c
>>         b/example/generator/odp_generator.c
>>         index 484e6bc..47416b2 100644
>>         --- a/example/generator/odp_generator.c
>>         +++ b/example/generator/odp_generator.c
>>         @@ -649,7 +649,7 @@ int main(int argc, char *argv[])
>>                 printf("cpu mask:           %s\n", cpumaskstr);
>>                 /* Create packet pool */
>>         -       memset(&params, 0, sizeof(params));
>>         +       odp_pool_param_init(&params);
>>                 params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>>                 params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>>                 params.pkt.num     =
>>         SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>>         diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
>>         index da88b17..0924a6e 100644
>>         --- a/example/ipsec/odp_ipsec.c
>>         +++ b/example/ipsec/odp_ipsec.c
>>         @@ -348,7 +348,7 @@ void ipsec_init_pre(void)
>>                 }
>>                 /* Create output buffer pool */
>>         -       memset(&params, 0, sizeof(params));
>>         +       odp_pool_param_init(&params);
>>                 params.pkt.seg_len = SHM_OUT_POOL_BUF_SIZE;
>>                 params.pkt.len     = SHM_OUT_POOL_BUF_SIZE;
>>                 params.pkt.num     = SHM_PKT_POOL_BUF_COUNT;
>>         @@ -1294,7 +1294,7 @@ main(int argc, char *argv[])
>>                 odp_barrier_init(&sync_barrier, num_workers);
>>                 /* Create packet buffer pool */
>>         -       memset(&params, 0, sizeof(params));
>>         +       odp_pool_param_init(&params);
>>                 params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>>                 params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>>                 params.pkt.num     = SHM_PKT_POOL_BUF_COUNT;
>>         diff --git a/example/packet/odp_pktio.c
>>         b/example/packet/odp_pktio.c
>>         index 7430b09..c485530 100644
>>         --- a/example/packet/odp_pktio.c
>>         +++ b/example/packet/odp_pktio.c
>>         @@ -376,7 +376,7 @@ int main(int argc, char *argv[])
>>                 printf("cpu mask:           %s\n", cpumaskstr);
>>                 /* Create packet pool */
>>         -       memset(&params, 0, sizeof(params));
>>         +       odp_pool_param_init(&params);
>>                 params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
>>                 params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
>>                 params.pkt.num     =
>>         SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
>>         diff --git a/example/timer/odp_timer_test.c
>>         b/example/timer/odp_timer_test.c
>>         index da7b208..ff1a8ce 100644
>>         --- a/example/timer/odp_timer_test.c
>>         +++ b/example/timer/odp_timer_test.c
>>         @@ -412,6 +412,7 @@ int main(int argc, char *argv[])
>>                 /*
>>                  * Create pool for timeouts
>>                  */
>>         +       odp_pool_param_init(&params);
>>                 params.tmo.num   = NUM_TMOS;
>>                 params.type      = ODP_POOL_TIMEOUT;
>>
>>
>>     _______________________________________________
>>     lng-odp mailing list
>>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>>     https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>>
>>
>
diff mbox

Patch

diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c
index ef95f95..e9b3700 100644
--- a/example/classifier/odp_classifier.c
+++ b/example/classifier/odp_classifier.c
@@ -430,7 +430,7 @@  int main(int argc, char *argv[])
 	printf("cpu mask:           %s\n", cpumaskstr);
 
 	/* Create packet pool */
-	memset(&params, 0, sizeof(params));
+	odp_pool_param_init(&params);
 	params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
 	params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
 	params.pkt.num     = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
index 484e6bc..47416b2 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -649,7 +649,7 @@  int main(int argc, char *argv[])
 	printf("cpu mask:           %s\n", cpumaskstr);
 
 	/* Create packet pool */
-	memset(&params, 0, sizeof(params));
+	odp_pool_param_init(&params);
 	params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
 	params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
 	params.pkt.num     = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
index da88b17..0924a6e 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -348,7 +348,7 @@  void ipsec_init_pre(void)
 	}
 
 	/* Create output buffer pool */
-	memset(&params, 0, sizeof(params));
+	odp_pool_param_init(&params);
 	params.pkt.seg_len = SHM_OUT_POOL_BUF_SIZE;
 	params.pkt.len     = SHM_OUT_POOL_BUF_SIZE;
 	params.pkt.num     = SHM_PKT_POOL_BUF_COUNT;
@@ -1294,7 +1294,7 @@  main(int argc, char *argv[])
 	odp_barrier_init(&sync_barrier, num_workers);
 
 	/* Create packet buffer pool */
-	memset(&params, 0, sizeof(params));
+	odp_pool_param_init(&params);
 	params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
 	params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
 	params.pkt.num     = SHM_PKT_POOL_BUF_COUNT;
diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
index 7430b09..c485530 100644
--- a/example/packet/odp_pktio.c
+++ b/example/packet/odp_pktio.c
@@ -376,7 +376,7 @@  int main(int argc, char *argv[])
 	printf("cpu mask:           %s\n", cpumaskstr);
 
 	/* Create packet pool */
-	memset(&params, 0, sizeof(params));
+	odp_pool_param_init(&params);
 	params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE;
 	params.pkt.len     = SHM_PKT_POOL_BUF_SIZE;
 	params.pkt.num     = SHM_PKT_POOL_SIZE/SHM_PKT_POOL_BUF_SIZE;
diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index da7b208..ff1a8ce 100644
--- a/example/timer/odp_timer_test.c
+++ b/example/timer/odp_timer_test.c
@@ -412,6 +412,7 @@  int main(int argc, char *argv[])
 	/*
 	 * Create pool for timeouts
 	 */
+	odp_pool_param_init(&params);
 	params.tmo.num   = NUM_TMOS;
 	params.type      = ODP_POOL_TIMEOUT;