aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-dpdk/include/odp/api
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2024-05-20 10:33:07 +0300
committerMatias Elo <matias.elo@nokia.com>2024-06-05 13:11:15 +0300
commit87913e636da621d47a8d3bc91fbe131abc09c294 (patch)
treedd1b579c93404d2d98b78944bbdf8313ec499bee /platform/linux-dpdk/include/odp/api
parent374159b3e6c321002179e75f6c3f47113289d781 (diff)
linux-dpdk: packet: inline odp_packet_reset_max_len() implementation
Inline implementation of odp_packet_reset_max_len() function. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Diffstat (limited to 'platform/linux-dpdk/include/odp/api')
-rw-r--r--platform/linux-dpdk/include/odp/api/plat/packet_inlines.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h b/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h
index 5a830fe77..627ed1d44 100644
--- a/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h
+++ b/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (c) 2016-2018 Linaro Limited
- * Copyright (c) 2019-2023 Nokia
+ * Copyright (c) 2019-2024 Nokia
*/
/**
@@ -59,6 +59,7 @@ extern "C" {
#define odp_packet_data_seg_len __odp_packet_data_seg_len
#define odp_packet_len __odp_packet_len
#define odp_packet_buf_len __odp_packet_buf_len
+ #define odp_packet_reset_max_len __odp_packet_reset_max_len
#define odp_packet_headroom __odp_packet_headroom
#define odp_packet_tailroom __odp_packet_tailroom
#define odp_packet_pool __odp_packet_pool
@@ -185,6 +186,11 @@ _ODP_INLINE uint32_t odp_packet_buf_len(odp_packet_t pkt)
return (uint32_t)(mb->nb_segs * mb->buf_len);
}
+_ODP_INLINE uint32_t odp_packet_reset_max_len(odp_packet_t pkt)
+{
+ return odp_packet_buf_len(pkt) - RTE_PKTMBUF_HEADROOM;
+}
+
_ODP_INLINE void *odp_packet_data_seg_len(odp_packet_t pkt,
uint32_t *seg_len)
{