From c484446b4930b5398e958f855917d54a97e6f2c7 Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Mon, 14 May 2018 16:12:05 +0300 Subject: Port 49c671e8, 11207ff1, 3abbe8b7, f49289a7 Fix build issues from the latest merge. These commits needed porting: 49c671e8 odp: pktio: add pcapng capture capabilities 11207ff1 linux-gen: use inlined event type function 3abbe8b7 linux-gen: event: inline event_type function f49289a7 linux-gen: buffer: remove buffer_inlines header file Signed-off-by: Petri Savolainen Reviewed-by: Bill Fischofer i Signed-off-by: Maxim Uvarov --- .../include/odp/api/plat/buffer_inline_types.h | 35 +++++++++++++++ .../include/odp/api/plat/event_inlines.h | 1 + platform/linux-dpdk/include/odp_buffer_inlines.h | 51 ---------------------- platform/linux-dpdk/include/odp_buffer_internal.h | 25 +++++++++++ platform/linux-dpdk/include/odp_packet_internal.h | 1 - .../linux-dpdk/include/odp_packet_io_internal.h | 9 ++++ 6 files changed, 70 insertions(+), 52 deletions(-) create mode 100644 platform/linux-dpdk/include/odp/api/plat/buffer_inline_types.h create mode 120000 platform/linux-dpdk/include/odp/api/plat/event_inlines.h delete mode 100644 platform/linux-dpdk/include/odp_buffer_inlines.h (limited to 'platform/linux-dpdk/include') diff --git a/platform/linux-dpdk/include/odp/api/plat/buffer_inline_types.h b/platform/linux-dpdk/include/odp/api/plat/buffer_inline_types.h new file mode 100644 index 000000000..29f49f8db --- /dev/null +++ b/platform/linux-dpdk/include/odp/api/plat/buffer_inline_types.h @@ -0,0 +1,35 @@ +/* Copyright (c) 2018, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_PLAT_BUFFER_INLINE_TYPES_H_ +#define ODP_PLAT_BUFFER_INLINE_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** @cond _ODP_HIDE_FROM_DOXYGEN_ */ + +/* Buffer header field accessor */ +#define _odp_buf_hdr_field(buf_hdr, cast, field) \ + (*(cast *)(uintptr_t)((uint8_t *)buf_hdr + \ + _odp_buffer_inline_offset.field)) + +/* Buffer header field offsets for inline functions */ +typedef struct _odp_buffer_inline_offset_t { + uint16_t event_type; + +} _odp_buffer_inline_offset_t; + +/** @endcond */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-dpdk/include/odp/api/plat/event_inlines.h b/platform/linux-dpdk/include/odp/api/plat/event_inlines.h new file mode 120000 index 000000000..f4f1fd63f --- /dev/null +++ b/platform/linux-dpdk/include/odp/api/plat/event_inlines.h @@ -0,0 +1 @@ +../../../../../linux-generic/include/odp/api/plat/event_inlines.h \ No newline at end of file diff --git a/platform/linux-dpdk/include/odp_buffer_inlines.h b/platform/linux-dpdk/include/odp_buffer_inlines.h deleted file mode 100644 index 421096a78..000000000 --- a/platform/linux-dpdk/include/odp_buffer_inlines.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (c) 2014-2018, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/** - * @file - * - * Inline functions for ODP buffer mgmt routines - implementation internal - */ - -#ifndef ODP_BUFFER_INLINES_H_ -#define ODP_BUFFER_INLINES_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -static inline odp_buffer_t buf_from_buf_hdr(odp_buffer_hdr_t *hdr) -{ - return (odp_buffer_t)hdr; -} - -static inline odp_buffer_hdr_t *buf_hdl_to_hdr(odp_buffer_t buf) -{ - return (odp_buffer_hdr_t *)(uintptr_t)buf; -} - -static inline odp_event_type_t _odp_buffer_event_type(odp_buffer_t buf) -{ - return buf_hdl_to_hdr(buf)->event_type; -} - -static inline void _odp_buffer_event_type_set(odp_buffer_t buf, int ev) -{ - buf_hdl_to_hdr(buf)->event_type = ev; -} - -static inline odp_event_t event_from_buf_hdr(odp_buffer_hdr_t *hdr) -{ - return (odp_event_t)hdr; -} - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-dpdk/include/odp_buffer_internal.h b/platform/linux-dpdk/include/odp_buffer_internal.h index f96a80e99..5af9b527e 100644 --- a/platform/linux-dpdk/include/odp_buffer_internal.h +++ b/platform/linux-dpdk/include/odp_buffer_internal.h @@ -96,6 +96,31 @@ static inline odp_buffer_hdr_t *mbuf_to_buf_hdr(struct rte_mbuf *mbuf) return (odp_buffer_hdr_t *)(uintptr_t)mbuf; } +static inline odp_buffer_t buf_from_buf_hdr(odp_buffer_hdr_t *hdr) +{ + return (odp_buffer_t)hdr; +} + +static inline odp_buffer_hdr_t *buf_hdl_to_hdr(odp_buffer_t buf) +{ + return (odp_buffer_hdr_t *)(uintptr_t)buf; +} + +static inline odp_event_type_t _odp_buffer_event_type(odp_buffer_t buf) +{ + return buf_hdl_to_hdr(buf)->event_type; +} + +static inline void _odp_buffer_event_type_set(odp_buffer_t buf, int ev) +{ + buf_hdl_to_hdr(buf)->event_type = ev; +} + +static inline odp_event_t event_from_buf_hdr(odp_buffer_hdr_t *hdr) +{ + return (odp_event_t)hdr; +} + #ifdef __cplusplus } #endif diff --git a/platform/linux-dpdk/include/odp_packet_internal.h b/platform/linux-dpdk/include/odp_packet_internal.h index 2268833f8..5623d9af0 100644 --- a/platform/linux-dpdk/include/odp_packet_internal.h +++ b/platform/linux-dpdk/include/odp_packet_internal.h @@ -21,7 +21,6 @@ extern "C" { #include #include #include -#include #include #include #include diff --git a/platform/linux-dpdk/include/odp_packet_io_internal.h b/platform/linux-dpdk/include/odp_packet_io_internal.h index 6160cfb66..5d2c900a9 100644 --- a/platform/linux-dpdk/include/odp_packet_io_internal.h +++ b/platform/linux-dpdk/include/odp_packet_io_internal.h @@ -126,6 +126,15 @@ struct pktio_entry { odp_queue_t queue; odp_pktout_queue_t pktout; } out_queue[PKTIO_MAX_QUEUES]; + + /* inotify instance for pcapng fifos */ + struct { + enum { + PCAPNG_WR_STOP = 0, + PCAPNG_WR_PKT, + } state[PKTIO_MAX_QUEUES]; + int fd[PKTIO_MAX_QUEUES]; + } pcapng; }; typedef union { -- cgit v1.2.3