diff options
author | Matias Elo <matias.elo@nokia.com> | 2022-10-11 17:16:03 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2022-10-28 14:58:47 +0300 |
commit | 1a4c46020d9a94a2e9692b23b7e54ea1fd6de8a8 (patch) | |
tree | ad3f372277fe463a8a6b412d8c9b2ddfa680a964 /platform/linux-dpdk/include/odp/api | |
parent | 54f58091c22e0002ea15e312e69b3d8a95df9c76 (diff) |
Port 414827cd9 "linux-gen: packet: inline odp_packet_buf_data_set() implementation"
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/api')
-rw-r--r-- | platform/linux-dpdk/include/odp/api/plat/packet_inlines.h | 10 |
1 files changed, 10 insertions, 0 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 2cbab8ad4..b1842c09c 100644 --- a/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h +++ b/platform/linux-dpdk/include/odp/api/plat/packet_inlines.h @@ -112,6 +112,7 @@ extern "C" { #define odp_packet_buf_size __odp_packet_buf_size #define odp_packet_buf_head __odp_packet_buf_head #define odp_packet_buf_data_offset __odp_packet_buf_data_offset + #define odp_packet_buf_data_set __odp_packet_buf_data_set #else #undef _ODP_INLINE #define _ODP_INLINE @@ -578,6 +579,15 @@ _ODP_INLINE uint32_t odp_packet_buf_data_offset(odp_packet_buf_t pkt_buf) return (uint32_t)((uintptr_t)data - (uintptr_t)head); } +_ODP_INLINE void odp_packet_buf_data_set(odp_packet_buf_t pkt_buf, uint32_t data_offset, + uint32_t data_len) +{ + struct rte_mbuf *mb = (struct rte_mbuf *)pkt_buf; + + mb->data_off = (uint16_t)data_offset; + mb->data_len = (uint16_t)data_len; +} + #ifdef __cplusplus } #endif |