You didn't mention calling tw_timer_expire_timers_xxx(tw, now), which is the 
only force of physics which will actually cause a timer to expire.

See also .../src/vppinfra/test_tw_timer.c, src/vlib/main.c or 
src/vnet/tcp/tcp.c for usage examples. The timer wheel code has been tested to 
N=60 million concurrent timers. It's not trivially broken.

D

________________________________
From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> on behalf of hari_akkin via 
Lists.Fd.Io <hari_akkin=yahoo....@lists.fd.io>
Sent: Wednesday, June 12, 2019 7:00 AM
To: vpp-dev@lists.fd.io
Cc: vpp-dev@lists.fd.io
Subject: [vpp-dev] timer wheel usage queries

Hello
I am trying to use timer_wheel framework to start a timer. I followed the 
examples given in fdio, but the expiry_callback function never being called 
back.
I am not sure if timer failed to expire or my usage has problems. I used the 
below functions:

Timer wheel Init:
    {
        tw_timer_wheel_1t_1w_2048sl_t* tw = &example_main->timer_wheels;
        tw_timer_wheel_init_1t_1w_2048sl (tw, example_timer_expired_callback, 
1.0 /* timer period 1s */ , 1024);
        tw->last_run_time = vlib_time_now (vm);
    }

Timer Start:
    handle = tw_timer_start_1t_1w_2048sl(&example->timer_wheels,1,0,5);

The expiry functiion example_timer_expired_callback never been called.

Is there any issue in the way I am using or is there any knwon issue in TW 
framework?

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#13262): https://lists.fd.io/g/vpp-dev/message/13262
Mute This Topic: https://lists.fd.io/mt/32039603/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to