diff options
author | Matias Elo <matias.elo@nokia.com> | 2020-10-19 09:51:26 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2020-10-30 13:04:16 +0200 |
commit | a764f9a1e47d93ca1296e0c444f5747aaba114f7 (patch) | |
tree | 60118ef2d8522e16339ea5c25e664d896f3c551a /platform/linux-dpdk/include/odp_packet_internal.h | |
parent | 47906491e30611b9700657349bfe4a843591e956 (diff) |
Port 5c3b590dc "linux-gen: packet: add cls mark metadata"
Add classifier mark into packet metadata. odp_packet_hdr_t has been
reorganized to make room for cls_mark.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Diffstat (limited to 'platform/linux-dpdk/include/odp_packet_internal.h')
-rw-r--r-- | platform/linux-dpdk/include/odp_packet_internal.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/platform/linux-dpdk/include/odp_packet_internal.h b/platform/linux-dpdk/include/odp_packet_internal.h index b7edb8a23..fb5b88ace 100644 --- a/platform/linux-dpdk/include/odp_packet_internal.h +++ b/platform/linux-dpdk/include/odp_packet_internal.h @@ -101,27 +101,22 @@ typedef struct { /* common buffer header */ odp_buffer_hdr_t buf_hdr; - /* - * Following members are initialized by packet_init() - */ - packet_parser_t p; odp_pktio_t input; - /* Event subtype */ - int8_t subtype; - - /* - * Members below are not initialized by packet_init() - */ - /* Timestamp value */ odp_time_t timestamp; /* Classifier destination queue */ odp_queue_t dst_queue; + /* Classifier mark */ + uint16_t cls_mark; + + /* Event subtype */ + int8_t subtype; + union { struct { /* Result for crypto packet op */ @@ -182,8 +177,9 @@ static inline void packet_subtype_set(odp_packet_t pkt, int ev) */ static inline void packet_init(odp_packet_hdr_t *pkt_hdr, odp_pktio_t input) { - pkt_hdr->p.input_flags.all = 0; - pkt_hdr->p.flags.all_flags = 0; + /* Clear all flags. Resets also return value of cls_mark, user_ptr, etc. */ + pkt_hdr->p.input_flags.all = 0; + pkt_hdr->p.flags.all_flags = 0; pkt_hdr->p.l2_offset = 0; pkt_hdr->p.l3_offset = ODP_PACKET_OFFSET_INVALID; @@ -207,6 +203,7 @@ static inline void copy_packet_cls_metadata(odp_packet_hdr_t *src_hdr, dst_hdr->p = src_hdr->p; dst_hdr->dst_queue = src_hdr->dst_queue; dst_hdr->timestamp = src_hdr->timestamp; + dst_hdr->cls_mark = src_hdr->cls_mark; } static inline uint32_t packet_len(odp_packet_hdr_t *pkt_hdr) |