[dpdk-dev] [PATCH v9 8/9] doc: add event timer adapter section to programmer's guide

Jerin Jacob jerin.jacob at caviumnetworks.com
Tue Apr 3 02:00:45 CEST 2018


-----Original Message-----
> Date: Mon, 2 Apr 2018 14:39:53 -0500
> From: Erik Gabriel Carrillo <erik.g.carrillo at intel.com>
> To: pbhagavatula at caviumnetworks.com
> CC: dev at dpdk.org, jerin.jacob at caviumnetworks.com, hemant.agrawal at nxp.com
> Subject: [PATCH v9 8/9] 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 at intel.com>
> Signed-off-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
> ---
> +To create an event timer adapter instance, initialize an
> +``rte_event_timer_adapter_conf`` struct with the desired values, and pass it
> +to ``rte_event_timer_adapter_create()``.
> +
> +.. code-block:: c
> +
> +	#define NSECPERSEC 1E9 // No of ns in 1 sec
> +	const struct rte_event_timer_adapter_config adapter_config = {

s/rte_event_timer_adapter_config/rte_event_timer_adapter_conf

> +                .event_dev_id = event_dev_id,
> +                .timer_adapter_id = 0,
> +                .clk_src = RTE_EVENT_TIMER_WHEEL_CPU_CLK,

s/RTE_EVENT_TIMER_WHEEL_CPU_CLK/RTE_EVENT_TIMER_ADAPTER_CPU_CLK

> +                .timer_tick_ns = NSECPERSEC / 10, // 100 milliseconds
> +                .max_tmo_nsec = 180 * NSECPERSEC // 2 minutes
> +                .nb_timers = 40000,
> +                .timer_adapter_flags = 0,
> +	};
> +
> +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) { ... }
> +
> +	/* Set up the event timer. */
> +	conn->evtim->ev.op = RTE_EVENT_OP_NEW;
> +	conn->evtim->ev.queue_id = event_queue_id;
> +        conn->evtim->ev.sched_type = RTE_SCHED_TYPE_ATOMIC;
> +        conn->evtim->ev.priority = RTE_EVENT_DEV_PRIORITY_NORMAL;
> +        conn->evtim->ev.event_type = RTE_EVENT_TYPE_TIMER;
> +	conn->evtim->ev.event_ptr = conn;
> +	conn->evtim->state = RTE_EVENT_TIMER_NOT_ARMED;
> +	conn->evtim->timeout_ticks = 30; //3 sec Per RFC1122(TCP returns)
> +
> +Note that it is necessary to initialize the event timer state to
> +RTE_EVENT_TIMER_NOT_ARMED.  Also 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.  As a convenience, the application may specify no value for
> +ev.event_ptr (rte_event_timer_init sets it to NULL), and the adapter will by

rte_event_timer_init() has been removed. Either re-introduce the function
or update the programmers guide and fix reference to rte_event_timer_init () in patch 3/9

I think, you made correct decision to remove rte_event_timer_init() as
it does not have much use. So it is up to you to include back or not.

Once above documentation is fixed, you can add my:
Acked-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>


More information about the dev mailing list