diff options
author | Petri Savolainen <petri.savolainen@linaro.org> | 2018-05-14 16:12:05 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2018-05-15 16:54:34 +0300 |
commit | c484446b4930b5398e958f855917d54a97e6f2c7 (patch) | |
tree | e7ae88da5eed03264fa40422ecaef5a4e2bf8790 /platform/linux-dpdk/include | |
parent | d295255c83cea92e93b1f4e9aa977fa36cfe2d98 (diff) |
Port 49c671e8, 11207ff1, 3abbe8b7, f49289a7v1.19.0.1_DPDK_17.1
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 <petri.savolainen@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>i
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-dpdk/include')
6 files changed, 70 insertions, 52 deletions
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 <stdint.h> + +/** @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 <odp_buffer_internal.h> - -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 <odp_debug_internal.h> #include <odp/api/debug.h> #include <odp_buffer_internal.h> -#include <odp_buffer_inlines.h> #include <odp_pool_internal.h> #include <odp/api/packet.h> #include <odp/api/plat/packet_inline_types.h> 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 { |