On 19 May 2015 at 15:34, Jacob,  Jerin <[email protected]> wrote:
> Ola,
>
> Is there any specific reason for following check in timer validation test ?
pa
>
> diff --git a/test/validation/odp_timer.c b/test/validation/odp_timer.c
> index 554b353..724026e 100644
> --- a/test/validation/odp_timer.c
> +++ b/test/validation/odp_timer.c
> @@ -260,7 +260,7 @@ static void handle_tmo(odp_event_t ev, bool stale, 
> uint64_t prev_tick)
>
>         if (ttp != NULL) {
>                 /* Internal error */
> -               CU_ASSERT_FATAL(ttp->ev == ODP_EVENT_INVALID);
> +---------->    CU_ASSERT_FATAL(ttp->ev == ODP_EVENT_INVALID);
>                 ttp->ev = ev;
>         }
>  }
>
> AFAIU, I should be CU_ASSERT_FATAL(ttp->ev != ODP_EVENT_INVALID) as
> tt[i].ev = odp_timeout_to_event(odp_timeout_alloc(tbp)) specified while 
> preparing  all timers.
Yes the timers are still inactive and the timeout event is stored in
the 'ev' member.

handle_timeout() is called for received timeouts (timer has expired).
In that case, the corresponding 'ev' member should not contain any
timeout event.

>
> Am I missing something in the timer specification ?
Or the timer specification is missing something?

odp_timer_set_abs(tt[i].tim, tck, &tt[i].ev); (line 309) is supposed
to grab the timeout event (on success) and clear the variable (write
ODP_TIMEOUT_INVALID), that's why the timeout is passed by reference
("&tt[i].ev").

Possibly this is not specified clearly enough in timer.h:
 * @param[in,out] tmo_ev  Reference to an event variable that points to
 * timeout event or NULL to reuse the existing timeout event. Any existing
 * timeout event that is replaced by a successful set operation will be
 * returned here.

The new timeout event is read from *tmo_ev. The old timeout event (if
timer was active) or ODP_TIMEOUT_INVALID (if timer was inactive) is
stored in *tmo_ev. I hope this is at least clear in the reference
implementation.

>
> Thanks,
> Jerin.
>
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to