From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0077.outbound.protection.outlook.com [104.47.34.77]) by dpdk.org (Postfix) with ESMTP id 1DC90E5D for ; Wed, 6 Dec 2017 16:36:10 +0100 (CET) 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; bh=aWSfoWnSdvVJ0Kc04VE8RwQwmmtFHn5UHdW5NmQyhC4=; b=kuN/wREGeBodA+BxX+oJgBJbDnjf+x94PSAhaPmYNDiK/V70JtnVzOm7owvAIXjgfQY0BdDQoh1wej6yB6Tx8pYyr7kA/x9qsJLgE1QnBbMKEt+6RQGVoWiz0P2DvbPltCee+/WUo4Fpz+Rj1XRjQiwiJqYWbcIus5D22cxaoUI= Received: from jerin (111.93.218.67) by CO2PR07MB2518.namprd07.prod.outlook.com (10.166.200.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Wed, 6 Dec 2017 15:36:05 +0000 Date: Wed, 6 Dec 2017 21:05:27 +0530 From: Jerin Jacob To: Erik Gabriel Carrillo Cc: pbhagavatula@caviumnetworks.com, dev@dpdk.org, nipun.gupta@nxp.com, hemant.agrawal@nxp.com Message-ID: <20171206153526.GB1591@jerin> References: <1511890148-22295-1-git-send-email-erik.g.carrillo@intel.com> <1512158458-22661-1-git-send-email-erik.g.carrillo@intel.com> <1512158458-22661-3-git-send-email-erik.g.carrillo@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1512158458-22661-3-git-send-email-erik.g.carrillo@intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BM1PR01CA0098.INDPRD01.PROD.OUTLOOK.COM (10.174.208.14) To CO2PR07MB2518.namprd07.prod.outlook.com (10.166.200.152) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e7400f20-d9c9-499c-9853-08d53cbf11eb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603286); SRVR:CO2PR07MB2518; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2518; 3:dZJFbSwnNl1C0nWZFzoI0lqP7kQ2PEjGp0oDOJxDXa09k21n9EC/kYKbn8OZcarSewkV5Rm9M1SY9CcqKlA85nlrtUJ1wasR+8znal9Ec2S2E76rHGW0/H8lvYHyin11NbzLofsMlc/v9uahwwF365to8yCE3gT2uNK9bPf+L6klA5yv8lkTMLqByJW7ba99MEHmfHPUHhzvKgZzEfQRRbuPURnzq+Q8D89qEoOxCRlJHmAxlrwVmbJeaOuqDkOb; 25:MqRCSnhllQ000ikIB5XYWir99HPQGpJtDnQH36vHopHWqZmdlBcuNivx3tjbsztoI4F7Ckiq27oiXZHKzq6BT9S0AgH87oiMl9oB1vlOmWtRPADcIbShV23rooTHmW6FqasL8/5+iWGwD1EzYv8cR+13uCszX6JT5MkvXpP8njFWRwsS/72NdGK0PzxXUl4p8oi4ASZAEBqqhOUJnDI5YltXu6xFhi2yftmWtSvdwjmSJO84FEhuyWa5e6o7fJF4PZqbdkBk6fpXmJu1FcxboG50+ZWdumCGQBz5M5U2flqJV9kdyh9aGXB7NrDU/d4b0EkSJg7o8uCKeKCI99s/pA==; 31:qoXmVfrI9I5EZp+6QJ0QNyWWJ8Od0eqKVbjN3f6FNXYSBUvoqGDnKDlT4Xu46NQsAjd6afbko1XVumZRPXPqaCUgwOgaAUd0m82FQpDLrVKXDCasHzHY7g/FeBW8mru3j9OFZw6d74iGaZpCdQvxgrdRznBbJdVbYm5NYSBmBzDdAiLK72yBQ7VtX3i07FdIymNX9gaa5T7lED9rF7JId9x/l9vfZxhF1QS2CLulajY= X-MS-TrafficTypeDiagnostic: CO2PR07MB2518: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2518; 20:7kJ8Ib7xmXJSaNebWyFldg+sWQVyFdylQpSlbSdiGwYioMpLKZ3MY6ON9u19dp+/Bdv0zcYRrfhLZYvOMzO5IoaomO9O4yYBeN/YTjr7WV9EuNiUmTXAqBpRV96SjZRwQUb7r46Z6Q3e9sBI+tubTiKF897YkKd8TlWmpBrEGVQa9NMSA/07IhkYJW0Fxjp6AmqPN3pTTbaZMRSg+pSOQOEA/heUnFYjV6omWhm6VXH3HUZrLX/M3Vi6yW+39LzcdcT/+M5CNAPORoZnHXSal3Flywt2TKL2Xp6YH6blnAYaQ0SYEYgMKwThToiHvh3SHxym1JBWF/JUy0QdE9tpTrdEWj3PCx0M2gpqKgJNGDOeoZO+CwLXVImwMEbAo0iCan+w/iyVSyNDJFSZ51Prk4FlHCbsjaZOVrVKKycR83IjXg4MUXjq1p6KLhi8NXLxXaUnZJ4TDkhMTdpJIetdXdp5DfJTD4XjgnexZg8qP8mxUXK8FqmGUdVbnK8Uoca6dQGYYlIY+pTVot8IRSLdLEuAy67YIqz9cbjmigQtMx9b0HQA1ZYKrrvDAnJXLpfzu015TuUeWG+1QXyyKT+RgMF6io5U2dfAGaOfUgpBIVQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(3231022)(10201501046)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(6072148)(201708071742011); SRVR:CO2PR07MB2518; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CO2PR07MB2518; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2518; 4:Lzzkr8HWixuf4Lz4Vy8sKkx2vdqFozSReUwqxg14G2MsXnxOWVsanC/9wHsz0qf68uhvxWvrGMFNocWs8RCP4gr+q6pbAohXQtKNoQdg4LWeCTNYsnx4ji6X0chHA/+K+7YIZNaLeOj5m6SApCOWv6OsMOZEAT4cJBnnzc9H7x26T1KQjKiCuvp+Bct4rG/1Lk1zITSqkTro+W0chT+DgyEVKE6N5edQFzBQaGD8BHc5P0tDsDM9F1ZbS8eitxIYjEw9Dcln6tWUI4pscivBjsoy7JbmU8j6RnzmrTFWXfKbNsojrcqUcp9PZdD0j3jAR+fcVJa+W14CL7jcGgLmSLMQJStMWeBOAGM95XQgdrk= X-Forefront-PRVS: 05134F8B4F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(13464003)(189003)(199004)(316002)(1076002)(33716001)(8676002)(8656006)(6116002)(83506002)(52116002)(72206003)(2906002)(8936002)(81166006)(55016002)(68736007)(229853002)(53936002)(101416001)(16586007)(2950100002)(6666003)(76176011)(4326008)(6916009)(9686003)(42882006)(58126008)(47776003)(66066001)(7736002)(575784001)(478600001)(50466002)(81156014)(33656002)(5660300001)(6496006)(106356001)(3846002)(97736004)(16526018)(23726003)(5009440100003)(105586002)(305945005)(33896004)(25786009)(6246003)(18370500001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB2518; H:jerin; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR07MB2518; 23:PjIVsR31guuEsozs/qtlZx32fD/T/HCAV9Q/wBwDW?= =?us-ascii?Q?cdWVjXQh/3PifGV2B+S9Cfwu2P5HNYRBEM81fi8CBbNqOhoeYuvw3r0JkJ3Y?= =?us-ascii?Q?IgTcwIdzk1H7pPuJZY1TLiHyeg5NLbWWx7TVx2dZm26+BFh1ic73H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1edONG/L2LwkFS2D2rRWIT/GrrEj40GTPZj+vtjxe/vbjXDOzdsVog+CwizvR+sEomL92GTH7TjecYhX25a/R04ml7TW8u9nh7xWhZh3LQrJhIqtZwczYjyTcb+bu4o+Mces2wh8KRbOXOYPnXLjfShEkK/S5K+gbd+ovUzJZnFt/I6jKtElDgBhkxD5n SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2017 15:36:05.2053 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e7400f20-d9c9-499c-9853-08d53cbf11eb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2518 Subject: Re: [dpdk-dev] [RFC PATCH v5 2/5] eventtimer: add common code 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: Wed, 06 Dec 2017 15:36:11 -0000 -----Original Message----- > Date: Fri, 1 Dec 2017 14:00:55 -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: [RFC PATCH v5 2/5] eventtimer: add common code > X-Mailer: git-send-email 1.7.10 > > This commit adds the logic that is shared by all event timer adapter > drivers; the common code handles instance allocation and some > initialization. > > Signed-off-by: Erik Gabriel Carrillo > --- > config/common_base | 1 + > drivers/event/sw/sw_evdev.c | 18 + > lib/librte_eventdev/Makefile | 2 + > lib/librte_eventdev/rte_event_timer_adapter.c | 407 ++++++++++++++++++++++ > lib/librte_eventdev/rte_event_timer_adapter_pmd.h | 159 +++++++++ > lib/librte_eventdev/rte_eventdev.h | 3 + > lib/librte_eventdev/rte_eventdev_pmd.h | 35 ++ > lib/librte_eventdev/rte_eventdev_version.map | 15 +- > 8 files changed, 639 insertions(+), 1 deletion(-) > create mode 100644 lib/librte_eventdev/rte_event_timer_adapter.c > create mode 100644 lib/librte_eventdev/rte_event_timer_adapter_pmd.h > > diff --git a/config/common_base b/config/common_base > index e74febe..91a2f0f 100644 > --- a/config/common_base > +++ b/config/common_base > @@ -574,6 +574,7 @@ CONFIG_RTE_LIBRTE_EVENTDEV=y > CONFIG_RTE_LIBRTE_EVENTDEV_DEBUG=n > CONFIG_RTE_EVENT_MAX_DEVS=16 > CONFIG_RTE_EVENT_MAX_QUEUES_PER_DEV=64 > +CONFIG_RTE_LIBRTE_EVENTDEV_TIMER_ADAPTER_DEBUG=n > > # > +rte_event_timer_arm_burst(const struct rte_event_timer_adapter *adapter, > + struct rte_event_timer **event_timers, > + uint16_t nb_event_timers) > +{ > +#ifdef RTE_LIBRTE_EVENTDEV_TIMER_ADAPTER_DEBUG > + ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL); > + FUNC_PTR_OR_ERR_RET(adapter->arm_burst, -EINVAL); > +#endif > + > + if (!adapter->data->started) > + return -EAGAIN; Other subsystems like ethdev, cryptodev, eventdev does not have this check in fastpath as it is costly. IMO, We can remove this check. > + > + return adapter->arm_burst(adapter, event_timers, nb_event_timers); > +} > + > +int > +rte_event_timer_arm_tmo_tick_burst( > + const struct rte_event_timer_adapter *adapter, > + struct rte_event_timer **event_timers, > + const uint64_t timeout_ticks, > + const uint16_t nb_event_timers) > +{ > +#ifdef RTE_LIBRTE_EVENTDEV_TIMER_ADAPTER_DEBUG > + ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL); > + FUNC_PTR_OR_ERR_RET(adapter->arm_tmo_tick_burst, -EINVAL); > +#endif > + > + if (!adapter->data->started) > + return -EAGAIN; Same as above. > + > + for (int i = 0; i < nb_event_timers; i++) > + event_timers[i]->timeout_ticks = timeout_ticks; IMO, We can push this to driver as driver may be in a position to to do better driver specific optimization. > + > + return adapter->arm_tmo_tick_burst(adapter, event_timers, timeout_ticks, > + nb_event_timers); > +} > + > +int > +rte_event_timer_cancel_burst(const struct rte_event_timer_adapter *adapter, > + struct rte_event_timer **event_timers, > + uint16_t nb_event_timers) > +{ > +#ifdef RTE_LIBRTE_EVENTDEV_TIMER_ADAPTER_DEBUG > + ADAPTER_VALID_OR_ERR_RET(adapter, -EINVAL); > + FUNC_PTR_OR_ERR_RET(adapter->cancel_burst, -EINVAL); > +#endif > + > + if (!adapter->data->started) > + return -EAGAIN; Same as above. > + > + return adapter->cancel_burst(adapter, event_timers, nb_event_timers); > +} > */ >