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_event_internal.h21
-rw-r--r--platform/linux-generic/include/odp_packet_internal.h12
-rw-r--r--platform/linux-generic/include/odp_pool_internal.h10
-rw-r--r--platform/linux-generic/include/odp_timer_internal.h5
-rw-r--r--platform/linux-generic/include/odp_traffic_mngr_internal.h1
5 files changed, 27 insertions, 22 deletions
diff --git a/platform/linux-generic/include/odp_event_internal.h b/platform/linux-generic/include/odp_event_internal.h
index fa7e5f354..92f201b01 100644
--- a/platform/linux-generic/include/odp_event_internal.h
+++ b/platform/linux-generic/include/odp_event_internal.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2021, Nokia
+/* Copyright (c) 2021-2022, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -17,21 +17,21 @@
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 {
+/* Combined pool and event index */
+typedef union _odp_event_index_t {
uint32_t u32;
struct {
uint32_t pool :8;
- uint32_t buffer :24;
+ uint32_t event :24;
};
-} buffer_index_t;
+} _odp_event_index_t;
/* Check that pool index fit into bit field */
ODP_STATIC_ASSERT(ODP_CONFIG_POOLS <= (0xFF + 1), "TOO_MANY_POOLS");
@@ -51,19 +51,12 @@ typedef struct _odp_event_hdr_t {
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;
+ /* Combined pool and event index */
+ _odp_event_index_t index;
/* Pool type */
int8_t type;
diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h
index 7c9b7735e..a230c3b76 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-2021, Nokia
+ * Copyright (c) 2019-2022, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -19,6 +19,7 @@ extern "C" {
#endif
#include <odp/api/align.h>
+#include <odp/api/atomic.h>
#include <odp/api/debug.h>
#include <odp/api/packet.h>
#include <odp/api/plat/packet_inline_types.h>
@@ -117,9 +118,18 @@ typedef struct ODP_ALIGNED_CACHE odp_packet_hdr_t {
/* Classifier destination queue */
odp_queue_t dst_queue;
+ /* Reference count */
+ odp_atomic_u32_t ref_cnt;
+
/* Flow hash value */
uint32_t flow_hash;
+ /* User area pointer */
+ void *uarea_addr;
+
+ /* User context pointer */
+ const void *user_ptr;
+
/* Classifier mark */
uint16_t cls_mark;
diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h
index c9bae7142..4c9f9a9ce 100644
--- a/platform/linux-generic/include/odp_pool_internal.h
+++ b/platform/linux-generic/include/odp_pool_internal.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2013-2018, Linaro Limited
- * Copyright (c) 2019-2021, Nokia
+ * Copyright (c) 2019-2022, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -159,16 +159,16 @@ static inline _odp_event_hdr_t *event_hdr_from_index(pool_t *pool,
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;
+ _odp_event_index_t index;
+ uint32_t pool_idx, event_idx;
pool_t *pool;
index.u32 = u32;
pool_idx = index.pool;
- buffer_idx = index.buffer;
+ event_idx = index.event;
pool = pool_entry(pool_idx);
- return event_hdr_from_index(pool, buffer_idx);
+ return event_hdr_from_index(pool, event_idx);
}
odp_event_t _odp_event_alloc(pool_t *pool);
diff --git a/platform/linux-generic/include/odp_timer_internal.h b/platform/linux-generic/include/odp_timer_internal.h
index 2a7173d29..b83591446 100644
--- a/platform/linux-generic/include/odp_timer_internal.h
+++ b/platform/linux-generic/include/odp_timer_internal.h
@@ -1,5 +1,5 @@
/* Copyright (c) 2014-2018, Linaro Limited
- * Copyright (c) 2021, Nokia
+ * Copyright (c) 2021-2022, Nokia
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -40,6 +40,9 @@ typedef struct ODP_ALIGNED_CACHE odp_timeout_hdr_t {
} odp_timeout_hdr_t;
+ODP_STATIC_ASSERT(sizeof(odp_timeout_hdr_t) <= ODP_CACHE_LINE_SIZE,
+ "TIMEOUT_HDR_SIZE_ERROR");
+
/* A larger decrement value should be used after receiving events compared to
* an 'empty' call. */
void _odp_timer_run_inline(int dec);
diff --git a/platform/linux-generic/include/odp_traffic_mngr_internal.h b/platform/linux-generic/include/odp_traffic_mngr_internal.h
index a54847319..2b5e47637 100644
--- a/platform/linux-generic/include/odp_traffic_mngr_internal.h
+++ b/platform/linux-generic/include/odp_traffic_mngr_internal.h
@@ -286,7 +286,6 @@ struct tm_queue_obj_s {
uint8_t blocked_cnt;
odp_bool_t ordered_enqueue;
tm_status_t status;
- odp_queue_t queue;
/* Statistics for odp_tm_queue_stats_t */
struct {
odp_atomic_u64_t discards;