diff mbox series

[API-NEXT,v1,3/4] linux-gen: packet: implement packet_data_seg_len

Message ID 1519308009-12837-4-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v1,1/4] api: packet: improve segmented packet documentation | expand

Commit Message

Github ODP bot Feb. 22, 2018, 2 p.m. UTC
From: Petri Savolainen <petri.savolainen@linaro.org>


Implement the new combined packet data and seg_len function.

Signed-off-by: Petri Savolainen <petri.savolainen@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 mbox series

Patch

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);