diff options
Diffstat (limited to 'platform/linux-generic/include/odp_parse_internal.h')
-rw-r--r-- | platform/linux-generic/include/odp_parse_internal.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/platform/linux-generic/include/odp_parse_internal.h b/platform/linux-generic/include/odp_parse_internal.h index 22d8c2cf6..c467abbcd 100644 --- a/platform/linux-generic/include/odp_parse_internal.h +++ b/platform/linux-generic/include/odp_parse_internal.h @@ -64,7 +64,6 @@ int _odp_packet_parse_common_l3_l4(packet_parser_t *prs, const uint8_t *parseptr, uint32_t offset, uint32_t frame_len, uint32_t seg_len, int layer, uint16_t ethtype, - odp_proto_chksums_t chksums, uint64_t *l4_part_sum, odp_pktin_config_opt_t opt); @@ -77,17 +76,18 @@ int _odp_packet_parse_common_l3_l4(packet_parser_t *prs, * Returns 0 on success, 1 on packet errors, and -1 if the packet should be * dropped. */ -static inline int _odp_packet_parse_common(packet_parser_t *prs, +static inline int _odp_packet_parse_common(odp_packet_hdr_t *pkt_hdr, const uint8_t *ptr, uint32_t frame_len, uint32_t seg_len, int layer, - odp_proto_chksums_t chksums, - uint64_t *l4_part_sum, odp_pktin_config_opt_t opt) { + int r; uint32_t offset; uint16_t ethtype; const uint8_t *parseptr; + packet_parser_t *prs = &pkt_hdr->p; + uint64_t l4_part_sum = 0; parseptr = ptr; offset = 0; @@ -100,9 +100,14 @@ static inline int _odp_packet_parse_common(packet_parser_t *prs, ethtype = _odp_parse_eth(prs, &parseptr, &offset, frame_len); - return _odp_packet_parse_common_l3_l4(prs, parseptr, offset, frame_len, - seg_len, layer, ethtype, chksums, - l4_part_sum, opt); + r = _odp_packet_parse_common_l3_l4(prs, parseptr, offset, frame_len, + seg_len, layer, ethtype, + &l4_part_sum, opt); + + if (!r && layer >= ODP_PROTO_LAYER_L4) + r = _odp_packet_l4_chksum(pkt_hdr, opt, l4_part_sum); + + return r; } #ifdef __cplusplus |