Re: [lng-odp] [PATCH API-NEXT v1 1/1] api:pktio: Adds MTU set function.

2017-08-10 Thread vamsi a
On Tue, Aug 8, 2017 at 5:08 PM, Bill Fischofer 
wrote:

>
>
> On Tue, Aug 8, 2017 at 2:38 AM, Vamsi Attunuru 
> wrote:
>
>> Signed-off-by: Vamsi Attunuru 
>> Signed-off-by: Shally Verma 
>> Signed-off-by: Mahipal Challa 
>>
>> ---
>>  include/odp/api/spec/packet_io.h | 21 +
>>  1 file changed, 21 insertions(+)
>>
>> diff --git a/include/odp/api/spec/packet_io.h
>> b/include/odp/api/spec/packet_io.h
>> index d42cebf..be81c3d 100644
>> --- a/include/odp/api/spec/packet_io.h
>> +++ b/include/odp/api/spec/packet_io.h
>> @@ -452,6 +452,9 @@ typedef union odp_pktio_set_op_t {
>> struct {
>> /** Promiscuous mode */
>> uint32_t promisc_mode : 1;
>> +
>> +   /** Allow app to set MTU size */
>> +   uint32_t mtu_set : 1;
>> } op;
>> /** All bits of the bit field structure.
>>   * This field can be used to set/clear all flags, or bitwise
>> @@ -480,6 +483,9 @@ typedef struct odp_pktio_capability_t {
>>
>> /** @deprecated Use enable_loop inside odp_pktin_config_t */
>> odp_bool_t ODP_DEPRECATE(loop_supported);
>> +
>> +   /** Maximum MTU size supported */
>> +   uint32_t max_mtu_size;
>>  } odp_pktio_capability_t;
>>
>>  /**
>> @@ -910,6 +916,21 @@ int odp_pktout_send(odp_pktout_queue_t queue, const
>> odp_packet_t packets[],
>>  uint32_t odp_pktio_mtu(odp_pktio_t pktio);
>>
>>  /**
>> + * Set MTU value of a packet IO interface.
>> + *
>> + * Application should pass value upto max_mtu_size as indicated by
>> + * odp_pktio_capability_t:max_mtu_size. Any value beyond max_mtu_size
>> + * limit will result in failure. mtu value < 68 also results in failure.
>>
>
> Seems like it would be better to have an explicit min_mtu_size in the
> odp_pktio_capability() than this arbitrary note buried as a comment.
>

sure, will add min_mtu_size field in odp_paktio_capability_t.

>From the last discussion, odp_pktio_config() api was suggested instead of
set_mtu() api, if my understanding is correct, Is the following sequence
allowed to occur multiple times like stop pktio interface, call
pktio_config() and start pktio interface.

>
>
>> + *
>> + * @param pktio  Packet IO handle.
>> + * @param mtuMTU value to be set.
>> + *
>> + * @return  0 on success
>> + * @retval <0 on failure
>> + */
>> +int odp_pktio_mtu_set(odp_pktio_t pktio, uint32_t mtu);
>> +
>> +/**
>>   * Enable/Disable promiscuous mode on a packet IO interface.
>>   *
>>   * @param[in] pktioPacket IO handle.
>> --
>> 1.9.3
>>
>>
>


Re: [lng-odp] [EXT] Re: ODP1.15 buffer alignment issue

2017-08-10 Thread shally verma
just to add for some implementation Buffer == data itself (without any
metadata or headroom). So while you work on this, please get us
clarity for such implementations as well.

On Fri, Aug 11, 2017 at 12:36 AM, Maxim Uvarov  wrote:
> On 08/10/17 21:41, Liron Himi wrote:
>> Hi,
>>
>> I think it is more than just naming replacement.
>> The odp-pool API state that the alignment is for buffer alignment and not 
>> for data. So it seems like a bug, right?
>>
>> Here is a snipped from the API:
>>   /** Minimum buffer alignment in bytes. Valid values are
>>   powers of two. Use 0 for default alignment.
>>   Default will always be a multiple of 8. */
>>   uint32_t align;
>>   } buf;
>>
>> Regards,
>> Liron
>>
>
>
> Ok, in my understanding this value comes from:
>
> typedef struct odp_pool_capability_t {
> .
>
> /** Buffer pool capabilities  */
> struct {
> /** Maximum buffer data alignment in bytes */
> uint32_t max_align;
>
>
> So it has to be "buffer data alignment". Please give me some time to
> double check with community that we all understand this api definition
> right.
>
> Thank you,
> Maxim.
>
>
>> -Original Message-
>> From: Maxim Uvarov [mailto:maxim.uva...@linaro.org]
>> Sent: Thursday, August 10, 2017 19:45
>> To: Liron Himi ; lng-odp@lists.linaro.org
>> Cc: Petri Savolainen ; Elo, Matias (Nokia - 
>> FI/Espoo) 
>> Subject: [EXT] Re: [lng-odp] ODP1.15 buffer alignment issue
>>
>> External Email
>>
>> --
>> On 08/08/17 09:49, Liron Himi wrote:
>>> Hi,
>>>
>>> See comments inline
>>>
>>> Regards,
>>> Liron
>>>
>>> -Original Message-
>>> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of
>>> Maxim Uvarov
>>> Sent: Monday, August 07, 2017 23:21
>>> To: lng-odp@lists.linaro.org
>>> Subject: Re: [lng-odp] ODP1.15 buffer alignment issue
>>>
>>> it's implementation specific.
>>>
>>> Full code is:
>>>
>>> +   offset = pool->headroom;
>>> +
>>> +   /* move to correct align */
>>> +   while (((uintptr_t)[offset]) % pool->align != 0)
>>> +   offset++;
>>> 
>>> +
>>> +   /* Pointer to data start (of the first segment) */
>>> +   buf_hdr->addr[0] = [offset];
>>> +   /* Store buffer into the global pool */
>>> +   ring_enq(ring, mask, (uint32_t)(uintptr_t)buf_hdl);
>>>
>>> If I understood idea right there should be odp specific packet header with 
>>> odp fields which is needed to implement api but missing in hardware buffer 
>>> field. Then hw buffer which is aligned by default with pointer to data. 
>>> Everything depends on implementation and it's not mandatory.
>>> [L.H.] As part of the linux-generic there is a 
>>> 'ODP_CONFIG_BUFFER_ALIGN_MIN' which should be used for the buffer alignment.
>>> However, the code above use this value for the data section alignment in 
>>> the buffer and not the buffer address alignment.
>>> On ODP1.11 the 'ODP_CONFIG_BUFFER_ALIGN_MIN' was used correctly for buffer 
>>> alignment.
>>> In order to continue we need to understand what was the real intention here:
>>> 1. To make sure the data section is aligned?
>>> 2. To make sure the buffer address is aligned? If so, there is a bug in 
>>> this code. A possible fix is as follow:
>>>  -   offset = pool->headroom;
>>>  +   offset = 0;
>>>
>>>  /* move to correct align */
>>> while (((uintptr_t)[offset]) % pool->align != 0)
>>> offset++;
>>>  +   offset += pool->headroom
>>>  
>>>  /* Pointer to data start (of the first segment) */
>>> buf_hdr->addr[0] = [offset];
>>>
>>> If 1# is required than maybe a 'ODP_CONFIG_DATA_ALIGN_MIN' should be define.
>>>
>>
>> Ah, ok I see. I think in current code we used data align. So that rename to 
>> ODP_CONFIG_DATA_ALIGN_MIN is needed. The remain question is should we also 
>> align buffers itself.
>>
>> Petri, Matias can you please test with dpdk pktio if buffer alignment 
>> improves performance?
>>
>> Maxim.
>>
>>
>>
>>> If your platform reuses this linux-generic file and that alignment does not 
>>> work for you then we rework it somehow.
>>>
>>> Bet regards.
>>> Maxim.
>>>
>>>
>>> On 08/07/17 21:58, Bill Fischofer wrote:
 This is part of the latest pool restructure code contributed by Nokia.
 If you'd like to join the ODP public call tomorrow at 15:00 UTC we
 can discuss this then.

 On Mon, Aug 7, 2017 at 8:57 AM, Liron Himi  wrote:

> Hi,
>
> I'm trying to move to odp1.15 and encounter with an buffer alignment 
> issue.
> It 

Re: [lng-odp] [EXT] Re: ODP1.15 buffer alignment issue

2017-08-10 Thread Maxim Uvarov
On 08/10/17 21:41, Liron Himi wrote:
> Hi,
> 
> I think it is more than just naming replacement.
> The odp-pool API state that the alignment is for buffer alignment and not for 
> data. So it seems like a bug, right?
> 
> Here is a snipped from the API:
>   /** Minimum buffer alignment in bytes. Valid values are
>   powers of two. Use 0 for default alignment.
>   Default will always be a multiple of 8. */
>   uint32_t align;
>   } buf;
> 
> Regards,
> Liron
> 


Ok, in my understanding this value comes from:

typedef struct odp_pool_capability_t {
.

/** Buffer pool capabilities  */
struct {
/** Maximum buffer data alignment in bytes */
uint32_t max_align;


So it has to be "buffer data alignment". Please give me some time to
double check with community that we all understand this api definition
right.

Thank you,
Maxim.


> -Original Message-
> From: Maxim Uvarov [mailto:maxim.uva...@linaro.org] 
> Sent: Thursday, August 10, 2017 19:45
> To: Liron Himi ; lng-odp@lists.linaro.org
> Cc: Petri Savolainen ; Elo, Matias (Nokia - 
> FI/Espoo) 
> Subject: [EXT] Re: [lng-odp] ODP1.15 buffer alignment issue
> 
> External Email
> 
> --
> On 08/08/17 09:49, Liron Himi wrote:
>> Hi,
>>
>> See comments inline
>>
>> Regards,
>> Liron
>>
>> -Original Message-
>> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of 
>> Maxim Uvarov
>> Sent: Monday, August 07, 2017 23:21
>> To: lng-odp@lists.linaro.org
>> Subject: Re: [lng-odp] ODP1.15 buffer alignment issue
>>
>> it's implementation specific.
>>
>> Full code is:
>>
>> +   offset = pool->headroom;
>> +
>> +   /* move to correct align */
>> +   while (((uintptr_t)[offset]) % pool->align != 0)
>> +   offset++;
>> 
>> +
>> +   /* Pointer to data start (of the first segment) */
>> +   buf_hdr->addr[0] = [offset];
>> +   /* Store buffer into the global pool */
>> +   ring_enq(ring, mask, (uint32_t)(uintptr_t)buf_hdl);
>>
>> If I understood idea right there should be odp specific packet header with 
>> odp fields which is needed to implement api but missing in hardware buffer 
>> field. Then hw buffer which is aligned by default with pointer to data. 
>> Everything depends on implementation and it's not mandatory.
>> [L.H.] As part of the linux-generic there is a 'ODP_CONFIG_BUFFER_ALIGN_MIN' 
>> which should be used for the buffer alignment.
>> However, the code above use this value for the data section alignment in the 
>> buffer and not the buffer address alignment.
>> On ODP1.11 the 'ODP_CONFIG_BUFFER_ALIGN_MIN' was used correctly for buffer 
>> alignment.
>> In order to continue we need to understand what was the real intention here:
>> 1. To make sure the data section is aligned?
>> 2. To make sure the buffer address is aligned? If so, there is a bug in this 
>> code. A possible fix is as follow:
>>  -   offset = pool->headroom;
>>  +   offset = 0;
>>  
>>  /* move to correct align */
>> while (((uintptr_t)[offset]) % pool->align != 0)
>> offset++;
>>  +   offset += pool->headroom
>>  
>>  /* Pointer to data start (of the first segment) */
>> buf_hdr->addr[0] = [offset];
>>  
>> If 1# is required than maybe a 'ODP_CONFIG_DATA_ALIGN_MIN' should be define.
>>  
> 
> Ah, ok I see. I think in current code we used data align. So that rename to 
> ODP_CONFIG_DATA_ALIGN_MIN is needed. The remain question is should we also 
> align buffers itself.
> 
> Petri, Matias can you please test with dpdk pktio if buffer alignment 
> improves performance?
> 
> Maxim.
> 
> 
> 
>> If your platform reuses this linux-generic file and that alignment does not 
>> work for you then we rework it somehow.
>>
>> Bet regards.
>> Maxim.
>>
>>
>> On 08/07/17 21:58, Bill Fischofer wrote:
>>> This is part of the latest pool restructure code contributed by Nokia. 
>>> If you'd like to join the ODP public call tomorrow at 15:00 UTC we 
>>> can discuss this then.
>>>
>>> On Mon, Aug 7, 2017 at 8:57 AM, Liron Himi  wrote:
>>>
 Hi,

 I'm trying to move to odp1.15 and encounter with an buffer alignment issue.
 It seems that linux-generic implementation make sure that the data 
 address is align with the requested alignment and not the buffer 
 address itself (look at the code sniped below).
 On ODP1.11 (the current version we use) the buffer was aligned correctly.

 Is the current behavior is the expected one?
 Our HW (and probably other HWs) rely on the fact that 

Re: [lng-odp] [EXT] Re: ODP1.15 buffer alignment issue

2017-08-10 Thread Liron Himi
Hi,

I think it is more than just naming replacement.
The odp-pool API state that the alignment is for buffer alignment and not for 
data. So it seems like a bug, right?

Here is a snipped from the API:
/** Minimum buffer alignment in bytes. Valid values are
powers of two. Use 0 for default alignment.
Default will always be a multiple of 8. */
uint32_t align;
} buf;

Regards,
Liron

-Original Message-
From: Maxim Uvarov [mailto:maxim.uva...@linaro.org] 
Sent: Thursday, August 10, 2017 19:45
To: Liron Himi ; lng-odp@lists.linaro.org
Cc: Petri Savolainen ; Elo, Matias (Nokia - 
FI/Espoo) 
Subject: [EXT] Re: [lng-odp] ODP1.15 buffer alignment issue

External Email

--
On 08/08/17 09:49, Liron Himi wrote:
> Hi,
> 
> See comments inline
> 
> Regards,
> Liron
> 
> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of 
> Maxim Uvarov
> Sent: Monday, August 07, 2017 23:21
> To: lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] ODP1.15 buffer alignment issue
> 
> it's implementation specific.
> 
> Full code is:
> 
> +   offset = pool->headroom;
> +
> +   /* move to correct align */
> +   while (((uintptr_t)[offset]) % pool->align != 0)
> +   offset++;
> 
> +
> +   /* Pointer to data start (of the first segment) */
> +   buf_hdr->addr[0] = [offset];
> +   /* Store buffer into the global pool */
> +   ring_enq(ring, mask, (uint32_t)(uintptr_t)buf_hdl);
> 
> If I understood idea right there should be odp specific packet header with 
> odp fields which is needed to implement api but missing in hardware buffer 
> field. Then hw buffer which is aligned by default with pointer to data. 
> Everything depends on implementation and it's not mandatory.
> [L.H.] As part of the linux-generic there is a 'ODP_CONFIG_BUFFER_ALIGN_MIN' 
> which should be used for the buffer alignment.
> However, the code above use this value for the data section alignment in the 
> buffer and not the buffer address alignment.
> On ODP1.11 the 'ODP_CONFIG_BUFFER_ALIGN_MIN' was used correctly for buffer 
> alignment.
> In order to continue we need to understand what was the real intention here:
> 1. To make sure the data section is aligned?
> 2. To make sure the buffer address is aligned? If so, there is a bug in this 
> code. A possible fix is as follow:
>   -   offset = pool->headroom;
>   +   offset = 0;
>   
>   /* move to correct align */
>  while (((uintptr_t)[offset]) % pool->align != 0)
>  offset++;
>   +   offset += pool->headroom
>   
>   /* Pointer to data start (of the first segment) */
>  buf_hdr->addr[0] = [offset];
>   
> If 1# is required than maybe a 'ODP_CONFIG_DATA_ALIGN_MIN' should be define.
>  

Ah, ok I see. I think in current code we used data align. So that rename to 
ODP_CONFIG_DATA_ALIGN_MIN is needed. The remain question is should we also 
align buffers itself.

Petri, Matias can you please test with dpdk pktio if buffer alignment improves 
performance?

Maxim.



> If your platform reuses this linux-generic file and that alignment does not 
> work for you then we rework it somehow.
> 
> Bet regards.
> Maxim.
> 
> 
> On 08/07/17 21:58, Bill Fischofer wrote:
>> This is part of the latest pool restructure code contributed by Nokia. 
>> If you'd like to join the ODP public call tomorrow at 15:00 UTC we 
>> can discuss this then.
>>
>> On Mon, Aug 7, 2017 at 8:57 AM, Liron Himi  wrote:
>>
>>> Hi,
>>>
>>> I'm trying to move to odp1.15 and encounter with an buffer alignment issue.
>>> It seems that linux-generic implementation make sure that the data 
>>> address is align with the requested alignment and not the buffer 
>>> address itself (look at the code sniped below).
>>> On ODP1.11 (the current version we use) the buffer was aligned correctly.
>>>
>>> Is the current behavior is the expected one?
>>> Our HW (and probably other HWs) rely on the fact that the buffers 
>>> are aligned.
>>>
>>> From odp_pool.c, init_buffers:
>>>
>>> offset = pool->headroom;
>>>
>>> /* move to correct align */
>>> while (((uintptr_t)[offset]) %
>>> pool->align != 0)
>>> offset++;
>>>
>>>
>>> Regards,
>>> Liron
>>>
> 



Re: [lng-odp] ODP1.15 buffer alignment issue

2017-08-10 Thread Maxim Uvarov
On 08/08/17 09:49, Liron Himi wrote:
> Hi,
> 
> See comments inline
> 
> Regards,
> Liron
> 
> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of Maxim 
> Uvarov
> Sent: Monday, August 07, 2017 23:21
> To: lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] ODP1.15 buffer alignment issue
> 
> it's implementation specific.
> 
> Full code is:
> 
> +   offset = pool->headroom;
> +
> +   /* move to correct align */
> +   while (((uintptr_t)[offset]) % pool->align != 0)
> +   offset++;
> 
> +
> +   /* Pointer to data start (of the first segment) */
> +   buf_hdr->addr[0] = [offset];
> +   /* Store buffer into the global pool */
> +   ring_enq(ring, mask, (uint32_t)(uintptr_t)buf_hdl);
> 
> If I understood idea right there should be odp specific packet header with 
> odp fields which is needed to implement api but missing in hardware buffer 
> field. Then hw buffer which is aligned by default with pointer to data. 
> Everything depends on implementation and it's not mandatory.
> [L.H.] As part of the linux-generic there is a 'ODP_CONFIG_BUFFER_ALIGN_MIN' 
> which should be used for the buffer alignment.
> However, the code above use this value for the data section alignment in the 
> buffer and not the buffer address alignment.
> On ODP1.11 the 'ODP_CONFIG_BUFFER_ALIGN_MIN' was used correctly for buffer 
> alignment.
> In order to continue we need to understand what was the real intention here:
> 1. To make sure the data section is aligned?
> 2. To make sure the buffer address is aligned? If so, there is a bug in this 
> code. A possible fix is as follow:
>   -   offset = pool->headroom;
>   +   offset = 0;
>   
>   /* move to correct align */
>  while (((uintptr_t)[offset]) % pool->align != 0)
>  offset++;
>   +   offset += pool->headroom
>   
>   /* Pointer to data start (of the first segment) */
>  buf_hdr->addr[0] = [offset];
>   
> If 1# is required than maybe a 'ODP_CONFIG_DATA_ALIGN_MIN' should be define.
>  

Ah, ok I see. I think in current code we used data align. So that rename
to ODP_CONFIG_DATA_ALIGN_MIN is needed. The remain question is should we
also align buffers itself.

Petri, Matias can you please test with dpdk pktio if buffer alignment
improves performance?

Maxim.



> If your platform reuses this linux-generic file and that alignment does not 
> work for you then we rework it somehow.
> 
> Bet regards.
> Maxim.
> 
> 
> On 08/07/17 21:58, Bill Fischofer wrote:
>> This is part of the latest pool restructure code contributed by Nokia. 
>> If you'd like to join the ODP public call tomorrow at 15:00 UTC we can 
>> discuss this then.
>>
>> On Mon, Aug 7, 2017 at 8:57 AM, Liron Himi  wrote:
>>
>>> Hi,
>>>
>>> I'm trying to move to odp1.15 and encounter with an buffer alignment issue.
>>> It seems that linux-generic implementation make sure that the data 
>>> address is align with the requested alignment and not the buffer 
>>> address itself (look at the code sniped below).
>>> On ODP1.11 (the current version we use) the buffer was aligned correctly.
>>>
>>> Is the current behavior is the expected one?
>>> Our HW (and probably other HWs) rely on the fact that the buffers are 
>>> aligned.
>>>
>>> From odp_pool.c, init_buffers:
>>>
>>> offset = pool->headroom;
>>>
>>> /* move to correct align */
>>> while (((uintptr_t)[offset]) %
>>> pool->align != 0)
>>> offset++;
>>>
>>>
>>> Regards,
>>> Liron
>>>
> 



[lng-odp] [Bug 3043] user guide error

2017-08-10 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=3043

--- Comment #7 from Maxim Uvarov  ---
https://github.com/Linaro/odp/commit/90d4ce1b3b25ca18446131906007571cc0ed0191
refs/heads/master
2017-08-10T13:55:29+03:00
Bill Fischofer bill.fischo...@linaro.org
doc: images: correct packet segment diagram

Correct the packet segment diagram (Figure 12 in the User Guide)
to reflect the correct APIs: odp_packet_l2_ptr(), odp_packet_l3_ptr(),
and odp_packet_l4_ptr(). This diagram had erroneously used
odp_packet_l2_ptr() for all three offsets.
https://bugs.linaro.org/show_bug.cgi?id=3043

Signed-off-by: Bill Fischofer 
Reviewed-by: Dmitry Eremin-Solenikov 
Signed-off-by: Maxim Uvarov 

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[lng-odp] [Linaro/odp] 90d4ce: doc: images: correct packet segment diagram

2017-08-10 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/Linaro/odp
  Commit: 90d4ce1b3b25ca18446131906007571cc0ed0191
  
https://github.com/Linaro/odp/commit/90d4ce1b3b25ca18446131906007571cc0ed0191
  Author: Bill Fischofer 
  Date:   2017-08-10 (Thu, 10 Aug 2017)

  Changed paths:
M doc/images/segment.svg

  Log Message:
  ---
  doc: images: correct packet segment diagram

Correct the packet segment diagram (Figure 12 in the User Guide)
to reflect the correct APIs: odp_packet_l2_ptr(), odp_packet_l3_ptr(),
and odp_packet_l4_ptr(). This diagram had erroneously used
odp_packet_l2_ptr() for all three offsets.
https://bugs.linaro.org/show_bug.cgi?id=3043

Signed-off-by: Bill Fischofer 
Reviewed-by: Dmitry Eremin-Solenikov 
Signed-off-by: Maxim Uvarov 




[lng-odp] [Linaro/odp] edc288: example: generator : use packet reference API to g...

2017-08-10 Thread GitHub
  Branch: refs/heads/api-next
  Home:   https://github.com/Linaro/odp
  Commit: edc288690b65167b347a0e8c2c171198e4d2fbe3
  
https://github.com/Linaro/odp/commit/edc288690b65167b347a0e8c2c171198e4d2fbe3
  Author: Bogdan Pricope 
  Date:   2017-08-09 (Wed, 09 Aug 2017)

  Changed paths:
M example/generator/odp_generator.c

  Log Message:
  ---
  example: generator : use packet reference API to generate udp and icmp traffic

Signed-off-by: Bogdan Pricope 
Reviewed-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 


  Commit: 65d0fbba8366f68a8fe24426bc0e16ea3cd3cd04
  
https://github.com/Linaro/odp/commit/65d0fbba8366f68a8fe24426bc0e16ea3cd3cd04
  Author: Matias Elo 
  Date:   2017-08-10 (Thu, 10 Aug 2017)

  Changed paths:
M platform/linux-generic/include/odp_pool_internal.h
M platform/linux-generic/odp_pool.c
M platform/linux-generic/pktio/dpdk.c

  Log Message:
  ---
  linux-gen: dpdk: make sure mbuf memory is allocated from huge pages

DPDK requires that mbuf memory is allocated from huge pages to ensure page
locking. Modify zero-copy dpdk pktio to fall back to packet copy if
transmitted ODP packet is not allocated from huge page memory.

Signed-off-by: Matias Elo 
Signed-off-by: Maxim Uvarov 


  Commit: 762372f299b64c8c30c3f5a0ba51fbb48e234e1e
  
https://github.com/Linaro/odp/commit/762372f299b64c8c30c3f5a0ba51fbb48e234e1e
  Author: Maxim Uvarov 
  Date:   2017-08-10 (Thu, 10 Aug 2017)

  Changed paths:
M example/generator/odp_generator.c
M platform/linux-generic/include/odp_pool_internal.h
M platform/linux-generic/odp_pool.c
M platform/linux-generic/pktio/dpdk.c

  Log Message:
  ---
  Merge branch 'master' into api-next


  Commit: 3547226b19e6982bf74fc8c258b89db2c5f6a39c
  
https://github.com/Linaro/odp/commit/3547226b19e6982bf74fc8c258b89db2c5f6a39c
  Author: Joyce Kong 
  Date:   2017-08-10 (Thu, 10 Aug 2017)

  Changed paths:
M platform/linux-generic/include/odp_timer_internal.h
M platform/linux-generic/odp_timer.c

  Log Message:
  ---
  linux-gen: timer: control timer pool polling frequency dynamically

Adjust frequency of timer pool polling by the duration
of timer. There needs to be 0 timer pool polling when
no timer pool created.

Signed-off-by: Joyce Kong 
Reviewed-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 


Compare: https://github.com/Linaro/odp/compare/e420668cd388...3547226b19e6


[lng-odp] [Linaro/odp] 65d0fb: linux-gen: dpdk: make sure mbuf memory is allocate...

2017-08-10 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/Linaro/odp
  Commit: 65d0fbba8366f68a8fe24426bc0e16ea3cd3cd04
  
https://github.com/Linaro/odp/commit/65d0fbba8366f68a8fe24426bc0e16ea3cd3cd04
  Author: Matias Elo 
  Date:   2017-08-10 (Thu, 10 Aug 2017)

  Changed paths:
M platform/linux-generic/include/odp_pool_internal.h
M platform/linux-generic/odp_pool.c
M platform/linux-generic/pktio/dpdk.c

  Log Message:
  ---
  linux-gen: dpdk: make sure mbuf memory is allocated from huge pages

DPDK requires that mbuf memory is allocated from huge pages to ensure page
locking. Modify zero-copy dpdk pktio to fall back to packet copy if
transmitted ODP packet is not allocated from huge page memory.

Signed-off-by: Matias Elo 
Signed-off-by: Maxim Uvarov 




[lng-odp] [Bug 3198] example ddf_app link failures with DPDK PMDs

2017-08-10 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=3198

Yi He  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|IN_PROGRESS |RESOLVED

--- Comment #1 from Yi He  ---
Fixed by PR: https://github.com/Linaro/odp/pull/121

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[lng-odp] [Linaro/odp] 7dce7a: example: ddf_app: fix build failure with dpdk PMDs

2017-08-10 Thread GitHub
  Branch: refs/heads/cloud-dev
  Home:   https://github.com/Linaro/odp
  Commit: 7dce7af2c3a936f711e845ffcf765bfb1cc3c95a
  
https://github.com/Linaro/odp/commit/7dce7af2c3a936f711e845ffcf765bfb1cc3c95a
  Author: Bogdan Pricope 
  Date:   2017-08-10 (Thu, 10 Aug 2017)

  Changed paths:
M example/ddf_app/Makefile.am

  Log Message:
  ---
  example: ddf_app: fix build failure with dpdk PMDs

Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=3198 by
changing build flags.

Signed-off-by: Bogdan Pricope 
Reviewed-and-tested-by: Yi He 




[lng-odp] [PATCH CLOUD-DEV v1 0/1] Fix ddf_app example build failure

2017-08-10 Thread Github ODP bot
Signed-off-by: Bogdan Pricope bogdan.pric...@linaro.org

github
/** Email created from pull request 121 (bogdanPricope:ddf_app_cloud_dev_pr)
 ** https://github.com/Linaro/odp/pull/121
 ** Patch: https://github.com/Linaro/odp/pull/121.patch
 ** Base sha: 863d61cc3ed82f9f0725c792910e8a05cc5d5a82
 ** Merge commit sha: c161c9b7fdf9992560b5a8c78c8c9632a9dd3620
 **/
/github

checkpatch.pl
total: 0 errors, 0 warnings, 0 checks, 8 lines checked


to_send-p-000.patch has no obvious style problems and is ready for submission.
/checkpatch.pl


[lng-odp] [PATCH CLOUD-DEV v1 1/1] Fix ddf_app example build failure

2017-08-10 Thread Github ODP bot
From: Bogdan Pricope 

Signed-off-by: Bogdan Pricope 
---
/** Email created from pull request 121 (bogdanPricope:ddf_app_cloud_dev_pr)
 ** https://github.com/Linaro/odp/pull/121
 ** Patch: https://github.com/Linaro/odp/pull/121.patch
 ** Base sha: 863d61cc3ed82f9f0725c792910e8a05cc5d5a82
 ** Merge commit sha: c161c9b7fdf9992560b5a8c78c8c9632a9dd3620
 **/
 example/ddf_app/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/example/ddf_app/Makefile.am b/example/ddf_app/Makefile.am
index e654202a..49f0170f 100644
--- a/example/ddf_app/Makefile.am
+++ b/example/ddf_app/Makefile.am
@@ -1,7 +1,7 @@
 include $(top_srcdir)/example/Makefile.inc
 
 bin_PROGRAMS = odp_ddf_app$(EXEEXT)
-odp_ddf_app_LDFLAGS = $(AM_LDFLAGS) -shared
+odp_ddf_app_LDFLAGS = $(AM_LDFLAGS) -static -Wl,--export-dynamic
 odp_ddf_app_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/example
 
 noinst_HEADERS = \



[lng-odp] [PATCH API-NEXT v5 0/1] API:IPSEC: IPSEC events may be reported synchronously

2017-08-10 Thread Github ODP bot
IPSEC events may be delivered synchronous or ansynchrous
depending on implementation. Application will know based on
return value of odp_ipsec_sa_disable API.
Signed-off-by: Nikhil Agarwal nikhil.agar...@linaro.org

github
/** Email created from pull request 109 (NikhilA-Linaro:disable_event)
 ** https://github.com/Linaro/odp/pull/109
 ** Patch: https://github.com/Linaro/odp/pull/109.patch
 ** Base sha: e420668cd3886f003c8bd6022e210bf08a0ee3b5
 ** Merge commit sha: f65d49b122f2f60a7fc9af3e0a09067dcfd369d9
 **/
/github

checkpatch.pl
WARNING: 'gauranteed' may be misspelled - perhaps 'guaranteed'?
#43: FILE: include/odp/api/spec/ipsec.h:841:
+ * gauranteed to complete synchronously as there is no queue assciated with SA.

total: 0 errors, 1 warnings, 0 checks, 26 lines checked


to_send-p-000.patch has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
/checkpatch.pl


[lng-odp] [PATCH API-NEXT v5 1/1] API:IPSEC: IPSEC events may be reported synchronously.

2017-08-10 Thread Github ODP bot
From: Nikhil Agarwal 

IPSEC events may be delivered synchronous or ansynchrous
depending on implementation. Application will know based on
return value of odp_ipsec_sa_disable API.

Signed-off-by: Nikhil Agarwal 
---
/** Email created from pull request 109 (NikhilA-Linaro:disable_event)
 ** https://github.com/Linaro/odp/pull/109
 ** Patch: https://github.com/Linaro/odp/pull/109.patch
 ** Base sha: e420668cd3886f003c8bd6022e210bf08a0ee3b5
 ** Merge commit sha: f65d49b122f2f60a7fc9af3e0a09067dcfd369d9
 **/
 include/odp/api/spec/ipsec.h | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h
index 7085bc0d..3f02635a 100644
--- a/include/odp/api/spec/ipsec.h
+++ b/include/odp/api/spec/ipsec.h
@@ -831,16 +831,19 @@ odp_ipsec_sa_t odp_ipsec_sa_create(const 
odp_ipsec_sa_param_t *param);
  * before calling disable. Packets in progress during the call may still match
  * the SA and be processed successfully.
  *
- * When in synchronous operation mode, the call will return when it's possible
- * to destroy the SA. In asynchronous mode, the same is indicated by an
- * ODP_EVENT_IPSEC_STATUS event sent to the queue specified for the SA. The
- * status event is guaranteed to be the last event for the SA, i.e. all
- * in-progress operations have completed and resulting events (including status
- * events) have been enqueued before it.
+ * A return value 0 indicates that the disable request has completed
+ * synchronously and the SA is now disabled. A return value 1 indicates that 
the
+ * disable request has been accepted and completion will be indicated by an
+ * ODP_EVENT_IPSEC_STATUS sent to the queue specified for the SA. This event is
+ * guaranteed to be the last event for the SA, i.e., all in-progress operations
+ * have completed and resulting events (including status events) have been
+ * enqueued before it. In synchronous mode of operation, disable requests are
+ * gauranteed to complete synchronously as there is no queue assciated with SA.
  *
  * @param sa  IPSEC SA to be disabled
  *
- * @retval 0  On success
+ * @retval 0  When SA is disabled successfully.
+ * @retval 1  Disable event will be posted on SA queue.
  * @retval <0 On failure
  *
  * @see odp_ipsec_sa_destroy()



[lng-odp] [PATCH CLOUD-DEV v2 2/2] linux-gen: pool: add generic pool module to mempool subsystem

2017-08-10 Thread Github ODP bot
From: Kevin Wang 

Signed-off-by: Kevin Wang 
---
/** Email created from pull request 120 (kevinwangsk:cloud-dev-pool-modular)
 ** https://github.com/Linaro/odp/pull/120
 ** Patch: https://github.com/Linaro/odp/pull/120.patch
 ** Base sha: 863d61cc3ed82f9f0725c792910e8a05cc5d5a82
 ** Merge commit sha: b484e3f4f3b7b1a5cc823b03e970999483c0bf2d
 **/
 platform/linux-generic/Makefile.am |   4 +-
 platform/linux-generic/include/odp_pool_internal.h |  37 +++
 platform/linux-generic/odp_buffer.c| 244 
 .../linux-generic/{odp_pool.c => pool/generic.c}   | 324 +++--
 platform/linux-generic/pool/subsystem.c| 220 ++
 5 files changed, 540 insertions(+), 289 deletions(-)
 rename platform/linux-generic/{odp_pool.c => pool/generic.c} (69%)

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index d74e2e31..cdb868b1 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -268,9 +268,9 @@ __LIB__libodp_linux_la_SOURCES = \
   pktio/sysfs.c \
   pktio/tap.c \
   pktio/ring.c \
+  pool/generic.c \
   pool/subsystem.c \
   odp_pkt_queue.c \
-  odp_pool.c \
   odp_queue.c \
   odp_queue_if.c \
   odp_queue_scalable.c \
@@ -326,6 +326,8 @@ if HAVE_PCAP
 __LIB__libodp_linux_la_SOURCES += pktio/pcap.c
 endif
 
+pool/generic.lo: CFLAGS += -DIM_ACTIVE_MODULE
+
 # Build modular framework into odp-linux library
 modularframeworkdir = $(top_srcdir)/frameworks/modular
 noinst_HEADERS += $(modularframeworkdir)/list.h \
diff --git a/platform/linux-generic/include/odp_pool_internal.h 
b/platform/linux-generic/include/odp_pool_internal.h
index f2d2e2ca..bc7305c4 100644
--- a/platform/linux-generic/include/odp_pool_internal.h
+++ b/platform/linux-generic/include/odp_pool_internal.h
@@ -21,11 +21,14 @@ extern "C" {
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
 #include 
 
+#define CACHE_BURST32
+
 typedef struct pool_cache_t {
uint32_t num;
uint32_t buf_index[CONFIG_POOL_CACHE_SIZE];
@@ -88,6 +91,14 @@ typedef struct pool_table_t {
 
 extern pool_table_t *pool_tbl;
 
+/* Thread local variables */
+typedef struct pool_local_t {
+   pool_cache_t *cache[ODP_CONFIG_POOLS];
+   int thr_id;
+} pool_local_t;
+
+extern __thread pool_local_t local;
+
 static inline pool_t *pool_entry(uint32_t pool_idx)
 {
return _tbl->pool[pool_idx];
@@ -103,6 +114,32 @@ static inline odp_buffer_hdr_t 
*buf_hdl_to_hdr(odp_buffer_t buf)
return (odp_buffer_hdr_t *)(uintptr_t)buf;
 }
 
+static inline odp_pool_t pool_index_to_handle(uint32_t pool_idx)
+{
+   return _odp_cast_scalar(odp_pool_t, pool_idx);
+}
+
+static inline pool_t *pool_from_buf(odp_buffer_t buf)
+{
+   odp_buffer_hdr_t *buf_hdr = buf_hdl_to_hdr(buf);
+
+   return buf_hdr->pool_ptr;
+}
+
+static inline odp_buffer_hdr_t *buf_hdr_from_index(pool_t *pool,
+  uint32_t buffer_idx)
+{
+   uint32_t block_offset;
+   odp_buffer_hdr_t *buf_hdr;
+
+   block_offset = buffer_idx * pool->block_size;
+
+   /* clang requires cast to uintptr_t */
+   buf_hdr = (odp_buffer_hdr_t *)(uintptr_t)>base_addr[block_offset];
+
+   return buf_hdr;
+}
+
 int buffer_alloc_multi(pool_t *pool, odp_buffer_hdr_t *buf_hdr[], int num);
 void buffer_free_multi(odp_buffer_hdr_t *buf_hdr[], int num_free);
 
diff --git a/platform/linux-generic/odp_buffer.c 
b/platform/linux-generic/odp_buffer.c
index 9c7dc1f5..b7ea88e6 100644
--- a/platform/linux-generic/odp_buffer.c
+++ b/platform/linux-generic/odp_buffer.c
@@ -83,3 +83,247 @@ uint64_t odp_buffer_to_u64(odp_buffer_t hdl)
 {
return _odp_pri(hdl);
 }
+
+odp_event_type_t _odp_buffer_event_type(odp_buffer_t buf)
+{
+   return buf_hdl_to_hdr(buf)->event_type;
+}
+
+void _odp_buffer_event_type_set(odp_buffer_t buf, int ev)
+{
+   buf_hdl_to_hdr(buf)->event_type = ev;
+}
+
+odp_event_subtype_t _odp_buffer_event_subtype(odp_buffer_t buf)
+{
+   return buf_hdl_to_hdr(buf)->event_subtype;
+}
+
+void _odp_buffer_event_subtype_set(odp_buffer_t buf, int ev)
+{
+   buf_hdl_to_hdr(buf)->event_subtype = ev;
+}
+
+int buffer_alloc_multi(pool_t *pool, odp_buffer_hdr_t *buf_hdr[], int max_num)
+{
+   ring_t *ring;
+   uint32_t mask, i;
+   pool_cache_t *cache;
+   uint32_t cache_num, num_ch, num_deq, burst;
+   odp_buffer_hdr_t *hdr;
+
+   cache = local.cache[pool->pool_idx];
+
+   cache_num = cache->num;
+   num_ch= max_num;
+   num_deq   = 0;
+   burst = CACHE_BURST;
+
+   if (odp_unlikely(cache_num < (uint32_t)max_num)) {
+   /* Cache does 

[lng-odp] [PATCH CLOUD-DEV v2 1/2] linux-gen: pool: apply modular framework and create subsystem

2017-08-10 Thread Github ODP bot
From: Kevin Wang 

Signed-off-by: Kevin Wang 
---
/** Email created from pull request 120 (kevinwangsk:cloud-dev-pool-modular)
 ** https://github.com/Linaro/odp/pull/120
 ** Patch: https://github.com/Linaro/odp/pull/120.patch
 ** Base sha: 863d61cc3ed82f9f0725c792910e8a05cc5d5a82
 ** Merge commit sha: b484e3f4f3b7b1a5cc823b03e970999483c0bf2d
 **/
 platform/linux-generic/Makefile.am |  2 +
 .../linux-generic/include/odp_pool_subsystem.h | 50 ++
 platform/linux-generic/pool/subsystem.c| 17 
 3 files changed, 69 insertions(+)
 create mode 100644 platform/linux-generic/include/odp_pool_subsystem.h
 create mode 100644 platform/linux-generic/pool/subsystem.c

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 1d703cea..d74e2e31 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -190,6 +190,7 @@ noinst_HEADERS = \
  ${srcdir}/include/odp_packet_tap.h \
  ${srcdir}/include/odp_pkt_queue_internal.h \
  ${srcdir}/include/odp_pool_internal.h \
+ ${srcdir}/include/odp_pool_subsystem.h \
  ${srcdir}/include/odp_posix_extensions.h \
  ${srcdir}/include/odp_queue_internal.h \
  ${srcdir}/include/odp_queue_scalable_internal.h \
@@ -267,6 +268,7 @@ __LIB__libodp_linux_la_SOURCES = \
   pktio/sysfs.c \
   pktio/tap.c \
   pktio/ring.c \
+  pool/subsystem.c \
   odp_pkt_queue.c \
   odp_pool.c \
   odp_queue.c \
diff --git a/platform/linux-generic/include/odp_pool_subsystem.h 
b/platform/linux-generic/include/odp_pool_subsystem.h
new file mode 100644
index ..45537a86
--- /dev/null
+++ b/platform/linux-generic/include/odp_pool_subsystem.h
@@ -0,0 +1,50 @@
+/* Copyright (c) 2017, ARM Limited. All rights reserved.
+ *
+ * Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef ODP_POOL_SUBSYSTEM_H_
+#define ODP_POOL_SUBSYSTEM_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+#include 
+
+/* ODP pool public APIs subsystem */
+ODP_SUBSYSTEM_DECLARE(pool);
+
+/* Subsystem APIs declarations */
+ODP_SUBSYSTEM_API(pool, int, capability, odp_pool_capability_t *capa);
+ODP_SUBSYSTEM_API(pool, odp_pool_t, create, const char *name,
+ odp_pool_param_t *params);
+ODP_SUBSYSTEM_API(pool, int, destroy, odp_pool_t pool);
+ODP_SUBSYSTEM_API(pool, odp_pool_t, lookup, const char *name);
+ODP_SUBSYSTEM_API(pool, int, info, odp_pool_t pool, odp_pool_info_t *info);
+ODP_SUBSYSTEM_API(pool, void, print, odp_pool_t pool);
+ODP_SUBSYSTEM_API(pool, uint64_t, to_u64, odp_pool_t pool);
+ODP_SUBSYSTEM_API(pool, void, param_init, odp_pool_param_t *params);
+
+typedef ODP_MODULE_CLASS(pool) {
+   odp_module_base_t base;
+
+   odp_api_proto(pool, capability) capability;
+   odp_api_proto(pool, create) create;
+   odp_api_proto(pool, destroy) destroy;
+   odp_api_proto(pool, lookup) lookup;
+   odp_api_proto(pool, info) info;
+   odp_api_proto(pool, print) print;
+   odp_api_proto(pool, to_u64) to_u64;
+   odp_api_proto(pool, param_init) param_init;
+} pool_module_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/pool/subsystem.c 
b/platform/linux-generic/pool/subsystem.c
new file mode 100644
index ..2750149c
--- /dev/null
+++ b/platform/linux-generic/pool/subsystem.c
@@ -0,0 +1,17 @@
+/* Copyright (c) 2017, ARM Limited. All rights reserved.
+ *
+ * Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+#include 
+
+#define SUBSYSTEM_VERSION 0x0001UL
+ODP_SUBSYSTEM_DEFINE(pool, "memory pool public APIs", SUBSYSTEM_VERSION);
+
+ODP_SUBSYSTEM_CONSTRUCTOR(pool)
+{
+   odp_subsystem_constructor(pool);
+}
+



[lng-odp] [PATCH CLOUD-DEV v2 0/2] Move pool to modular framework

2017-08-10 Thread Github ODP bot
Separate with two commits.
First one is to add the pool subsystem in modular framework.
Second one is to add the generic pool implementation to the pool subsystem.

github
/** Email created from pull request 120 (kevinwangsk:cloud-dev-pool-modular)
 ** https://github.com/Linaro/odp/pull/120
 ** Patch: https://github.com/Linaro/odp/pull/120.patch
 ** Base sha: 863d61cc3ed82f9f0725c792910e8a05cc5d5a82
 ** Merge commit sha: b484e3f4f3b7b1a5cc823b03e970999483c0bf2d
 **/
/github

checkpatch.pl
total: 0 errors, 0 warnings, 0 checks, 81 lines checked


to_send-p-000.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 958 lines checked


to_send-p-001.patch has no obvious style problems and is ready for submission.
/checkpatch.pl