From ead42ed2ad0115084a2a48400c8a47be289c0f2c Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Mon, 6 Jun 2022 14:15:53 +0300 Subject: Port 75260118d "linux-gen: packet: add missing subtype metadata to _odp_packet_copy_md()" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port original commit from linux-generic. Signed-off-by: Matias Elo Reviewed-by: Jere Leppänen --- platform/linux-dpdk/include/odp_packet_internal.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'platform/linux-dpdk/include/odp_packet_internal.h') diff --git a/platform/linux-dpdk/include/odp_packet_internal.h b/platform/linux-dpdk/include/odp_packet_internal.h index 546b2bf29..02d7ff7b0 100644 --- a/platform/linux-dpdk/include/odp_packet_internal.h +++ b/platform/linux-dpdk/include/odp_packet_internal.h @@ -20,20 +20,23 @@ extern "C" { #include #include +#include #include #include -#include #include #include #include #include +#include + #include #include #include #include #include +#include #include #include @@ -269,7 +272,10 @@ static inline void _odp_packet_copy_md(odp_packet_hdr_t *dst_hdr, odp_packet_hdr_t *src_hdr, odp_bool_t uarea_copy) { + const int8_t subtype = src_hdr->subtype; + dst_hdr->input = src_hdr->input; + dst_hdr->subtype = subtype; dst_hdr->dst_queue = src_hdr->dst_queue; dst_hdr->cos = src_hdr->cos; dst_hdr->cls_mark = src_hdr->cls_mark; @@ -319,6 +325,15 @@ static inline void _odp_packet_copy_md(odp_packet_hdr_t *dst_hdr, dst_hdr->uarea_addr = src_uarea; } } + + if (odp_unlikely(subtype != ODP_EVENT_PACKET_BASIC)) { + if (subtype == ODP_EVENT_PACKET_IPSEC) + dst_hdr->ipsec_ctx = src_hdr->ipsec_ctx; + else if (subtype == ODP_EVENT_PACKET_CRYPTO) + dst_hdr->crypto_op_result = src_hdr->crypto_op_result; + else if (subtype == ODP_EVENT_PACKET_COMP) + dst_hdr->comp_op_result = src_hdr->comp_op_result; + } } static inline void _odp_packet_copy_cls_md(odp_packet_hdr_t *dst_hdr, -- cgit v1.2.3