From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH v3 09/12] event/octeontx: optimize timer adapter resolution parameters Date: Sun, 8 Apr 2018 13:39:45 +0530 Message-ID: <20180408080940.GF6880@jerin> References: <20180216213700.3415-1-pbhagavatula@caviumnetworks.com> <20180403150514.24201-1-pbhagavatula@caviumnetworks.com> <20180403150514.24201-10-pbhagavatula@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: santosh.shukla@caviumnetworks.com, erik.g.carrillo@intel.com, dev@dpdk.org To: Pavan Nikhilesh Return-path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0079.outbound.protection.outlook.com [104.47.34.79]) by dpdk.org (Postfix) with ESMTP id 84EC11B7A4 for ; Sun, 8 Apr 2018 10:10:06 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20180403150514.24201-10-pbhagavatula@caviumnetworks.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -----Original Message----- > Date: Tue, 3 Apr 2018 20:35:11 +0530 > From: Pavan Nikhilesh > To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, > erik.g.carrillo@intel.com > Cc: dev@dpdk.org, Pavan Nikhilesh > Subject: [dpdk-dev] [PATCH v3 09/12] event/octeontx: optimize timer adapter > resolution parameters > X-Mailer: git-send-email 2.16.3 > > When application sets `RTE_EVENT_TIMER_ADAPTER_F_ADJUST_RES` flag > while creating adapter underlying driver is free to optimize the > resolution for best possible configuration. > > Signed-off-by: Pavan Nikhilesh > --- > static int > timvf_ring_start(const struct rte_event_timer_adapter *adptr) > { > @@ -217,7 +256,7 @@ timvf_ring_create(struct rte_event_timer_adapter *adptr) > } > > timr->tim_ring_id = adptr->data->id; > - timr->tck_nsec = rcfg->timer_tick_ns; > + timr->tck_nsec = RTE_ALIGN_MUL_CEIL(rcfg->timer_tick_ns, 10); > timr->max_tout = rcfg->max_tmo_ns; > timr->meta.nb_bkts = (timr->max_tout / timr->tck_nsec) + 1; > timr->vbar0 = octeontx_timvf_bar(timr->tim_ring_id, 0); > @@ -227,6 +266,13 @@ timvf_ring_create(struct rte_event_timer_adapter *adptr) > > timr->nb_chunks = nb_timers / nb_chunk_slots; > > + /* Try to optimize the bucket parameters. */ > + if ((rcfg->flags & RTE_EVENT_TIMER_ADAPTER_F_ADJUST_RES) > + && !rte_is_power_of_2(timr->meta.nb_bkts)) { > + optimize_bucket_parameters(timr); > + timvf_log_info("Optimizing configured values"); You could print the adjusted values here. > + } > + > if (rcfg->flags & RTE_EVENT_TIMER_ADAPTER_F_SP_PUT) { > mp_flags = MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET; > timvf_log_info("Using single producer mode"); > diff --git a/drivers/event/octeontx/timvf_evdev.h b/drivers/event/octeontx/timvf_evdev.h > index d8a6d111f..22c8c2266 100644 > --- a/drivers/event/octeontx/timvf_evdev.h > +++ b/drivers/event/octeontx/timvf_evdev.h > @@ -192,6 +192,12 @@ bkt_mod(const uint32_t rel_bkt, const uint32_t nb_bkts) > return rel_bkt % nb_bkts; > } > > +static __rte_always_inline uint32_t __hot __hot may not be required here as it in as inline function. > +bkt_and(uint32_t rel_bkt, uint32_t nb_bkts) > +{ > + return rel_bkt & (nb_bkts - 1); > +} > + > int timvf_timer_adapter_caps_get(const struct rte_eventdev *dev, uint64_t flags, > uint32_t *caps, const struct rte_event_timer_adapter_ops **ops); > uint16_t timvf_timer_unreg_burst(const struct rte_event_timer_adapter *adptr, With above change: Acked-by: Jerin Jacob