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 | |
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')
-rw-r--r-- | platform/linux-dpdk/Makefile.am | 6 | ||||
-rw-r--r-- | platform/linux-dpdk/include/odp/api/plat/buffer_inline_types.h | 35 | ||||
l--------- | platform/linux-dpdk/include/odp/api/plat/event_inlines.h | 1 | ||||
-rw-r--r-- | platform/linux-dpdk/include/odp_buffer_inlines.h | 51 | ||||
-rw-r--r-- | platform/linux-dpdk/include/odp_buffer_internal.h | 25 | ||||
-rw-r--r-- | platform/linux-dpdk/include/odp_packet_internal.h | 1 | ||||
-rw-r--r-- | platform/linux-dpdk/include/odp_packet_io_internal.h | 9 | ||||
-rw-r--r-- | platform/linux-dpdk/m4/configure.m4 | 1 | ||||
l--------- | platform/linux-dpdk/m4/odp_pcapng.m4 | 1 | ||||
-rw-r--r-- | platform/linux-dpdk/odp_buffer.c | 12 | ||||
-rw-r--r-- | platform/linux-dpdk/odp_crypto.c | 3 | ||||
-rw-r--r-- | platform/linux-dpdk/odp_packet.c | 3 | ||||
-rw-r--r-- | platform/linux-dpdk/odp_queue_basic.c | 1 |
13 files changed, 94 insertions, 55 deletions
diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am index 02c4af66c..6c9c4affe 100644 --- a/platform/linux-dpdk/Makefile.am +++ b/platform/linux-dpdk/Makefile.am @@ -22,8 +22,10 @@ if !ODP_ABI_COMPAT odpapiplatincludedir= $(includedir)/odp/api/plat odpapiplatinclude_HEADERS = \ include/odp/api/plat/atomic_inlines.h \ + include/odp/api/plat/buffer_inline_types.h \ include/odp/api/plat/byteorder_inlines.h \ include/odp/api/plat/byteorder_inlines_api.h \ + include/odp/api/plat/event_inlines.h \ include/odp/api/plat/packet_flag_inlines.h \ include/odp/api/plat/packet_flag_inlines_api.h \ include/odp/api/plat/packet_inline_types.h \ @@ -82,7 +84,6 @@ noinst_HEADERS = \ arch/odp_arch_time_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_align_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_atomic_internal.h \ - include/odp_buffer_inlines.h \ include/odp_buffer_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_bitmap_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_bitset.h \ @@ -106,6 +107,7 @@ noinst_HEADERS = \ ${top_srcdir}/platform/linux-generic/include/odp_packet_io_ring_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_packet_socket.h \ ${top_srcdir}/platform/linux-generic/include/odp_packet_null.h \ + ${top_srcdir}/platform/linux-generic/include/odp_pcapng.h \ ${top_srcdir}/platform/linux-generic/include/odp_pkt_queue_internal.h \ include/odp_pool_internal.h \ include/odp_posix_extensions.h \ @@ -175,6 +177,7 @@ __LIB__libodp_linux_la_SOURCES = \ ../linux-generic/odp_spinlock.c \ ../linux-generic/odp_spinlock_recursive.c \ ../linux-generic/odp_system_info.c \ + ../linux-generic/odp_pcapng.c \ odp_thread.c \ ../linux-generic/odp_thrmask.c \ odp_time.c \ @@ -188,6 +191,7 @@ if ODP_ABI_COMPAT __LIB__libodp_linux_la_SOURCES += \ ../linux-generic/odp_atomic_api.c \ ../linux-generic/odp_byteorder.c \ + ../linux-generic/odp_event_api.c \ ../linux-generic/odp_packet_api.c \ ../linux-generic/odp_packet_flags_api.c \ ../linux-generic/odp_pktio_api.c \ 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 { diff --git a/platform/linux-dpdk/m4/configure.m4 b/platform/linux-dpdk/m4/configure.m4 index 5a841997a..4ad36c8e6 100644 --- a/platform/linux-dpdk/m4/configure.m4 +++ b/platform/linux-dpdk/m4/configure.m4 @@ -11,6 +11,7 @@ ODP_PTHREAD ODP_TIMER ODP_OPENSSL ODP_LIBCONFIG([linux-dpdk]) +m4_include([platform/linux-dpdk/m4/odp_pcapng.m4]) ODP_SCHEDULER ########################################################################## diff --git a/platform/linux-dpdk/m4/odp_pcapng.m4 b/platform/linux-dpdk/m4/odp_pcapng.m4 new file mode 120000 index 000000000..fbdc23722 --- /dev/null +++ b/platform/linux-dpdk/m4/odp_pcapng.m4 @@ -0,0 +1 @@ +../../linux-generic/m4/odp_pcapng.m4
\ No newline at end of file diff --git a/platform/linux-dpdk/odp_buffer.c b/platform/linux-dpdk/odp_buffer.c index 59ea26f77..d3a28b1c5 100644 --- a/platform/linux-dpdk/odp_buffer.c +++ b/platform/linux-dpdk/odp_buffer.c @@ -6,14 +6,24 @@ #include <odp/api/buffer.h> #include <odp_buffer_internal.h> -#include <odp_buffer_inlines.h> #include <odp_debug_internal.h> #include <odp_pool_internal.h> +#include <odp/api/plat/buffer_inline_types.h> #include <string.h> #include <stdio.h> #include <inttypes.h> +#include <odp/visibility_begin.h> + +/* Fill in buffer header field offsets for inline functions */ +const _odp_buffer_inline_offset_t ODP_ALIGNED_CACHE +_odp_buffer_inline_offset = { + .event_type = offsetof(odp_buffer_hdr_t, event_type) +}; + +#include <odp/visibility_end.h> + odp_buffer_t odp_buffer_from_event(odp_event_t ev) { return (odp_buffer_t)ev; diff --git a/platform/linux-dpdk/odp_crypto.c b/platform/linux-dpdk/odp_crypto.c index eea7373d7..4dbce532e 100644 --- a/platform/linux-dpdk/odp_crypto.c +++ b/platform/linux-dpdk/odp_crypto.c @@ -22,6 +22,9 @@ #include <odp/api/plat/packet_inlines.h> #include <odp_packet_internal.h> +/* Inlined API functions */ +#include <odp/api/plat/event_inlines.h> + #include <rte_config.h> #include <rte_crypto.h> #include <rte_cryptodev.h> diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_packet.c index 2f3bea21b..077b77535 100644 --- a/platform/linux-dpdk/odp_packet.c +++ b/platform/linux-dpdk/odp_packet.c @@ -16,6 +16,9 @@ #include <odp/api/packet_io.h> #include <odp/api/plat/pktio_inlines.h> +/* Inlined API functions */ +#include <odp/api/plat/event_inlines.h> + #include <protocols/eth.h> #include <protocols/ip.h> #include <protocols/tcp.h> diff --git a/platform/linux-dpdk/odp_queue_basic.c b/platform/linux-dpdk/odp_queue_basic.c index 67303c185..455382b6d 100644 --- a/platform/linux-dpdk/odp_queue_basic.c +++ b/platform/linux-dpdk/odp_queue_basic.c @@ -14,7 +14,6 @@ #include <odp/api/buffer.h> #include <odp_buffer_internal.h> #include <odp_pool_internal.h> -#include <odp_buffer_inlines.h> #include <odp_internal.h> #include <odp/api/shared_memory.h> #include <odp/api/schedule.h> |