timer: fix reset return value
authorRobert Sanford <rsanford2@gmail.com>
Wed, 25 Feb 2015 04:09:49 +0000 (23:09 -0500)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 25 Feb 2015 09:43:27 +0000 (10:43 +0100)
commit7085f6c738c38c9c0b5b03e2e66c55c610263c12
treee73b921869c4a794e6cb98c00bd5f6bef6194f6c
parent319abb43fa9ae51ba19cce33b3a887aa0c865581
timer: fix reset return value

- API rte_timer_reset() should return -1 when the timer is in the
RUNNING or CONFIG state. Instead, it ignores the return value of
internal function __rte_timer_reset() and always returns 0.
We change rte_timer_reset() to return the value returned by
__rte_timer_reset().

- Enhance timer stress test 2 to report how many timer reset
collisions occur, i.e., how many times rte_timer_reset() fails
due to a timer being in the CONFIG state.

Signed-off-by: Robert Sanford <rsanford2@gmail.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
app/test/test_timer.c
lib/librte_timer/rte_timer.c