diff mbox series

[API-NEXT,v1,3/7] api: red: random early detection and back pressure

Message ID 1509973206-1972-4-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v1,1/7] api: std_types: add odp_percent_t data type | expand

Commit Message

Github ODP bot Nov. 6, 2017, 1 p.m. UTC
From: Balasubramanian Manoharan <bala.manoharan@linaro.org>


adds random early detection configuration parameter
adds back pressure configuration parameter

Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>

---
/** Email created from pull request 277 (bala-manoharan:RED)
 ** https://github.com/Linaro/odp/pull/277
 ** Patch: https://github.com/Linaro/odp/pull/277.patch
 ** Base sha: d22c949cc466bf28de559855a1cb525740578137
 ** Merge commit sha: f8726f45026a85ce1dde794190c1eb35945dca3f
 **/
 include/odp/api/spec/red.h                   | 79 ++++++++++++++++++++++++++++
 platform/linux-generic/include/odp/api/red.h | 30 +++++++++++
 2 files changed, 109 insertions(+)
 create mode 100644 include/odp/api/spec/red.h
 create mode 100644 platform/linux-generic/include/odp/api/red.h
diff mbox series

Patch

diff --git a/include/odp/api/spec/red.h b/include/odp/api/spec/red.h
new file mode 100644
index 000000000..c1aee238c
--- /dev/null
+++ b/include/odp/api/spec/red.h
@@ -0,0 +1,79 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP RED
+ */
+
+#ifndef ODP_API_RED_H_
+#define ODP_API_RED_H_
+#include <odp/visibility_begin.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/api/schedule_types.h>
+#include <odp/api/threshold.h>
+
+/** Random Early Detection (RED)
+ * Random Early Detection is enabled to initiate a drop probability
+ * for the incoming packet when the packets in the queue/pool reaches
+ * a specified threshold.
+ * When RED is enabled for a particular flow then further incoming
+ * packets are assigned a drop probability based on the size of the
+ * pool/queue and the drop probability becomes 100% when the queue/pool
+ * is full.
+ * RED can be configured either in pool or queue depending on the platform
+ * capabilities.
+ */
+typedef struct odp_red_param_t {
+	/** A boolean to enable RED
+	 * When true, RED is enabled and configured with RED parameters.
+	 * Otherwise, RED parameters are ignored. */
+	odp_bool_t red_enable;
+
+	/** Threshold parameters for RED
+	 * RED is enabled when the resource limit is equal to or greater than
+	 * the maximum threshold value and is disabled when resource limit
+	 * is less than or equal to minimum threshold value. */
+	odp_threshold_t red_threshold;
+} odp_red_param_t;
+
+/** Back pressure (BP)
+ * When back pressure is enabled for a particular flow, the HW can send
+ * back pressure information to the remote peer indicating a network congestion.
+ * Back pressure can be configured either in the pool or queue based on the
+ * platform capabilities.
+ */
+
+typedef struct odp_bp_param_t {
+	/** A boolean to enable Back pressure
+	 * When true, back pressure is enabled and configured with the BP
+	 * parameters. Otherwise BP parameters are ignored.
+	 */
+	odp_bool_t bp_enable;
+
+	/** Threshold value for back pressure.
+	 * BP is enabled when queue or pool value is equal to or greater
+	 * than the max backpressure threshold.
+	 * Min threshold parameters are ignored for BP configuration.
+	 */
+	odp_threshold_t bp_threshold;
+} odp_bp_param_t;
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#include <odp/visibility_end.h>
+#endif
diff --git a/platform/linux-generic/include/odp/api/red.h b/platform/linux-generic/include/odp/api/red.h
new file mode 100644
index 000000000..8bd1596e5
--- /dev/null
+++ b/platform/linux-generic/include/odp/api/red.h
@@ -0,0 +1,30 @@ 
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP RED
+ */
+
+#ifndef ODP_PLAT_RED_H_
+#define ODP_PLAT_RED_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @}
+ */
+
+#include <odp/api/spec/red.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif