From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 1F2E35F1B for ; Fri, 30 Mar 2018 21:50:46 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Mar 2018 12:50:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,382,1517904000"; d="scan'208";a="28927431" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga008.fm.intel.com with ESMTP; 30 Mar 2018 12:50:44 -0700 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 30 Mar 2018 12:50:43 -0700 Received: from fmsmsx115.amr.corp.intel.com ([169.254.4.26]) by FMSMSX154.amr.corp.intel.com ([169.254.6.109]) with mapi id 14.03.0319.002; Fri, 30 Mar 2018 12:50:43 -0700 From: "Carrillo, Erik G" To: Pavan Nikhilesh , "jerin.jacob@caviumnetworks.com" , "santosh.shukla@caviumnetworks.com" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 1/4] app/eventdev: add event timer adapter as a producer Thread-Index: AQHTvrrauwZSQTBKJ0e6mQf5QMpejaPpP+BQ Date: Fri, 30 Mar 2018 19:50:42 +0000 Message-ID: References: <20180318131216.11699-1-pbhagavatula@caviumnetworks.com> In-Reply-To: <20180318131216.11699-1-pbhagavatula@caviumnetworks.com> 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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGUzYzY5ZGEtNmJhOC00YmU1LThkYjYtYjUwMDUyODZiNGFiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJVaTFoTm10VGZjOXNERWhZXC9CQUVrQ3U1UzZhcllvTVhcLzdja0QwNVJLcnl2SG5Id3k2N3lXaWRlRzVnaHAxMloifQ== x-ctpclassification: CTP_NT x-originating-ip: [10.1.200.108] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/4] app/eventdev: add event timer adapter as a producer 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: Fri, 30 Mar 2018 19:50:47 -0000 Hi Pavan, Some comments in-line: > -----Original Message----- > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com] > Sent: Sunday, March 18, 2018 8:12 AM > To: jerin.jacob@caviumnetworks.com; > santosh.shukla@caviumnetworks.com; Carrillo, Erik G > > Cc: dev@dpdk.org; Pavan Nikhilesh > Subject: [dpdk-dev] [PATCH 1/4] app/eventdev: add event timer adapter as > a producer >=20 > Add event timer adapter as producer option that can be selected by passin= g - > -prod_type_timerdev. >=20 > Signed-off-by: Pavan Nikhilesh > --- <...snipped...> > diff --git a/app/test-eventdev/test_perf_common.c b/app/test- > eventdev/test_perf_common.c > index 59fa0a49e..6ae146d91 100644 > --- a/app/test-eventdev/test_perf_common.c > +++ b/app/test-eventdev/test_perf_common.c > @@ -72,6 +72,62 @@ perf_producer(void *arg) > return 0; > } >=20 > +static inline int > +perf_event_timer_producer(void *arg) > +{ > + struct prod_data *p =3D arg; > + struct test_perf *t =3D p->t; > + struct evt_options *opt =3D t->opt; > + uint32_t flow_counter =3D 0; > + uint64_t count =3D 0; > + uint64_t arm_latency =3D 0; > + const uint8_t nb_timer_adptrs =3D opt->nb_timer_adptrs; > + const uint32_t nb_flows =3D t->nb_flows; > + const uint64_t nb_timers =3D opt->nb_timers; > + struct rte_mempool *pool =3D t->pool; > + struct perf_elt *m =3D NULL; > + struct rte_event_timer_adapter **adptr =3D t->timer_adptr; > + const struct rte_event_timer tim =3D { > + .ev.op =3D RTE_EVENT_OP_NEW, > + .ev.queue_id =3D p->queue_id, > + .ev.sched_type =3D t->opt->sched_type_list[0], > + .ev.priority =3D RTE_EVENT_DEV_PRIORITY_NORMAL, > + .ev.event_type =3D RTE_EVENT_TYPE_TIMER, > + .timeout_ticks =3D opt->optm_bkt_tck_nsec ? > + (opt->nb_bkt_tcks * opt->bkt_tck_nsec) / > + opt->optm_bkt_tck_nsec : opt->nb_bkt_tcks, We should also initialize .state =3D RTE_EVENT_TIMER_NOT_ARMED. Also, would it be better to take the ceiling instead of the floor when scal= ing the ticks with: ((opt->nb_bkt_tcks * opt->bkt_tck_nsec) + opt->optm_bkt_tck_nsec - 1) / opt= ->optm_bkt_tck_nsec If the fraction is less than one in the current form, then truncation would= return 0, which at least in the case of the software impl would be treated= as RTE_EVENT_TIMER_ERROR_TOOEARLY. Thoughts? Regards, Gabriel