From: Petri Savolainen <[email protected]>

For improved cache hit rate, prefetch may be used to prefetch packet
data before accessing it the first time. Largest benefit may be expected
for the data that is deep in the packet. Typically, packet head and
metadata are automatically prefetched anyway.

Signed-off-by: Petri Savolainen <[email protected]>
Signed-off-by: Bill Fischofer <[email protected]>
---
 include/odp/api/spec/packet.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h
index 6e2302c..0dddf17 100644
--- a/include/odp/api/spec/packet.h
+++ b/include/odp/api/spec/packet.h
@@ -314,6 +314,18 @@ void *odp_packet_offset(odp_packet_t pkt, uint32_t offset, 
uint32_t *len,
                        odp_packet_seg_t *seg);
 
 /**
+ * Packet data prefetch
+ *
+ * Prefetch 'len' bytes of packet data starting from 'offset' into various
+ * caches close to the calling thread.
+ *
+ * @param      pkt      Packet handle
+ * @param      offset   Byte offset into packet data
+ * @param      len      Number of bytes to prefetch starting from 'offset'
+ */
+void odp_packet_prefetch(odp_packet_t pkt, uint32_t offset, uint32_t len);
+
+/**
  * Push out packet head
  *
  * Increase packet data length by moving packet head into packet headroom.
-- 
2.5.0

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

Reply via email to