Address minor issues in timer sample documentation: - Capitalize "linux" to "Linux" - Complete incomplete phrase "and also on the main" to "and also on the main lcore"
Signed-off-by: Stephen Hemminger <[email protected]> --- doc/guides/sample_app_ug/timer.rst | 45 +++++++++++++++--------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/doc/guides/sample_app_ug/timer.rst b/doc/guides/sample_app_ug/timer.rst index 7af35d3d67..a1149be6c3 100644 --- a/doc/guides/sample_app_ug/timer.rst +++ b/doc/guides/sample_app_ug/timer.rst @@ -4,20 +4,23 @@ Timer Sample Application ======================== -The Timer sample application is a simple application that demonstrates the use of a timer in a DPDK application. -This application prints some messages from different lcores regularly, demonstrating the use of timers. +Overview +-------- + +The Timer sample application demonstrates the use of a timer in a DPDK application. +This application prints messages from different lcores at regular intervals using timers. Compiling the Application ------------------------- -To compile the sample application see :doc:`compiling`. +To compile the sample application, see :doc:`compiling`. The application is located in the ``timer`` sub-directory. Running the Application ----------------------- -To run the example in linux environment: +To run the example in a Linux environment: .. code-block:: console @@ -29,12 +32,10 @@ the Environment Abstraction Layer (EAL) options. Explanation ----------- -The following sections provide some explanation of the code. - Initialization and Main Loop ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In addition to EAL initialization, the timer subsystem must be initialized, by calling the rte_timer_subsystem_init() function. +In addition to EAL initialization, the timer subsystem must be initialized by calling the ``rte_timer_subsystem_init()`` function. .. literalinclude:: ../../../examples/timer/main.c :language: c @@ -44,7 +45,7 @@ In addition to EAL initialization, the timer subsystem must be initialized, by c After timer creation (see the next paragraph), the main loop is executed on each worker lcore using the well-known -rte_eal_remote_launch() and also on the main. +``rte_eal_remote_launch()`` and also on the main lcore. .. literalinclude:: ../../../examples/timer/main.c :language: c @@ -61,14 +62,14 @@ The main loop is very simple in this example: :dedent: 1 As explained in the comment, it is better to use the TSC register (as it is a per-lcore register) to check if the -rte_timer_manage() function must be called or not. +``rte_timer_manage()`` function must be called or not. In this example, the resolution of the timer is 10 milliseconds. Managing Timers ~~~~~~~~~~~~~~~ -In the main() function, the two timers are initialized. -This call to rte_timer_init() is necessary before doing any other operation on the timer structure. +In the ``main()`` function, the two timers are initialized. +This call to ``rte_timer_init()`` is necessary before doing any other operation on the timer structure. .. literalinclude:: ../../../examples/timer/main.c :language: c @@ -76,15 +77,15 @@ This call to rte_timer_init() is necessary before doing any other operation on t :end-before: >8 End of init timer structures. :dedent: 1 -Then, the two timers are configured: +Next, the two timers are configured: -* The first timer (timer0) is loaded on the main lcore and expires every second. - Since the PERIODICAL flag is provided, the timer is reloaded automatically by the timer subsystem. - The callback function is timer0_cb(). +* The first timer (``timer0``) is loaded on the main lcore and expires every second. + Since the ``PERIODICAL`` flag is provided, the timer is reloaded automatically by the timer subsystem. + The callback function is ``timer0_cb()``. -* The second timer (timer1) is loaded on the next available lcore every 333 ms. - The SINGLE flag means that the timer expires only once and must be reloaded manually if required. - The callback function is timer1_cb(). +* The second timer (``timer1``) is loaded on the next available lcore every 333 ms. + The ``SINGLE`` flag means that the timer expires only once and must be reloaded manually if required. + The callback function is ``timer1_cb()``. .. literalinclude:: ../../../examples/timer/main.c :language: c @@ -92,16 +93,16 @@ Then, the two timers are configured: :end-before: >8 End of two timers configured. :dedent: 1 -The callback for the first timer (timer0) only displays a message until a global counter reaches 20 (after 20 seconds). -In this case, the timer is stopped using the rte_timer_stop() function. +The callback for the first timer (``timer0``) only displays a message until a global counter reaches 20 (after 20 seconds). +In this case, the timer is stopped using the ``rte_timer_stop()`` function. .. literalinclude:: ../../../examples/timer/main.c :language: c :start-after: timer0 callback. 8< :end-before: >8 End of timer0 callback. -The callback for the second timer (timer1) displays a message and reloads the timer on the next lcore, using the -rte_timer_reset() function: +The callback for the second timer (``timer1``) displays a message and reloads the timer on the next lcore, using the +``rte_timer_reset()`` function: .. literalinclude:: ../../../examples/timer/main.c :language: c -- 2.51.0

