From: Petri Savolainen <petri.savolai...@linaro.org>

Implement the new combined packet data and seg_len function.

Signed-off-by: Petri Savolainen <petri.savolai...@linaro.org>
---
/** Email created from pull request 497 (psavol:next-packet-data-doc)
 ** https://github.com/Linaro/odp/pull/497
 ** Patch: https://github.com/Linaro/odp/pull/497.patch
 ** Base sha: ea2afab619ae74108a03798bc358fdfcd29fdd88
 ** Merge commit sha: d1c9a3d36dfe9e38ecfe7d4a52bebe13d0c01098
 **/
 platform/linux-generic/include/odp/api/plat/packet_inlines.h     | 7 +++++++
 platform/linux-generic/include/odp/api/plat/packet_inlines_api.h | 5 +++++
 2 files changed, 12 insertions(+)

diff --git a/platform/linux-generic/include/odp/api/plat/packet_inlines.h 
b/platform/linux-generic/include/odp/api/plat/packet_inlines.h
index b6b493363..ae90ec5bf 100644
--- a/platform/linux-generic/include/odp/api/plat/packet_inlines.h
+++ b/platform/linux-generic/include/odp/api/plat/packet_inlines.h
@@ -63,6 +63,13 @@ static inline uint32_t _odp_packet_seg_len(odp_packet_t pkt)
        return _odp_pkt_get(pkt, uint32_t, seg_len);
 }
 
+static inline void *_odp_packet_data_seg_len(odp_packet_t pkt,
+                                            uint32_t *seg_len)
+{
+       *seg_len = _odp_packet_seg_len(pkt);
+       return _odp_packet_data(pkt);
+}
+
 static inline uint32_t _odp_packet_len(odp_packet_t pkt)
 {
        return _odp_pkt_get(pkt, uint32_t, frame_len);
diff --git a/platform/linux-generic/include/odp/api/plat/packet_inlines_api.h 
b/platform/linux-generic/include/odp/api/plat/packet_inlines_api.h
index d0f3adc12..76210e005 100644
--- a/platform/linux-generic/include/odp/api/plat/packet_inlines_api.h
+++ b/platform/linux-generic/include/odp/api/plat/packet_inlines_api.h
@@ -23,6 +23,11 @@ _ODP_INLINE uint32_t odp_packet_seg_len(odp_packet_t pkt)
        return _odp_packet_seg_len(pkt);
 }
 
+_ODP_INLINE void *odp_packet_data_seg_len(odp_packet_t pkt, uint32_t *seg_len)
+{
+       return _odp_packet_data_seg_len(pkt, seg_len);
+}
+
 _ODP_INLINE uint32_t odp_packet_len(odp_packet_t pkt)
 {
        return _odp_packet_len(pkt);

Reply via email to