aboutsummaryrefslogtreecommitdiff
path: root/include/odp/api/classification.h
diff options
context:
space:
mode:
authorBalasubramanian Manoharan <bala.manoharan@linaro.org>2015-12-16 14:58:48 +0530
committerMaxim Uvarov <maxim.uvarov@linaro.org>2015-12-29 14:07:52 +0300
commitfab0012c9b73d8774a8e736c70934bdcc4a2ca2b (patch)
treefba882aaea47c8defe3ddf803aff1cab2823d7ad /include/odp/api/classification.h
parentb9ddbd1dfbf2fbbc6740726735a67cf277168b95 (diff)
api/validation/linux-generic: classification: implement class of service create api
Implements odp_cls_cos_create() and odp_cls_cos_param_init() functions and replace odp_cos_create() function with odp_cls_cos_create() in validation and examples. Class of service create function now takes pool, queue, drop policy and name as input parameters. Adds class of service parameter structure odp_cls_cos_param_t and initialization function odp_cls_cos_param_init() Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'include/odp/api/classification.h')
-rw-r--r--include/odp/api/classification.h37
1 files changed, 31 insertions, 6 deletions
diff --git a/include/odp/api/classification.h b/include/odp/api/classification.h
index 725e1ab6d..4db5bf06e 100644
--- a/include/odp/api/classification.h
+++ b/include/odp/api/classification.h
@@ -37,7 +37,7 @@ extern "C" {
/**
* @def ODP_COS_INVALID
- * This value is returned from odp_cos_create() on failure,
+ * This value is returned from odp_cls_cos_create() on failure,
* May also be used as a sink class of service that
* results in packets being discarded.
*/
@@ -60,9 +60,9 @@ extern "C" {
*/
/**
- * Class-of-service packet drop policies
+ * class of service packet drop policies
*/
-typedef enum odp_cos_drop {
+typedef enum odp_cls_drop {
ODP_COS_DROP_POOL, /**< Follow buffer pool drop policy */
ODP_COS_DROP_NEVER, /**< Never drop, ignoring buffer pool policy */
} odp_drop_e;
@@ -89,14 +89,39 @@ typedef enum odp_cos_hdr_flow_fields {
} odp_cos_hdr_flow_fields_e;
/**
+ * Class of service parameters
+ * Used to communicate class of service creation options
+ */
+typedef struct odp_cls_cos_param {
+ odp_queue_t queue; /**< Queue associated with CoS */
+ odp_pool_t pool; /**< Pool associated with CoS */
+ odp_drop_e drop_policy; /**< Drop policy associated with CoS */
+} odp_cls_cos_param_t;
+
+/**
+ * Initialize class of service parameters
+ *
+ * Initialize an odp_cls_cos_param_t to its default value for all fields
+ *
+ * @param param Address of the odp_cls_cos_param_t to be initialized
+ */
+void odp_cls_cos_param_init(odp_cls_cos_param_t *param);
+
+/**
* Create a class-of-service
*
- * @param[in] name String intended for debugging purposes.
+ * @param name String intended for debugging purposes.
*
- * @return Class of service instance identifier
+ * @param param class of service parameters
+ *
+ * @retval class of service handle
* @retval ODP_COS_INVALID on failure.
+ *
+ * @note ODP_QUEUE_INVALID and ODP_POOL_INVALID are valid values for queue
+ * and pool associated with a class of service and when any one of these values
+ * are configured as INVALID then the packets assigned to the CoS gets dropped.
*/
-odp_cos_t odp_cos_create(const char *name);
+odp_cos_t odp_cls_cos_create(const char *name, odp_cls_cos_param_t *param);
/**
* Discard a class-of-service along with all its associated resources