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? > + > +/** > * Free packet > * > * Frees the packet into the buffer pool it was allocated from. > @@ -86,6 +103,17 @@ odp_packet_t odp_packet_alloc(odp_pool_t pool, > uint32_t len); > void odp_packet_free(odp_packet_t pkt); > > /** > + * Free packets > + * > + * Frees the packets into the buffer pools they were allocated from. > + * Packets may have been allocated from different pools. > + * > + * @param pkt Packet handles > + * @param len Number of packet handles to free > + */ > +void odp_packet_free_multi(const odp_packet_t pkt[], int num); > Not clear why this needs to be const since the singleton free doesn't use this convention > + > +/** > * Reset packet > * > * Resets all packet metadata to their default values. Packet length is > used > -- > 2.5.0.3.gba4f141 > > > _______________________________________________ > 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