diff mbox series

[API-NEXT,v4,3/4] api: classification: add random early detection and back pressure

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

Commit Message

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


Adds random early detection and Back pressure feature to CoS

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: 0f3d27771374d5b525af19461f31d0e308b05874
 **/
 include/odp/api/spec/classification.h | 68 +++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)
diff mbox series

Patch

diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h
index 0c4a95c5f..f66dfab30 100644
--- a/include/odp/api/spec/classification.h
+++ b/include/odp/api/spec/classification.h
@@ -20,6 +20,7 @@  extern "C" {
 
 #include <odp/api/packet_io.h>
 #include <odp/api/support.h>
+#include <odp/api/threshold.h>
 /** @defgroup odp_classification ODP CLASSIFICATION
  *  Classification operations.
  *  @{
@@ -107,6 +108,55 @@  typedef union odp_cls_pmr_terms_t {
 	uint64_t all_bits;
 } odp_cls_pmr_terms_t;
 
+/** 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 is logically configured in the CoS and could be implemented
+ * in either pool or queue linked to the CoS depending on
+ * platform capabilities. Application should make sure not to link
+ * multiple CoS with different RED or BP configuration to the same queue
+ * or pool.
+ * 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. */
+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.
+ */
+
+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;
+
 /**
  * Classification capabilities
  * This capability structure defines system level classification capability
@@ -135,6 +185,18 @@  typedef struct odp_cls_capability_t {
 
 	/** A Boolean to denote support of PMR range */
 	odp_bool_t pmr_range_supported;
+
+	/** Support for Random Early Detection */
+	odp_support_t random_early_detection;
+
+	/** Supported threshold type for RED */
+	odp_threshold_type_t threshold_red;
+
+	/** Support for Back Pressure to the remote peer */
+	odp_support_t back_pressure;
+
+	/** Supported threshold type for BP */
+	odp_threshold_type_t threshold_bp;
 } odp_cls_capability_t;
 
 /**
@@ -206,6 +268,12 @@  typedef struct odp_cls_cos_param {
 
 	/** Drop policy associated with CoS */
 	odp_cls_drop_t drop_policy;
+
+	/** Random Early Detection configuration */
+	odp_red_param_t red;
+
+	/** Back Pressure configuration */
+	odp_bp_param_t bp;
 } odp_cls_cos_param_t;
 
 /**