Hi,

I am not sure whether we need this call for alloc multiple packets at once.
The reason being in a high speed data plane system the packets which
are allocated and not processed will result in holding up of pool
space which will result in dropping of the incoming packets if the
pool space is depleted.

So it will always be advisable to allocated the packets as soon as the
core is ready to process them rather than allocating an array of
packets in a single call and then processing them in a serial manner.
Maybe it would be better if you can define the use-case and advantages
of allocating the packets in a single API and then we can decide if
this API is needed.

Regards,
Bala

On 29 September 2015 at 22:34, Nicolas Morey-Chaisemartin
<nmo...@kalray.eu> wrote:
>
>
> On 09/29/2015 04:34 PM, Bill Fischofer wrote:
>
>
>
> On Tue, Sep 29, 2015 at 9:15 AM, Nicolas Morey-Chaisemartin
> <nmo...@kalray.eu> wrote:
>>
>> Signed-off-by: Nicolas Morey-Chaisemartin <nmo...@kalray.eu>
>> ---
>>  include/odp/api/packet.h | 28 ++++++++++++++++++++++++++++
>>  1 file changed, 28 insertions(+)
>>
>> diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h
>> index 5d46b7b..c220329 100644
>> --- a/include/odp/api/packet.h
>> +++ b/include/odp/api/packet.h
>> @@ -77,6 +77,23 @@ extern "C" {
>>  odp_packet_t odp_packet_alloc(odp_pool_t pool, uint32_t len);
>>
>>  /**
>> + * Allocate packets from a buffer pool
>> + *
>> + * @see odp_packet_alloc
>> + *
>> + * @param pool          Pool handle
>> + * @param len           Packet data length
>> + * @param pkt           Array of packet handles for output
>> + * @param num           Maximum number of packet to allocate
>> + *
>> + * @return Number of packet actually allocated (0 ... num)
>> + * @retval <0 on failure
>> + *
>> + */
>> +int odp_packet_alloc_multi(odp_pool_t pool, uint32_t len,
>> +                          odp_packet_t pkt[], int num);
>
>
>
> 3rd parameter is an output array, so should be *odp_packet_t pkt[]
> Should 2nd parameter also be an array or is it sufficient to restrict this
> to allocating all pkts of the same length?
>
>
> I am not sure there is a way to efficiently alloc multiple packets with
> different sizes at once. And making sure all len are the same will reduce
> the benefits of having a simple multi alloc.
> If someone has a use case where a multiple len multi alloc is useful, we can
> either tweak this call or add another one.
>
> Nicolas
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to