From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0080.outbound.protection.outlook.com [104.47.41.80]) by dpdk.org (Postfix) with ESMTP id A28444C92 for ; Mon, 10 Sep 2018 15:34:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dO4ThdI56QTUDG0b1yu7Yo2S6ldKXkBTgvLVb3ZTB7I=; b=ODoTUwM02EqR0IMkkBimXv9Bs7AJewMupxQ5Udek7Q0BSKJrI5+ycgRC7aSw7na7D+eYvTpckYOXjbLKaOjJePH0weExOqTXtxhSt76rx1q1mROxBj1LcbsXdj9URzDex02xiFKFI/KEB7vnMSNqVary7o7GKIV7IMnUqtLNEog= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (115.113.156.3) by DM6PR07MB5002.namprd07.prod.outlook.com (2603:10b6:5:25::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.18; Mon, 10 Sep 2018 13:33:59 +0000 Date: Mon, 10 Sep 2018 19:03:42 +0530 From: Jerin Jacob To: Hemant Agrawal Cc: dev@dpdk.org, nipun.gupta@nxp.com Message-ID: <20180910133341.GA21608@jerin> References: <1535607196-26782-1-git-send-email-hemant.agrawal@nxp.com> <1535607196-26782-2-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1535607196-26782-2-git-send-email-hemant.agrawal@nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [115.113.156.3] X-ClientProxiedBy: PN1PR0101CA0013.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::23) To DM6PR07MB5002.namprd07.prod.outlook.com (2603:10b6:5:25::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4efd1d68-9d18-4ffa-06fb-08d6172211b1 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:DM6PR07MB5002; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB5002; 3:CctZafikw/4kKNkYVJjH0YPCr0x1gdUX43xrBb/KzsJUV4TSa/TEMYQiIg+skeFJEiMz3ifdXN+FFUB0wivMaStz7bXldCxXgjohZgJS6UFUz0tRLMQuJTcvO61ogXFNLENnPrDSLq1DYbwrbT1xiyPzlao4J2cJmFK51u9U8a/Tskoxwo2r5xH+xpoMc+oBjhModijWgAvwKZARTFPiNEuzUUqzON/Ehyz8ybqYlR+aXHIW9fe3lanBbkuW0N3X; 25:XCOIS9tFL40QhNmatDYU1HeHlOZGPq7yFJ8t2rtHRVkX6Q+D4fGCe2aFjI/dcuz68SECatsHZvLIfeb9IR9zjA4wllxP51+us93QYx+OtDWF60Tnxd/stnB30XMXcxB1HDjcErYk8i/yXnxhBZBc88EpF+SgI546q+Bg5LF1U8BuQhJtpQbFO7oK86hQhaYv1ZwnIqMoV6m2WwhDwIqyjDAN/nr1jVc1HZA+uApaqLRl67ga6eizDaAqHBEtOo40cmImprKz4bNY39Y3vcinjnBveKTtETxtAq9uX9UO8SCsF2nctg6yGZI/dTiOKi9ZO1UlI/CHtZFGq52MoKaJmw==; 31:XRBfvvdAuE8Z8moubeFA89Y/jUeeSKwIQ9CjlrKi0MUCLbhieyUA3w5zXJtQxBCicCytSyQXwxX/UZm8P49nraZqPaRkfpey2h/gkf7D/N1bxsx72+4prnXrZhwDXz3PXnEPgMO9nykvxlB4jq222zpssR28hXPDOiPNdRrmlJYB84yA4C0Sx9sYaBueqzCl6mG7zd3EpiPgrkZV57UyZyXtM6V8k3ylmQKt8tfowcs= X-MS-TrafficTypeDiagnostic: DM6PR07MB5002: X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB5002; 20:BzZ1FRVted+kVd6vUrnXkkWxJ4i+Ox18nIXOBk24sgGbpbBtdVEem3928JoG7NwsNu0Z6KlGiTPP2T1e0uwITU1Ra5Wl3mo6vFzm/Knd95lqpLWGAhwUJ60i+1aDYYFasbv5+m0UmOcr/ISsxOhiShC13NIA4zE9C+McKnmOadC65mRK2sTJctky+wiPBCYmfznEuUyjbGi/Nh6Yv1v+MMC3UFzZioH0dt3C5uPipV7O3PlO9hF4zfNIuJANIRsGkhdpjp5JlFLkF/hC1YOtKxEdtcnl8Zh4hn6uszS18Soi5LW5YOdRNxc+Aihjk+OIxlnqrHzctEPyFp1sWEzfxAj8+RoxFfHVs4C25in+3E4HgYtRBcZxNXHpM5dZcoTvmPA6/lIDJALWGTuoI5xthfO0WP3zfyOOMF4rjUYfZ07z0VwxaEudsXGmaop2PfIthayqTcpn7g+er1G67cZeUIlCT0MC8esyPBFtn3DclrzfMjgzZyfeB3DZ2r2ubVMyvmEpb2z87jwkIceiyjqk8iBhsqqbggvmPVjaAeBVvNGta+gvK+3iylOrVySVV11hpuoEt5wZLKfojYHL2YtsRrThBTzZm/3pOcF0Z6kS1Xo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(227817650892897); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(10201501046)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201708071742011)(7699050); SRVR:DM6PR07MB5002; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB5002; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB5002; 4:gO3XM8vQwpFyGqEJpZ6NXkQRS8gCh1/gUSPaSsEth10Ro41CSU+UZe6jPrgX8j0bMHChETNKrPTonnhfE88/uLoxEKcf/nvYrZ1Mz2ke7WHoYqtYVdHzKuVtN488bGVkZSwnTr+OZcpRKwlgx4gJ+bmub2auE55sTLh1MXMYcbhAE4B0Z02yQ8Ygqr82HWVf69+8SvVm+MvOFOdSay0yNcAaG78xL7/o2ZV8Pkr7um8Kt0B994DGLtnyEgIOS5w9HMj7lFAvEAyEfaK0zapmMuPhswuoUEGQmhWZd49u+Pt5+/5NFzSRZFN3rXueghWnEoJ/47T4sWczojGnEcs+laRUdEL5z/RmGmv93VT4VB0= X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(396003)(39850400004)(136003)(13464003)(189003)(199004)(68736007)(16586007)(305945005)(58126008)(66066001)(6666003)(478600001)(1076002)(26005)(316002)(186003)(2906002)(16526019)(6116002)(23726003)(3846002)(6496006)(25786009)(52116002)(8676002)(76176011)(7736002)(33896004)(47776003)(4326008)(6916009)(229853002)(72206003)(97736004)(106356001)(81156014)(8936002)(81166006)(6246003)(44832011)(33716001)(55016002)(42882007)(5660300001)(55236004)(50466002)(446003)(9686003)(11346002)(105586002)(53936002)(486006)(476003)(386003)(956004)(33656002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB5002; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR07MB5002; 23:e4TF4Iu2oUCRgY82mpYAN4vxUBaZJcgiRwWnW3nbZ?= =?us-ascii?Q?lHQB4r0WhloYdG5o7cxa1IJya52I5Itr46yzYH+2/DW1DDJV3V/GbXwarPLS?= =?us-ascii?Q?9r13/TRCg7uHGKh6y6edTwv/Z3DMWLbBeBWXzLSclLUAIMhqIFGp2FlxRDKL?= =?us-ascii?Q?RQCJWjMkUudelRpEDdKk9oDXbkvRz9xRUzKzN6GL72MDOvgjlD2QqtKc6WjX?= =?us-ascii?Q?0NRAezrh3MmOeB6JWVCJ3px34PYZeY5SL2vEBv8Q2mPXzVSY4GBk6fgdNi30?= =?us-ascii?Q?MTxQ2fsLBUcmzf0wkIZ8F/ps+uDSWn9t1RFNVZf0TnhYwKYRC+pLwjkOcn34?= =?us-ascii?Q?VF9a8mdMpFZoDzwLKGkwY7PL5fqm+pTi5IVjsAikIyHb/GG/OaDUC821uj0y?= =?us-ascii?Q?Jlx6mDcUV4Ky3YkB7axxum6Wvi3gH2MOZDup1Uin/OOnSmvXNTzuxfkWIrtc?= =?us-ascii?Q?SNcLrFxmBonr8b/Ph9xAHa4nDh5+5dv/r9L8HACCivGRgeZwI3yNpdtXoJix?= =?us-ascii?Q?PhQJCR5viVBwr4/U+rdt0pPQ5iJziobQzliaGKo1HBYWhAS5QUBjLqehn9jL?= =?us-ascii?Q?EoTAxFYNR6AtIw+luXBiLM8In0yjelBPBPvJgrD31N7XU+j1gulC80fy8pRN?= =?us-ascii?Q?KwxTc9CxkELkuP9/ZWvnLG2nEQ6n4QU7FKtogJINDWucnbdqLNASdJKJclgs?= =?us-ascii?Q?nwxry1jn1MfH10GS0KtaDGy+6+CEP5XuTu5TsNR5WKb3buf9nw/qjcq4xF67?= =?us-ascii?Q?fVGuUBXAQXX/seZzpj5+pgINJoFdtpgQ50lA3+DJ6Co7J2lEvcVI3jwcMLff?= =?us-ascii?Q?S69GUjSNF4z3XwqeE/1P9uCAmLqWl8/a5sRNIBSTEOUcANzNRTmWb98mr3Kd?= =?us-ascii?Q?IpkWZlwqHBCHBSE75xEIeZPkAYUqMjVdOn9i5IFf21zNOCwmgib8UsYUBZ/l?= =?us-ascii?Q?3Zl2IRWNXGmiIUPn/faKgNmv3bZJ87b0dDVqN+BIDeyIKskYJnJnbG2xBKng?= =?us-ascii?Q?xjRAYlj8X2nvIA3I0OewipOpe506SqIr6RHYM8pj696Giaed7dadbptdcTvq?= =?us-ascii?Q?QTli+MumzRfIC6m7M/fBsmvNIrYnRqSGKp0UPR4T+Q+aNe6u5UJYfcp8D3wg?= =?us-ascii?Q?I72BjoOjwM3g/eGIXVJn4z0mauDUhnyi0rIDuEoI/iGiDZnPrtWfgfP0F0ZM?= =?us-ascii?Q?Jcrr5Q9cTCEHDbRyIaR5x/k3+eFfoTmQUDwlxm8/sn0d11hAAlCM+HETpCEF?= =?us-ascii?Q?OxuWq7IQwCrqn+aZqoq6pts3Qesw6GwbaxYBb696MGhq8HTdQZrb4PuSzjOd?= =?us-ascii?Q?1rDyph0QanrRp9oAllObIbC4+/OOPyJLyw1srchKLut?= X-Microsoft-Antispam-Message-Info: BlxYpmZo6Q9iA1eUP1VKr1CHHlgzK6x1XT5T5NYuej3cDHpMwD3WDM6Z5VP83ilZc/EWeiT4qAStQz/eXc+tmKMj2w9DyjE7bVjmHeVfImSPXK9malHebtrSbQvdLsYt0iFI5+Ipx8KF/pfhXJpl3kal4qzeBoopqfdwitJsWX5g5vnvc2IYgEABFVIQCKglu8fSa6uNsvn01p5OO9d6nf1U96sWb2fysDNvqztd328nHd/DF1zC9RZ/9/CkNE9hM1ixv9MkiYrOdj6pGfvOBwr6c34AbMYzauc+zkin9MgSi0A5734NCMNLyMYpCLuHGwpLmFntfces9gsV6RyoZCA9r/iPVFTv4sLkfNbBOmo= X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB5002; 6:ApL0S5fIp/o+1P4PjeV0kZ32Wp6NFlGbza8DF7wlKqmc/L+yCgjFswE5Tk3aQdi2BhULxdzrVOmWy02bQCzBhwTHTfGeed8Dj+nfurmPVssa/nqsx52gvyQ5gAsUX8Q5+C0q6p28ATzNmzc7buZD3fX+BoJSaUFEItsuk5QOwymBHooVmBZH+fSYnOnR6mmaAt1xR/MRabdFlxifaHsMjQJ5VU16rHBkvEzPcik/b/7NGkS5Qp2021oDoLndA0cmjjUqj8cLhiHsu6dB0DKCqcZ62xs9U/kTSYDZkwqZrTyu2BL/KN0A6NVy7qO2pxsXdztO7lv2zAOOTANqKz8KF1QOIcENp+m0kX7IilWcZkauldY8N06ivDFBo6sukP0gCIQ/ItOip9K8cKFh3dzXlDsOaO+9iCJqOxq1yJV/gigu8T6n7YxHEVUNvUinEgkUOCp7VR6ncppH+eII4CvscA==; 5:wW4xsky15pORxYyCc0whsPSVHUuQgPTEp91uMyrDxHPIxes2+Z6+lqQt1/Be8zOX6EyAJoMg1swVEQ4aax7sFCaXvZv8RJUNaFjzcosYDUj3XwsX2NAfPne/FAxhk5lBi/ND6K6vaJvZI8DSqIqqzcN+vFDUhASK+mU65KZQBRI=; 7:waGA1ut3vgzWAudzcHWLkUWeTCd81W++1NyvhyGAwTEjW2ob8eDo5yicuaSnfsQQ5JNnwOTOKGF2q261DhUHQsgKqHibJYtttQbKFlaOHHJ1cT06rkkbSCx23uUB00wdpvORgE2b/O9cBYuPS+7JjC8salUUTmOt4X8G1pg99nJkRjGYmx/NzHizhQFh8K4N/68kiarPfB6687NebiLVGYifzDekqx4Sh3vpbFo2WiyMzAEwvMxw083BhC7IpzLO SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2018 13:33:59.5926 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4efd1d68-9d18-4ffa-06fb-08d6172211b1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB5002 Subject: Re: [dpdk-dev] [PATCH 2/2] event/dpaa: add select based event support 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, 10 Sep 2018 13:34:03 -0000 -----Original Message----- > Date: Thu, 30 Aug 2018 11:03:16 +0530 > From: Hemant Agrawal > To: dev@dpdk.org > CC: jerin.jacob@caviumnetworks.com, nipun.gupta@nxp.com > Subject: [PATCH 2/2] event/dpaa: add select based event support > X-Mailer: git-send-email 2.7.4 > > External Email > > Signed-off-by: Hemant Agrawal > --- > config/common_base | 1 + > config/defconfig_arm64-dpaa-linuxapp-gcc | 1 + > drivers/event/dpaa/dpaa_eventdev.c | 148 +++++++++++++++++++++++-------- > drivers/event/dpaa/dpaa_eventdev.h | 8 +- > 4 files changed, 115 insertions(+), 43 deletions(-) > > diff --git a/config/common_base b/config/common_base > index 4bcbaf9..01a6f17 100644 > --- a/config/common_base > +++ b/config/common_base > @@ -199,6 +199,7 @@ CONFIG_RTE_LIBRTE_DPAA_BUS=n > CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=n > CONFIG_RTE_LIBRTE_DPAA_PMD=n > CONFIG_RTE_LIBRTE_DPAA_HWDEBUG=n > +CONFIG_RTE_LIBRTE_DPAA_EVENT_INTR_MODE=n > +#ifdef RTE_LIBRTE_DPAA_EVENT_INTR_MODE Please don't add new compile time options. You can use devargs to select this mode and have different function pointer to choose this mode at runtime. > +static void drain_4_bytes(int fd, fd_set *fdset) > +{ > + if (FD_ISSET(fd, fdset)) { > + /* drain 4 bytes */ > + uint32_t junk; > + ssize_t sjunk = read(qman_thread_fd(), &junk, sizeof(junk)); > + if (sjunk != sizeof(junk)) > + DPAA_EVENTDEV_ERR("UIO irq read error"); > + } > +} > + > +static inline int > +dpaa_event_dequeue_wait(uint64_t timeout_ticks) > +{ > + int fd_qman, nfds; > + int ret; > + fd_set readset; > + > + /* Go into (and back out of) IRQ mode for each select, > + * it simplifies exit-path considerations and other > + * potential nastiness. > + */ > + struct timeval tv = { > + .tv_sec = timeout_ticks / 1000000, > + .tv_usec = timeout_ticks % 1000000 > + }; > + > + fd_qman = qman_thread_fd(); > + nfds = fd_qman + 1; > + FD_ZERO(&readset); > + FD_SET(fd_qman, &readset); > + > + qman_irqsource_add(QM_PIRQ_DQRI); > + > + ret = select(nfds, &readset, NULL, NULL, &tv); > + if (ret < 0) > + return ret; > + /* Calling irqsource_remove() prior to thread_irq() > + * means thread_irq() will not process whatever caused > + * the interrupts, however it does ensure that, once > + * thread_irq() re-enables interrupts, they won't fire > + * again immediately. > + */ > + qman_irqsource_remove(~0); > + drain_4_bytes(fd_qman, &readset); > + qman_thread_irq(); > + > + return ret; > +} > +#endif > + > static uint16_t > dpaa_event_dequeue_burst(void *port, struct rte_event ev[], > uint16_t nb_events, uint64_t timeout_ticks) > @@ -107,8 +163,8 @@ dpaa_event_dequeue_burst(void *port, struct rte_event ev[], > int ret; > u16 ch_id; > void *buffers[8]; > - u32 num_frames, i; > - uint64_t wait_time, cur_ticks, start_ticks; > + u32 num_frames, i, irq = 0; > + uint64_t cur_ticks = 0, wait_time_ticks = 0; > struct dpaa_port *portal = (struct dpaa_port *)port; > struct rte_mbuf *mbuf; > > @@ -147,20 +203,32 @@ dpaa_event_dequeue_burst(void *port, struct rte_event ev[], > } > DPAA_PER_LCORE_DQRR_HELD = 0; > > - if (portal->timeout == DPAA_EVENT_PORT_DEQUEUE_TIMEOUT_INVALID) > - wait_time = timeout_ticks; > + if (timeout_ticks) > + wait_time_ticks = timeout_ticks; > else > - wait_time = portal->timeout; > + wait_time_ticks = portal->timeout_us; > > - /* Lets dequeue the frames */ > - start_ticks = rte_get_timer_cycles(); > - wait_time += start_ticks; > +#ifndef RTE_LIBRTE_DPAA_EVENT_INTR_MODE > + wait_time_ticks += rte_get_timer_cycles(); > +#endif > do { > + /* Lets dequeue the frames */ > num_frames = qman_portal_dequeue(ev, nb_events, buffers); > - if (num_frames != 0) > + if (irq) > + irq = 0; > + if (num_frames) > break; > +#ifdef RTE_LIBRTE_DPAA_EVENT_INTR_MODE > + if (wait_time_ticks) { /* wait for time */ > + if (dpaa_event_dequeue_wait(wait_time_ticks) > 0) { > + irq = 1; > + continue; > + } > + break; /* no event after waiting */ > + } > +#endif > cur_ticks = rte_get_timer_cycles(); > - } while (cur_ticks < wait_time); > + } while (cur_ticks < wait_time_ticks); > > return num_frames; > } > @@ -184,7 +252,7 @@ dpaa_event_dev_info_get(struct rte_eventdev *dev, > dev_info->max_dequeue_timeout_ns = > DPAA_EVENT_MAX_DEQUEUE_TIMEOUT; > dev_info->dequeue_timeout_ns = > - DPAA_EVENT_MIN_DEQUEUE_TIMEOUT; > + DPAA_EVENT_PORT_DEQUEUE_TIMEOUT_NS; > dev_info->max_event_queues = > DPAA_EVENT_MAX_QUEUES; > dev_info->max_event_queue_flows = > @@ -230,15 +298,6 @@ dpaa_event_dev_configure(const struct rte_eventdev *dev) > priv->nb_event_port_enqueue_depth = conf->nb_event_port_enqueue_depth; > priv->event_dev_cfg = conf->event_dev_cfg; > > - /* Check dequeue timeout method is per dequeue or global */ > - if (priv->event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT) { > - /* > - * Use timeout value as given in dequeue operation. > - * So invalidating this timetout value. > - */ > - priv->dequeue_timeout_ns = 0; > - } > - > ch_id = rte_malloc("dpaa-channels", > sizeof(uint32_t) * priv->nb_event_queues, > RTE_CACHE_LINE_SIZE); > @@ -260,24 +319,34 @@ dpaa_event_dev_configure(const struct rte_eventdev *dev) > /* Lets prepare event ports */ > memset(&priv->ports[0], 0, > sizeof(struct dpaa_port) * priv->nb_event_ports); > + > + /* Check dequeue timeout method is per dequeue or global */ > if (priv->event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT) { > - for (i = 0; i < priv->nb_event_ports; i++) { > - priv->ports[i].timeout = > - DPAA_EVENT_PORT_DEQUEUE_TIMEOUT_INVALID; > - } > - } else if (priv->dequeue_timeout_ns == 0) { > - for (i = 0; i < priv->nb_event_ports; i++) { > - dpaa_event_dequeue_timeout_ticks(NULL, > - DPAA_EVENT_PORT_DEQUEUE_TIMEOUT_NS, > - &priv->ports[i].timeout); > - } > + /* > + * Use timeout value as given in dequeue operation. > + * So invalidating this timeout value. > + */ > + priv->dequeue_timeout_ns = 0; > + > + } else if (conf->dequeue_timeout_ns == 0) { > + priv->dequeue_timeout_ns = DPAA_EVENT_PORT_DEQUEUE_TIMEOUT_NS; > } else { > - for (i = 0; i < priv->nb_event_ports; i++) { > - dpaa_event_dequeue_timeout_ticks(NULL, > - priv->dequeue_timeout_ns, > - &priv->ports[i].timeout); > - } > + priv->dequeue_timeout_ns = conf->dequeue_timeout_ns; > } > + > + for (i = 0; i < priv->nb_event_ports; i++) { > +#ifdef RTE_LIBRTE_DPAA_EVENT_INTR_MODE > + priv->ports[i].timeout_us = priv->dequeue_timeout_ns/1000; > +#else > + uint64_t cycles_per_second; > + > + cycles_per_second = rte_get_timer_hz(); > + priv->ports[i].timeout_us = > + (priv->dequeue_timeout_ns * cycles_per_second) > + / NS_PER_S; > +#endif > + } > + > /* > * TODO: Currently portals are affined with threads. Maximum threads > * can be created equals to number of lcore. > @@ -454,7 +523,8 @@ dpaa_event_port_unlink(struct rte_eventdev *dev, void *port, > event_queue->event_port = NULL; > } > > - event_port->num_linked_evq = event_port->num_linked_evq - i; > + if (event_port->num_linked_evq) > + event_port->num_linked_evq = event_port->num_linked_evq - i; > > return (int)i; > } > diff --git a/drivers/event/dpaa/dpaa_eventdev.h b/drivers/event/dpaa/dpaa_eventdev.h > index 3994bd6..2021339 100644 > --- a/drivers/event/dpaa/dpaa_eventdev.h > +++ b/drivers/event/dpaa/dpaa_eventdev.h > @@ -12,8 +12,8 @@ > > #define EVENTDEV_NAME_DPAA_PMD event_dpaa1 > > -#define DPAA_EVENT_MAX_PORTS 8 > -#define DPAA_EVENT_MAX_QUEUES 16 > +#define DPAA_EVENT_MAX_PORTS 4 > +#define DPAA_EVENT_MAX_QUEUES 8 > #define DPAA_EVENT_MIN_DEQUEUE_TIMEOUT 1 > #define DPAA_EVENT_MAX_DEQUEUE_TIMEOUT (UINT32_MAX - 1) > #define DPAA_EVENT_MAX_QUEUE_FLOWS 2048 > @@ -21,7 +21,7 @@ > #define DPAA_EVENT_MAX_EVENT_PRIORITY_LEVELS 0 > #define DPAA_EVENT_MAX_EVENT_PORT RTE_MIN(RTE_MAX_LCORE, INT8_MAX) > #define DPAA_EVENT_MAX_PORT_DEQUEUE_DEPTH 8 > -#define DPAA_EVENT_PORT_DEQUEUE_TIMEOUT_NS 100UL > +#define DPAA_EVENT_PORT_DEQUEUE_TIMEOUT_NS 100000UL > #define DPAA_EVENT_PORT_DEQUEUE_TIMEOUT_INVALID ((uint64_t)-1) > #define DPAA_EVENT_MAX_PORT_ENQUEUE_DEPTH 1 > #define DPAA_EVENT_MAX_NUM_EVENTS (INT32_MAX - 1) > @@ -54,7 +54,7 @@ struct dpaa_port { > struct dpaa_eventq evq_info[DPAA_EVENT_MAX_QUEUES]; > uint8_t num_linked_evq; > uint8_t is_port_linked; > - uint64_t timeout; > + uint64_t timeout_us; > }; > > struct dpaa_eventdev { > -- > 2.7.4 >