diff mbox

validation: pktio: use odp_time_ns() instead own function

Message ID 1452705517-28808-1-git-send-email-ivan.khoronzhuk@linaro.org
State Accepted
Commit ac034ee36d293683669c4ad46f259051b299b7a6
Headers show

Commit Message

Ivan Khoronzhuk Jan. 13, 2016, 5:18 p.m. UTC
Now odp_time_wait_ns() can be used.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
---
 test/validation/pktio/pktio.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Comments

Ivan Khoronzhuk Jan. 18, 2016, 5:53 p.m. UTC | #1
ping

On 13.01.16 19:18, Ivan Khoronzhuk wrote:
> Now odp_time_wait_ns() can be used.
>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> ---
>   test/validation/pktio/pktio.c | 13 +------------
>   1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
> index 45c11c5..29ad4ea 100644
> --- a/test/validation/pktio/pktio.c
> +++ b/test/validation/pktio/pktio.c
> @@ -259,17 +259,6 @@ static int default_pool_create(void)
>   	return 0;
>   }
>
> -static void spin_wait(uint64_t ns)
> -{
> -	odp_time_t start, now, diff;
> -
> -	start = odp_time_local();
> -	do {
> -		now = odp_time_local();
> -		diff = odp_time_diff(now, start);
> -	} while (odp_time_to_ns(diff) < ns);
> -}
> -
>   static odp_pktio_t create_pktio(int iface_idx, odp_pktio_input_mode_t imode,
>   				odp_pktio_output_mode_t omode)
>   {
> @@ -294,7 +283,7 @@ static odp_pktio_t create_pktio(int iface_idx, odp_pktio_input_mode_t imode,
>   		odp_pktio_print(pktio);
>
>   	if (wait_for_network)
> -		spin_wait(ODP_TIME_SEC_IN_NS / 4);
> +		odp_time_wait_ns(ODP_TIME_SEC_IN_NS / 4);
>
>   	return pktio;
>   }
>
Ivan Khoronzhuk Jan. 20, 2016, 8:31 a.m. UTC | #2
ping

On 13.01.16 19:18, Ivan Khoronzhuk wrote:
> Now odp_time_wait_ns() can be used.
>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> ---
>   test/validation/pktio/pktio.c | 13 +------------
>   1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
> index 45c11c5..29ad4ea 100644
> --- a/test/validation/pktio/pktio.c
> +++ b/test/validation/pktio/pktio.c
> @@ -259,17 +259,6 @@ static int default_pool_create(void)
>   	return 0;
>   }
>
> -static void spin_wait(uint64_t ns)
> -{
> -	odp_time_t start, now, diff;
> -
> -	start = odp_time_local();
> -	do {
> -		now = odp_time_local();
> -		diff = odp_time_diff(now, start);
> -	} while (odp_time_to_ns(diff) < ns);
> -}
> -
>   static odp_pktio_t create_pktio(int iface_idx, odp_pktio_input_mode_t imode,
>   				odp_pktio_output_mode_t omode)
>   {
> @@ -294,7 +283,7 @@ static odp_pktio_t create_pktio(int iface_idx, odp_pktio_input_mode_t imode,
>   		odp_pktio_print(pktio);
>
>   	if (wait_for_network)
> -		spin_wait(ODP_TIME_SEC_IN_NS / 4);
> +		odp_time_wait_ns(ODP_TIME_SEC_IN_NS / 4);
>
>   	return pktio;
>   }
>
Bill Fischofer Jan. 20, 2016, 5:59 p.m. UTC | #3
On Wed, Jan 13, 2016 at 11:18 AM, Ivan Khoronzhuk <
ivan.khoronzhuk@linaro.org> wrote:

> Now odp_time_wait_ns() can be used.

>

> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>

>


Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>



> ---

>  test/validation/pktio/pktio.c | 13 +------------

>  1 file changed, 1 insertion(+), 12 deletions(-)

>

> diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c

> index 45c11c5..29ad4ea 100644

> --- a/test/validation/pktio/pktio.c

> +++ b/test/validation/pktio/pktio.c

> @@ -259,17 +259,6 @@ static int default_pool_create(void)

>         return 0;

>  }

>

> -static void spin_wait(uint64_t ns)

> -{

> -       odp_time_t start, now, diff;

> -

> -       start = odp_time_local();

> -       do {

> -               now = odp_time_local();

> -               diff = odp_time_diff(now, start);

> -       } while (odp_time_to_ns(diff) < ns);

> -}

> -

>  static odp_pktio_t create_pktio(int iface_idx, odp_pktio_input_mode_t

> imode,

>                                 odp_pktio_output_mode_t omode)

>  {

> @@ -294,7 +283,7 @@ static odp_pktio_t create_pktio(int iface_idx,

> odp_pktio_input_mode_t imode,

>                 odp_pktio_print(pktio);

>

>         if (wait_for_network)

> -               spin_wait(ODP_TIME_SEC_IN_NS / 4);

> +               odp_time_wait_ns(ODP_TIME_SEC_IN_NS / 4);

>

>         return pktio;

>  }

> --

> 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/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
index 45c11c5..29ad4ea 100644
--- a/test/validation/pktio/pktio.c
+++ b/test/validation/pktio/pktio.c
@@ -259,17 +259,6 @@  static int default_pool_create(void)
 	return 0;
 }
 
-static void spin_wait(uint64_t ns)
-{
-	odp_time_t start, now, diff;
-
-	start = odp_time_local();
-	do {
-		now = odp_time_local();
-		diff = odp_time_diff(now, start);
-	} while (odp_time_to_ns(diff) < ns);
-}
-
 static odp_pktio_t create_pktio(int iface_idx, odp_pktio_input_mode_t imode,
 				odp_pktio_output_mode_t omode)
 {
@@ -294,7 +283,7 @@  static odp_pktio_t create_pktio(int iface_idx, odp_pktio_input_mode_t imode,
 		odp_pktio_print(pktio);
 
 	if (wait_for_network)
-		spin_wait(ODP_TIME_SEC_IN_NS / 4);
+		odp_time_wait_ns(ODP_TIME_SEC_IN_NS / 4);
 
 	return pktio;
 }