Signed-off-by: Nicolas Morey-Chaisemartin <[email protected]>
Reviewed-by: Petri Savolainen <[email protected]>
---
 include/odp/api/packet.h | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h
index 5d46b7b..85cc9c9 100644
--- a/include/odp/api/packet.h
+++ b/include/odp/api/packet.h
@@ -77,6 +77,24 @@ extern "C" {
 odp_packet_t odp_packet_alloc(odp_pool_t pool, uint32_t len);
 
 /**
+ * Allocate multiple packets from a buffer pool
+ *
+ * Otherwise like odp_packet_alloc(), but allocates multiple
+ * packets from a pool.
+ *
+ * @param pool          Pool handle
+ * @param len           Packet data length
+ * @param[out] pkt      Array of packet handles for output
+ * @param num           Maximum number of packets to allocate
+ *
+ * @return Number of packets 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);
+
+/**
  * Free packet
  *
  * Frees the packet into the buffer pool it was allocated from.
@@ -86,6 +104,17 @@ odp_packet_t odp_packet_alloc(odp_pool_t pool, uint32_t 
len);
 void odp_packet_free(odp_packet_t pkt);
 
 /**
+ * Free multiple packets
+ *
+ * Otherwise like odp_packet_free(), but frees multiple packets
+ * to their originating pools.
+ *
+ * @param pkt           Array of packet handles
+ * @param num           Number of packet handles to free
+ */
+void odp_packet_free_multi(const odp_packet_t pkt[], int num);
+
+/**
  * Reset packet
  *
  * Resets all packet metadata to their default values. Packet length is used
-- 
2.6.1.3.g8d02103


_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to