DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Cc: pbhagavatula@caviumnetworks.com, dev@dpdk.org,
	nipun.gupta@nxp.com, hemant.agrawal@nxp.com
Subject: Re: [dpdk-dev] [PATCH v7 6/7] doc: add event timer adapter section to programmer's guide
Date: Mon, 12 Mar 2018 16:51:07 +0530	[thread overview]
Message-ID: <20180312112105.GA23858@jerin> (raw)
In-Reply-To: <1520546046-6973-7-git-send-email-erik.g.carrillo@intel.com>

-----Original Message-----
> Date: Thu, 8 Mar 2018 15:54:05 -0600
> From: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
> To: pbhagavatula@caviumnetworks.com
> CC: dev@dpdk.org, jerin.jacob@caviumnetworks.com, nipun.gupta@nxp.com,
>  hemant.agrawal@nxp.com
> Subject: [PATCH v7 6/7] doc: add event timer adapter section to
>  programmer's guide
> X-Mailer: git-send-email 1.7.10
> 
> Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---
>  doc/guides/prog_guide/event_timer_adapter.rst | 277 ++++++++++++++++++++++++++
>  doc/guides/prog_guide/index.rst               |   1 +
>  2 files changed, 278 insertions(+)
>  create mode 100644 doc/guides/prog_guide/event_timer_adapter.rst
> 
> diff --git a/doc/guides/prog_guide/event_timer_adapter.rst b/doc/guides/prog_guide/event_timer_adapter.rst
> new file mode 100644
> index 0000000..423b91d
> --- /dev/null
> +++ b/doc/guides/prog_guide/event_timer_adapter.rst
> @@ -0,0 +1,277 @@
> +..  SPDX-License-Identifier: BSD-3-Clause
> +    Copyright(c) 2017 Intel Corporation. All rights reserved.
> +
> +Event Timer Adapter Library
> +=================================
> +
> +The DPDK
> +`Event Device library <http://dpdk.org/doc/guides/prog_guide/eventdev.html>`_
> +introduces an event driven programming model which presents applications with
> +an alternative to the polling model traditionally used in DPDK
> +applications. Event devices can be coupled with arbitrary components to provide
> +new event sources by using **event adapters**. The Event Timer Adapter is one
> +such adapter; it bridges event devices and timer mechanisms.
> +
> +The Event Timer Adapter library extends the event driven model
> +by introducing a :ref:`new type of event <timer_expiry_event>` that represents
> +a timer expiration, and providing an API with which adapters can be created or
> +destroyed, and :ref:`event timers <event_timer>` can be armed and canceled.
> +
> +The Event Timer Adapter library is designed to interface with hardware or
> +software implementations of the timer mechanism; it will query an eventdev PMD
> +to determine which implementation should be used.  The default software
> +implementation manages timers using the DPDK
> +`Timer library <http://dpdk.org/doc/guides/prog_guide/timer_lib.html>`_.
> +
> +Examples of using the API are presented in the `API Overview`_ and
> +`Processing Timer Expiry Events`_ sections.  Code samples are abstracted and
> +are based on the example of handling a TCP retransmission.
> +
> +.. _event_timer:
> +
> +Event Timer struct
> +------------------
> +Event timers are timers that enqueue a timer expiration event to an event
> +device upon firing.

I think, it better to change to _timer expiry_ from _firing_.

> +
> +The Event Timer Adapter API represents each event timer with a generic struct,
> +which contains an event and user metadata.  The ``rte_event_timer`` struct is
> +defined in ``lib/librte_event/librte_event_timer_adapter.h``.
> +
> +.. _timer_expiry_event:
> +
> +Arming Event Timers
> +~~~~~~~~~~~~~~~~~~~~~
> +
> +Once an event timer adapter has been started, an application can begin to
> +manage event timers with it.
> +
> +The application should allocate ``struct rte_event_timer`` objects from a
> +mempool or huge-page backed application buffers of required size. Upon
> +successful allocation, the application should initialize the event timer, and
> +then set any of the necessary event attributes described in the
> +`Timer Expiry Event`_ section. In the following example, assume ``conn``
> +represents a TCP connection and that ``event_timer_pool`` is a mempool that
> +was created previously:
> +
> +.. code-block:: c
> +
> +	rte_mempool_get(event_timer_pool, (void **)&conn->evtim);
> +	if (conn->evtim == NULL) { ... }
> +
> +        rte_event_timer_init(&conn->evtim);
> +
> +	/* Set up the expiry event. */
> +	conn->evtim->ev.event_ptr = conn;

Not specific to this specific example, What would be the default
behaviour if application does not set ev.event_ptr value.

Can we say?
"NULL value is allowed, in which case adapter set the event_ptr
to struct rte_event_timer *

> +	conn->evtim->ev.queue_id = event_queue_id;
> +	...
> +	conn->evtim->timeout_ticks = 30; //3 sec Per RFC1122(TCP returns)
> +
> +Note that we have saved a pointer to the ``conn`` object in the timer's event
> +payload. This will allow us to locate the connection object again once we
> +dequeue the timer expiry event from the event device later.
> +
> +Processing Timer Expiry Events
> +------------------------------
> +
> +Once an event timer has successfully enqueued a timer expiry event in the event
> +device, the application will subsequently dequeue it from the event device.
> +The application can use the event payload to retrieve a pointer to the object
> +associated with the event timer. It can then re-arm the event timer or free the
> +event timer object as desired:
> +
> +.. code-block:: c
> +
> +	void
> +	event_processing_loop(...)
> +	{
> +		while (...) {
> +			/* Receive events from the configured event port. */
> +			rte_event_dequeue_burst(event_dev_id, event_port, &ev, 1, 0);
> +			...
> +			switch(ev.event_type) {
> +				...
> +				case RTE_EVENT_TYPE_TIMER:
> +					process_timer_event(ev);
> +					...
> +					break;
> +			}
> +		}
> +	}
> +
> +	uint8_t
> +	process_timer_event(...)
> +	{
> +		/* A retransmission timeout for the connection has been received. */
> +		conn = ev.event_ptr;
> +		/* Retransmit last packet (e.g. TCP segment). */
> +		...
> +		/* Re-arm timer using original values. */
> +		rte_event_timer_arm_burst(wheel_id, &conn->timer, 1);

s/wheel_id/adapter_id

> +	}
> +
> +Summary
> +-------
> +
> +The Event Timer Adapter library extends the DPDK event-based programming model
> +by representing timer expirations as events in the system and allowing
> +applications to use existing event processing loops to arm and cancel event
> +timers or handle timer expiry events.
> diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst
> index bbbe789..589c05d 100644
> --- a/doc/guides/prog_guide/index.rst
> +++ b/doc/guides/prog_guide/index.rst
> @@ -42,6 +42,7 @@ Programmer's Guide
>      thread_safety_dpdk_functions
>      eventdev
>      event_ethernet_rx_adapter
> +    event_timer_adapter
>      qos_framework
>      power_man
>      packet_classif_access_ctrl

Overall, it looks good. With above changes

Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>


> -- 
> 2.6.4
> 

  reply	other threads:[~2018-03-12 11:21 UTC|newest]

Thread overview: 133+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1511890148-22295-1-git-send-email-erik.g.carrillo@intel.com>
2017-12-01 20:00 ` [dpdk-dev] [RFC PATCH v5 0/5] eventtimer: introduce event timer adapter Erik Gabriel Carrillo
2017-12-01 20:00   ` [dpdk-dev] [RFC PATCH v5 1/5] " Erik Gabriel Carrillo
2017-12-06 15:17     ` Jerin Jacob
2017-12-06 16:23       ` Carrillo, Erik G
2017-12-01 20:00   ` [dpdk-dev] [RFC PATCH v5 2/5] eventtimer: add common code Erik Gabriel Carrillo
2017-12-06 15:35     ` Jerin Jacob
2017-12-01 20:00   ` [dpdk-dev] [RFC PATCH v5 3/5] eventtimer: add config variable for adapter Erik Gabriel Carrillo
2017-12-06 15:41     ` Jerin Jacob
2017-12-06 20:01       ` Carrillo, Erik G
2017-12-01 20:00   ` [dpdk-dev] [RFC PATCH v5 4/5] eventtimer: add default software implementation stub Erik Gabriel Carrillo
2017-12-01 20:00   ` [dpdk-dev] [RFC PATCH v5 5/5] test: add event timer adapter auto-test Erik Gabriel Carrillo
2018-01-11  0:20   ` [dpdk-dev] [PATCH v6 00/23] eventtimer: introduce event timer adapter Erik Gabriel Carrillo
2018-01-11  0:20     ` [dpdk-dev] [PATCH v6 01/23] eventtimer: add event timer adapter API Erik Gabriel Carrillo
2018-01-11 11:10       ` Pavan Nikhilesh
2018-01-11 16:56         ` Carrillo, Erik G
2018-01-11 17:31           ` Pavan Nikhilesh
2018-01-11  0:20     ` [dpdk-dev] [PATCH v6 02/23] eventtimer: add common code Erik Gabriel Carrillo
2018-01-11  0:20     ` [dpdk-dev] [PATCH v6 03/23] eventtimer: add default software driver stub Erik Gabriel Carrillo
2018-01-11  0:20     ` [dpdk-dev] [PATCH v6 04/23] test: add event timer adapter auto-test Erik Gabriel Carrillo
2018-01-11  0:20     ` [dpdk-dev] [PATCH v6 05/23] eventtimer: add adapter allocation definitions Erik Gabriel Carrillo
2018-01-11 11:18       ` Pavan Nikhilesh
2018-01-11  0:20     ` [dpdk-dev] [PATCH v6 06/23] test: exercise event timer adapter allocation functions Erik Gabriel Carrillo
2018-01-11  0:20     ` [dpdk-dev] [PATCH v6 07/23] eventtimer: add adapter get info function definition Erik Gabriel Carrillo
2018-01-11  0:20     ` [dpdk-dev] [PATCH v6 08/23] eventtimer: add adapter start/stop definitions Erik Gabriel Carrillo
2018-01-11 17:28       ` Pavan Nikhilesh
2018-01-18 23:57         ` Carrillo, Erik G
2018-01-11  0:21     ` [dpdk-dev] [PATCH v6 09/23] eventtimer: add API to get service id Erik Gabriel Carrillo
2018-01-11  0:21     ` [dpdk-dev] [PATCH v6 10/23] eventtimer: remove service id entry from info structure Erik Gabriel Carrillo
2018-01-11 11:34       ` Pavan Nikhilesh
2018-01-11  0:21     ` [dpdk-dev] [PATCH v6 11/23] test: exercise event timer adapter start/stop functions Erik Gabriel Carrillo
2018-01-11  0:21     ` [dpdk-dev] [PATCH v6 12/23] eventtimer: add event timer arm/cancel function definitions Erik Gabriel Carrillo
2018-01-11 11:38       ` Pavan Nikhilesh
2018-01-11  0:21     ` [dpdk-dev] [PATCH v6 13/23] eventtimer: add adapter service definition Erik Gabriel Carrillo
2018-01-11 12:03       ` Pavan Nikhilesh
2018-01-11  0:21     ` [dpdk-dev] [PATCH v6 14/23] eventtimer: add event timer initializer function Erik Gabriel Carrillo
2018-01-11  0:21     ` [dpdk-dev] [PATCH v6 15/23] eventtimer: add buffering of timer expiry events Erik Gabriel Carrillo
2018-01-11 12:18       ` Pavan Nikhilesh
2018-01-18 23:07         ` Carrillo, Erik G
2018-01-20  8:55           ` Pavan Nikhilesh
2018-01-11  0:21     ` [dpdk-dev] [PATCH v6 16/23] eventtimer: add stats to API Erik Gabriel Carrillo
2018-01-11  0:21     ` [dpdk-dev] [PATCH v6 17/23] eventtimer: add support for single-producer put mode Erik Gabriel Carrillo
2018-01-11  0:21     ` [dpdk-dev] [PATCH v6 18/23] eventtimer: add non-blocking mode for event timer operations Erik Gabriel Carrillo
2018-01-11  0:21     ` [dpdk-dev] [PATCH v6 19/23] test: exercise event timer arm and expiry Erik Gabriel Carrillo
2018-01-11 12:26       ` Pavan Nikhilesh
2018-01-11  0:21     ` [dpdk-dev] [PATCH v6 20/23] maintainers: add event timer adapter section Erik Gabriel Carrillo
2018-01-11  0:21     ` [dpdk-dev] [PATCH v6 21/23] doc: add event timer adapter to API index Erik Gabriel Carrillo
2018-01-12 11:12       ` Kovacevic, Marko
2018-01-11  0:21     ` [dpdk-dev] [PATCH v6 22/23] doc: add event timer adapter section to programmer's guide Erik Gabriel Carrillo
2018-01-11 15:26       ` Kovacevic, Marko
2018-01-11  0:21     ` [dpdk-dev] [PATCH v6 23/23] doc: add event timer adapter to release notes Erik Gabriel Carrillo
2018-01-12 10:48       ` Kovacevic, Marko
2018-03-08 21:53     ` [dpdk-dev] [PATCH v7 0/7] eventtimer: introduce event timer adapter Erik Gabriel Carrillo
2018-03-08 21:54       ` [dpdk-dev] [PATCH v7 1/7] eventtimer: add event timer adapter API Erik Gabriel Carrillo
2018-03-12  7:53         ` Jerin Jacob
2018-03-12 16:22           ` Carrillo, Erik G
2018-03-08 21:54       ` [dpdk-dev] [PATCH v7 2/7] eventtimer: add common code Erik Gabriel Carrillo
2018-03-12  8:11         ` Jerin Jacob
2018-03-08 21:54       ` [dpdk-dev] [PATCH v7 3/7] eventtimer: add default software driver Erik Gabriel Carrillo
2018-03-12  8:45         ` Jerin Jacob
2018-03-12 21:20           ` Carrillo, Erik G
2018-03-08 21:54       ` [dpdk-dev] [PATCH v7 4/7] eventtimer: add support for meson build system Erik Gabriel Carrillo
2018-03-08 21:54       ` [dpdk-dev] [PATCH v7 5/7] test: add event timer adapter auto-test Erik Gabriel Carrillo
2018-03-14 12:52         ` Pavan Nikhilesh
2018-03-14 21:42           ` Carrillo, Erik G
2018-03-14 13:31         ` Pavan Nikhilesh
2018-03-14 21:40           ` Carrillo, Erik G
2018-03-08 21:54       ` [dpdk-dev] [PATCH v7 6/7] doc: add event timer adapter section to programmer's guide Erik Gabriel Carrillo
2018-03-12 11:21         ` Jerin Jacob [this message]
2018-03-12 22:02           ` Carrillo, Erik G
2018-03-08 21:54       ` [dpdk-dev] [PATCH v7 7/7] doc: add event timer adapter documentation Erik Gabriel Carrillo
2018-03-12 11:28         ` Jerin Jacob
2018-03-29 21:27       ` [dpdk-dev] [PATCH v8 0/9] eventtimer: introduce event timer adapter Erik Gabriel Carrillo
2018-03-29 21:27         ` [dpdk-dev] [PATCH v8 1/9] " Erik Gabriel Carrillo
2018-03-29 21:27         ` [dpdk-dev] [PATCH v8 2/9] eventdev: convert to SPDX license tag in header Erik Gabriel Carrillo
2018-04-02  8:12           ` Jerin Jacob
2018-04-02  9:16             ` Hemant Agrawal
2018-03-29 21:27         ` [dpdk-dev] [PATCH v8 3/9] eventtimer: add common code Erik Gabriel Carrillo
2018-03-29 21:27         ` [dpdk-dev] [PATCH v8 4/9] mk: update library order in static build Erik Gabriel Carrillo
2018-03-29 21:27         ` [dpdk-dev] [PATCH v8 5/9] eventtimer: add default software driver Erik Gabriel Carrillo
2018-04-02  8:42           ` Jerin Jacob
2018-03-29 21:27         ` [dpdk-dev] [PATCH v8 6/9] eventtimer: add support for meson build system Erik Gabriel Carrillo
2018-03-29 21:27         ` [dpdk-dev] [PATCH v8 7/9] test: add event timer adapter auto-test Erik Gabriel Carrillo
2018-03-30 15:48           ` Bhagavatula, Pavan
2018-03-30 18:47             ` Carrillo, Erik G
2018-03-29 21:27         ` [dpdk-dev] [PATCH v8 8/9] doc: add event timer adapter section to programmer's guide Erik Gabriel Carrillo
2018-03-29 21:27         ` [dpdk-dev] [PATCH v8 9/9] doc: add event timer adapter documentation Erik Gabriel Carrillo
2018-04-02 19:39         ` [dpdk-dev] [PATCH v9 0/9] eventtimer: introduce event timer adapter Erik Gabriel Carrillo
2018-04-02 19:39           ` [dpdk-dev] [PATCH v9 1/9] " Erik Gabriel Carrillo
2018-04-02 23:25             ` Jerin Jacob
2018-04-02 19:39           ` [dpdk-dev] [PATCH v9 2/9] eventdev: convert to SPDX license tag in header Erik Gabriel Carrillo
2018-04-02 23:27             ` Jerin Jacob
2018-04-02 19:39           ` [dpdk-dev] [PATCH v9 3/9] eventtimer: add common code Erik Gabriel Carrillo
2018-04-02 23:35             ` Jerin Jacob
2018-04-03 18:38               ` Carrillo, Erik G
2018-04-02 19:39           ` [dpdk-dev] [PATCH v9 4/9] mk: update library order in static build Erik Gabriel Carrillo
2018-04-02 23:36             ` Jerin Jacob
2018-04-02 19:39           ` [dpdk-dev] [PATCH v9 5/9] eventtimer: add default software driver Erik Gabriel Carrillo
2018-04-03  9:59             ` Pavan Nikhilesh
2018-04-02 19:39           ` [dpdk-dev] [PATCH v9 6/9] eventtimer: add support for meson build system Erik Gabriel Carrillo
2018-04-02 19:39           ` [dpdk-dev] [PATCH v9 7/9] test: add event timer adapter auto-test Erik Gabriel Carrillo
2018-04-03  9:52             ` Pavan Nikhilesh
2018-04-02 19:39           ` [dpdk-dev] [PATCH v9 8/9] doc: add event timer adapter section to programmer's guide Erik Gabriel Carrillo
2018-04-03  0:00             ` Jerin Jacob
2018-04-02 19:39           ` [dpdk-dev] [PATCH v9 9/9] doc: add event timer adapter documentation Erik Gabriel Carrillo
2018-04-02 23:42             ` Jerin Jacob
2018-04-02 23:19           ` [dpdk-dev] [PATCH v9 0/9] eventtimer: introduce event timer adapter Jerin Jacob
2018-04-03 14:09             ` Carrillo, Erik G
2018-04-03 14:15               ` Jerin Jacob
2018-04-03 18:32                 ` Carrillo, Erik G
2018-04-03 21:44           ` [dpdk-dev] [PATCH v10 " Erik Gabriel Carrillo
2018-04-03 21:44             ` [dpdk-dev] [PATCH v10 1/9] " Erik Gabriel Carrillo
2018-04-03 21:44             ` [dpdk-dev] [PATCH v10 2/9] eventdev: convert to SPDX license tag in header Erik Gabriel Carrillo
2018-04-03 21:44             ` [dpdk-dev] [PATCH v10 3/9] eventtimer: add common code Erik Gabriel Carrillo
2018-04-04 16:50               ` Pavan Nikhilesh
2018-04-03 21:44             ` [dpdk-dev] [PATCH v10 4/9] mk: update library order in static build Erik Gabriel Carrillo
2018-04-03 21:44             ` [dpdk-dev] [PATCH v10 5/9] eventtimer: add default software driver Erik Gabriel Carrillo
2018-04-03 21:44             ` [dpdk-dev] [PATCH v10 6/9] eventtimer: add support for meson build system Erik Gabriel Carrillo
2018-04-04 16:51               ` Pavan Nikhilesh
2018-04-03 21:44             ` [dpdk-dev] [PATCH v10 7/9] test: add event timer adapter auto-test Erik Gabriel Carrillo
2018-04-03 21:44             ` [dpdk-dev] [PATCH v10 8/9] doc: add event timer adapter section to programmer's guide Erik Gabriel Carrillo
2018-04-03 21:44             ` [dpdk-dev] [PATCH v10 9/9] doc: add event timer adapter documentation Erik Gabriel Carrillo
2018-04-04  2:31             ` [dpdk-dev] [PATCH v10 0/9] eventtimer: introduce event timer adapter Jerin Jacob
2018-04-04 21:51             ` [dpdk-dev] [PATCH v11 " Erik Gabriel Carrillo
2018-04-04 21:51               ` [dpdk-dev] [PATCH v11 1/9] " Erik Gabriel Carrillo
2018-04-04 21:51               ` [dpdk-dev] [PATCH v11 2/9] eventdev: convert to SPDX license tag in header Erik Gabriel Carrillo
2018-04-04 21:51               ` [dpdk-dev] [PATCH v11 3/9] eventtimer: add common code Erik Gabriel Carrillo
2018-04-04 21:51               ` [dpdk-dev] [PATCH v11 4/9] mk: update library order in static build Erik Gabriel Carrillo
2018-04-04 21:51               ` [dpdk-dev] [PATCH v11 5/9] eventtimer: add default software driver Erik Gabriel Carrillo
2018-04-04 21:51               ` [dpdk-dev] [PATCH v11 6/9] eventtimer: add support for meson build system Erik Gabriel Carrillo
2018-04-04 21:51               ` [dpdk-dev] [PATCH v11 7/9] test: add event timer adapter auto-test Erik Gabriel Carrillo
2018-04-04 21:51               ` [dpdk-dev] [PATCH v11 8/9] doc: add event timer adapter section to programmer's guide Erik Gabriel Carrillo
2018-04-04 21:51               ` [dpdk-dev] [PATCH v11 9/9] doc: add event timer adapter documentation Erik Gabriel Carrillo
2018-04-05  3:31               ` [dpdk-dev] [PATCH v11 0/9] eventtimer: introduce event timer adapter Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180312112105.GA23858@jerin \
    --to=jerin.jacob@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=erik.g.carrillo@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=nipun.gupta@nxp.com \
    --cc=pbhagavatula@caviumnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).