From 4ed64972ef6e08588592930b32e8a11da45297f5 Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Thu, 22 Feb 2018 14:53:29 +0200 Subject: api: packet: add combined packet data and seg len Packet data pointer and segment length used often. Combine two calls into one call. One call performs better in ABI compatible mode than two calls. Signed-off-by: Petri Savolainen Reviewed-by: Dmitry Eremin-Solenikov Reviewed-by: Bill Fischofer Reviewed-by: Balasubramanian Manoharan Signed-off-by: Maxim Uvarov --- include/odp/api/spec/packet.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 746f6fbf7..e1f2f2218 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -439,6 +439,22 @@ void *odp_packet_data(odp_packet_t pkt); */ uint32_t odp_packet_seg_len(odp_packet_t pkt); +/** + * Packet data pointer with segment length + * + * Returns both data pointer and number of data bytes (in the segment) + * following it. This is equivalent to calling odp_packet_data() and + * odp_packet_seg_len(). + * + * @param pkt Packet handle + * @param[out] seg_len Pointer to output segment length + * + * @return Pointer to the packet data + * + * @see odp_packet_data(), odp_packet_seg_len() + */ +void *odp_packet_data_seg_len(odp_packet_t pkt, uint32_t *seg_len); + /** * Packet data length * -- cgit v1.2.3