diff mbox

[v2] api: classification: pmr statistics counter API removal

Message ID 1422952925-17875-1-git-send-email-bala.manoharan@linaro.org
State Accepted
Commit 9b95678461051c5ec0041bd646e97db7863da06d
Headers show

Commit Message

Balasubramanian Manoharan Feb. 3, 2015, 8:42 a.m. UTC
From: Balasubramanian Manoharan <bala.manoharan@linaro.org>

odp_pmr_match_count() API related to statistics count of PMR has been moved out of ODP 1.0
version and the same will be incorporated once an ODP level common statistics counter design has
been achieved.

Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
---
v2: Incorporated review comments from Mike

 include/odp/api/classification.h                    |  9 ---------
 platform/linux-generic/odp_classification.c         |  8 --------
 .../classification/odp_classification_tests.c       | 21 ---------------------
 3 files changed, 38 deletions(-)

Comments

Mike Holmes Feb. 3, 2015, 11:17 a.m. UTC | #1
On 3 February 2015 at 03:42, <bala.manoharan@linaro.org> wrote:

> From: Balasubramanian Manoharan <bala.manoharan@linaro.org>
>
> odp_pmr_match_count() API related to statistics count of PMR has been
> moved out of ODP 1.0
> version and the same will be incorporated once an ODP level common
> statistics counter design has
> been achieved.
>
> Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
>

Reviewed-by: Mike Holmes <mike.holmes@linaro.org>


> ---
> v2: Incorporated review comments from Mike
>
>  include/odp/api/classification.h                    |  9 ---------
>  platform/linux-generic/odp_classification.c         |  8 --------
>  .../classification/odp_classification_tests.c       | 21
> ---------------------
>  3 files changed, 38 deletions(-)
>
> diff --git a/include/odp/api/classification.h
> b/include/odp/api/classification.h
> index 5c6636f..609d529 100644
> --- a/include/odp/api/classification.h
> +++ b/include/odp/api/classification.h
> @@ -279,15 +279,6 @@ int odp_pktio_pmr_cos(odp_pmr_t pmr_id,
>  int odp_cos_pmr_cos(odp_pmr_t pmr_id, odp_cos_t src_cos, odp_cos_t
> dst_cos);
>
>  /**
> - * Retrieve packet matcher statistics
> - *
> - * @param[in]  pmr_id          PMR from which to retrieve the count
> - *
> - * @return                     Current number of matches for a given
> matcher instance.
> - */
> -signed long odp_pmr_match_count(odp_pmr_t pmr_id);
> -
> -/**
>   * Inquire about matching terms supported by the classifier
>   *
>   * @return A mask one bit per enumerated term, one for each of
> op_pmr_term_e
> diff --git a/platform/linux-generic/odp_classification.c
> b/platform/linux-generic/odp_classification.c
> index 78597ef..31d1328 100644
> --- a/platform/linux-generic/odp_classification.c
> +++ b/platform/linux-generic/odp_classification.c
> @@ -505,14 +505,6 @@ int odp_cos_pmr_cos(odp_pmr_t pmr_id, odp_cos_t
> src_cos, odp_cos_t dst_cos)
>         return 0;
>  }
>
> -signed long odp_pmr_match_count(odp_pmr_t pmr_id)
> -{
> -       pmr_t *pmr = get_pmr_entry(pmr_id);
> -       if (pmr == NULL)
> -               return -1;
> -       return (signed long)odp_atomic_load_u32(&pmr->s.count);
> -}
> -
>  unsigned long long odp_pmr_terms_cap(void)
>  {
>         unsigned long long term_cap = 0;
> diff --git a/test/validation/classification/odp_classification_tests.c
> b/test/validation/classification/odp_classification_tests.c
> index e4b3260..45822d3 100644
> --- a/test/validation/classification/odp_classification_tests.c
> +++ b/test/validation/classification/odp_classification_tests.c
> @@ -423,8 +423,6 @@ void test_cls_pmr_chain(void)
>         pkt = receive_packet(&queue, ODP_TIME_SEC);
>         CU_ASSERT(queue == queue_list[CLS_PMR_CHAIN_SRC]);
>         CU_ASSERT(seq == cls_pkt_get_seq(pkt));
> -
> -       CU_ASSERT(1 == odp_pmr_match_count(pmr_list[CLS_PMR_CHAIN_DST]));
>         odp_packet_free(pkt);
>  }
>
> @@ -657,7 +655,6 @@ void test_pmr_cos(void)
>         pkt = receive_packet(&queue, ODP_TIME_SEC);
>         CU_ASSERT(queue == queue_list[CLS_PMR]);
>         CU_ASSERT(seq == cls_pkt_get_seq(pkt));
> -       CU_ASSERT(1 == odp_pmr_match_count(pmr_list[CLS_PMR]));
>         odp_packet_free(pkt);
>  }
>
> @@ -740,23 +737,6 @@ void test_pktio_pmr_match_set_cos(void)
>         odp_packet_free(pkt);
>  }
>
> -static void classification_pmr_match_count(void)
> -{
> -       odp_pmr_t pmr;
> -       uint16_t val;
> -       uint16_t mask;
> -       val = 1024;
> -       mask = 0xffff;
> -       int retval;
> -       pmr = odp_pmr_create_match(ODP_PMR_TCP_SPORT, &val, &mask,
> sizeof(val));
> -       CU_ASSERT(pmr != ODP_PMR_INVAL);
> -
> -       retval = odp_pmr_match_count(pmr);
> -       CU_ASSERT(retval == 0);
> -
> -       odp_pmr_destroy(pmr);
> -}
> -
>  static void classification_pmr_terms_avail(void)
>  {
>         int retval;
> @@ -814,6 +794,5 @@ CU_TestInfo classification_tests[] = {
>         _CU_TEST_INFO(classification_pmr_terms_cap),
>         _CU_TEST_INFO(classification_pktio_configure),
>         _CU_TEST_INFO(classification_pktio_test),
> -       _CU_TEST_INFO(classification_pmr_match_count),
>         CU_TEST_INFO_NULL,
>  };
> --
> 2.0.1.472.g6f92e5f
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov Feb. 3, 2015, 2:03 p.m. UTC | #2
Merged!

Maxim.

On 02/03/2015 02:17 PM, Mike Holmes wrote:
>
>
> On 3 February 2015 at 03:42, <bala.manoharan@linaro.org 
> <mailto:bala.manoharan@linaro.org>> wrote:
>
>     From: Balasubramanian Manoharan <bala.manoharan@linaro.org
>     <mailto:bala.manoharan@linaro.org>>
>
>     odp_pmr_match_count() API related to statistics count of PMR has
>     been moved out of ODP 1.0
>     version and the same will be incorporated once an ODP level common
>     statistics counter design has
>     been achieved.
>
>     Signed-off-by: Balasubramanian Manoharan
>     <bala.manoharan@linaro.org <mailto:bala.manoharan@linaro.org>>
>
>
> Reviewed-by: Mike Holmes <mike.holmes@linaro.org 
> <mailto:mike.holmes@linaro.org>>
>
>     ---
>     v2: Incorporated review comments from Mike
>
>      include/odp/api/classification.h                    |  9 ---------
>      platform/linux-generic/odp_classification.c         |  8 --------
>      .../classification/odp_classification_tests.c       | 21
>     ---------------------
>      3 files changed, 38 deletions(-)
>
>     diff --git a/include/odp/api/classification.h
>     b/include/odp/api/classification.h
>     index 5c6636f..609d529 100644
>     --- a/include/odp/api/classification.h
>     +++ b/include/odp/api/classification.h
>     @@ -279,15 +279,6 @@ int odp_pktio_pmr_cos(odp_pmr_t pmr_id,
>      int odp_cos_pmr_cos(odp_pmr_t pmr_id, odp_cos_t src_cos,
>     odp_cos_t dst_cos);
>
>      /**
>     - * Retrieve packet matcher statistics
>     - *
>     - * @param[in]  pmr_id          PMR from which to retrieve the count
>     - *
>     - * @return                     Current number of matches for a
>     given matcher instance.
>     - */
>     -signed long odp_pmr_match_count(odp_pmr_t pmr_id);
>     -
>     -/**
>       * Inquire about matching terms supported by the classifier
>       *
>       * @return A mask one bit per enumerated term, one for each of
>     op_pmr_term_e
>     diff --git a/platform/linux-generic/odp_classification.c
>     b/platform/linux-generic/odp_classification.c
>     index 78597ef..31d1328 100644
>     --- a/platform/linux-generic/odp_classification.c
>     +++ b/platform/linux-generic/odp_classification.c
>     @@ -505,14 +505,6 @@ int odp_cos_pmr_cos(odp_pmr_t pmr_id,
>     odp_cos_t src_cos, odp_cos_t dst_cos)
>             return 0;
>      }
>
>     -signed long odp_pmr_match_count(odp_pmr_t pmr_id)
>     -{
>     -       pmr_t *pmr = get_pmr_entry(pmr_id);
>     -       if (pmr == NULL)
>     -               return -1;
>     -       return (signed long)odp_atomic_load_u32(&pmr->s.count);
>     -}
>     -
>      unsigned long long odp_pmr_terms_cap(void)
>      {
>             unsigned long long term_cap = 0;
>     diff --git
>     a/test/validation/classification/odp_classification_tests.c
>     b/test/validation/classification/odp_classification_tests.c
>     index e4b3260..45822d3 100644
>     --- a/test/validation/classification/odp_classification_tests.c
>     +++ b/test/validation/classification/odp_classification_tests.c
>     @@ -423,8 +423,6 @@ void test_cls_pmr_chain(void)
>             pkt = receive_packet(&queue, ODP_TIME_SEC);
>             CU_ASSERT(queue == queue_list[CLS_PMR_CHAIN_SRC]);
>             CU_ASSERT(seq == cls_pkt_get_seq(pkt));
>     -
>     -       CU_ASSERT(1 ==
>     odp_pmr_match_count(pmr_list[CLS_PMR_CHAIN_DST]));
>             odp_packet_free(pkt);
>      }
>
>     @@ -657,7 +655,6 @@ void test_pmr_cos(void)
>             pkt = receive_packet(&queue, ODP_TIME_SEC);
>             CU_ASSERT(queue == queue_list[CLS_PMR]);
>             CU_ASSERT(seq == cls_pkt_get_seq(pkt));
>     -       CU_ASSERT(1 == odp_pmr_match_count(pmr_list[CLS_PMR]));
>             odp_packet_free(pkt);
>      }
>
>     @@ -740,23 +737,6 @@ void test_pktio_pmr_match_set_cos(void)
>             odp_packet_free(pkt);
>      }
>
>     -static void classification_pmr_match_count(void)
>     -{
>     -       odp_pmr_t pmr;
>     -       uint16_t val;
>     -       uint16_t mask;
>     -       val = 1024;
>     -       mask = 0xffff;
>     -       int retval;
>     -       pmr = odp_pmr_create_match(ODP_PMR_TCP_SPORT, &val, &mask,
>     sizeof(val));
>     -       CU_ASSERT(pmr != ODP_PMR_INVAL);
>     -
>     -       retval = odp_pmr_match_count(pmr);
>     -       CU_ASSERT(retval == 0);
>     -
>     -       odp_pmr_destroy(pmr);
>     -}
>     -
>      static void classification_pmr_terms_avail(void)
>      {
>             int retval;
>     @@ -814,6 +794,5 @@ CU_TestInfo classification_tests[] = {
>             _CU_TEST_INFO(classification_pmr_terms_cap),
>             _CU_TEST_INFO(classification_pktio_configure),
>             _CU_TEST_INFO(classification_pktio_test),
>     -       _CU_TEST_INFO(classification_pmr_match_count),
>             CU_TEST_INFO_NULL,
>      };
>     --
>     2.0.1.472.g6f92e5f
>
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
> -- 
> *Mike Holmes*
> Linaro  Sr Technical Manager
> LNG - ODP
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://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 5c6636f..609d529 100644
--- a/include/odp/api/classification.h
+++ b/include/odp/api/classification.h
@@ -279,15 +279,6 @@  int odp_pktio_pmr_cos(odp_pmr_t pmr_id,
 int odp_cos_pmr_cos(odp_pmr_t pmr_id, odp_cos_t src_cos, odp_cos_t dst_cos);
 
 /**
- * Retrieve packet matcher statistics
- *
- * @param[in]	pmr_id		PMR from which to retrieve the count
- *
- * @return			Current number of matches for a given matcher instance.
- */
-signed long odp_pmr_match_count(odp_pmr_t pmr_id);
-
-/**
  * Inquire about matching terms supported by the classifier
  *
  * @return A mask one bit per enumerated term, one for each of op_pmr_term_e
diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c
index 78597ef..31d1328 100644
--- a/platform/linux-generic/odp_classification.c
+++ b/platform/linux-generic/odp_classification.c
@@ -505,14 +505,6 @@  int odp_cos_pmr_cos(odp_pmr_t pmr_id, odp_cos_t src_cos, odp_cos_t dst_cos)
 	return 0;
 }
 
-signed long odp_pmr_match_count(odp_pmr_t pmr_id)
-{
-	pmr_t *pmr = get_pmr_entry(pmr_id);
-	if (pmr == NULL)
-		return -1;
-	return (signed long)odp_atomic_load_u32(&pmr->s.count);
-}
-
 unsigned long long odp_pmr_terms_cap(void)
 {
 	unsigned long long term_cap = 0;
diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c
index e4b3260..45822d3 100644
--- a/test/validation/classification/odp_classification_tests.c
+++ b/test/validation/classification/odp_classification_tests.c
@@ -423,8 +423,6 @@  void test_cls_pmr_chain(void)
 	pkt = receive_packet(&queue, ODP_TIME_SEC);
 	CU_ASSERT(queue == queue_list[CLS_PMR_CHAIN_SRC]);
 	CU_ASSERT(seq == cls_pkt_get_seq(pkt));
-
-	CU_ASSERT(1 == odp_pmr_match_count(pmr_list[CLS_PMR_CHAIN_DST]));
 	odp_packet_free(pkt);
 }
 
@@ -657,7 +655,6 @@  void test_pmr_cos(void)
 	pkt = receive_packet(&queue, ODP_TIME_SEC);
 	CU_ASSERT(queue == queue_list[CLS_PMR]);
 	CU_ASSERT(seq == cls_pkt_get_seq(pkt));
-	CU_ASSERT(1 == odp_pmr_match_count(pmr_list[CLS_PMR]));
 	odp_packet_free(pkt);
 }
 
@@ -740,23 +737,6 @@  void test_pktio_pmr_match_set_cos(void)
 	odp_packet_free(pkt);
 }
 
-static void classification_pmr_match_count(void)
-{
-	odp_pmr_t pmr;
-	uint16_t val;
-	uint16_t mask;
-	val = 1024;
-	mask = 0xffff;
-	int retval;
-	pmr = odp_pmr_create_match(ODP_PMR_TCP_SPORT, &val, &mask, sizeof(val));
-	CU_ASSERT(pmr != ODP_PMR_INVAL);
-
-	retval = odp_pmr_match_count(pmr);
-	CU_ASSERT(retval == 0);
-
-	odp_pmr_destroy(pmr);
-}
-
 static void classification_pmr_terms_avail(void)
 {
 	int retval;
@@ -814,6 +794,5 @@  CU_TestInfo classification_tests[] = {
 	_CU_TEST_INFO(classification_pmr_terms_cap),
 	_CU_TEST_INFO(classification_pktio_configure),
 	_CU_TEST_INFO(classification_pktio_test),
-	_CU_TEST_INFO(classification_pmr_match_count),
 	CU_TEST_INFO_NULL,
 };