new file mode 100644
@@ -0,0 +1,7 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <odp/arch/default/api/abi/queue.h>
new file mode 100644
@@ -0,0 +1,7 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <odp/arch/default/api/abi/queue.h>
new file mode 100644
@@ -0,0 +1,35 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef ODP_ABI_QUEUE_H_
+#define ODP_ABI_QUEUE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @internal Dummy type for strong typing */
+typedef struct { char dummy; /**< @internal Dummy */ } _odp_abi_queue_t;
+
+/** @ingroup odp_queue
+ * @{
+ */
+
+typedef _odp_abi_queue_t *odp_queue_t;
+
+#define ODP_QUEUE_INVALID ((odp_queue_t)0)
+
+#define ODP_QUEUE_NAME_LEN 32
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
new file mode 100644
@@ -0,0 +1,7 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <odp/arch/default/api/abi/queue.h>
new file mode 100644
@@ -0,0 +1,7 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <odp/arch/default/api/abi/queue.h>
new file mode 100644
@@ -0,0 +1,7 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <odp/arch/default/api/abi/queue.h>
new file mode 100644
@@ -0,0 +1,7 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <odp/arch/default/api/abi/queue.h>
@@ -67,7 +67,8 @@ odpapiabidefaultinclude_HEADERS = \
$(top_srcdir)/include/odp/arch/default/api/abi/crypto.h \
$(top_srcdir)/include/odp/arch/default/api/abi/event.h \
$(top_srcdir)/include/odp/arch/default/api/abi/packet.h \
- $(top_srcdir)/include/odp/arch/default/api/abi/pool.h
+ $(top_srcdir)/include/odp/arch/default/api/abi/pool.h \
+ $(top_srcdir)/include/odp/arch/default/api/abi/queue.h
odpapiabiarchincludedir= $(includedir)/odp/arch/@ARCH_ABI@/odp/api/abi
odpapiabiarchinclude_HEADERS = \
@@ -76,7 +77,8 @@ odpapiabiarchinclude_HEADERS = \
$(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/crypto.h \
$(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/event.h \
$(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/packet.h \
- $(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/pool.h
+ $(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/pool.h \
+ $(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/queue.h
EXTRA_DIST = \
arch/arm/odp/api/cpu_arch.h \
@@ -17,39 +17,30 @@
extern "C" {
#endif
+#include <odp/api/plat/static_inline.h>
+#if ODP_ABI_COMPAT == 1
+#include <odp/api/abi/queue.h>
+#else
+
#include <odp/api/std_types.h>
#include <odp/api/plat/strong_types.h>
-/** @addtogroup odp_queue ODP QUEUE
- * Macros and operation on a queue.
+/** @ingroup odp_queue
* @{
*/
typedef ODP_HANDLE_T(odp_queue_t);
-typedef ODP_HANDLE_T(odp_queue_group_t);
-
#define ODP_QUEUE_INVALID _odp_cast_scalar(odp_queue_t, 0)
#define ODP_QUEUE_NAME_LEN 32
/**
- * @def ODP_QUEUE_TYPE_TM
- * Traffic manager queue
- * @note Internal to the implementation -- not part of queue type API
- */
-#define ODP_QUEUE_TYPE_TM 4
-
-/** Get printable format of odp_queue_t */
-static inline uint64_t odp_queue_to_u64(odp_queue_t hdl)
-{
- return _odp_pri(hdl);
-}
-
-/**
* @}
*/
+#endif
+
#ifdef __cplusplus
}
#endif
@@ -27,6 +27,10 @@ extern "C" {
* @{
*/
+/* REMOVE FROM API SPEC. Typedef needed only for suppressing Doxygen
+ * warning. */
+typedef void odp_queue_group_t;
+
/**
* @}
*/
@@ -82,7 +82,6 @@ struct cos_s {
union cos_u *linked_cos[ODP_PMR_PER_COS_MAX]; /* Chained CoS with PMR*/
uint32_t valid; /* validity Flag */
odp_cls_drop_t drop_policy; /* Associated Drop Policy */
- odp_queue_group_t queue_group; /* Associated Queue Group */
size_t headroom; /* Headroom for this CoS */
odp_spinlock_t lock; /* cos lock */
odp_atomic_u32_t num_rule; /* num of PMRs attached with this CoS */
@@ -756,3 +756,8 @@ int sched_cb_queue_empty(uint32_t queue_index)
return ret;
}
+
+uint64_t odp_queue_to_u64(odp_queue_t hdl)
+{
+ return _odp_pri(hdl);
+}
@@ -37,6 +37,9 @@ static const pkt_desc_t EMPTY_PKT_DESC = { .word = 0 };
#define MAX_PRIORITIES ODP_TM_MAX_PRIORITIES
#define NUM_SHAPER_COLORS ODP_NUM_SHAPER_COLORS
+/* Traffic manager queue */
+#define QUEUE_TYPE_TM 4
+
static tm_prop_t basic_prop_tbl[MAX_PRIORITIES][NUM_SHAPER_COLORS] = {
[0] = {
[ODP_TM_SHAPER_GREEN] = { 0, DECR_BOTH },
@@ -3915,7 +3918,7 @@ odp_tm_queue_t odp_tm_queue_create(odp_tm_t odp_tm,
tm_queue_obj->pkt = ODP_PACKET_INVALID;
odp_ticketlock_init(&tm_wred_node->tm_wred_node_lock);
- tm_queue_obj->tm_qentry.s.type = ODP_QUEUE_TYPE_TM;
+ tm_queue_obj->tm_qentry.s.type = QUEUE_TYPE_TM;
tm_queue_obj->tm_qentry.s.enqueue = queue_tm_reenq;
tm_queue_obj->tm_qentry.s.enqueue_multi = queue_tm_reenq_multi;
Initially, use the same default ABI file for all architectures. Default values match those defined in odp-linux implementation to minimize changes in this phase. Removed an unused type definition, documentation of that need to be still removed for API spec. Moved a TM specific define into TM source file. Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> --- include/odp/arch/arm32-linux/odp/api/abi/queue.h | 7 +++++ include/odp/arch/arm64-linux/odp/api/abi/queue.h | 7 +++++ include/odp/arch/default/api/abi/queue.h | 35 ++++++++++++++++++++++ include/odp/arch/mips64-linux/odp/api/abi/queue.h | 7 +++++ include/odp/arch/power64-linux/odp/api/abi/queue.h | 7 +++++ include/odp/arch/x86_32-linux/odp/api/abi/queue.h | 7 +++++ include/odp/arch/x86_64-linux/odp/api/abi/queue.h | 7 +++++ platform/Makefile.inc | 6 ++-- .../include/odp/api/plat/queue_types.h | 25 +++++----------- platform/linux-generic/include/odp/api/queue.h | 4 +++ .../include/odp_classification_datamodel.h | 1 - platform/linux-generic/odp_queue.c | 5 ++++ platform/linux-generic/odp_traffic_mngr.c | 5 +++- 13 files changed, 102 insertions(+), 21 deletions(-) create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/queue.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/queue.h create mode 100644 include/odp/arch/default/api/abi/queue.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/queue.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/queue.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/queue.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/queue.h -- 2.8.1