[v2] doc: announce API change in timer

Message ID 20200804035135.7526-1-sarosh.arif@emumba.com (mailing list archive)
State Rejected, archived
Delegated to: Thomas Monjalon
Headers
Series [v2] doc: announce API change in timer |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: errored

Commit Message

Sarosh Arif Aug. 4, 2020, 3:51 a.m. UTC
  If the user tries to reset/stop some other timer in it's callback
function, which is also about to expire, using
rte_timer_reset_sync/rte_timer_stop_sync the application goes into
an infinite loop. This happens because
rte_timer_reset_sync/rte_timer_stop_sync loop until the timer
resets/stops and there is check inside timer_set_config_state which
prevents a running timer from being reset/stopped by not it's own
timer_cb. Therefore timer_set_config_state returns -1 due to which
rte_timer_reset returns -1 and rte_timer_reset_sync goes into an
infinite loop

To to prevent this rte_timer_reset_sync and rte_timer_stop_sync should
have int return types, so that -1 can be returned if the above condition
occurs

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
---
v2: rephrase and fix typo
---
 doc/guides/rel_notes/deprecation.rst | 6 ++++++
 1 file changed, 6 insertions(+)
  

Patch

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index ea4cfa7a4..227950165 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -151,3 +151,9 @@  Deprecation Notices
   Python 2 support will be completely removed in 20.11.
   In 20.08, explicit deprecation warnings will be displayed when running
   scripts with Python 2.
+
+* timer: Timers can get stuck in an infinite loop if their callback tries to
+  synchronously reset/stop some other timer that is also about to expire. The
+  functions ``rte_timer_reset_sync`` and ``rte_timer_stop_sync`` will be updated
+  with an int return type so that an error code can be returned when this
+  condition occurs.