diff options
Diffstat (limited to 'platform/linux-dpdk/include/odp_buffer_internal.h')
-rw-r--r-- | platform/linux-dpdk/include/odp_buffer_internal.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/platform/linux-dpdk/include/odp_buffer_internal.h b/platform/linux-dpdk/include/odp_buffer_internal.h index f96a80e99..5af9b527e 100644 --- a/platform/linux-dpdk/include/odp_buffer_internal.h +++ b/platform/linux-dpdk/include/odp_buffer_internal.h @@ -96,6 +96,31 @@ static inline odp_buffer_hdr_t *mbuf_to_buf_hdr(struct rte_mbuf *mbuf) return (odp_buffer_hdr_t *)(uintptr_t)mbuf; } +static inline odp_buffer_t buf_from_buf_hdr(odp_buffer_hdr_t *hdr) +{ + return (odp_buffer_t)hdr; +} + +static inline odp_buffer_hdr_t *buf_hdl_to_hdr(odp_buffer_t buf) +{ + return (odp_buffer_hdr_t *)(uintptr_t)buf; +} + +static inline odp_event_type_t _odp_buffer_event_type(odp_buffer_t buf) +{ + return buf_hdl_to_hdr(buf)->event_type; +} + +static inline void _odp_buffer_event_type_set(odp_buffer_t buf, int ev) +{ + buf_hdl_to_hdr(buf)->event_type = ev; +} + +static inline odp_event_t event_from_buf_hdr(odp_buffer_hdr_t *hdr) +{ + return (odp_event_t)hdr; +} + #ifdef __cplusplus } #endif |