diff options
4 files changed, 9 insertions, 5 deletions
diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h b/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h index d1cad9f9e..bcfe81ac6 100644 --- a/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h +++ b/platform/linux-dpdk/include/odp/api/plat/packet_inline_types.h @@ -37,6 +37,7 @@ typedef struct _odp_packet_inline_offset_t { uint16_t timestamp; uint16_t input_flags; uint16_t flags; + uint16_t subtype; uint16_t buf_addr; uint16_t data; uint16_t pkt_len; diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h b/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h index b8116c14f..6913068d2 100644 --- a/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h +++ b/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h @@ -23,6 +23,7 @@ extern "C" { #include <odp/api/hints.h> #include <odp/api/time.h> #include <odp/api/abi/buffer.h> +#include <odp/api/abi/event.h> #include <odp/api/plat/packet_inline_types.h> #include <odp/api/plat/pool_inline_types.h> @@ -76,6 +77,7 @@ extern "C" { #define odp_packet_to_event __odp_packet_to_event #define odp_packet_from_event_multi __odp_packet_from_event_multi #define odp_packet_to_event_multi __odp_packet_to_event_multi + #define odp_packet_subtype __odp_packet_subtype #else #undef _ODP_INLINE #define _ODP_INLINE @@ -403,6 +405,11 @@ _ODP_INLINE void odp_packet_to_event_multi(const odp_packet_t pkt[], ev[i] = odp_packet_to_event(pkt[i]); } +_ODP_INLINE odp_event_subtype_t odp_packet_subtype(odp_packet_t pkt) +{ + return (odp_event_subtype_t)_odp_pkt_get(pkt, int8_t, subtype); +} + #ifdef __cplusplus } #endif diff --git a/platform/linux-dpdk/include/odp_packet_internal.h b/platform/linux-dpdk/include/odp_packet_internal.h index e9e867b6c..010723cbd 100644 --- a/platform/linux-dpdk/include/odp_packet_internal.h +++ b/platform/linux-dpdk/include/odp_packet_internal.h @@ -161,11 +161,6 @@ static inline odp_packet_t packet_from_buf_hdr(odp_buffer_hdr_t *buf_hdr) return (odp_packet_t)(odp_packet_hdr_t *)buf_hdr; } -static inline odp_event_subtype_t packet_subtype(odp_packet_t pkt) -{ - return packet_hdr(pkt)->subtype; -} - static inline void packet_subtype_set(odp_packet_t pkt, int ev) { packet_hdr(pkt)->subtype = ev; diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_packet.c index be01c4e8d..a727bd61e 100644 --- a/platform/linux-dpdk/odp_packet.c +++ b/platform/linux-dpdk/odp_packet.c @@ -45,6 +45,7 @@ const _odp_packet_inline_offset_t ODP_ALIGNED_CACHE _odp_packet_inline = { .timestamp = offsetof(odp_packet_hdr_t, timestamp), .input_flags = offsetof(odp_packet_hdr_t, p.input_flags), .flags = offsetof(odp_packet_hdr_t, p.flags), + .subtype = offsetof(odp_packet_hdr_t, subtype), .buf_addr = offsetof(odp_packet_hdr_t, buf_hdr.mb.buf_addr), .data = offsetof(odp_packet_hdr_t, buf_hdr.mb.data_off), .pkt_len = offsetof(odp_packet_hdr_t, buf_hdr.mb.pkt_len), |