diff mbox

[v3,1/4] api: config: move ODP_SHM_NUM_BLOCKS to config.h

Message ID 1424806074-26864-1-git-send-email-mike.holmes@linaro.org
State Superseded
Headers show

Commit Message

Mike Holmes Feb. 24, 2015, 7:27 p.m. UTC
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 include/odp/api/config.h                   | 6 ++++++
 platform/linux-generic/odp_shared_memory.c | 5 +----
 2 files changed, 7 insertions(+), 4 deletions(-)

Comments

Maxim Uvarov Feb. 25, 2015, 9:44 a.m. UTC | #1
On 02/25/2015 11:59 AM, Savolainen, Petri (Nokia - FI/Espoo) wrote:
> The entire patch set
> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
>
>
> Agree with Maxim that (ODP_CONFIG_POOLS * 4) gives wrong impression that shm block should be always multiple of pools. It's trivial to modify this with another patch e.g. like this
>
> #define ODP_CONFIG_SHM_BLOCKS (ODP_CONFIG_POOLS + 48)
>
> -Petri
Can there be v4 with that fix? I counted 11 odp_shm_reserve function in 
init. So 24 has to be fine. I'm also ok with POOLS + 48.

Maxim.


>
>> -----Original Message-----
>> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp-
>> bounces@lists.linaro.org] On Behalf Of ext Mike Holmes
>> Sent: Tuesday, February 24, 2015 9:28 PM
>> To: lng-odp@lists.linaro.org
>> Subject: [lng-odp] [PATCH v3 1/4] api: config: move ODP_SHM_NUM_BLOCKS to
>> config.h
>>
>> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>> ---
>>   include/odp/api/config.h                   | 6 ++++++
>>   platform/linux-generic/odp_shared_memory.c | 5 +----
>>   2 files changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/include/odp/api/config.h b/include/odp/api/config.h
>> index 8f1139d..8989fed 100644
>> --- a/include/odp/api/config.h
>> +++ b/include/odp/api/config.h
>> @@ -121,6 +121,12 @@ extern "C" {
>>    */
>>   #define ODP_CONFIG_PACKET_BUF_LEN_MAX (ODP_CONFIG_PACKET_SEG_LEN_MIN*6)
>>
>> +/** Maximum number of shared memory blocks.
>> + *
>> + * This the the number of separate SHM areas that can be reserved
>> concurrently
>> + */
>> +#define ODP_SHM_NUM_BLOCKS 32
>> +
>>   /**
>>    * @}
>>    */
>> diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-
>> generic/odp_shared_memory.c
>> index dbaec22..9b6e92b 100644
>> --- a/platform/linux-generic/odp_shared_memory.c
>> +++ b/platform/linux-generic/odp_shared_memory.c
>> @@ -15,6 +15,7 @@
>>   #include <odp/debug.h>
>>   #include <odp_debug_internal.h>
>>   #include <odp_align_internal.h>
>> +#include <odp/config.h>
>>
>>   #include <unistd.h>
>>   #include <sys/mman.h>
>> @@ -26,10 +27,6 @@
>>   #include <string.h>
>>   #include <errno.h>
>>
>> -
>> -#define ODP_SHM_NUM_BLOCKS 32
>> -
>> -
>>   typedef struct {
>>   	char      name[ODP_SHM_NAME_LEN];
>>   	uint64_t  size;
>> --
>> 2.1.0
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Maxim Uvarov Feb. 25, 2015, 1:33 p.m. UTC | #2
On 02/25/2015 01:33 PM, Savolainen, Petri (Nokia - FI/Espoo) wrote:
> I think it's OK to just merge this as is, and then change that line with another patch.
>
> -Petri
I can set it to on merge:

#define ODP_CONFIG_SHM_BLOCKS (ODP_CONFIG_POOLS + 48)

If nobody objects.

Maxim.


>> -----Original Message-----
>> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp-
>> bounces@lists.linaro.org] On Behalf Of ext Maxim Uvarov
>> Sent: Wednesday, February 25, 2015 11:45 AM
>> To: lng-odp@lists.linaro.org
>> Subject: Re: [lng-odp] [PATCH v3 1/4] api: config: move ODP_SHM_NUM_BLOCKS
>> to config.h
>>
>> On 02/25/2015 11:59 AM, Savolainen, Petri (Nokia - FI/Espoo) wrote:
>>> The entire patch set
>>> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
>>>
>>>
>>> Agree with Maxim that (ODP_CONFIG_POOLS * 4) gives wrong impression that
>> shm block should be always multiple of pools. It's trivial to modify this
>> with another patch e.g. like this
>>> #define ODP_CONFIG_SHM_BLOCKS (ODP_CONFIG_POOLS + 48)
>>>
>>> -Petri
>> Can there be v4 with that fix? I counted 11 odp_shm_reserve function in
>> init. So 24 has to be fine. I'm also ok with POOLS + 48.
>>
>> Maxim.
>>
>>
>>>> -----Original Message-----
>>>> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp-
>>>> bounces@lists.linaro.org] On Behalf Of ext Mike Holmes
>>>> Sent: Tuesday, February 24, 2015 9:28 PM
>>>> To: lng-odp@lists.linaro.org
>>>> Subject: [lng-odp] [PATCH v3 1/4] api: config: move ODP_SHM_NUM_BLOCKS
>> to
>>>> config.h
>>>>
>>>> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>>>> ---
>>>>    include/odp/api/config.h                   | 6 ++++++
>>>>    platform/linux-generic/odp_shared_memory.c | 5 +----
>>>>    2 files changed, 7 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/include/odp/api/config.h b/include/odp/api/config.h
>>>> index 8f1139d..8989fed 100644
>>>> --- a/include/odp/api/config.h
>>>> +++ b/include/odp/api/config.h
>>>> @@ -121,6 +121,12 @@ extern "C" {
>>>>     */
>>>>    #define ODP_CONFIG_PACKET_BUF_LEN_MAX
>> (ODP_CONFIG_PACKET_SEG_LEN_MIN*6)
>>>> +/** Maximum number of shared memory blocks.
>>>> + *
>>>> + * This the the number of separate SHM areas that can be reserved
>>>> concurrently
>>>> + */
>>>> +#define ODP_SHM_NUM_BLOCKS 32
>>>> +
>>>>    /**
>>>>     * @}
>>>>     */
>>>> diff --git a/platform/linux-generic/odp_shared_memory.c
>> b/platform/linux-
>>>> generic/odp_shared_memory.c
>>>> index dbaec22..9b6e92b 100644
>>>> --- a/platform/linux-generic/odp_shared_memory.c
>>>> +++ b/platform/linux-generic/odp_shared_memory.c
>>>> @@ -15,6 +15,7 @@
>>>>    #include <odp/debug.h>
>>>>    #include <odp_debug_internal.h>
>>>>    #include <odp_align_internal.h>
>>>> +#include <odp/config.h>
>>>>
>>>>    #include <unistd.h>
>>>>    #include <sys/mman.h>
>>>> @@ -26,10 +27,6 @@
>>>>    #include <string.h>
>>>>    #include <errno.h>
>>>>
>>>> -
>>>> -#define ODP_SHM_NUM_BLOCKS 32
>>>> -
>>>> -
>>>>    typedef struct {
>>>>    	char      name[ODP_SHM_NAME_LEN];
>>>>    	uint64_t  size;
>>>> --
>>>> 2.1.0
>>>>
>>>>
>>>> _______________________________________________
>>>> lng-odp mailing list
>>>> lng-odp@lists.linaro.org
>>>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>> _______________________________________________
>>> lng-odp mailing list
>>> lng-odp@lists.linaro.org
>>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
Mike Holmes Feb. 25, 2015, 10:14 p.m. UTC | #3
I have no objection to you making the change

On 25 February 2015 at 08:33, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> On 02/25/2015 01:33 PM, Savolainen, Petri (Nokia - FI/Espoo) wrote:
>
>> I think it's OK to just merge this as is, and then change that line with
>> another patch.
>>
>> -Petri
>>
> I can set it to on merge:
>
> #define ODP_CONFIG_SHM_BLOCKS (ODP_CONFIG_POOLS + 48)
>
> If nobody objects.
>
>
> Maxim.
>
>
>  -----Original Message-----
>>> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp-
>>> bounces@lists.linaro.org] On Behalf Of ext Maxim Uvarov
>>> Sent: Wednesday, February 25, 2015 11:45 AM
>>> To: lng-odp@lists.linaro.org
>>> Subject: Re: [lng-odp] [PATCH v3 1/4] api: config: move
>>> ODP_SHM_NUM_BLOCKS
>>> to config.h
>>>
>>> On 02/25/2015 11:59 AM, Savolainen, Petri (Nokia - FI/Espoo) wrote:
>>>
>>>> The entire patch set
>>>> Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
>>>>
>>>>
>>>> Agree with Maxim that (ODP_CONFIG_POOLS * 4) gives wrong impression that
>>>>
>>> shm block should be always multiple of pools. It's trivial to modify this
>>> with another patch e.g. like this
>>>
>>>> #define ODP_CONFIG_SHM_BLOCKS (ODP_CONFIG_POOLS + 48)
>>>>
>>>> -Petri
>>>>
>>> Can there be v4 with that fix? I counted 11 odp_shm_reserve function in
>>> init. So 24 has to be fine. I'm also ok with POOLS + 48.
>>>
>>> Maxim.
>>>
>>>
>>>  -----Original Message-----
>>>>> From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp-
>>>>> bounces@lists.linaro.org] On Behalf Of ext Mike Holmes
>>>>> Sent: Tuesday, February 24, 2015 9:28 PM
>>>>> To: lng-odp@lists.linaro.org
>>>>> Subject: [lng-odp] [PATCH v3 1/4] api: config: move ODP_SHM_NUM_BLOCKS
>>>>>
>>>> to
>>>
>>>> config.h
>>>>>
>>>>> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>>>>> ---
>>>>>    include/odp/api/config.h                   | 6 ++++++
>>>>>    platform/linux-generic/odp_shared_memory.c | 5 +----
>>>>>    2 files changed, 7 insertions(+), 4 deletions(-)
>>>>>
>>>>> diff --git a/include/odp/api/config.h b/include/odp/api/config.h
>>>>> index 8f1139d..8989fed 100644
>>>>> --- a/include/odp/api/config.h
>>>>> +++ b/include/odp/api/config.h
>>>>> @@ -121,6 +121,12 @@ extern "C" {
>>>>>     */
>>>>>    #define ODP_CONFIG_PACKET_BUF_LEN_MAX
>>>>>
>>>> (ODP_CONFIG_PACKET_SEG_LEN_MIN*6)
>>>
>>>> +/** Maximum number of shared memory blocks.
>>>>> + *
>>>>> + * This the the number of separate SHM areas that can be reserved
>>>>> concurrently
>>>>> + */
>>>>> +#define ODP_SHM_NUM_BLOCKS 32
>>>>> +
>>>>>    /**
>>>>>     * @}
>>>>>     */
>>>>> diff --git a/platform/linux-generic/odp_shared_memory.c
>>>>>
>>>> b/platform/linux-
>>>
>>>> generic/odp_shared_memory.c
>>>>> index dbaec22..9b6e92b 100644
>>>>> --- a/platform/linux-generic/odp_shared_memory.c
>>>>> +++ b/platform/linux-generic/odp_shared_memory.c
>>>>> @@ -15,6 +15,7 @@
>>>>>    #include <odp/debug.h>
>>>>>    #include <odp_debug_internal.h>
>>>>>    #include <odp_align_internal.h>
>>>>> +#include <odp/config.h>
>>>>>
>>>>>    #include <unistd.h>
>>>>>    #include <sys/mman.h>
>>>>> @@ -26,10 +27,6 @@
>>>>>    #include <string.h>
>>>>>    #include <errno.h>
>>>>>
>>>>> -
>>>>> -#define ODP_SHM_NUM_BLOCKS 32
>>>>> -
>>>>> -
>>>>>    typedef struct {
>>>>>         char      name[ODP_SHM_NAME_LEN];
>>>>>         uint64_t  size;
>>>>> --
>>>>> 2.1.0
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> lng-odp mailing list
>>>>> lng-odp@lists.linaro.org
>>>>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>>>>
>>>> _______________________________________________
>>>> lng-odp mailing list
>>>> lng-odp@lists.linaro.org
>>>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>>>
>>>
>>> _______________________________________________
>>> lng-odp 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
>
diff mbox

Patch

diff --git a/include/odp/api/config.h b/include/odp/api/config.h
index 8f1139d..8989fed 100644
--- a/include/odp/api/config.h
+++ b/include/odp/api/config.h
@@ -121,6 +121,12 @@  extern "C" {
  */
 #define ODP_CONFIG_PACKET_BUF_LEN_MAX (ODP_CONFIG_PACKET_SEG_LEN_MIN*6)
 
+/** Maximum number of shared memory blocks.
+ *
+ * This the the number of separate SHM areas that can be reserved concurrently
+ */
+#define ODP_SHM_NUM_BLOCKS 32
+
 /**
  * @}
  */
diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c
index dbaec22..9b6e92b 100644
--- a/platform/linux-generic/odp_shared_memory.c
+++ b/platform/linux-generic/odp_shared_memory.c
@@ -15,6 +15,7 @@ 
 #include <odp/debug.h>
 #include <odp_debug_internal.h>
 #include <odp_align_internal.h>
+#include <odp/config.h>
 
 #include <unistd.h>
 #include <sys/mman.h>
@@ -26,10 +27,6 @@ 
 #include <string.h>
 #include <errno.h>
 
-
-#define ODP_SHM_NUM_BLOCKS 32
-
-
 typedef struct {
 	char      name[ODP_SHM_NAME_LEN];
 	uint64_t  size;