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/classification.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/classification.h>
new file mode 100644
@@ -0,0 +1,40 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef ODP_ABI_CLASSIFICATION_H_
+#define ODP_ABI_CLASSIFICATION_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @internal Dummy type for strong typing */
+typedef struct { char dummy; /**< @internal Dummy */ } _odp_abi_cos_t;
+
+/** Dummy type for strong typing */
+typedef struct { char dummy; /**< @internal Dummy */ } _odp_abi_pmr_t;
+
+/** @ingroup odp_classification
+ * @{
+ */
+
+typedef _odp_abi_cos_t *odp_cos_t;
+typedef _odp_abi_pmr_t *odp_pmr_t;
+
+#define ODP_COS_INVALID ((odp_cos_t)~0)
+#define ODP_PMR_INVAL ((odp_pmr_t)~0)
+
+#define ODP_COS_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/classification.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/classification.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/classification.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/classification.h>
@@ -63,11 +63,13 @@ odpapispecinclude_HEADERS = \
odpapiabidefaultincludedir= $(includedir)/odp/arch/default/api/abi
odpapiabidefaultinclude_HEADERS = \
$(top_srcdir)/include/odp/arch/default/api/abi/buffer.h \
+ $(top_srcdir)/include/odp/arch/default/api/abi/classification.h \
$(top_srcdir)/include/odp/arch/default/api/abi/event.h
odpapiabiarchincludedir= $(includedir)/odp/arch/@ARCH_ABI@/odp/api/abi
odpapiabiarchinclude_HEADERS = \
$(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/buffer.h \
+ $(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/classification.h \
$(top_srcdir)/include/odp/arch/@ARCH_ABI@/odp/api/abi/event.h
EXTRA_DIST = \
@@ -10,8 +10,8 @@
* ODP classification descriptor
*/
-#ifndef ODP_PLAT_CLASSIFY_H_
-#define ODP_PLAT_CLASSIFY_H_
+#ifndef ODP_PLAT_CLASSIFICATION_H_
+#define ODP_PLAT_CLASSIFICATION_H_
#ifdef __cplusplus
extern "C" {
@@ -28,6 +28,11 @@ extern "C" {
* @{
*/
+/* REMOVE THESE FROM API SPEC. Typedefs needed only for suppressing Doxygen
+ * warning. */
+typedef void odp_flowsig_t;
+typedef void odp_cos_flow_set_t;
+
/**
* @}
*/
@@ -10,46 +10,38 @@
* ODP classification descriptor
*/
-#ifndef ODP_CLASSIFY_TYPES_H_
-#define ODP_CLASSIFY_TYPES_H_
+#ifndef ODP_CLASSIFICATION_TYPES_H_
+#define ODP_CLASSIFICATION_TYPES_H_
#ifdef __cplusplus
extern "C" {
#endif
+#include <odp/api/plat/static_inline.h>
+#if ODP_ABI_COMPAT == 1
+#include <odp/api/abi/classification.h>
+#else
+
#include <odp/api/plat/strong_types.h>
-/** @addtogroup odp_classification
+/** @ingroup odp_classification
* @{
*/
typedef ODP_HANDLE_T(odp_cos_t);
-typedef ODP_HANDLE_T(odp_flowsig_t);
-
-#define ODP_COS_INVALID _odp_cast_scalar(odp_cos_t, ~0)
-#define ODP_COS_NAME_LEN 32
-
-typedef uint16_t odp_cos_flow_set_t;
+#define ODP_COS_INVALID _odp_cast_scalar(odp_cos_t, ~0)
typedef ODP_HANDLE_T(odp_pmr_t);
-#define ODP_PMR_INVAL _odp_cast_scalar(odp_pmr_t, ~0)
-
-/** Get printable format of odp_cos_t */
-static inline uint64_t odp_cos_to_u64(odp_cos_t hdl)
-{
- return _odp_pri(hdl);
-}
+#define ODP_PMR_INVAL _odp_cast_scalar(odp_pmr_t, ~0)
-/** Get printable format of odp_pmr_t */
-static inline uint64_t odp_pmr_to_u64(odp_pmr_t hdl)
-{
- return _odp_pri(hdl);
-}
+#define ODP_COS_NAME_LEN 32
/**
* @}
*/
+#endif
+
#ifdef __cplusplus
}
#endif
@@ -83,7 +83,6 @@ struct cos_s {
uint32_t valid; /* validity Flag */
odp_cls_drop_t drop_policy; /* Associated Drop Policy */
odp_queue_group_t queue_group; /* Associated Queue Group */
- odp_cos_flow_set_t flow_set; /* Assigned Flow Set */
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 */
@@ -149,8 +148,6 @@ typedef struct classifier {
uint32_t l3_precedence; /* L3 QoS precedence */
pmr_l2_cos_t l2_cos_table; /* L2 QoS-CoS table map */
pmr_l3_cos_t l3_cos_table; /* L3 Qos-CoS table map */
- odp_cos_flow_set_t flow_set; /* Flow Set to be calculated
- for this pktio */
size_t headroom; /* Pktio Headroom */
size_t skip; /* Pktio Skip Offset */
} classifier_t;
@@ -185,7 +185,6 @@ odp_cos_t odp_cls_cos_create(const char *name, odp_cls_cos_param_t *param)
}
cos_tbl->cos_entry[i].s.queue = queue;
cos_tbl->cos_entry[i].s.pool = param->pool;
- cos_tbl->cos_entry[i].s.flow_set = 0;
cos_tbl->cos_entry[i].s.headroom = 0;
cos_tbl->cos_entry[i].s.valid = 1;
cos_tbl->cos_entry[i].s.drop_policy = drop_policy;
@@ -732,7 +731,6 @@ int pktio_classifier_init(pktio_entry_t *entry)
if (entry == NULL)
return -1;
cls = &entry->s.cls;
- cls->flow_set = 0;
cls->error_cos = NULL;
cls->default_cos = NULL;
cls->headroom = 0;
@@ -897,3 +895,13 @@ cos_t *match_qos_cos(pktio_entry_t *entry, const uint8_t *pkt_addr,
}
return NULL;
}
+
+uint64_t odp_cos_to_u64(odp_cos_t hdl)
+{
+ return _odp_pri(hdl);
+}
+
+uint64_t odp_pmr_to_u64(odp_pmr_t hdl)
+{
+ return _odp_pri(hdl);
+}
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 unused type definitions, documentation of those need to be still removed for API spec. Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> --- .../arch/arm32-linux/odp/api/abi/classification.h | 7 ++++ .../arch/arm64-linux/odp/api/abi/classification.h | 7 ++++ include/odp/arch/default/api/abi/classification.h | 40 ++++++++++++++++++++++ .../arch/mips64-linux/odp/api/abi/classification.h | 7 ++++ .../power64-linux/odp/api/abi/classification.h | 7 ++++ .../arch/x86_32-linux/odp/api/abi/classification.h | 7 ++++ .../arch/x86_64-linux/odp/api/abi/classification.h | 7 ++++ platform/Makefile.inc | 2 ++ .../linux-generic/include/odp/api/classification.h | 9 +++-- .../include/odp/api/plat/classification_types.h | 34 +++++++----------- .../include/odp_classification_datamodel.h | 3 -- platform/linux-generic/odp_classification.c | 12 +++++-- 12 files changed, 114 insertions(+), 28 deletions(-) create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/classification.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/classification.h create mode 100644 include/odp/arch/default/api/abi/classification.h create mode 100644 include/odp/arch/mips64-linux/odp/api/abi/classification.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/classification.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/classification.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/classification.h -- 2.8.1