@@ -10,8 +10,10 @@ odpapiinclude_HEADERS = \
odp/api/buffer.h \
odp/api/byteorder.h \
odp/api/chksum.h \
+ odp/api/classification.h \
odp/api/compiler.h \
odp/api/cpumask.h \
+ odp/api/crypto.h \
odp/api/deprecated.h \
odp/api/errno.h \
odp/api/event.h \
@@ -20,6 +22,10 @@ odpapiinclude_HEADERS = \
odp/api/hints.h \
odp/api/init.h \
odp/api/ipsec.h \
+ odp/api/packet.h \
+ odp/api/packet_flags.h \
+ odp/api/packet_io.h \
+ odp/api/packet_io_stats.h \
odp/api/pool.h \
odp/api/queue.h \
odp/api/random.h \
similarity index 93%
rename from platform/linux-generic/include/odp/api/classification.h
rename to include/odp/api/classification.h
@@ -20,7 +20,7 @@ extern "C" {
#include <odp/api/std_types.h>
#include <odp/api/abi/pool.h>
#include <odp/api/abi/classification.h>
-#include <odp/api/plat/packet_types.h>
+#include <odp/api/abi/packet.h>
#include <odp/api/abi/packet_io.h>
#include <odp/api/abi/queue.h>
similarity index 92%
rename from platform/linux-generic/include/odp/api/crypto.h
rename to include/odp/api/crypto.h
@@ -18,7 +18,7 @@ extern "C" {
#endif
#include <odp/api/std_types.h>
-#include <odp/api/plat/packet_types.h>
+#include <odp/api/abi/packet.h>
#include <odp/api/abi/crypto.h>
#include <odp/api/abi/buffer.h>
#include <odp/api/abi/pool.h>
similarity index 67%
rename from platform/linux-generic/include/odp/api/packet.h
rename to include/odp/api/packet.h
@@ -10,8 +10,8 @@
* ODP packet descriptor
*/
-#ifndef ODP_PLAT_PACKET_H_
-#define ODP_PLAT_PACKET_H_
+#ifndef ODP_API_PACKET_H_
+#define ODP_API_PACKET_H_
#ifdef __cplusplus
extern "C" {
@@ -20,15 +20,10 @@ extern "C" {
#include <odp/api/std_types.h>
#include <odp/api/abi/event.h>
#include <odp/api/abi/packet_io.h>
-#include <odp/api/plat/packet_types.h>
+#include <odp/api/abi/packet.h>
#include <odp/api/abi/buffer.h>
#include <odp/api/abi/pool.h>
-#include <odp/api/plat/static_inline.h>
-#if ODP_ABI_COMPAT == 0
-#include <odp/api/plat/packet_inlines.h>
-#endif
-
#include <odp/api/spec/packet.h>
#ifdef __cplusplus
similarity index 59%
rename from platform/linux-generic/include/odp/api/packet_flags.h
rename to include/odp/api/packet_flags.h
@@ -10,17 +10,14 @@
* ODP packet flags
*/
-#ifndef ODP_PLAT_PACKET_FLAGS_H_
-#define ODP_PLAT_PACKET_FLAGS_H_
+#ifndef ODP_API_PACKET_FLAGS_H_
+#define ODP_API_PACKET_FLAGS_H_
#ifdef __cplusplus
extern "C" {
#endif
-#include <odp/api/plat/static_inline.h>
-#if ODP_ABI_COMPAT == 0
-#include <odp/api/plat/packet_flag_inlines.h>
-#endif
+#include <odp/api/abi/packet_flags.h>
#include <odp/api/spec/packet_flags.h>
similarity index 83%
rename from platform/linux-generic/include/odp/api/packet_io.h
rename to include/odp/api/packet_io.h
@@ -10,8 +10,8 @@
* ODP Packet IO
*/
-#ifndef ODP_PLAT_PACKET_IO_H_
-#define ODP_PLAT_PACKET_IO_H_
+#ifndef ODP_API_PACKET_IO_H_
+#define ODP_API_PACKET_IO_H_
#ifdef __cplusplus
extern "C" {
@@ -20,7 +20,7 @@ extern "C" {
#include <odp/api/std_types.h>
#include <odp/api/abi/pool.h>
#include <odp/api/abi/classification.h>
-#include <odp/api/plat/packet_types.h>
+#include <odp/api/abi/packet.h>
#include <odp/api/abi/packet_io.h>
#include <odp/api/abi/queue.h>
similarity index 79%
rename from platform/linux-generic/include/odp/api/packet_io_stats.h
rename to include/odp/api/packet_io_stats.h
@@ -10,8 +10,8 @@
* ODP packet IO stats
*/
-#ifndef ODP_PLAT_PACKET_IO_STATS_H_
-#define ODP_PLAT_PACKET_IO_STATS_H_
+#ifndef ODP_API_PACKET_IO_STATS_H_
+#define ODP_API_PACKET_IO_STATS_H_
#ifdef __cplusplus
extern "C" {
@@ -20,14 +20,8 @@ odpinclude_HEADERS = \
odpapiincludedir= $(includedir)/odp/api
odpapiinclude_HEADERS = \
include/odp/api/align.h \
- include/odp/api/classification.h \
include/odp/api/cpu.h \
- include/odp/api/crypto.h \
- include/odp/api/debug.h \
- include/odp/api/packet_flags.h \
- include/odp/api/packet.h \
- include/odp/api/packet_io.h \
- include/odp/api/packet_io_stats.h
+ include/odp/api/debug.h
odpapiplatincludedir= $(includedir)/odp/api/plat
odpapiplatinclude_HEADERS = \
@@ -35,9 +29,9 @@ odpapiplatinclude_HEADERS = \
include/odp/api/plat/byteorder_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 \
include/odp/api/plat/packet_inlines.h \
include/odp/api/plat/packet_inlines_api.h \
- include/odp/api/plat/packet_types.h \
include/odp/api/plat/std_clib_inlines.h \
include/odp/api/plat/strong_types.h \
include/odp/api/plat/sync_inlines.h \
@@ -60,6 +54,8 @@ odpapiabiarchinclude_HEADERS = \
include-abi/odp/api/abi/event.h \
include-abi/odp/api/abi/init.h \
include-abi/odp/api/abi/ipsec.h \
+ include-abi/odp/api/abi/packet.h \
+ include-abi/odp/api/abi/packet_flags.h \
include-abi/odp/api/abi/packet_io.h \
include-abi/odp/api/abi/pool.h \
include-abi/odp/api/abi/queue.h \
new file mode 100644
@@ -0,0 +1,68 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP packet descriptor
+ */
+
+#ifndef ODP_API_ABI_PACKET_H_
+#define ODP_API_ABI_PACKET_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/api/std_types.h>
+#include <odp/api/plat/strong_types.h>
+
+/** @ingroup odp_packet
+ * @{
+ */
+
+typedef ODP_HANDLE_T(odp_packet_t);
+
+#define ODP_PACKET_INVALID _odp_cast_scalar(odp_packet_t, 0)
+
+#define ODP_PACKET_OFFSET_INVALID 0xffff
+
+typedef uint8_t odp_packet_seg_t;
+
+static inline uint8_t _odp_packet_seg_to_ndx(odp_packet_seg_t seg)
+{
+ return (uint8_t)seg;
+}
+
+static inline odp_packet_seg_t _odp_packet_seg_from_ndx(uint8_t ndx)
+{
+ return (odp_packet_seg_t)ndx;
+}
+
+#define ODP_PACKET_SEG_INVALID ((odp_packet_seg_t)-1)
+
+typedef enum {
+ ODP_PACKET_GREEN = 0,
+ ODP_PACKET_YELLOW = 1,
+ ODP_PACKET_RED = 2,
+ ODP_PACKET_ALL_COLORS = 3,
+} odp_packet_color_t;
+
+#define ODP_NUM_PACKET_COLORS 3
+
+#include <odp/api/plat/static_inline.h>
+#include <odp/api/plat/packet_inlines.h>
+#include <odp/api/plat/packet_inlines_api.h>
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
new file mode 100644
@@ -0,0 +1,27 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP packet descriptor
+ */
+
+#ifndef ODP_API_ABI_PACKET_FLAGS_H_
+#define ODP_API_ABI_PACKET_FLAGS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/api/plat/packet_flag_inlines.h>
+#include <odp/api/plat/packet_flag_inlines_api.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
@@ -13,7 +13,8 @@
#ifndef _ODP_PLAT_PACKET_FLAG_INLINES_H_
#define _ODP_PLAT_PACKET_FLAG_INLINES_H_
-#include <odp/api/plat/packet_types.h>
+#include <odp/api/abi/packet.h>
+#include <odp/api/plat/packet_inlines.h>
#include <odp/api/hints.h>
/** @internal Inline function offsets */
@@ -70,20 +71,4 @@ static inline int _odp_packet_has_ts(odp_packet_t pkt)
return flags.timestamp;
}
-/* Include inlined versions of API functions */
-#include <odp/api/plat/static_inline.h>
-#if ODP_ABI_COMPAT == 0
-
-/** @ingroup odp_packet
- * @{
- */
-
-#include <odp/api/plat/packet_flag_inlines_api.h>
-
-/**
- * @}
- */
-
-#endif
-
#endif
similarity index 76%
rename from platform/linux-generic/include/odp/api/plat/packet_types.h
rename to platform/linux-generic/include/odp/api/plat/packet_inline_types.h
@@ -11,61 +11,14 @@
* ODP packet descriptor
*/
-#ifndef ODP_PACKET_TYPES_H_
-#define ODP_PACKET_TYPES_H_
+#ifndef ODP_PACKET_INLINE_TYPES_H_
+#define ODP_PACKET_INLINE_TYPES_H_
#ifdef __cplusplus
extern "C" {
#endif
-#include <stddef.h>
-
-#include <odp/api/plat/static_inline.h>
-#if ODP_ABI_COMPAT == 1
-#include <odp/api/abi/packet.h>
-#else
-
-#include <odp/api/std_types.h>
-#include <odp/api/plat/strong_types.h>
-
-/** @ingroup odp_packet
- * @{
- */
-
-typedef ODP_HANDLE_T(odp_packet_t);
-
-#define ODP_PACKET_INVALID _odp_cast_scalar(odp_packet_t, 0)
-
-#define ODP_PACKET_OFFSET_INVALID 0xffff
-
-typedef uint8_t odp_packet_seg_t;
-
-static inline uint8_t _odp_packet_seg_to_ndx(odp_packet_seg_t seg)
-{
- return (uint8_t)seg;
-}
-
-static inline odp_packet_seg_t _odp_packet_seg_from_ndx(uint8_t ndx)
-{
- return (odp_packet_seg_t)ndx;
-}
-
-#define ODP_PACKET_SEG_INVALID ((odp_packet_seg_t)-1)
-
-typedef enum {
- ODP_PACKET_GREEN = 0,
- ODP_PACKET_YELLOW = 1,
- ODP_PACKET_RED = 2,
- ODP_PACKET_ALL_COLORS = 3,
-} odp_packet_color_t;
-
-#define ODP_NUM_PACKET_COLORS 3
-
-/**
- * @}
- */
-
-#endif
+#include <stdint.h>
/** @internal Packet field accessor */
#define _odp_pkt_get(pkt, cast, field) \
@@ -13,16 +13,21 @@
#ifndef _ODP_PLAT_PACKET_INLINES_H_
#define _ODP_PLAT_PACKET_INLINES_H_
-#include <odp/api/plat/strong_types.h>
-#include <odp/api/plat/packet_types.h>
+#include <odp/api/abi/packet.h>
#include <odp/api/pool.h>
-#include <odp/api/packet_io.h>
+#include <odp/api/abi/packet_io.h>
#include <odp/api/hints.h>
+#include <odp/api/time.h>
+#include <odp/api/abi/buffer.h>
+
+#include <odp/api/plat/packet_inline_types.h>
/** @internal Inline function offsets */
extern const _odp_packet_inline_offset_t _odp_packet_inline;
+#include <odp/api/plat/static_inline.h>
#if ODP_ABI_COMPAT == 1
+#include <odp/api/plat/strong_types.h>
/** @internal Inline function @param seg @return */
static inline uint32_t _odp_packet_seg_to_ndx(odp_packet_seg_t seg)
{
@@ -164,20 +169,4 @@ static inline odp_buffer_t packet_to_buffer(odp_packet_t pkt)
return (odp_buffer_t)pkt;
}
-/* Include inlined versions of API functions */
-#include <odp/api/plat/static_inline.h>
-#if ODP_ABI_COMPAT == 0
-
-/** @ingroup odp_packet
- * @{
- */
-
-#include <odp/api/plat/packet_inlines_api.h>
-
-/**
- * @}
- */
-
-#endif
-
#endif
@@ -23,11 +23,12 @@ extern "C" {
#include <odp_pool_internal.h>
#include <odp_buffer_inlines.h>
#include <odp/api/packet.h>
+#include <odp/api/plat/packet_inline_types.h>
#include <odp/api/packet_io.h>
#include <odp/api/crypto.h>
#include <odp_crypto_internal.h>
#include <odp_ipsec_internal.h>
-#include <odp/api/plat/packet_types.h>
+#include <odp/api/abi/packet.h>
#include <odp_queue_if.h>
/** Minimum segment length expected by packet_parse_common() */
@@ -6,8 +6,8 @@
#include "config.h"
-#include <odp/api/plat/packet_inlines.h>
#include <odp/api/packet.h>
+#include <odp/api/plat/packet_inlines.h>
#include <odp_packet_internal.h>
#include <odp_debug_internal.h>
#include <odp/api/hints.h>
@@ -17,8 +17,8 @@
#include <odp/api/cpumask.h>
-#include <odp/api/plat/packet_inlines.h>
#include <odp/api/packet.h>
+#include <odp/api/plat/packet_inlines.h>
#include <odp_packet_io_internal.h>
#include <odp_classification_internal.h>
@@ -10,8 +10,8 @@
#include <odp_posix_extensions.h>
-#include <odp/api/plat/packet_inlines.h>
#include <odp/api/packet.h>
+#include <odp/api/plat/packet_inlines.h>
#include <odp_packet_io_internal.h>
#include <odp_packet_netmap.h>
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org> --- include/Makefile.am | 6 ++ .../include => include}/odp/api/classification.h | 2 +- .../include => include}/odp/api/crypto.h | 2 +- .../include => include}/odp/api/packet.h | 11 +--- .../include => include}/odp/api/packet_flags.h | 9 +-- .../include => include}/odp/api/packet_io.h | 6 +- .../include => include}/odp/api/packet_io_stats.h | 4 +- platform/linux-generic/Makefile.am | 12 ++-- .../linux-generic/include-abi/odp/api/abi/packet.h | 68 ++++++++++++++++++++++ .../include-abi/odp/api/abi/packet_flags.h | 27 +++++++++ .../include/odp/api/plat/packet_flag_inlines.h | 19 +----- .../plat/{packet_types.h => packet_inline_types.h} | 53 +---------------- .../include/odp/api/plat/packet_inlines.h | 27 +++------ .../linux-generic/include/odp_packet_internal.h | 3 +- platform/linux-generic/odp_packet.c | 2 +- platform/linux-generic/pktio/dpdk.c | 2 +- platform/linux-generic/pktio/netmap.c | 2 +- 17 files changed, 136 insertions(+), 119 deletions(-) rename {platform/linux-generic/include => include}/odp/api/classification.h (93%) rename {platform/linux-generic/include => include}/odp/api/crypto.h (92%) rename {platform/linux-generic/include => include}/odp/api/packet.h (67%) rename {platform/linux-generic/include => include}/odp/api/packet_flags.h (59%) rename {platform/linux-generic/include => include}/odp/api/packet_io.h (83%) rename {platform/linux-generic/include => include}/odp/api/packet_io_stats.h (79%) create mode 100644 platform/linux-generic/include-abi/odp/api/abi/packet.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/packet_flags.h rename platform/linux-generic/include/odp/api/plat/{packet_types.h => packet_inline_types.h} (76%) -- 2.14.2