diff mbox series

[API-NEXT,v1,4/12] api: packet: multi converts and single pool free

Message ID 1512140407-13534-5-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v1,1/12] api: event: add free multiple | expand

Commit Message

Github ODP bot Dec. 1, 2017, 2:59 p.m. UTC
From: Petri Savolainen <petri.savolainen@linaro.org>


Added multi versions for better throughput. Convert multiple
packets/events with a single call. Free multiple packets into
the same originating pool.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>

---
/** Email created from pull request 318 (psavol:next-multi-apis)
 ** https://github.com/Linaro/odp/pull/318
 ** Patch: https://github.com/Linaro/odp/pull/318.patch
 ** Base sha: bdb7cbf620ada8682c89b5ae5a97cb84f16c0ed0
 ** Merge commit sha: aee2bcc574d2a8efdfcecc3b8e681ce391119798
 **/
 include/odp/api/spec/packet.h | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
diff mbox series

Patch

diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h
index b897c9d3c..619098868 100644
--- a/include/odp/api/spec/packet.h
+++ b/include/odp/api/spec/packet.h
@@ -204,6 +204,17 @@  void odp_packet_free(odp_packet_t pkt);
  */
 void odp_packet_free_multi(const odp_packet_t pkt[], int num);
 
+/**
+ * Free multiple packets to the same pool
+ *
+ * Otherwise like odp_packet_free_multi(), but all packets must be from the
+ * same originating pool.
+ *
+ * @param pkt           Array of packet handles
+ * @param num           Number of packets to free
+ */
+void odp_packet_free_sp(const odp_packet_t pkt[], int num);
+
 /**
  * Reset packet
  *
@@ -235,6 +246,18 @@  int odp_packet_reset(odp_packet_t pkt, uint32_t len);
  */
 odp_packet_t odp_packet_from_event(odp_event_t ev);
 
+/**
+ * Convert multiple packet events to packet handles
+ *
+ * All events must be of type ODP_EVENT_PACKET.
+ *
+ * @param[out] pkt  Packet handle array for output
+ * @param      ev   Array of event handles to convert
+ * @param      num  Number of packets and events
+ */
+void odp_packet_from_event_multi(odp_packet_t pkt[], const odp_event_t ev[],
+				 int num);
+
 /**
  * Convert packet handle to event
  *
@@ -244,6 +267,16 @@  odp_packet_t odp_packet_from_event(odp_event_t ev);
  */
 odp_event_t odp_packet_to_event(odp_packet_t pkt);
 
+/**
+ * Convert multiple packet handles to events
+ *
+ * @param      pkt  Array of packet handles to convert
+ * @param[out] ev   Event handle array for output
+ * @param      num  Number of packets and events
+ */
+void odp_packet_to_event_multi(const odp_packet_t pkt[], odp_event_t ev[],
+			       int num);
+
 /*
  *
  * Pointers and lengths