aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@linaro.org>2017-01-31 10:07:21 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2017-02-03 19:52:37 +0300
commit62108ed367a2718e0f0e2d7d8682b5c83d504670 (patch)
tree07adf3382278f2f68ec083cce80c639bdd1a6331
parent4afed247a6ee3058aa6dc3e66ed0bd5acff9ce97 (diff)
abi: classifier: added initial definitions
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> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r--include/odp/arch/arm32-linux/odp/api/abi/classification.h7
-rw-r--r--include/odp/arch/arm64-linux/odp/api/abi/classification.h7
-rw-r--r--include/odp/arch/default/api/abi/classification.h40
-rw-r--r--include/odp/arch/mips64-linux/odp/api/abi/classification.h7
-rw-r--r--include/odp/arch/power64-linux/odp/api/abi/classification.h7
-rw-r--r--include/odp/arch/x86_32-linux/odp/api/abi/classification.h7
-rw-r--r--include/odp/arch/x86_64-linux/odp/api/abi/classification.h7
-rw-r--r--platform/Makefile.inc2
-rw-r--r--platform/linux-generic/include/odp/api/classification.h9
-rw-r--r--platform/linux-generic/include/odp/api/plat/classification_types.h34
-rw-r--r--platform/linux-generic/include/odp_classification_datamodel.h3
-rw-r--r--platform/linux-generic/odp_classification.c12
12 files changed, 114 insertions, 28 deletions
diff --git a/include/odp/arch/arm32-linux/odp/api/abi/classification.h b/include/odp/arch/arm32-linux/odp/api/abi/classification.h
new file mode 100644
index 000000000..d48a4733f
--- /dev/null
+++ b/include/odp/arch/arm32-linux/odp/api/abi/classification.h
@@ -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>
diff --git a/include/odp/arch/arm64-linux/odp/api/abi/classification.h b/include/odp/arch/arm64-linux/odp/api/abi/classification.h
new file mode 100644
index 000000000..d48a4733f
--- /dev/null
+++ b/include/odp/arch/arm64-linux/odp/api/abi/classification.h
@@ -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>
diff --git a/include/odp/arch/default/api/abi/classification.h b/include/odp/arch/default/api/abi/classification.h
new file mode 100644
index 000000000..771907aec
--- /dev/null
+++ b/include/odp/arch/default/api/abi/classification.h
@@ -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
diff --git a/include/odp/arch/mips64-linux/odp/api/abi/classification.h b/include/odp/arch/mips64-linux/odp/api/abi/classification.h
new file mode 100644
index 000000000..d48a4733f
--- /dev/null
+++ b/include/odp/arch/mips64-linux/odp/api/abi/classification.h
@@ -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>
diff --git a/include/odp/arch/power64-linux/odp/api/abi/classification.h b/include/odp/arch/power64-linux/odp/api/abi/classification.h
new file mode 100644
index 000000000..d48a4733f
--- /dev/null
+++ b/include/odp/arch/power64-linux/odp/api/abi/classification.h
@@ -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>
diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/classification.h b/include/odp/arch/x86_32-linux/odp/api/abi/classification.h
new file mode 100644
index 000000000..d48a4733f
--- /dev/null
+++ b/include/odp/arch/x86_32-linux/odp/api/abi/classification.h
@@ -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>
diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/classification.h b/include/odp/arch/x86_64-linux/odp/api/abi/classification.h
new file mode 100644
index 000000000..d48a4733f
--- /dev/null
+++ b/include/odp/arch/x86_64-linux/odp/api/abi/classification.h
@@ -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>
diff --git a/platform/Makefile.inc b/platform/Makefile.inc
index b078df891..bb406928b 100644
--- a/platform/Makefile.inc
+++ b/platform/Makefile.inc
@@ -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 = \
diff --git a/platform/linux-generic/include/odp/api/classification.h b/platform/linux-generic/include/odp/api/classification.h
index 0bec38be8..2ba6eb0eb 100644
--- a/platform/linux-generic/include/odp/api/classification.h
+++ b/platform/linux-generic/include/odp/api/classification.h
@@ -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;
+
/**
* @}
*/
diff --git a/platform/linux-generic/include/odp/api/plat/classification_types.h b/platform/linux-generic/include/odp/api/plat/classification_types.h
index 2093f54ac..d210feb0c 100644
--- a/platform/linux-generic/include/odp/api/plat/classification_types.h
+++ b/platform/linux-generic/include/odp/api/plat/classification_types.h
@@ -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
diff --git a/platform/linux-generic/include/odp_classification_datamodel.h b/platform/linux-generic/include/odp_classification_datamodel.h
index f6393ee78..d5382f372 100644
--- a/platform/linux-generic/include/odp_classification_datamodel.h
+++ b/platform/linux-generic/include/odp_classification_datamodel.h
@@ -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;
diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c
index 50a7e5473..e3e357443 100644
--- a/platform/linux-generic/odp_classification.c
+++ b/platform/linux-generic/odp_classification.c
@@ -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);
+}