tw_timer_expire_timers() - add a maximum to the number of expiration per call 58/5158/4
authorGabriel Ganne <gabriel.ganne@enea.com>
Wed, 15 Feb 2017 15:55:30 +0000 (16:55 +0100)
committerDamjan Marion <dmarion.lists@gmail.com>
Thu, 16 Feb 2017 19:33:28 +0000 (19:33 +0000)
commit83ed1f4f1bc3f09de0e7ca1e163bf1d7dd4b8be2
tree2e04d0efe50b6fbd41708a631fddc2c51d6eb5d5
parentb69111e167f5be70b3721ed5c2e5e02b971c3f67
tw_timer_expire_timers() - add a maximum to the number of expiration per call

The idea is to prevent a huge processing burst if, say, the network goes
down 10' for some reason, and so that we don't need to expire 1M timer
sessions on the first call.

The maximum is not an exact value, but a value after which the
expiration process is postponed until the next call.
That way, we don't have to process the same tick twice, nor to unlink
timers once at a time when processing a tick.
The fact that a timer slot could contain many entries should be dealt
with by changing the number of ticks per second.

Change-Id: I892d07f965094102a3d53e7dbf4e6f5ad22d4967
Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
src/vppinfra/tw_timer_template.c
src/vppinfra/tw_timer_template.h