aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/include
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux-generic/include')
-rw-r--r--platform/linux-generic/include/odp_buffer_internal.h72
-rw-r--r--platform/linux-generic/include/odp_config_internal.h10
-rw-r--r--platform/linux-generic/include/odp_event_internal.h103
-rw-r--r--platform/linux-generic/include/odp_event_vector_internal.h24
-rw-r--r--platform/linux-generic/include/odp_forward_typedefs_internal.h3
-rw-r--r--platform/linux-generic/include/odp_global_data.h2
-rw-r--r--platform/linux-generic/include/odp_init_internal.h3
-rw-r--r--platform/linux-generic/include/odp_ipsec_internal.h24
-rw-r--r--platform/linux-generic/include/odp_packet_internal.h34
-rw-r--r--platform/linux-generic/include/odp_pool_internal.h46
-rw-r--r--platform/linux-generic/include/odp_queue_if.h11
-rw-r--r--platform/linux-generic/include/odp_queue_scalable_internal.h6
-rw-r--r--platform/linux-generic/include/odp_random_openssl_internal.h5
-rw-r--r--platform/linux-generic/include/odp_random_std_internal.h5
-rw-r--r--platform/linux-generic/include/odp_schedule_if.h11
-rw-r--r--platform/linux-generic/include/odp_schedule_scalable.h5
-rw-r--r--platform/linux-generic/include/odp_schedule_scalable_ordered.h5
-rw-r--r--platform/linux-generic/include/odp_sysinfo_internal.h1
-rw-r--r--platform/linux-generic/include/odp_timer_internal.h15
19 files changed, 240 insertions, 145 deletions
diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h
index dec85f9d3..e0be593d0 100644
--- a/platform/linux-generic/include/odp_buffer_internal.h
+++ b/platform/linux-generic/include/odp_buffer_internal.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2019, Nokia
+ * Copyright (c) 2019-2021, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -29,88 +29,40 @@ extern "C" {
#include <odp/api/byteorder.h>
#include <odp/api/thread.h>
#include <odp/api/event.h>
-#include <odp_forward_typedefs_internal.h>
+#include <odp_event_internal.h>
#include <stddef.h>
-typedef union buffer_index_t {
- uint32_t u32;
+/* Internal buffer header */
+typedef struct ODP_ALIGNED_CACHE odp_buffer_hdr_t {
+ /* Common event header */
+ _odp_event_hdr_t event_hdr;
- struct {
- uint32_t pool :8;
- uint32_t buffer :24;
- };
-} buffer_index_t;
-
-/* Check that pool index fit into bit field */
-ODP_STATIC_ASSERT(ODP_CONFIG_POOLS <= (0xFF + 1), "TOO_MANY_POOLS");
-
-/* Check that buffer index fit into bit field */
-ODP_STATIC_ASSERT(CONFIG_POOL_MAX_NUM <= (0xFFFFFF + 1), "TOO_LARGE_POOL");
-
-/* Type size limits number of flow IDs supported */
-#define BUF_HDR_MAX_FLOW_ID 255
-
-/* Common buffer header */
-struct ODP_ALIGNED_CACHE odp_buffer_hdr_t {
- /* Initial buffer data pointer */
- uint8_t *base_data;
-
- /* Pool pointer */
- void *pool_ptr;
-
- /* --- Mostly read only data --- */
- const void *user_ptr;
-
- /* Initial buffer tail pointer */
- uint8_t *buf_end;
-
- /* User area pointer */
- void *uarea_addr;
-
- /* Combined pool and buffer index */
- buffer_index_t index;
-
- /* Reference count */
- odp_atomic_u32_t ref_cnt;
-
- /* Pool type */
- int8_t type;
-
- /* Event type. Maybe different than pool type (crypto compl event) */
- int8_t event_type;
-
- /* Event flow id */
- uint8_t flow_id;
-
- /* Data or next header */
+ /* Data */
uint8_t data[];
-};
+} odp_buffer_hdr_t;
/* Buffer header size is critical for performance. Ensure that it does not accidentally
* grow over cache line size. Note that ODP_ALIGNED_CACHE rounds up struct size to a multiple of
* ODP_CACHE_LINE_SIZE. */
ODP_STATIC_ASSERT(sizeof(odp_buffer_hdr_t) <= ODP_CACHE_LINE_SIZE, "BUFFER_HDR_SIZE_ERROR");
-odp_event_type_t _odp_buffer_event_type(odp_buffer_t buf);
-void _odp_buffer_event_type_set(odp_buffer_t buf, int ev);
-
-static inline odp_buffer_t buf_from_buf_hdr(odp_buffer_hdr_t *hdr)
+static inline odp_buffer_hdr_t *_odp_buf_hdr(odp_buffer_t buf)
{
- return (odp_buffer_t)hdr;
+ return (odp_buffer_hdr_t *)(uintptr_t)buf;
}
static inline uint32_t event_flow_id(odp_event_t ev)
{
odp_buffer_hdr_t *buf_hdr = (odp_buffer_hdr_t *)(uintptr_t)ev;
- return buf_hdr->flow_id;
+ return buf_hdr->event_hdr.flow_id;
}
static inline void event_flow_id_set(odp_event_t ev, uint32_t flow_id)
{
odp_buffer_hdr_t *buf_hdr = (odp_buffer_hdr_t *)(uintptr_t)ev;
- buf_hdr->flow_id = flow_id;
+ buf_hdr->event_hdr.flow_id = flow_id;
}
#ifdef __cplusplus
diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h
index 899b261bd..872d6f6d5 100644
--- a/platform/linux-generic/include/odp_config_internal.h
+++ b/platform/linux-generic/include/odp_config_internal.h
@@ -54,6 +54,16 @@ extern "C" {
#define CONFIG_QUEUE_MAX_ORD_LOCKS 2
/*
+ * Maximum number of DMA sessions
+ */
+#define CONFIG_MAX_DMA_SESSIONS 32
+
+/*
+ * Stashes reserved for internal usage
+ */
+#define CONFIG_INTERNAL_STASHES CONFIG_MAX_DMA_SESSIONS
+
+/*
* Maximum number of stashes
*/
#define CONFIG_MAX_STASHES 128
diff --git a/platform/linux-generic/include/odp_event_internal.h b/platform/linux-generic/include/odp_event_internal.h
new file mode 100644
index 000000000..fa7e5f354
--- /dev/null
+++ b/platform/linux-generic/include/odp_event_internal.h
@@ -0,0 +1,103 @@
+/* Copyright (c) 2021, Nokia
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP event descriptor - implementation internal
+ */
+
+#ifndef ODP_EVENT_INTERNAL_H_
+#define ODP_EVENT_INTERNAL_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/api/atomic.h>
+#include <odp/api/debug.h>
+#include <odp/api/event.h>
+#include <odp/api/std_types.h>
+
+#include <odp_config_internal.h>
+
+typedef union buffer_index_t {
+ uint32_t u32;
+
+ struct {
+ uint32_t pool :8;
+ uint32_t buffer :24;
+ };
+} buffer_index_t;
+
+/* Check that pool index fit into bit field */
+ODP_STATIC_ASSERT(ODP_CONFIG_POOLS <= (0xFF + 1), "TOO_MANY_POOLS");
+
+/* Check that buffer index fit into bit field */
+ODP_STATIC_ASSERT(CONFIG_POOL_MAX_NUM <= (0xFFFFFF + 1), "TOO_LARGE_POOL");
+
+/* Type size limits number of flow IDs supported */
+#define BUF_HDR_MAX_FLOW_ID 255
+
+/* Common header for all event types without alignment constraints. */
+typedef struct _odp_event_hdr_t {
+ /* Initial buffer data pointer */
+ uint8_t *base_data;
+
+ /* Pool pointer */
+ void *pool_ptr;
+
+ /* --- Mostly read only data --- */
+ const void *user_ptr;
+
+ /* Initial buffer tail pointer */
+ uint8_t *buf_end;
+
+ /* User area pointer */
+ void *uarea_addr;
+
+ /* Combined pool and buffer index */
+ buffer_index_t index;
+
+ /* Reference count */
+ odp_atomic_u32_t ref_cnt;
+
+ /* Pool type */
+ int8_t type;
+
+ /* Event type. Maybe different than pool type (crypto compl event) */
+ int8_t event_type;
+
+ /* Event flow id */
+ uint8_t flow_id;
+
+} _odp_event_hdr_t;
+
+static inline odp_event_t _odp_event_from_hdr(_odp_event_hdr_t *hdr)
+{
+ return (odp_event_t)hdr;
+}
+
+static inline _odp_event_hdr_t *_odp_event_hdr(odp_event_t event)
+{
+ return (_odp_event_hdr_t *)(uintptr_t)event;
+}
+
+static inline odp_event_type_t _odp_event_type(odp_event_t event)
+{
+ return _odp_event_hdr(event)->event_type;
+}
+
+static inline void _odp_event_type_set(odp_event_t event, int ev)
+{
+ _odp_event_hdr(event)->event_type = ev;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/include/odp_event_vector_internal.h b/platform/linux-generic/include/odp_event_vector_internal.h
index 2d51801df..33b26d711 100644
--- a/platform/linux-generic/include/odp_event_vector_internal.h
+++ b/platform/linux-generic/include/odp_event_vector_internal.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2020, Nokia
+/* Copyright (c) 2020-2021, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -13,18 +13,20 @@
#ifndef ODP_EVENT_VECTOR_INTERNAL_H_
#define ODP_EVENT_VECTOR_INTERNAL_H_
-#include <stdint.h>
+#include <odp/api/align.h>
+#include <odp/api/debug.h>
#include <odp/api/packet.h>
-#include <odp_buffer_internal.h>
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
+#include <odp_event_internal.h>
+
+#include <stdint.h>
+
/**
* Internal event vector header
*/
-typedef struct {
- /* Common buffer header */
- odp_buffer_hdr_t buf_hdr;
+typedef struct ODP_ALIGNED_CACHE odp_event_vector_hdr_t {
+ /* Common event header */
+ _odp_event_hdr_t event_hdr;
/* Event vector size */
uint32_t size;
@@ -33,7 +35,11 @@ typedef struct {
odp_packet_t packet[];
} odp_event_vector_hdr_t;
-#pragma GCC diagnostic pop
+
+/* Vector header size is critical for performance. Ensure that it does not accidentally
+ * grow over cache line size. */
+ODP_STATIC_ASSERT(sizeof(odp_event_vector_hdr_t) <= ODP_CACHE_LINE_SIZE,
+ "EVENT_VECTOR_HDR_SIZE_ERROR");
/**
* Return the vector header
diff --git a/platform/linux-generic/include/odp_forward_typedefs_internal.h b/platform/linux-generic/include/odp_forward_typedefs_internal.h
index fc2d74857..d7e14b953 100644
--- a/platform/linux-generic/include/odp_forward_typedefs_internal.h
+++ b/platform/linux-generic/include/odp_forward_typedefs_internal.h
@@ -10,7 +10,7 @@
* ODP forward typedefs - implementation internal
*
* This needs to be a separate file because it is needed by both
- * odp_queue_internal.h and odp_buffer_internal.h and clang prohibits forward
+ * odp_queue_internal.h and odp_queue_lf.h and clang prohibits forward
* "redefining" typedefs. Note that this file can be extended with additional
* forward typedefs as needed.
*/
@@ -22,7 +22,6 @@
extern "C" {
#endif
-typedef struct odp_buffer_hdr_t odp_buffer_hdr_t;
typedef union queue_entry_u queue_entry_t;
#ifdef __cplusplus
diff --git a/platform/linux-generic/include/odp_global_data.h b/platform/linux-generic/include/odp_global_data.h
index 75978bd6c..c94369e9f 100644
--- a/platform/linux-generic/include/odp_global_data.h
+++ b/platform/linux-generic/include/odp_global_data.h
@@ -72,12 +72,12 @@ typedef struct odp_global_data_ro_t {
uint8_t has_config_rt;
config_t libconfig_default;
config_t libconfig_runtime;
- odp_random_kind_t ipsec_rand_kind;
/* Disabled features during global init */
struct {
uint8_t compress;
uint8_t crypto;
+ uint8_t dma;
uint8_t ipsec;
uint8_t stash;
uint8_t traffic_mngr;
diff --git a/platform/linux-generic/include/odp_init_internal.h b/platform/linux-generic/include/odp_init_internal.h
index 9754dfa31..2a1039854 100644
--- a/platform/linux-generic/include/odp_init_internal.h
+++ b/platform/linux-generic/include/odp_init_internal.h
@@ -99,6 +99,9 @@ int _odp_hash_term_global(void);
int _odp_stash_init_global(void);
int _odp_stash_term_global(void);
+int _odp_dma_init_global(void);
+int _odp_dma_term_global(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/platform/linux-generic/include/odp_ipsec_internal.h b/platform/linux-generic/include/odp_ipsec_internal.h
index cc224e4cc..b7fb2cbf7 100644
--- a/platform/linux-generic/include/odp_ipsec_internal.h
+++ b/platform/linux-generic/include/odp_ipsec_internal.h
@@ -171,6 +171,7 @@ struct ipsec_sa_s {
union {
unsigned flags;
struct {
+ unsigned inbound : 1;
unsigned dec_ttl : 1;
unsigned copy_dscp : 1;
unsigned copy_df : 1;
@@ -246,7 +247,28 @@ struct ipsec_sa_s {
} stats;
uint32_t next_sa;
- odp_ipsec_sa_param_t param;
+
+ /* Data stored solely for odp_ipsec_sa_info() */
+ struct {
+ odp_cipher_alg_t cipher_alg;
+ uint32_t cipher_key_len;
+ uint32_t cipher_key_extra_len;
+
+ odp_auth_alg_t auth_alg;
+ uint32_t auth_key_len;
+ uint32_t auth_key_extra_len;
+
+ uint32_t icv_len;
+ uint32_t context_len;
+ union {
+ struct {
+ uint32_t antireplay_ws;
+ } in;
+ struct{
+ uint32_t mtu;
+ } out;
+ };
+ } sa_info;
};
/**
diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h
index 62f8aea25..7c9b7735e 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2019, Nokia
+ * Copyright (c) 2019-2021, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -20,15 +20,16 @@ extern "C" {
#include <odp/api/align.h>
#include <odp/api/debug.h>
-#include <odp_buffer_internal.h>
-#include <odp_pool_internal.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/api/comp.h>
-#include <odp_ipsec_internal.h>
#include <odp/api/abi/packet.h>
+
+#include <odp_event_internal.h>
+#include <odp_ipsec_internal.h>
+#include <odp_pool_internal.h>
#include <odp_queue_if.h>
#include <stdint.h>
@@ -73,8 +74,6 @@ typedef struct {
ODP_STATIC_ASSERT(PKT_MAX_SEGS < UINT16_MAX, "PACKET_MAX_SEGS_ERROR");
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
/**
* Internal Packet header
*
@@ -82,9 +81,9 @@ ODP_STATIC_ASSERT(PKT_MAX_SEGS < UINT16_MAX, "PACKET_MAX_SEGS_ERROR");
* packet_init(). Because of this any new fields added must be reviewed for
* initialization requirements.
*/
-typedef struct odp_packet_hdr_t {
- /* Common buffer header (cache line aligned) */
- odp_buffer_hdr_t buf_hdr;
+typedef struct ODP_ALIGNED_CACHE odp_packet_hdr_t {
+ /* Common event header */
+ _odp_event_hdr_t event_hdr;
/* Segment data start */
uint8_t *seg_data;
@@ -153,13 +152,10 @@ typedef struct odp_packet_hdr_t {
uint8_t data[];
} odp_packet_hdr_t;
-#pragma GCC diagnostic pop
/* Packet header size is critical for performance. Ensure that it does not accidentally
- * grow over 256 bytes when cache line size is 64 bytes (or less). With larger cache line sizes,
- * the struct size is larger due to the odp_buffer_hdr_t alignment requirement. */
-ODP_STATIC_ASSERT(sizeof(odp_packet_hdr_t) <= 256 || ODP_CACHE_LINE_SIZE > 64,
- "PACKET_HDR_SIZE_ERROR");
+ * grow over 256 bytes. */
+ODP_STATIC_ASSERT(sizeof(odp_packet_hdr_t) <= 256, "PACKET_HDR_SIZE_ERROR");
/**
* Return the packet header
@@ -174,14 +170,14 @@ static inline odp_packet_t packet_handle(odp_packet_hdr_t *pkt_hdr)
return (odp_packet_t)pkt_hdr;
}
-static inline odp_buffer_hdr_t *packet_to_buf_hdr(odp_packet_t pkt)
+static inline _odp_event_hdr_t *packet_to_event_hdr(odp_packet_t pkt)
{
- return &packet_hdr(pkt)->buf_hdr;
+ return (_odp_event_hdr_t *)(uintptr_t)&packet_hdr(pkt)->event_hdr;
}
-static inline odp_packet_t packet_from_buf_hdr(odp_buffer_hdr_t *buf_hdr)
+static inline odp_packet_t packet_from_event_hdr(_odp_event_hdr_t *event_hdr)
{
- return (odp_packet_t)(odp_packet_hdr_t *)buf_hdr;
+ return (odp_packet_t)(uintptr_t)event_hdr;
}
static inline odp_packet_hdr_t *packet_last_seg(odp_packet_hdr_t *hdr)
@@ -202,7 +198,7 @@ static inline void packet_subtype_set(odp_packet_t pkt, int ev)
*/
static inline void packet_init(odp_packet_hdr_t *pkt_hdr, uint32_t len)
{
- pool_t *pool = pkt_hdr->buf_hdr.pool_ptr;
+ pool_t *pool = pkt_hdr->event_hdr.pool_ptr;
uint32_t seg_len;
int num = pkt_hdr->seg_count;
diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h
index 001bdfc37..c9bae7142 100644
--- a/platform/linux-generic/include/odp_pool_internal.h
+++ b/platform/linux-generic/include/odp_pool_internal.h
@@ -23,6 +23,7 @@ extern "C" {
#include <odp/api/align.h>
#include <odp_buffer_internal.h>
+#include <odp_event_internal.h>
#include <odp_config_internal.h>
#include <odp_ring_ptr_internal.h>
#include <odp/api/plat/strong_types.h>
@@ -31,22 +32,22 @@ typedef struct ODP_ALIGNED_CACHE pool_cache_t {
/* Number of buffers in cache */
uint32_t cache_num;
/* Cached buffers */
- odp_buffer_hdr_t *buf_hdr[CONFIG_POOL_CACHE_MAX_SIZE];
+ _odp_event_hdr_t *event_hdr[CONFIG_POOL_CACHE_MAX_SIZE];
} pool_cache_t;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
-/* Buffer header ring */
+/* Event header ring */
typedef struct ODP_ALIGNED_CACHE {
/* Ring header */
ring_ptr_t hdr;
/* Ring data: buffer handles */
- odp_buffer_hdr_t *buf_hdr[CONFIG_POOL_MAX_NUM + 1];
+ _odp_event_hdr_t *event_hdr[CONFIG_POOL_MAX_NUM + 1];
/* Index to pointer look-up table for external memory pool */
- odp_buffer_hdr_t *buf_hdr_by_index[];
+ _odp_event_hdr_t *event_hdr_by_index[];
} pool_ring_t;
#pragma GCC diagnostic pop
@@ -88,6 +89,7 @@ typedef struct pool_t {
uint8_t *base_addr;
uint8_t *max_addr;
uint8_t *uarea_base_addr;
+ odp_pool_type_t type_2;
odp_pool_ext_param_t ext_param;
/* Used by DPDK zero-copy pktio */
@@ -140,27 +142,22 @@ static inline pool_t *pool_entry_from_hdl(odp_pool_t pool_hdl)
return &_odp_pool_glb->pool[_odp_typeval(pool_hdl) - 1];
}
-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_buffer_hdr_t *buf_hdr_from_index(pool_t *pool,
- uint32_t buffer_idx)
+static inline _odp_event_hdr_t *event_hdr_from_index(pool_t *pool,
+ uint32_t event_idx)
{
uint64_t block_offset;
- odp_buffer_hdr_t *buf_hdr;
+ _odp_event_hdr_t *event_hdr;
- block_offset = (buffer_idx * (uint64_t)pool->block_size) +
+ block_offset = (event_idx * (uint64_t)pool->block_size) +
pool->block_offset;
/* clang requires cast to uintptr_t */
- buf_hdr = (odp_buffer_hdr_t *)(uintptr_t)&pool->base_addr[block_offset];
+ event_hdr = (_odp_event_hdr_t *)(uintptr_t)&pool->base_addr[block_offset];
- return buf_hdr;
+ return event_hdr;
}
-static inline odp_buffer_hdr_t *buf_hdr_from_index_u32(uint32_t u32)
+static inline _odp_event_hdr_t *_odp_event_hdr_from_index_u32(uint32_t u32)
{
buffer_index_t index;
uint32_t pool_idx, buffer_idx;
@@ -171,12 +168,21 @@ static inline odp_buffer_hdr_t *buf_hdr_from_index_u32(uint32_t u32)
buffer_idx = index.buffer;
pool = pool_entry(pool_idx);
- return buf_hdr_from_index(pool, buffer_idx);
+ return event_hdr_from_index(pool, buffer_idx);
+}
+
+odp_event_t _odp_event_alloc(pool_t *pool);
+int _odp_event_alloc_multi(pool_t *pool, _odp_event_hdr_t *event_hdr[], int num);
+void _odp_event_free_multi(_odp_event_hdr_t *event_hdr[], int num_free);
+int _odp_event_is_valid(odp_event_t event);
+
+static inline void _odp_event_free(odp_event_t event)
+{
+ _odp_event_free_multi((_odp_event_hdr_t **)&event, 1);
}
-int _odp_buffer_alloc_multi(pool_t *pool, odp_buffer_hdr_t *buf_hdr[], int num);
-void _odp_buffer_free_multi(odp_buffer_hdr_t *buf_hdr[], int num_free);
-int _odp_buffer_is_valid(odp_buffer_t buf);
+odp_pool_t _odp_pool_create(const char *name, const odp_pool_param_t *params,
+ odp_pool_type_t type_2);
#ifdef __cplusplus
}
diff --git a/platform/linux-generic/include/odp_queue_if.h b/platform/linux-generic/include/odp_queue_if.h
index fa92a4171..ed4ec4e61 100644
--- a/platform/linux-generic/include/odp_queue_if.h
+++ b/platform/linux-generic/include/odp_queue_if.h
@@ -1,4 +1,5 @@
/* Copyright (c) 2017, ARM Limited
+ * Copyright (c) 2021, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -14,6 +15,8 @@ extern "C" {
#include <odp/api/queue.h>
#include <odp/api/schedule.h>
#include <odp/api/packet_io.h>
+
+#include <odp_event_internal.h>
#include <odp_forward_typedefs_internal.h>
#define QUEUE_MULTI_MAX CONFIG_BURST_SIZE
@@ -22,12 +25,12 @@ typedef int (*queue_init_global_fn_t)(void);
typedef int (*queue_term_global_fn_t)(void);
typedef int (*queue_init_local_fn_t)(void);
typedef int (*queue_term_local_fn_t)(void);
-typedef int (*queue_enq_fn_t)(odp_queue_t queue, odp_buffer_hdr_t *buf_hdr);
+typedef int (*queue_enq_fn_t)(odp_queue_t queue, _odp_event_hdr_t *event_hdr);
typedef int (*queue_enq_multi_fn_t)(odp_queue_t queue,
- odp_buffer_hdr_t **buf_hdr, int num);
-typedef odp_buffer_hdr_t *(*queue_deq_fn_t)(odp_queue_t queue);
+ _odp_event_hdr_t **event_hdr, int num);
+typedef _odp_event_hdr_t *(*queue_deq_fn_t)(odp_queue_t queue);
typedef int (*queue_deq_multi_fn_t)(odp_queue_t queue,
- odp_buffer_hdr_t **buf_hdr, int num);
+ _odp_event_hdr_t **event_hdr, int num);
typedef odp_pktout_queue_t (*queue_get_pktout_fn_t)(odp_queue_t queue);
typedef void (*queue_set_pktout_fn_t)(odp_queue_t queue, odp_pktio_t pktio,
int index);
diff --git a/platform/linux-generic/include/odp_queue_scalable_internal.h b/platform/linux-generic/include/odp_queue_scalable_internal.h
index 9f326a9ee..6f9b85c85 100644
--- a/platform/linux-generic/include/odp_queue_scalable_internal.h
+++ b/platform/linux-generic/include/odp_queue_scalable_internal.h
@@ -17,7 +17,7 @@ extern "C" {
#include <odp/api/queue.h>
#include <odp_forward_typedefs_internal.h>
#include <odp_queue_if.h>
-#include <odp_buffer_internal.h>
+#include <odp_event_internal.h>
#include <odp_align_internal.h>
#include <odp/api/packet_io.h>
#include <odp/api/align.h>
@@ -58,10 +58,10 @@ union queue_entry_u {
uint8_t pad[ROUNDUP_CACHE_LINE(sizeof(struct queue_entry_s))];
};
-int _odp_queue_deq(sched_elem_t *q, odp_buffer_hdr_t *buf_hdr[], int num);
+int _odp_queue_deq(sched_elem_t *q, _odp_event_hdr_t *event_hdr[], int num);
int _odp_queue_deq_sc(sched_elem_t *q, odp_event_t *evp, int num);
int _odp_queue_deq_mc(sched_elem_t *q, odp_event_t *evp, int num);
-int _odp_queue_enq_sp(sched_elem_t *q, odp_buffer_hdr_t *buf_hdr[], int num);
+int _odp_queue_enq_sp(sched_elem_t *q, _odp_event_hdr_t *event_hdr[], int num);
queue_entry_t *_odp_qentry_from_ext(odp_queue_t handle);
/* Round up memory size to next cache line size to
diff --git a/platform/linux-generic/include/odp_random_openssl_internal.h b/platform/linux-generic/include/odp_random_openssl_internal.h
index 3205a2c32..5cb9006d1 100644
--- a/platform/linux-generic/include/odp_random_openssl_internal.h
+++ b/platform/linux-generic/include/odp_random_openssl_internal.h
@@ -13,10 +13,7 @@ extern "C" {
#include <stdint.h>
-#include <odp/api/random.h>
-
-odp_random_kind_t _odp_random_openssl_max_kind(void);
-int32_t _odp_random_openssl_data(uint8_t *buf, uint32_t len, odp_random_kind_t kind);
+int32_t _odp_random_openssl_data(uint8_t *buf, uint32_t len);
int _odp_random_openssl_init_local(void);
int _odp_random_openssl_term_local(void);
diff --git a/platform/linux-generic/include/odp_random_std_internal.h b/platform/linux-generic/include/odp_random_std_internal.h
index 69f8b6d85..fb350fd22 100644
--- a/platform/linux-generic/include/odp_random_std_internal.h
+++ b/platform/linux-generic/include/odp_random_std_internal.h
@@ -13,11 +13,8 @@ extern "C" {
#include <stdint.h>
-#include <odp/api/random.h>
-
-odp_random_kind_t _odp_random_std_max_kind(void);
int32_t _odp_random_std_test_data(uint8_t *buf, uint32_t len, uint64_t *seed);
-int32_t _odp_random_std_data(uint8_t *buf, uint32_t len, odp_random_kind_t kind);
+int32_t _odp_random_std_data(uint8_t *buf, uint32_t len);
int _odp_random_std_init_local(void);
int _odp_random_std_term_local(void);
diff --git a/platform/linux-generic/include/odp_schedule_if.h b/platform/linux-generic/include/odp_schedule_if.h
index a804f8c95..dddd2182d 100644
--- a/platform/linux-generic/include/odp_schedule_if.h
+++ b/platform/linux-generic/include/odp_schedule_if.h
@@ -13,9 +13,10 @@ extern "C" {
#endif
#include <odp/api/queue.h>
-#include <odp_queue_if.h>
#include <odp/api/schedule.h>
-#include <odp_forward_typedefs_internal.h>
+
+#include <odp_event_internal.h>
+#include <odp_queue_if.h>
#define _ODP_SCHED_ID_BASIC 0
#define _ODP_SCHED_ID_SP 1
@@ -45,8 +46,8 @@ typedef int (*schedule_create_queue_fn_t)(uint32_t queue_index,
typedef void (*schedule_destroy_queue_fn_t)(uint32_t queue_index);
typedef int (*schedule_sched_queue_fn_t)(uint32_t queue_index);
typedef int (*schedule_unsched_queue_fn_t)(uint32_t queue_index);
-typedef int (*schedule_ord_enq_multi_fn_t)(odp_queue_t queue,
- void *buf_hdr[], int num, int *ret);
+typedef int (*schedule_ord_enq_multi_fn_t)(odp_queue_t queue, void *event_hdr[],
+ int num, int *ret);
typedef int (*schedule_init_global_fn_t)(void);
typedef int (*schedule_term_global_fn_t)(void);
typedef int (*schedule_init_local_fn_t)(void);
@@ -87,7 +88,7 @@ extern const schedule_fn_t *_odp_sched_fn;
/* Interface for the scheduler */
int _odp_sched_cb_pktin_poll(int pktio_index, int pktin_index,
- odp_buffer_hdr_t *hdr_tbl[], int num);
+ _odp_event_hdr_t *hdr_tbl[], int num);
int _odp_sched_cb_pktin_poll_one(int pktio_index, int rx_queue, odp_event_t evts[]);
void _odp_sched_cb_pktio_stop_finalize(int pktio_index);
diff --git a/platform/linux-generic/include/odp_schedule_scalable.h b/platform/linux-generic/include/odp_schedule_scalable.h
index c5e6a2880..207573f4c 100644
--- a/platform/linux-generic/include/odp_schedule_scalable.h
+++ b/platform/linux-generic/include/odp_schedule_scalable.h
@@ -13,6 +13,7 @@
#include <odp/api/schedule.h>
#include <odp/api/ticketlock.h>
+#include <odp_event_internal.h>
#include <odp_schedule_scalable_config.h>
#include <odp_schedule_scalable_ordered.h>
#include <odp_llqueue.h>
@@ -74,13 +75,13 @@ typedef struct ODP_ALIGNED_CACHE {
ringidx_t prod_read SPLIT_PC;
ringidx_t prod_write;
ringidx_t prod_mask;
- odp_buffer_hdr_t **prod_ring;
+ _odp_event_hdr_t **prod_ring;
ringidx_t cons_write SPLIT_PC;
ringidx_t cons_read;
reorder_window_t *rwin;
void *user_ctx;
#ifdef CONFIG_SPLIT_PRODCONS
- odp_buffer_hdr_t **cons_ring;
+ _odp_event_hdr_t **cons_ring;
ringidx_t cons_mask;
uint16_t cons_type;
#else
diff --git a/platform/linux-generic/include/odp_schedule_scalable_ordered.h b/platform/linux-generic/include/odp_schedule_scalable_ordered.h
index 3fa81f750..21c89bed2 100644
--- a/platform/linux-generic/include/odp_schedule_scalable_ordered.h
+++ b/platform/linux-generic/include/odp_schedule_scalable_ordered.h
@@ -13,6 +13,7 @@
#include <odp_align_internal.h>
#include <odp_bitset.h>
+#include <odp_event_internal.h>
#include <odp_ishmpool_internal.h>
/* High level functioning of reordering
@@ -106,7 +107,7 @@ struct ODP_ALIGNED_CACHE reorder_context {
/* Number of events stored in this reorder context */
uint8_t numevts;
/* Events stored in this context */
- odp_buffer_hdr_t *events[RC_EVT_SIZE];
+ _odp_event_hdr_t *events[RC_EVT_SIZE];
queue_entry_t *destq[RC_EVT_SIZE];
};
@@ -119,6 +120,6 @@ void _odp_rwin_unreserve_sc(reorder_window_t *rwin, uint32_t sn);
void _odp_rctx_init(reorder_context_t *rctx, uint16_t idx,
reorder_window_t *rwin, uint32_t sn);
void _odp_rctx_release(reorder_context_t *rctx);
-int _odp_rctx_save(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], int num);
+int _odp_rctx_save(queue_entry_t *queue, _odp_event_hdr_t *event_hdr[], int num);
#endif /* ODP_SCHEDULE_SCALABLE_ORDERED_H */
diff --git a/platform/linux-generic/include/odp_sysinfo_internal.h b/platform/linux-generic/include/odp_sysinfo_internal.h
index 81bfd045f..16e4ced84 100644
--- a/platform/linux-generic/include/odp_sysinfo_internal.h
+++ b/platform/linux-generic/include/odp_sysinfo_internal.h
@@ -17,7 +17,6 @@ extern "C" {
#include <string.h>
int _odp_cpuinfo_parser(FILE *file, system_info_t *sysinfo);
-uint64_t odp_cpu_hz_current(int id);
uint64_t odp_cpu_arch_hz_current(int id);
void _odp_sys_info_print_arch(void);
diff --git a/platform/linux-generic/include/odp_timer_internal.h b/platform/linux-generic/include/odp_timer_internal.h
index 435fa8b70..2a7173d29 100644
--- a/platform/linux-generic/include/odp_timer_internal.h
+++ b/platform/linux-generic/include/odp_timer_internal.h
@@ -1,4 +1,5 @@
/* Copyright (c) 2014-2018, Linaro Limited
+ * Copyright (c) 2021, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -15,19 +16,18 @@
#include <odp/api/align.h>
#include <odp/api/debug.h>
-#include <odp_buffer_internal.h>
-#include <odp_pool_internal.h>
#include <odp/api/timer.h>
+
+#include <odp_event_internal.h>
#include <odp_global_data.h>
+#include <odp_pool_internal.h>
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
/**
* Internal Timeout header
*/
-typedef struct {
- /* common buffer header */
- odp_buffer_hdr_t buf_hdr;
+typedef struct ODP_ALIGNED_CACHE odp_timeout_hdr_t {
+ /* Common event header */
+ _odp_event_hdr_t event_hdr;
/* Requested expiration time */
uint64_t expiration;
@@ -39,7 +39,6 @@ typedef struct {
odp_timer_t timer;
} odp_timeout_hdr_t;
-#pragma GCC diagnostic pop
/* A larger decrement value should be used after receiving events compared to
* an 'empty' call. */