diff mbox series

[API-NEXT,v1,5/12] linux-gen: packet: multi converts and single pool free

Message ID 1512140407-13534-6-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, 3 p.m. UTC
From: Petri Savolainen <petri.savolainen@linaro.org>


Simple implement of the new multi convert and single pool
free functions.

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
 **/
 platform/linux-generic/odp_packet.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c
index bdcb482fa..cdcb62d21 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -912,6 +912,11 @@  void odp_packet_free_multi(const odp_packet_t pkt[], int num)
 		packet_free_multi(buf_hdr, num - num_freed);
 }
 
+void odp_packet_free_sp(const odp_packet_t pkt[], int num)
+{
+	odp_packet_free_multi(pkt, num);
+}
+
 int odp_packet_reset(odp_packet_t pkt, uint32_t len)
 {
 	odp_packet_hdr_t *const pkt_hdr = packet_hdr(pkt);
@@ -944,6 +949,24 @@  odp_event_t odp_packet_to_event(odp_packet_t pkt)
 	return (odp_event_t)buffer_handle(packet_hdr(pkt));
 }
 
+void odp_packet_from_event_multi(odp_packet_t pkt[], const odp_event_t ev[],
+				 int num)
+{
+	int i;
+
+	for (i = 0; i < num; i++)
+		pkt[i] = odp_packet_from_event(ev[i]);
+}
+
+void odp_packet_to_event_multi(const odp_packet_t pkt[], odp_event_t ev[],
+			       int num)
+{
+	int i;
+
+	for (i = 0; i < num; i++)
+		ev[i] = odp_packet_to_event(pkt[i]);
+}
+
 /*
  *
  * Pointers and lengths