From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hemant Agrawal Subject: Re: [PATCH] eventdev: define the default value for dequeue timeout Date: Thu, 18 May 2017 19:45:44 +0530 Message-ID: References: <20170518084827.13626-1-jerin.jacob@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Cc: , , , , To: Jerin Jacob , Return-path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0040.outbound.protection.outlook.com [104.47.36.40]) by dpdk.org (Postfix) with ESMTP id BD82D16E for ; Thu, 18 May 2017 16:16:02 +0200 (CEST) In-Reply-To: <20170518084827.13626-1-jerin.jacob@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" On 5/18/2017 2:18 PM, Jerin Jacob wrote: > Defining the value 0 as default value for dequeue timeout > will help the application reduce the configuration setup > if the application is interested only in default > timeout value. > > Signed-off-by: Jerin Jacob > --- > This patch will fix following error found in the event_pipeline RFC application > http://dpdk.org/dev/patchwork/patch/23799/ with event_octeontx HW driver. > > EVENTDEV: rte_event_dev_configure() line 379: dev0 invalid > dequeue_timeout_ns=0 min_dequeue_timeout_ns=853 max_dequeue_timeout_ns=873813 > --- > drivers/event/octeontx/ssovf_evdev.c | 2 ++ > lib/librte_eventdev/rte_eventdev.c | 5 +++-- > lib/librte_eventdev/rte_eventdev.h | 1 + > 3 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c > index c80a44379..5499b1bf7 100644 > --- a/drivers/event/octeontx/ssovf_evdev.c > +++ b/drivers/event/octeontx/ssovf_evdev.c > @@ -194,6 +194,8 @@ ssovf_configure(const struct rte_eventdev *dev) > > ssovf_func_trace(); > deq_tmo_ns = conf->dequeue_timeout_ns; > + if (deq_tmo_ns == 0) > + deq_tmo_ns = edev->min_deq_timeout_ns; '0' should mean don't wait? > > if (conf->event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT) { > edev->is_timeout_deq = 1; > diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c > index 20afc3f0e..8cafffe03 100644 > --- a/lib/librte_eventdev/rte_eventdev.c > +++ b/lib/librte_eventdev/rte_eventdev.c > @@ -369,9 +369,10 @@ rte_event_dev_configure(uint8_t dev_id, > > /* Check dequeue_timeout_ns value is in limit */ > if (!(dev_conf->event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT)) { > - if (dev_conf->dequeue_timeout_ns < info.min_dequeue_timeout_ns > + if (dev_conf->dequeue_timeout_ns && > + (dev_conf->dequeue_timeout_ns < info.min_dequeue_timeout_ns > || dev_conf->dequeue_timeout_ns > > - info.max_dequeue_timeout_ns) { > + info.max_dequeue_timeout_ns)) { > RTE_EDEV_LOG_ERR("dev%d invalid dequeue_timeout_ns=%d" > " min_dequeue_timeout_ns=%d max_dequeue_timeout_ns=%d", > dev_id, dev_conf->dequeue_timeout_ns, > diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h > index 94284337d..f39fbc6b9 100644 > --- a/lib/librte_eventdev/rte_eventdev.h > +++ b/lib/librte_eventdev/rte_eventdev.h > @@ -409,6 +409,7 @@ struct rte_event_dev_config { > * This value should be in the range of *min_dequeue_timeout_ns* and > * *max_dequeue_timeout_ns* which previously provided in > * rte_event_dev_info_get() > + * The value 0 is allowed, in which case, default dequeue timeout used. > * @see RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT > */ > int32_t nb_events_limit; >