[PATCHv8,01/12] linux-generic: zero params for pool create

Message ID 1439895698-18597-2-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov Aug. 18, 2015, 11:01 a.m.
Adding more params to pool create breaks original work.
Make sure that not set params are zero.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 platform/linux-generic/odp_schedule.c | 1 +
 test/validation/queue/queue.c         | 1 +
 2 files changed, 2 insertions(+)

Comments

Bill Fischofer Aug. 18, 2015, 1 p.m. | #1
This should be using odp_pool_param_init() since that's what it's designed
to do.

On Tue, Aug 18, 2015 at 6:01 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
wrote:

> Adding more params to pool create breaks original work.
> Make sure that not set params are zero.
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> ---
>  platform/linux-generic/odp_schedule.c | 1 +
>  test/validation/queue/queue.c         | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/platform/linux-generic/odp_schedule.c
> b/platform/linux-generic/odp_schedule.c
> index 689ec3f..e14e9d6 100644
> --- a/platform/linux-generic/odp_schedule.c
> +++ b/platform/linux-generic/odp_schedule.c
> @@ -123,6 +123,7 @@ int odp_schedule_init_global(void)
>
>         memset(sched, 0, sizeof(sched_t));
>
> +       memset(&params, 0, sizeof(params));
>         params.buf.size  = sizeof(sched_cmd_t);
>         params.buf.align = 0;
>         params.buf.num   = NUM_SCHED_CMD;
> diff --git a/test/validation/queue/queue.c b/test/validation/queue/queue.c
> index 5b2a13a..ff8cd9a 100644
> --- a/test/validation/queue/queue.c
> +++ b/test/validation/queue/queue.c
> @@ -19,6 +19,7 @@ int queue_suite_init(void)
>  {
>         odp_pool_param_t params;
>
> +       memset(&params, 0, sizeof(params));
>         params.buf.size  = 0;
>         params.buf.align = ODP_CACHE_LINE_SIZE;
>         params.buf.num   = 1024 * 10;
> --
> 1.9.1
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
Bill Fischofer Aug. 18, 2015, 1 p.m. | #2
I believe this is already part of the API-NEXT patch for adding that API.

On Tue, Aug 18, 2015 at 8:00 AM, Bill Fischofer <bill.fischofer@linaro.org>
wrote:

> This should be using odp_pool_param_init() since that's what it's designed
> to do.
>
> On Tue, Aug 18, 2015 at 6:01 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
> wrote:
>
>> Adding more params to pool create breaks original work.
>> Make sure that not set params are zero.
>>
>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>> ---
>>  platform/linux-generic/odp_schedule.c | 1 +
>>  test/validation/queue/queue.c         | 1 +
>>  2 files changed, 2 insertions(+)
>>
>> diff --git a/platform/linux-generic/odp_schedule.c
>> b/platform/linux-generic/odp_schedule.c
>> index 689ec3f..e14e9d6 100644
>> --- a/platform/linux-generic/odp_schedule.c
>> +++ b/platform/linux-generic/odp_schedule.c
>> @@ -123,6 +123,7 @@ int odp_schedule_init_global(void)
>>
>>         memset(sched, 0, sizeof(sched_t));
>>
>> +       memset(&params, 0, sizeof(params));
>>         params.buf.size  = sizeof(sched_cmd_t);
>>         params.buf.align = 0;
>>         params.buf.num   = NUM_SCHED_CMD;
>> diff --git a/test/validation/queue/queue.c b/test/validation/queue/queue.c
>> index 5b2a13a..ff8cd9a 100644
>> --- a/test/validation/queue/queue.c
>> +++ b/test/validation/queue/queue.c
>> @@ -19,6 +19,7 @@ int queue_suite_init(void)
>>  {
>>         odp_pool_param_t params;
>>
>> +       memset(&params, 0, sizeof(params));
>>         params.buf.size  = 0;
>>         params.buf.align = ODP_CACHE_LINE_SIZE;
>>         params.buf.num   = 1024 * 10;
>> --
>> 1.9.1
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>
>
Maxim Uvarov Aug. 18, 2015, 1:04 p.m. | #3
On 08/18/15 16:00, Bill Fischofer wrote:
> I believe this is already part of the API-NEXT patch for adding that API.

yes, but for now we it's not merged to master. Will be in 1.3. That 
patches do not change API.

Maxim.
>
> On Tue, Aug 18, 2015 at 8:00 AM, Bill Fischofer 
> <bill.fischofer@linaro.org <mailto:bill.fischofer@linaro.org>> wrote:
>
>     This should be using odp_pool_param_init() since that's what it's
>     designed to do.
>
>     On Tue, Aug 18, 2015 at 6:01 AM, Maxim Uvarov
>     <maxim.uvarov@linaro.org <mailto:maxim.uvarov@linaro.org>> wrote:
>
>         Adding more params to pool create breaks original work.
>         Make sure that not set params are zero.
>
>         Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org
>         <mailto:maxim.uvarov@linaro.org>>
>         ---
>          platform/linux-generic/odp_schedule.c | 1 +
>          test/validation/queue/queue.c         | 1 +
>          2 files changed, 2 insertions(+)
>
>         diff --git a/platform/linux-generic/odp_schedule.c
>         b/platform/linux-generic/odp_schedule.c
>         index 689ec3f..e14e9d6 100644
>         --- a/platform/linux-generic/odp_schedule.c
>         +++ b/platform/linux-generic/odp_schedule.c
>         @@ -123,6 +123,7 @@ int odp_schedule_init_global(void)
>
>                 memset(sched, 0, sizeof(sched_t));
>
>         +       memset(&params, 0, sizeof(params));
>                 params.buf.size  = sizeof(sched_cmd_t);
>                 params.buf.align = 0;
>                 params.buf.num   = NUM_SCHED_CMD;
>         diff --git a/test/validation/queue/queue.c
>         b/test/validation/queue/queue.c
>         index 5b2a13a..ff8cd9a 100644
>         --- a/test/validation/queue/queue.c
>         +++ b/test/validation/queue/queue.c
>         @@ -19,6 +19,7 @@ int queue_suite_init(void)
>          {
>                 odp_pool_param_t params;
>
>         +       memset(&params, 0, sizeof(params));
>                 params.buf.size  = 0;
>                 params.buf.align = ODP_CACHE_LINE_SIZE;
>                 params.buf.num   = 1024 * 10;
>         --
>         1.9.1
>
>         _______________________________________________
>         lng-odp mailing list
>         lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>         https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>

Patch

diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c
index 689ec3f..e14e9d6 100644
--- a/platform/linux-generic/odp_schedule.c
+++ b/platform/linux-generic/odp_schedule.c
@@ -123,6 +123,7 @@  int odp_schedule_init_global(void)
 
 	memset(sched, 0, sizeof(sched_t));
 
+	memset(&params, 0, sizeof(params));
 	params.buf.size  = sizeof(sched_cmd_t);
 	params.buf.align = 0;
 	params.buf.num   = NUM_SCHED_CMD;
diff --git a/test/validation/queue/queue.c b/test/validation/queue/queue.c
index 5b2a13a..ff8cd9a 100644
--- a/test/validation/queue/queue.c
+++ b/test/validation/queue/queue.c
@@ -19,6 +19,7 @@  int queue_suite_init(void)
 {
 	odp_pool_param_t params;
 
+	memset(&params, 0, sizeof(params));
 	params.buf.size  = 0;
 	params.buf.align = ODP_CACHE_LINE_SIZE;
 	params.buf.num   = 1024 * 10;