From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 0BEC52BDF for ; Mon, 12 Mar 2018 23:02:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Mar 2018 15:02:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,463,1515484800"; d="scan'208";a="41369291" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 12 Mar 2018 15:02:34 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 12 Mar 2018 15:02:34 -0700 Received: from fmsmsx115.amr.corp.intel.com ([169.254.4.147]) by fmsmsx158.amr.corp.intel.com ([169.254.15.84]) with mapi id 14.03.0319.002; Mon, 12 Mar 2018 15:02:33 -0700 From: "Carrillo, Erik G" To: Jerin Jacob CC: "pbhagavatula@caviumnetworks.com" , "dev@dpdk.org" Thread-Topic: [PATCH v7 6/7] doc: add event timer adapter section to programmer's guide Thread-Index: AQHTufRcAAQXerzST0O2V9LY9npCy6PNI6TQ Date: Mon, 12 Mar 2018 22:02:33 +0000 Message-ID: References: <1515630074-29020-1-git-send-email-erik.g.carrillo@intel.com> <1520546046-6973-1-git-send-email-erik.g.carrillo@intel.com> <1520546046-6973-7-git-send-email-erik.g.carrillo@intel.com> <20180312112105.GA23858@jerin> In-Reply-To: <20180312112105.GA23858@jerin> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjAwYWE3MTctMGYxYi00NzRjLTgxNmMtYTAyZmFiMDVlOGU5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJGVnYrQTdET2VnaUVWOVBMWFM4YVNwd2ZMZ0syUEpKdElQQ1puSUtFdjcxMW9DV3kzK3dORUhUcEI0S2tod2NXIn0= x-ctpclassification: CTP_NT x-originating-ip: [10.1.200.107] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v7 6/7] doc: add event timer adapter section to programmer's guide X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 22:02:36 -0000 Hi Jerin, > -----Original Message----- > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > Sent: Monday, March 12, 2018 6:21 AM > To: Carrillo, Erik G > Cc: pbhagavatula@caviumnetworks.com; dev@dpdk.org; > nipun.gupta@nxp.com; hemant.agrawal@nxp.com > Subject: Re: [PATCH v7 6/7] doc: add event timer adapter section to > programmer's guide >=20 > -----Original Message----- > > Date: Thu, 8 Mar 2018 15:54:05 -0600 > > From: Erik Gabriel Carrillo > > 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 > > Signed-off-by: Jerin Jacob > > Signed-off-by: Pavan Nikhilesh > > --- <... snipped ...> > > + > > +Event Timer struct > > +------------------ > > +Event timers are timers that enqueue a timer expiration event to an > > +event device upon firing. >=20 > I think, it better to change to _timer expiry_ from _firing_. >=20 Sounds good. > > + > > +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 =3D=3D NULL) { ... } > > + > > + rte_event_timer_init(&conn->evtim); > > + > > + /* Set up the expiry event. */ > > + conn->evtim->ev.event_ptr =3D conn; >=20 > Not specific to this specific example, What would be the default behaviou= r if > application does not set ev.event_ptr value. >=20 Currently, it's undefined. > Can we say? > "NULL value is allowed, in which case adapter set the event_ptr to struct > rte_event_timer * >=20 I like that idea; it would be a convenient touch. I'll look at making this= update. > > + conn->evtim->ev.queue_id =3D event_queue_id; > > + ... > > + conn->evtim->timeout_ticks =3D 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. <... snipped ...> >=20 > Overall, it looks good. With above changes >=20 > Acked-by: Jerin Jacob >=20 >=20 > > -- > > 2.6.4 > > Thanks for the suggestions, Gabriel