diff mbox

[RFC,API-NEXT,2/2] api: packet: add odp_packet_parse() api

Message ID 1473244319-11501-2-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer Sept. 7, 2016, 10:31 a.m. UTC
The odp_packet_parse() call forces an inline reparse of a packet without
reclassifying it.

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

---
 include/odp/api/spec/packet.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

-- 
2.5.0
diff mbox

Patch

diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h
index 4a14f2d..2ff763c 100644
--- a/include/odp/api/spec/packet.h
+++ b/include/odp/api/spec/packet.h
@@ -155,6 +155,22 @@  void odp_packet_free_multi(const odp_packet_t pkt[], int num);
 int odp_packet_reset(odp_packet_t pkt, uint32_t len);
 
 /**
+ * Parse a packet
+ *
+ * Performs a complete parse of an ODP packet to repopulate parser
+ * metadata associated with the packet. This can be used to perform
+ * inline re-classification of a packet after, for example, decaspulation.
+ * Any previous parser metadata is discarded and overwritten by this call.
+ *
+ * @param pkt   Packet to (re)parse
+ *
+ * @return Parse results
+ * @retval 0  Parse successful
+ * @retval <0 Parse unsuccessful (packet format not recognized)
+ */
+int odp_packet_parse(odp_packet_t pkt);
+
+/**
  * Get packet handle from event
  *
  * Converts an ODP_EVENT_PACKET type event to a packet.