diff mbox

[API-NEXT/PATCHv1,1/4] api: classification: add class of serivce create api

Message ID 1449570112-5486-1-git-send-email-bala.manoharan@linaro.org
State Superseded
Headers show

Commit Message

Balasubramanian Manoharan Dec. 8, 2015, 10:21 a.m. UTC
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>
---
 include/odp/api/classification.h | 31 ++++++++++++++++++++++++++-----
 1 file changed, 26 insertions(+), 5 deletions(-)

Comments

Balasubramanian Manoharan Dec. 14, 2015, 9:35 a.m. UTC | #1
Ping.

On 8 December 2015 at 15:51, Balasubramanian Manoharan
<bala.manoharan@linaro.org> wrote:
> 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>
> ---
>  include/odp/api/classification.h | 31 ++++++++++++++++++++++++++-----
>  1 file changed, 26 insertions(+), 5 deletions(-)
>
> diff --git a/include/odp/api/classification.h b/include/odp/api/classification.h
> index 725e1ab..18572ad 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,35 @@ 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.
>   *
> - * @return             Class of service instance identifier
> + * @param[in]  param   class of service parameters
> + *
> + * @retval             class of service handle
>   * @retval             ODP_COS_INVALID on failure.
>   */
> -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
> --
> 1.9.1
>
diff mbox

Patch

diff --git a/include/odp/api/classification.h b/include/odp/api/classification.h
index 725e1ab..18572ad 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,35 @@  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.
  *
- * @return		Class of service instance identifier
+ * @param[in]	param	class of service parameters
+ *
+ * @retval		class of service handle
  * @retval		ODP_COS_INVALID on failure.
  */
-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