From: Matias Elo <matias....@nokia.com> Signed-off-by: Matias Elo <matias....@nokia.com> --- /** Email created from pull request 667 (matiaselo:dev/abi_clean_invalid) ** https://github.com/Linaro/odp/pull/667 ** Patch: https://github.com/Linaro/odp/pull/667.patch ** Base sha: 7c87b66edc84e8c713fefc68d46464660adaf71e ** Merge commit sha: 0c5d0fdd232cad0a55d68e819ff9f707fea014f5 **/ include/odp/api/abi-default/packet.h | 2 +- platform/linux-generic/include/odp/api/plat/packet_inlines.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/odp/api/abi-default/packet.h b/include/odp/api/abi-default/packet.h index 97c0d0883..b5380b04c 100644 --- a/include/odp/api/abi-default/packet.h +++ b/include/odp/api/abi-default/packet.h @@ -27,7 +27,7 @@ typedef _odp_abi_packet_t *odp_packet_t; typedef _odp_abi_packet_seg_t *odp_packet_seg_t; #define ODP_PACKET_INVALID ((odp_packet_t)0) -#define ODP_PACKET_SEG_INVALID ((odp_packet_seg_t)0xffffffff) +#define ODP_PACKET_SEG_INVALID ((odp_packet_seg_t)0) #define ODP_PACKET_OFFSET_INVALID 0xffff typedef uint8_t odp_proto_l2_type_t; diff --git a/platform/linux-generic/include/odp/api/plat/packet_inlines.h b/platform/linux-generic/include/odp/api/plat/packet_inlines.h index e2c32728c..602d33440 100644 --- a/platform/linux-generic/include/odp/api/plat/packet_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/packet_inlines.h @@ -85,12 +85,12 @@ extern const _odp_pool_inline_offset_t _odp_pool_inline; #include <odp/api/plat/strong_types.h> static inline uint32_t _odp_packet_seg_to_ndx(odp_packet_seg_t seg) { - return _odp_typeval(seg); + return _odp_typeval(seg) - 1; } static inline odp_packet_seg_t _odp_packet_seg_from_ndx(uint32_t ndx) { - return _odp_cast_scalar(odp_packet_seg_t, ndx); + return _odp_cast_scalar(odp_packet_seg_t, ndx + 1); } #endif