diff mbox series

[API-NEXT,v5,1/2] api: classification: add random early detection and back pressure

Message ID 1505376010-305-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v5,1/2] api: classification: add random early detection and back pressure | expand

Commit Message

Github ODP bot Sept. 14, 2017, 8 a.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 172 (bala-manoharan:random_early_discard)
 ** https://github.com/Linaro/odp/pull/172
 ** Patch: https://github.com/Linaro/odp/pull/172.patch
 ** Base sha: 6b6253c30f88c80bf632436ff06c1b000860a2f1
 ** Merge commit sha: 004b3f911c315f6d1e9e7fb1a057bd8fd86ee4c8
 **/
 include/odp/api/spec/classification.h | 44 +++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
diff mbox series

Patch

diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h
index 0c4a95c5..6e8cd951 100644
--- a/include/odp/api/spec/classification.h
+++ b/include/odp/api/spec/classification.h
@@ -135,6 +135,13 @@  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;
+
+	/** Support for Back Pressure to the remote peer */
+	odp_support_t back_pressure;
+
 } odp_cls_capability_t;
 
 /**
@@ -206,6 +213,43 @@  typedef struct odp_cls_cos_param {
 
 	/** Drop policy associated with CoS */
 	odp_cls_drop_t drop_policy;
+
+	/* 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 1 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.
+	 * RED is controlled using maximum and minimum threshold values
+	 * which are defined as percentage of the system resource.
+	 * 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. */
+
+	/* A boolean to enable RED parameters */
+	odp_bool_t red_enable;
+
+	/* Maximum threshold percentage for RED */
+	uint16_t max_red_threshold;
+
+	/* Minimum threshold percentage for RED */
+	uint16_t min_red_threshold;
+
+	/* Back pressure
+	 * When back pressure is enabled for a particular flow, the HW can send
+	 * back pressure information to the remote peer indicating a network
+	 * congestion */
+	odp_bool_t bp_enable;
+
+	/* Threshold for enabling back pressure. BP is enabled when pool/queue
+	 * size is equal to or greater than this backpressure threshold.
+	 * BP threshold is expressed as a percentage of the resource size. */
+	uint16_t bp_threshold;
 } odp_cls_cos_param_t;
 
 /**