The classification code accesses this variable directly, which prevents reusing that code e.g. in ODP-DPDK.
Signed-off-by: Zoltan Kiss <[email protected]> --- v2: rename it packet_len(), to align with packet_set_len() platform/linux-generic/include/odp_classification_inlines.h | 5 +++-- platform/linux-generic/include/odp_packet_internal.h | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/linux-generic/include/odp_classification_inlines.h b/platform/linux-generic/include/odp_classification_inlines.h index e9739aa..5f0b564 100644 --- a/platform/linux-generic/include/odp_classification_inlines.h +++ b/platform/linux-generic/include/odp_classification_inlines.h @@ -24,6 +24,7 @@ extern "C" { #include <odp/helper/ipsec.h> #include <odp/helper/udp.h> #include <odp/helper/tcp.h> +#include <odp_packet_internal.h> /* PMR term value verification function These functions verify the given PMR term value with the value in the packet @@ -33,7 +34,7 @@ These following functions return 1 on success and 0 on failure static inline int verify_pmr_packet_len(odp_packet_hdr_t *pkt_hdr, pmr_term_value_t *term_value) { - if (term_value->val == (pkt_hdr->frame_len & + if (term_value->val == (packet_len(pkt_hdr) & term_value->mask)) return 1; @@ -240,7 +241,7 @@ static inline int verify_pmr_custom_frame(const uint8_t *pkt_addr, ODP_ASSERT(val_sz <= ODP_PMR_TERM_BYTES_MAX); - if (pkt_hdr->frame_len <= offset + val_sz) + if (packet_len(pkt_hdr) <= offset + val_sz) return 0; memcpy(&val, pkt_addr + offset, val_sz); diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h index 12e9cca..5078cc2 100644 --- a/platform/linux-generic/include/odp_packet_internal.h +++ b/platform/linux-generic/include/odp_packet_internal.h @@ -214,6 +214,11 @@ static inline void pull_tail(odp_packet_hdr_t *pkt_hdr, size_t len) pkt_hdr->frame_len -= len; } +static inline uint32_t packet_len(odp_packet_hdr_t* pkt_hdr) +{ + return pkt_hdr->frame_len; +} + static inline void packet_set_len(odp_packet_t pkt, uint32_t len) { odp_packet_hdr(pkt)->frame_len = len; -- 1.9.1 _______________________________________________ lng-odp mailing list [email protected] https://lists.linaro.org/mailman/listinfo/lng-odp
