diff mbox

[API-NEXT/PATCHv2,5/6] api: classification: rename odp_drop_e to odp_cls_drop_t

Message ID 1450258133-3375-5-git-send-email-bala.manoharan@linaro.org
State New
Headers show

Commit Message

Balasubramanian Manoharan Dec. 16, 2015, 9:28 a.m. UTC
Changes drop policy enum name from odp_drop_e to odp_cls_drop_t

Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
---
 include/odp/api/classification.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Bill Fischofer Dec. 17, 2015, 3:24 a.m. UTC | #1
On Wed, Dec 16, 2015 at 3:28 AM, Balasubramanian Manoharan <
bala.manoharan@linaro.org> wrote:

> Changes drop policy enum name from odp_drop_e to odp_cls_drop_t

>

> Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>

> ---

>  include/odp/api/classification.h | 8 ++++----

>  1 file changed, 4 insertions(+), 4 deletions(-)

>

> diff --git a/include/odp/api/classification.h

> b/include/odp/api/classification.h

> index 4db5bf0..c9493c2 100644

> --- a/include/odp/api/classification.h

> +++ b/include/odp/api/classification.h

> @@ -65,7 +65,7 @@ extern "C" {

>  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;

> +} odp_cls_drop_t;

>

>  /**

>   * Packet header field enumeration

> @@ -95,7 +95,7 @@ typedef enum odp_cos_hdr_flow_fields {

>  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_drop_t drop_policy;     /**< Drop policy associated with

> CoS */

>


Changing this to odp_cos_drop_t instead of odp_cls_drop_t would be more
consistent.  The object metadata belongs to an odp_cos_t, not an odp_cls_t.


>  } odp_cls_cos_param_t;

>

>  /**

> @@ -170,7 +170,7 @@ odp_queue_t odp_cos_queue(odp_cos_t cos_id);

>   *

>   * @note Optional.

>   */

> -int odp_cos_drop_set(odp_cos_t cos_id, odp_drop_e drop_policy);

> +int odp_cos_drop_set(odp_cos_t cos_id, odp_cls_drop_t drop_policy);

>

>  /**

>  * Get the drop policy configured for a specific class-of-service instance.

> @@ -180,7 +180,7 @@ int odp_cos_drop_set(odp_cos_t cos_id, odp_drop_e

> drop_policy);

>  * @retval                      Drop policy configured with the given

>  *                              class-of-service

>  */

> -odp_drop_e odp_cos_drop(odp_cos_t cos_id);

> +odp_cls_drop_t odp_cos_drop(odp_cos_t cos_id);

>


Again odp_cos_drop should return an odp_cos_drop_t.  If the return type
were odp_cls_drop_t then the function should be odp_cls_drop() for
consistency, but odp_cos_drop() seems correct here.

>

>  /**

>   * Request to override per-port class of service

> --

> 1.9.1

>

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>
Balasubramanian Manoharan Dec. 17, 2015, 6:40 a.m. UTC | #2
Hi,

On 17 December 2015 at 08:54, Bill Fischofer <bill.fischofer@linaro.org> wrote:
>
>
> On Wed, Dec 16, 2015 at 3:28 AM, Balasubramanian Manoharan
> <bala.manoharan@linaro.org> wrote:
>>
>> Changes drop policy enum name from odp_drop_e to odp_cls_drop_t
>>
>> Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
>> ---
>>  include/odp/api/classification.h | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/include/odp/api/classification.h
>> b/include/odp/api/classification.h
>> index 4db5bf0..c9493c2 100644
>> --- a/include/odp/api/classification.h
>> +++ b/include/odp/api/classification.h
>> @@ -65,7 +65,7 @@ extern "C" {
>>  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;
>> +} odp_cls_drop_t;
>>
>>  /**
>>   * Packet header field enumeration
>> @@ -95,7 +95,7 @@ typedef enum odp_cos_hdr_flow_fields {
>>  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_drop_t drop_policy;     /**< Drop policy associated with
>> CoS */
>
>
> Changing this to odp_cos_drop_t instead of odp_cls_drop_t would be more
> consistent.  The object metadata belongs to an odp_cos_t, not an odp_cls_t.

As explained in the previous mail odp_cls_xxx is used as a prefix
since it is common for PMR and CoS.

>
>>
>>  } odp_cls_cos_param_t;
>>
>>  /**
>> @@ -170,7 +170,7 @@ odp_queue_t odp_cos_queue(odp_cos_t cos_id);
>>   *
>>   * @note Optional.
>>   */
>> -int odp_cos_drop_set(odp_cos_t cos_id, odp_drop_e drop_policy);
>> +int odp_cos_drop_set(odp_cos_t cos_id, odp_cls_drop_t drop_policy);
>>
>>  /**
>>  * Get the drop policy configured for a specific class-of-service
>> instance.
>> @@ -180,7 +180,7 @@ int odp_cos_drop_set(odp_cos_t cos_id, odp_drop_e
>> drop_policy);
>>  * @retval                      Drop policy configured with the given
>>  *                              class-of-service
>>  */
>> -odp_drop_e odp_cos_drop(odp_cos_t cos_id);
>> +odp_cls_drop_t odp_cos_drop(odp_cos_t cos_id);
>
>
> Again odp_cos_drop should return an odp_cos_drop_t.  If the return type were
> odp_cls_drop_t then the function should be odp_cls_drop() for consistency,
> but odp_cos_drop() seems correct here.

Agreed.

Regards,
Bala
>>
>>
>>  /**
>>   * Request to override per-port class of service
>> --
>> 1.9.1
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
diff mbox

Patch

diff --git a/include/odp/api/classification.h b/include/odp/api/classification.h
index 4db5bf0..c9493c2 100644
--- a/include/odp/api/classification.h
+++ b/include/odp/api/classification.h
@@ -65,7 +65,7 @@  extern "C" {
 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;
+} odp_cls_drop_t;
 
 /**
  * Packet header field enumeration
@@ -95,7 +95,7 @@  typedef enum odp_cos_hdr_flow_fields {
 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_drop_t drop_policy;	/**< Drop policy associated with CoS */
 } odp_cls_cos_param_t;
 
 /**
@@ -170,7 +170,7 @@  odp_queue_t odp_cos_queue(odp_cos_t cos_id);
  *
  * @note Optional.
  */
-int odp_cos_drop_set(odp_cos_t cos_id, odp_drop_e drop_policy);
+int odp_cos_drop_set(odp_cos_t cos_id, odp_cls_drop_t drop_policy);
 
 /**
 * Get the drop policy configured for a specific class-of-service instance.
@@ -180,7 +180,7 @@  int odp_cos_drop_set(odp_cos_t cos_id, odp_drop_e drop_policy);
 * @retval			Drop policy configured with the given
 *				class-of-service
 */
-odp_drop_e odp_cos_drop(odp_cos_t cos_id);
+odp_cls_drop_t odp_cos_drop(odp_cos_t cos_id);
 
 /**
  * Request to override per-port class of service