diff options
author | Matias Elo <matias.elo@nokia.com> | 2022-06-06 14:15:53 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2022-06-20 16:13:54 +0300 |
commit | ead42ed2ad0115084a2a48400c8a47be289c0f2c (patch) | |
tree | 6623765e4c7944f314f6cc381931fb589ef9ed69 /platform/linux-dpdk/include/odp_packet_internal.h | |
parent | 7b8debc5093683d2bfde0c226e793e11276540ce (diff) |
Port 75260118d "linux-gen: packet: add missing subtype metadata to _odp_packet_copy_md()"
Port original commit from linux-generic.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Diffstat (limited to 'platform/linux-dpdk/include/odp_packet_internal.h')
-rw-r--r-- | platform/linux-dpdk/include/odp_packet_internal.h | 17 |
1 files changed, 16 insertions, 1 deletions
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 <odp/api/align.h> #include <odp/api/debug.h> +#include <odp/api/hints.h> #include <odp/api/ipsec.h> #include <odp/api/packet.h> -#include <odp/api/plat/packet_inline_types.h> #include <odp/api/packet_io.h> #include <odp/api/crypto.h> #include <odp/api/comp.h> #include <odp/api/std.h> +#include <odp/api/plat/packet_inline_types.h> + #include <odp_config_internal.h> #include <odp_debug_internal.h> #include <odp_event_internal.h> #include <odp_pool_internal.h> #include <protocols/eth.h> +#include <stdint.h> #include <string.h> #include <rte_config.h> @@ -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, |