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

2015-12-14 Thread Bala Manoharan
Ping.

On 8 December 2015 at 15:51, Balasubramanian Manoharan
 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 
> ---
>  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]  nameString 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
>



-- 
Regards,
Bala
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


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

2015-12-14 Thread Savolainen, Petri (Nokia - FI/Espoo)


> -Original Message-
> From: EXT Balasubramanian Manoharan [mailto:bala.manoha...@linaro.org]
> Sent: Tuesday, December 08, 2015 12:22 PM
> To: lng-odp@lists.linaro.org
> Cc: Savolainen, Petri (Nokia - FI/Espoo); Balasubramanian Manoharan
> Subject: [API-NEXT/PATCHv1 1/4] api: classification: add class of serivce
> create api
> 
> 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 
> ---
>  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;


This type could be renamed to odp_cls_drop_t. odp_drop_e is pretty generic type 
name. All odp_xxx_e types should be renamed to odp_xxx_t to be consistent with 
type naming. This can be done now or in a later patch set.



> @@ -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
>   *

The function documentation needs some words about parameter usage. E.g. can 
user pass ODP_QUEUE_INVALID and on which conditions?  The implementation seems 
to accept it and it's a valid input when defining a drop policy CoS...


>   * @param[in]  name  String intended for debugging purposes.

[in] not needed.

>   *
> - * @return   Class of service instance identifier
> + * @param[in]param   class of service parameters

[in] not needed. Could remove [in] throughout the entire header file in one 
patch (in the beginning of the series).


-Petri


> + *
> + * @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

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


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

2015-12-08 Thread Balasubramanian Manoharan
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 
---
 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]  nameString 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

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp