From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 891ACA054F; Sun, 14 Mar 2021 17:51:22 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C4EB16082C; Sun, 14 Mar 2021 17:51:22 +0100 (CET) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id 5C96F40138 for ; Sun, 14 Mar 2021 17:51:21 +0100 (CET) Received: by mail-pf1-f177.google.com with SMTP id 18so5132228pfo.6 for ; Sun, 14 Mar 2021 09:51:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=llnJOKGjc2b3RMEq/JfFZzW1MEHOnp/PNkeBWR1OJlk=; b=JBS+HKIdw6o/N8A4dVdRm0MqFUQxKmyhuegpXG4ylzK7VnkR7s0M3iGbEnJc0Ot3Z3 WVk6+mtdKT9YuvVIU1MqkpqyBO6C1/arHgxldlCMQlhmXyCUSQNQDBMXHLv7YyO/9dxK dx4EsGM0hGPuAf4zGxlGMCJKRRkM7i6gspKYi5TZYL4wda5SUdSXofDcZBOFoNTrQKKM X30sR1eD1Emhv+ecT9yLeCfhd7HtLbqLGIdAdP8WN3jnhifaZf8AwUnh/fLhVS2X1/pf X3gnaAFP+F4Qe5o3FX0qWUcmeLwSSSAGuHgoBNgyUc7o6X21IW6MSZBZvB4GirjtG1/b Cb2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=llnJOKGjc2b3RMEq/JfFZzW1MEHOnp/PNkeBWR1OJlk=; b=n34l6a7SPe4KoCx2zGps4D4ylNUavQcXTfNXbj+ygNPLPK2OSoULFv7ASAtAbMXqOU owmmVPQr0vpl62DMyu6mMXHi6SRef699M9+Rxwd2ovwHhyWiulrlgqpA8mlvjP5NFkkd S/RiVoo219pD47YkLtpzsC83WweSKX2shTCCHBIo72vXbJbIGSbftlFrTazaiaK+LvSh i5hgT9s0EuXt7F3ZVrbZky2ORwUBq2KQd1Qge95Y/JyK4K7SkybtDq6Ojpi3PxXmBv/X Md8kjYrpGHTe0LwbKY+5umtNVsdW3ICCtaiAklrScQ0g7NlKvCXh1KMgOZRrOhpMB7Ur ssTw== X-Gm-Message-State: AOAM532QqyNZAkXP8sjFCb4U/SkRZFv7lIqGYX1uJz7tptvR7mLfTww/ bqwjP25K8C/lAMSb7kPE0fQ= X-Google-Smtp-Source: ABdhPJyqLFKes1x/eB86vtcL+Yr1yc8dirV3tRpg66Ey9B9AfQk7x9hkPrJ/sznhFYYlqj1/1p/9dg== X-Received: by 2002:a63:d0f:: with SMTP id c15mr194050pgl.390.1615740680569; Sun, 14 Mar 2021 09:51:20 -0700 (PDT) Received: from BG-LT7405.marvell.com (117.205.98.34.bc.googleusercontent.com. [34.98.205.117]) by smtp.gmail.com with ESMTPSA id d19sm7830610pjs.55.2021.03.14.09.51.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Mar 2021 09:51:20 -0700 (PDT) Date: Sun, 14 Mar 2021 22:19:36 +0530 From: Shijith Thotton To: "Carrillo, Erik G" Cc: Shijith Thotton , Pavan Nikhilesh , Jerin Jacob , "dev@dpdk.org" Message-ID: <20210314164936.GA21@BG-LT7405.marvell.com> References: <20210308204543.2903723-1-sthotton@marvell.com> <20210308204543.2903723-2-sthotton@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [dpdk-dev] [PATCH 1/3] eventdev: introduce adapter flags for periodic mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Mar 12, 2021 at 03:30:11PM +0000, Carrillo, Erik G wrote: > Hi Shijith, > > Some comments in-line: > > > -----Original Message----- > > From: Shijith Thotton > > Sent: Monday, March 8, 2021 2:46 PM > > To: Carrillo, Erik G > > Cc: Shijith Thotton ; Pavan Nikhilesh > > ; Jerin Jacob ; > > dev@dpdk.org > > Subject: [PATCH 1/3] eventdev: introduce adapter flags for periodic mode > > > > A timer adapter in periodic mode can be used to arm periodic timers. > > This patch adds flags used to advertise capability and configure timer adapter > > in periodic mode. Capability flag should be set for adapters which support > > periodic mode. > > > > Below is a programming sequence on the usage: > > /* check for periodic mode support by reading capability. */ > > rte_event_timer_adapter_caps_get(...); > > > > /* create adapter in periodic mode by setting periodic flag > > (RTE_EVENT_TIMER_ADAPTER_F_PERIODIC) and resolution. */ > > rte_event_timer_adapter_create_ext(...); > > > > /* arm periodic timer of configured resolution */ > > rte_event_timer_arm_burst(...); > > > > /* timer event will be periodically generated at configured > > resolution till cancel is called. */ > > while (running) { rte_event_dequeue_burst(...); } > > > > /* cancel periodic timer which stops generating events */ > > rte_event_timer_cancel_burst(...); > > > > Signed-off-by: Shijith Thotton > > --- > > doc/guides/prog_guide/event_timer_adapter.rst | 33 > > +++++++++++++++++++ lib/librte_eventdev/rte_event_timer_adapter.h | > > 6 ++++ > > lib/librte_eventdev/rte_eventdev.h | 3 ++ > > 3 files changed, 42 insertions(+) > > > > diff --git a/doc/guides/prog_guide/event_timer_adapter.rst > > b/doc/guides/prog_guide/event_timer_adapter.rst > > index a95efbe0d..fcdecdb3b 100644 > > --- a/doc/guides/prog_guide/event_timer_adapter.rst > > +++ b/doc/guides/prog_guide/event_timer_adapter.rst > > @@ -252,6 +252,39 @@ be canceled by calling > > ``rte_event_timer_cancel_burst()``: > > */ > > rte_event_timer_cancel_burst(adapter, &conn->timer, 1); > > > > +Timer adapter in periodic mode > > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > + > > +A periodic timer is a timer, which expires at fixed time intervals > > +continuously till it is cancelled. A timer adapter can be configured > > +to arm such timers by configuring it in periodic mode. Capability flag > > +``RTE_EVENT_TIMER_ADAPTER_CAP_PERIODIC`` can be used to check if an > > +adapter supports periodic mode. An adapter in periodic mode can only be > > +used to arm periodic timers. > > + > > +Example config to create an adapter in periodic mode with 100ms > > resolution: > > + > > +.. code-block:: c > > + > > + #define NSECPERSEC 1E9 // No of ns in 1 sec > > + const struct rte_event_timer_adapter_conf adapter_config = { > > + .event_dev_id = event_dev_id, > > + .timer_adapter_id = 0, > > + .clk_src = RTE_EVENT_TIMER_ADAPTER_CPU_CLK, > > + .timer_tick_ns = NSECPERSEC / 10, // 100 milliseconds > > + .nb_timers = 100, > > + .timer_adapter_flags = RTE_EVENT_TIMER_ADAPTER_F_PERIODIC, > > + }; > > + > > +``timer_adapter_flags`` is set to include periodic flag > > +``RTE_EVENT_TIMER_ADAPTER_F_PERIODIC`` and ``timer_tick_ns`` to > > resolution. > > +Maximum timeout (``max_tmo_nsec``) does not apply for periodic mode. > > This content can be reworked slightly and moved into the "Create and Configure an Adapter Instance" section, perhaps as a subsection describing the two adapter modes. > Reworked as suggested in v2. > > + > > +After starting the adapter, event timer arm APIs can be used to arm > > +periodic timers. Timer events will be generated at configured > > +``timer_tick_ns`` intervals. Event generation can be stopped using > > +cancel API ``rte_event_timer_cancel_burst``. > > + > > I think this content should be worked into the "Arming Event Timers" section, indicating how the timer behavior depends on the mode of the adapter that specified in the arm call. > Reworked as suggested in v2. > > Processing Timer Expiry Events > > ------------------------------ > > > > diff --git a/lib/librte_eventdev/rte_event_timer_adapter.h > > b/lib/librte_eventdev/rte_event_timer_adapter.h > > index d2ebcb090..f9fc95711 100644 > > --- a/lib/librte_eventdev/rte_event_timer_adapter.h > > +++ b/lib/librte_eventdev/rte_event_timer_adapter.h > > I think we should also update the doxygen documentation for the rte_event_timer_arm_burst to indicate that timer expiry events will be generated once or periodically until the timer is stopped based on the mode of the adapter that is specified. We can have a "see also" for the RTE_EVENT_TIMER_ADAPTER_F_PERIODIC flag. > Updated comments in v2. > > @@ -151,6 +151,12 @@ enum rte_event_timer_adapter_clk_src { > > * @see struct rte_event_timer_adapter_conf::flags > > */ > > > > +#define RTE_EVENT_TIMER_ADAPTER_F_PERIODIC (1ULL << 2) > > +/**< Flag to configure event timer adapter in periodic mode. > > + * > > + * @see struct rte_event_timer_adapter_conf::flags > > + */ > > + > > /** > > * Timer adapter configuration structure > > */ > Thanks, Shijith