From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0078.outbound.protection.outlook.com [104.47.38.78]) by dpdk.org (Postfix) with ESMTP id F2B229A10 for ; Thu, 25 May 2017 20:09:32 +0200 (CEST) Received: from MWHPR03CA0015.namprd03.prod.outlook.com (10.175.133.153) by BN1PR03MB172.namprd03.prod.outlook.com (10.255.200.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Thu, 25 May 2017 18:09:31 +0000 Received: from BY2FFO11FD012.protection.gbl (2a01:111:f400:7c0c::138) by MWHPR03CA0015.outlook.office365.com (2603:10b6:300:117::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Thu, 25 May 2017 18:09:30 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD012.mail.protection.outlook.com (10.1.14.130) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1075.5 via Frontend Transport; Thu, 25 May 2017 18:09:30 +0000 Received: from b27504-OptiPlex-790.ap.freescale.net (b27504-OptiPlex-790.ap.freescale.net [10.232.132.60]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v4PI84WL022340; Thu, 25 May 2017 11:09:27 -0700 From: Nipun Gupta To: CC: , , , , , , Nipun Gupta Date: Thu, 25 May 2017 23:37:41 +0530 Message-ID: <1495735671-4917-11-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1495735671-4917-1-git-send-email-nipun.gupta@nxp.com> References: <1495735671-4917-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131402093706942974; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39380400002)(39400400002)(39410400002)(39450400003)(39860400002)(39850400002)(39840400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(76176999)(4326008)(85426001)(38730400002)(110136004)(498600001)(106466001)(48376002)(2950100002)(50466002)(6916009)(8676002)(6666003)(81166006)(8656002)(53936002)(54906002)(33646002)(86362001)(50986999)(305945005)(50226002)(2351001)(8936002)(5003940100001)(36756003)(356003)(5890100001)(104016004)(189998001)(77096006)(105606002)(5660300001)(47776003)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1PR03MB172; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD012; 1:KB3XgPI0OCYGr2KeFOiwqgYfjK5sWKZ50r39HQtePt6dm0slRLZZsJQpfaLijmvRgv5cXesrtmyWxNBqVNtuHQGE+TaG4paXbr66n3nXdE8EbH/AeANb4VmiVpqKAtd2PE3eDovnW42DlHgBahMN24prq/NCVJORaWOyrzFEKZRRsmyfwiX7ZPGaRg06sfaMRIU8sBJT73O2epYSe0iI+V691GdxwmMGcalEyYnj6ayAFlfB/1tNIplVKV7efL0DHYk1jVroHBy0SYA3wXp7lFZJT7Yhea7twLMJthHqnM03C3Et2g5XsrNjrmwgkv54EFCxrTrw6/mP4Ekpa0TdYfsOPI552TyTgmSp54G+VoHcC/sA97Zz3FGZyzr2cu02e8HE/erN7fJ96lByy2p35h/cdbuC/oEVmlHuGcR/+LjtQhsa04Q+/pVB0/rfbjWFDBOcHWw0x9mKvCX2lhRfGJw5/IFQU/1dY6sZBttBarL7VMAniQAw9FElqSf70TmW2ngINtYhXtp2ywome5B9fYQhoG8aOeBkesxyxXX1on6LHNLTXNIf4kGMkC6SJ9J48kc/Z0AVJ28zM5Pkz4ZVLKCx9D9AQZTnyFA8Cdu4M8Ac5xIaof3h7pgmtu1bGtu9FnJYd/rUkhWqGm00qR2JEg8ano2A2m6Q+J9LUK6sI3gDpoQ89ZQ6G+W6H1vbwCicTwDinaBEV/OkzhgmFdnTKV8LmnSFZ8LcSgE7IPSJaSeRrUUuHeOChcrEBiW1hYs6DXjYBmRAaTpKAfs7P9jTQQ== MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PR03MB172: X-MS-Office365-Filtering-Correlation-Id: 26c3655e-347a-468f-19fe-08d4a399309c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BN1PR03MB172; X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB172; 3:rcuGqRqmsMVFrvJraixIBSbeJh3M/BaC47uvL4jBeJUMJkIZZWAJXAAu6q13HkWGp1KYhODVUkvK4HZ51kv3CiIWnJKiL6nBpCttzErAs/r73zziUV3am54+ap0JgclG3/I6mZ4GpKV3SADQSE8WgAaJ6C1MF+4EyAtcHvyDheXAmsFRm3WLYJlwzyYHLqtgTjYaS2la4e0uTep9EKZezRRfG8/aohcXGFtANdE3Yc8ptgd/9W0IWOYzNKDYQ8GgmYmT9//JvMfkrjAtEYSnspoyRyGK3CU9DSMTluYuzdndOfiUBu5TvIwVSitgYZ1Bm8MNGVKH3BxIUMatCjjx7TAKDp+0zTx7znjfeGJMhiLxYw4PWxuzX3sm5mzEYM0h3nysv0VRaMQFS1Zs/zmUwTlCW9/6yqSbsjKFknnvX1xCACObN/r8XN9I+pQ5oKUb; 25:a9RqAYxtZglhtyyL0mX9mM+ZjhNBuKWMxltEG08ibwpN26NquXR39jVShHjK1mj1+NjcG3xWV05hoP3fjkab8358Rhou0BUk5NTMbZvYXGNVDKhuz4twwXTfIh8x8s/namWxyZeaVe1azcimYT7suq7yox7lNIQaBlb7fnx7640qyFIVUn/RKNC8jCUxZcDRqCYeNj9+ciz2zX0nZfKcFutTe0n2avxFx2Wvd2n/rzox+ZaguKrI6sxruLzokQTcl7ajgiZv2XxuAzFw0Ym3UjFi88Wt+qb3R3G7QEtEt4EZh8HNlHBGZrpYWUugZkonx2f1jzy4ZHyRXVY0Jo8vSQIHFmkTAve/DFcpiOPG8ywtp4G1d00rZsouN7WqGIY7DAazp2SVoRFq3wG4nEmmBiQyAzUQbG+I+T1CINsA2Lu/rBMAeVNZGnf4Ydxuo3f74hplzVKE3e8XC3FcqJnAy3k57yQa6xZJ3aqYI28iUeQ= X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB172; 31:WA/2fRkZXT5RRWyxJe99VJ9ObADpIMS5ei+hAi/Iw94aCvAUiO56CA+bqvYt4azA+NNSeRye50EWdZbCMqo+FOmDyz6/wNNCW1Yhhx1F5uZSHLz9nT1Zr1zmpNLywW3QPLwZt40VNR0LwZA8gEybOd5bnyLVjezzP0WzwL8GNsPcosLhL7MS+xXiZDLYY/ixbDytAuqV6uN3ByOqjBEfFvrjfLQVGKhpfuPS5dfJHwngoS+7NewdMVnf6NFYL9Cg X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(601004)(2401047)(5005006)(13015025)(13017025)(13024025)(13023025)(8121501046)(13018025)(93006095)(93001095)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123556025)(20161123561025)(20161123559100)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123565025); SRVR:BN1PR03MB172; BCL:0; PCL:0; RULEID:(400006); SRVR:BN1PR03MB172; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR03MB172; 4:B3JXQcmOn+nBh0RkOKcISlTp6adRnFbCzY+TEYpqwaI?= =?us-ascii?Q?IP63ksSu8xzDHhT0iChUygTZErccPQqBL9usT2qwCRnhBI8e0zAaCkmKb1IQ?= =?us-ascii?Q?NIU1rwsZekGO7Ekvx+kXGRIu8Ui+ZLU5+8tkax7/fOVBKVO1UQ4P4mLkuazc?= =?us-ascii?Q?GvZvE3a98NM6dgAp/mjYk/VYj6aoff9NlByEvzGwWGGRiu26AwBaRf6gTM6y?= =?us-ascii?Q?HFaE/OGiy1uq/aRxgmIifQBA/nIIiLEo1xTPpI0TItjW1IXM1MW3RE9RML8X?= =?us-ascii?Q?nmsS9GTOe77gXiZ4asL2XAsSk+enVAXdTXJxLMmlD/H4HeVi/4F2sm/rFKSG?= =?us-ascii?Q?NK+TULHASP4TR3VK/7bP6DsmsI+q3JHPh+/gtjNf+Urt2PORV3ErT+U5LnOs?= =?us-ascii?Q?LpnqUctIR99jl11PCZcX9kMeJIy5saoP/1uG5eiJqViVTexkopym7fIYC3kb?= =?us-ascii?Q?FrwR9u3QiAGjKN5LftUJQfC8TSvDT4XG/8QwNrPHHH7STk3tgvFlAtGJxcgw?= =?us-ascii?Q?sFNmF1dc2tkiFbsLTNXB5tnfYW8PJhS+hcIABIdA49HUC//yDLtrpBxkkwIo?= =?us-ascii?Q?YxbJwydoaxPFeQqCoaTrgcfDWa65DTWXhQxAH+NHM9YDXEyHYUbHYLt1FRW5?= =?us-ascii?Q?qrGOZhTCqrgTaBZuKSIgyragx0sXDjAlU1OmQWHnd0zxK/d0MItxipXd/dz8?= =?us-ascii?Q?C0hm/xJMRCWxZwQZFUgWh+V3O/qkAFUJPFSDluz+JIpuaXU58ON1DcFZR7YU?= =?us-ascii?Q?DHifO9XLVQ9DLnpt1riZ6m/s+dPjzxXx2Q41X3wKIyM7HFPOrM7/cEcHxoD5?= =?us-ascii?Q?qQg8pgMS360xoHHy2/V/4Y7X4L9kN/Vw4S3pckgnbfVGCMUXG7ToS5UOZsEH?= =?us-ascii?Q?jrd4WOYedOeCqTkaQMUJz0AV51Q9TcdNPVXGrXTo9DpwjRI+JK6r7jW30HGa?= =?us-ascii?Q?8caeuomhIhna+YY62rVJRckHIGsSttisoFjrNz58ytDKjV6IueUBGaRasBig?= =?us-ascii?Q?=3D?= X-Forefront-PRVS: 0318501FAE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1PR03MB172; 23:3WKz0hKVaX5kquPdQ5eFO77oKJszKJVUGtHZokQhdC?= =?us-ascii?Q?tUEmbnD5PDMW47iHOzXpP2y7Uj3kXZC8jLiuzt/X4ZxrF0MQEB59rDN+0pRh?= =?us-ascii?Q?3exa6zg8ULSjpgS68i/n4oUBvTNhdiLTmQOWdSqM9zhOKEwoh8W1v2mbcOgc?= =?us-ascii?Q?mU9MjKQZn+PDsYKbQwEuLFNT5N+HSJzITyGfThhMwvI5ToRfwUTU+90LFsEW?= =?us-ascii?Q?0VlA6NkjRcLOeefAIIiKodvA5bKiewh8txpFIfS+C9TMuheQqJ6oba2wbHbC?= =?us-ascii?Q?3dvi9YgA8mTd/iQL6SKGuoJDTvXrE96WPhf573K0NiYFkaWmTdp1JU6IRWQ0?= =?us-ascii?Q?gCDUUMptNAnlFLYW8afZ83z0UiMZsR4NVki887MnlZ4MBApu46U7YbI+OThG?= =?us-ascii?Q?2byiMdtkza98Q9wWQIBwnYnpSTuB7vfh1wYBqcm23ddLm5gKwaZ324NW7Hlz?= =?us-ascii?Q?bqrM8BLaRqk2Rh3M1/IEOMNAGiDM7PIEwlu3BG+V7xFJuAaf/DNxzrM7U+u1?= =?us-ascii?Q?MBlZU2vhBniF7LJaAIARHf0IbzJpE6RZ1lPCzS0TDF7f9IEv0V3oOgmMKEAs?= =?us-ascii?Q?MpG9YTJg22JXMw0wKwh4gWLAEOP/uov2SLDIuPO+ewWvjpWAV50ANC9nGO+L?= =?us-ascii?Q?hO1uENJqKZdYmefvdVrzjq2e1wuFhVkuNxP79h7WmYGl8s5A9TFOl03+raT/?= =?us-ascii?Q?2CU1obBGQwu0bdO5WB+HlPm6DEaf7tHFhCvONtOZklRzQtLeDW9g4WcIuBgq?= =?us-ascii?Q?B35PokLwdiMUNV2CZTayYGffy+xClPgEHBmyBAFPiWRmARSbUulgU0DJKCHC?= =?us-ascii?Q?Kq62V7EVgGztd8QLLxdi6epAUy1k+/GLYuONeycO39zkswIQzI27FJM6iF8Z?= =?us-ascii?Q?R4dUQXuripQHzYAH4uFm74+g9HXbaiRdA/aR+/i+kB0GyjcrGZqCLsm+w/Vy?= =?us-ascii?Q?kqkT4r7oOLgpmCd8Lwx+SeKbA1s1G0iz4WjKl2t0LQcog8X2KCPOdYmx1ZRi?= =?us-ascii?Q?niwadbzWFB6UtbYe11Oq4VrvYHNLwVjAKPRZT9naa95EnM6VgAFf34VFM7lU?= =?us-ascii?Q?GnF4JQnG3m3paZhSodJ+Qb9FO9GMknzttj4RzTzvG5+QQsMkrj0wbUD6AN0Y?= =?us-ascii?Q?KLJyOEtq2Daq+jfFBOVDqqsUwYPGcHeN4AshzSxkTsujB04QKVUg215LUA4g?= =?us-ascii?Q?vNmJJAAB8/fzIeQ6zVm/qDHTSJ6pmxKFbMpazmIr0JkeNbivacBYCEAv2LKx?= =?us-ascii?Q?ARkPqS0LystIxJLG+EV7ZAKbeDFW+A7raigGc4?= X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB172; 6:C8jQvGOXZeYGoyjlHpN+OGN/4vVVTrv9L7XVMY2IaGU0FPFAKY7bRuQfDRz4dEHevdFjBu8Cicwu5D8O/nQuzdIpiLgemUohQ7ctO8rom5aP47oJajjEU0vA/qE7URlj/oi1b87Og1BFubrMvfiTWV0f6ZX6mcHWaNpBUDysuwoKfT4z++vRq6sHiJWDD42XD+zq+PbmtyziJKuxQltMtMRrwOuLQo7WbrRURg+gnDxKC3FmhNDjxITbE1ue0r/qoJVB2+BCGH/FaxJGEYk6PpX8GpAMWcf42KZfcTSQq7A2IDIRBXJVY2QN6FjU5xRSIcg6Y25Q18ye/BLsDIBbQ/wBhHLFikNOwYyq/aoSfmtkWi6ICXY3aCjo/SMiriizvTV4Zgs2IQKHnc0JymuzozqX3dtm+D/clmj+5ywDetJCEA71hN5SATxBhDN/GCX4nqhBokQb/G806kiJwYSFQUGnozFJrV07IDMFMCDhDwpKBePnekJVHvpuRiKlkDalmSc/vkYfY6qQF/Mc5ddh6g==; 5:P/AdJEFjDsUpd2HE0Qsl9TBdlBhXnlNHJSYkyHXumf1jkjhDVdpXDkrcWhh9BoozVDlZaXFiNOTjZuQTwO6O6S5apzZ5cFPDiRYu0A+uD3N52QecR4KBSveSor9ORtU0pePtXatgDLh/XBckAQa1k0bMGoTGjokYnsnA5spCJ7zWDbpTUqnoyBfY3TQNBQc0; 24:YW05dFuVGUzj78jCes2yvpzjb6xrAahFeKNrw5TfqOaRVEVoNJbvMT0LnfJLtfe6C2w7jMeoLlRrJqrcqQp92+x/pV+C1Z7IUu3oD1/2fNI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN1PR03MB172; 7:NvKzPj6x8L541jlMMGfGvdAPIJiSID7s6G8yAiKxV2Lfi/A5t6tvdRbeVhrqP2JXT8L2qBr19v3BwmN9ZWPx1US/FUXrd984eApwMbeBeRzBdL61knwuTx2O3AOh5F/OdXa8jg6nElhKMKHo0/UcoTdewn+1TmQxoZJ0HtvfACGkIngBsGSw8R+WlzPWPKGWc9vxL9CCBrPGGsFf8pKaeu5++H6v6kRy8mCeO/pWoFQ4TV1hsOuqInsWZPSKkYbkmGUWP/rBYHYXAMvKGmfgfdvHo4EKlPid14NcwCtNmn5+cPCgxvJE/yfsipXujqvuKecl/tG+hsj1StO9L6ojEA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2017 18:09:30.5070 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR03MB172 Subject: [dpdk-dev] [PATCH 10/20] event/dpaa2: add initialization of event device 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: Thu, 25 May 2017 18:09:33 -0000 Signed-off-by: Nipun Gupta --- drivers/event/dpaa2/dpaa2_eventdev.c | 153 ++++++++++++++++++++++++++++++++++- drivers/event/dpaa2/dpaa2_eventdev.h | 22 +++++ 2 files changed, 171 insertions(+), 4 deletions(-) diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 191901e..7fa17f2 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -30,17 +30,164 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include #include "dpaa2_eventdev.h" +#include +#include + +/* Clarifications + * Evendev = SoC Instance + * Eventport = DPIO Instance + * Eventqueue = DPCON Instance + * 1 Eventdev can have N Eventqueue + * Soft Event Flow is DPCI Instance + */ + +static uint16_t +dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], + uint16_t nb_events) +{ + RTE_SET_USED(port); + RTE_SET_USED(ev); + RTE_SET_USED(nb_events); + + return 0; +} + +static uint16_t +dpaa2_eventdev_enqueue(void *port, const struct rte_event *ev) +{ + return dpaa2_eventdev_enqueue_burst(port, ev, 1); +} + +static uint16_t +dpaa2_eventdev_dequeue_burst(void *port, struct rte_event ev[], + uint16_t nb_events, uint64_t timeout_ticks) +{ + RTE_SET_USED(port); + RTE_SET_USED(ev); + RTE_SET_USED(nb_events); + RTE_SET_USED(timeout_ticks); + + return 0; +} + +static uint16_t +dpaa2_eventdev_dequeue(void *port, struct rte_event *ev, + uint64_t timeout_ticks) +{ + return dpaa2_eventdev_dequeue_burst(port, ev, 1, timeout_ticks); +} + +static const struct rte_eventdev_ops dpaa2_eventdev_ops; + +static int +dpaa2_eventdev_setup_dpci(struct dpaa2_dpci_dev *dpci_dev, + struct dpaa2_dpcon_dev *dpcon_dev) +{ + struct dpci_rx_queue_cfg rx_queue_cfg; + int ret, i; + + /*Do settings to get the frame on a DPCON object*/ + rx_queue_cfg.options = DPCI_QUEUE_OPT_DEST; + rx_queue_cfg.dest_cfg.dest_type = DPCI_DEST_DPCON; + rx_queue_cfg.dest_cfg.dest_id = dpcon_dev->dpcon_id; + rx_queue_cfg.dest_cfg.priority = DPAA2_EVENT_DEFAULT_DPCI_PRIO; + + for (i = 0 ; i < DPAA2_EVENT_DPCI_MAX_QUEUES; i++) { + rx_queue_cfg.user_ctx = (uint64_t)(&dpci_dev->queue[i]); + ret = dpci_set_rx_queue(&dpci_dev->dpci, + CMD_PRI_LOW, + dpci_dev->token, i, + &rx_queue_cfg); + if (ret) { + PMD_DRV_LOG(ERR, PMD, + "set_rx_q failed with err code: %d", ret); + return ret; + } + } + return 0; +} static int dpaa2_eventdev_create(const char *name) { - RTE_SET_USED(name); + struct rte_eventdev *eventdev; + struct dpaa2_eventdev *priv; + struct dpaa2_dpcon_dev *dpcon_dev = NULL; + struct dpaa2_dpci_dev *dpci_dev = NULL; + int ret; + + eventdev = rte_event_pmd_vdev_init(name, + sizeof(struct dpaa2_eventdev), + rte_socket_id()); + if (eventdev == NULL) { + PMD_DRV_ERR("Failed to create eventdev vdev %s", name); + goto fail; + } + + eventdev->dev_ops = &dpaa2_eventdev_ops; + eventdev->schedule = NULL; + eventdev->enqueue = dpaa2_eventdev_enqueue; + eventdev->enqueue_burst = dpaa2_eventdev_enqueue_burst; + eventdev->dequeue = dpaa2_eventdev_dequeue; + eventdev->dequeue_burst = dpaa2_eventdev_dequeue_burst; + + priv = eventdev->data->dev_private; + priv->max_event_queues = 0; + + do { + dpcon_dev = rte_dpaa2_alloc_dpcon_dev(); + if (!dpcon_dev) + break; + priv->evq_info[priv->max_event_queues].dpcon = dpcon_dev; + + dpci_dev = rte_dpaa2_alloc_dpci_dev(); + if (!dpci_dev) { + rte_dpaa2_free_dpcon_dev(dpcon_dev); + break; + } + priv->evq_info[priv->max_event_queues].dpci = dpci_dev; + + ret = dpaa2_eventdev_setup_dpci(dpci_dev, dpcon_dev); + if (ret) { + PMD_DRV_LOG(ERR, PMD, + "dpci setup failed with err code: %d", ret); + return ret; + } + priv->max_event_queues++; + } while (dpcon_dev && dpci_dev); return 0; +fail: + return -EFAULT; } static int @@ -61,9 +208,7 @@ name = rte_vdev_device_name(vdev); PMD_DRV_LOG(INFO, "Closing %s", name); - RTE_SET_USED(name); - - return 0; + return rte_event_pmd_vdev_uninit(name); } static struct rte_vdev_driver vdev_eventdev_dpaa2_pmd = { diff --git a/drivers/event/dpaa2/dpaa2_eventdev.h b/drivers/event/dpaa2/dpaa2_eventdev.h index b151502..01de73c 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.h +++ b/drivers/event/dpaa2/dpaa2_eventdev.h @@ -52,6 +52,16 @@ #define PMD_DRV_ERR(fmt, args...) \ RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ## args) +#define DPAA2_EVENT_DEFAULT_DPCI_PRIO 0 + +#define DPAA2_EVENT_MAX_QUEUES 16 + +enum { + DPAA2_EVENT_DPCI_PARALLEL_QUEUE, + DPAA2_EVENT_DPCI_ATOMIC_QUEUE, + DPAA2_EVENT_DPCI_MAX_QUEUES +}; + struct dpaa2_dpcon_dev { TAILQ_ENTRY(dpaa2_dpcon_dev) next; struct fsl_mc_io dpcon; @@ -63,6 +73,18 @@ struct dpaa2_dpcon_dev { uint8_t channel_index; }; +struct evq_info_t { + /* DPcon device */ + struct dpaa2_dpcon_dev *dpcon; + /* Attached DPCI device */ + struct dpaa2_dpci_dev *dpci; +}; + +struct dpaa2_eventdev { + struct evq_info_t evq_info[DPAA2_EVENT_MAX_QUEUES]; + uint8_t max_event_queues; +}; + struct dpaa2_dpcon_dev *rte_dpaa2_alloc_dpcon_dev(void); void rte_dpaa2_free_dpcon_dev(struct dpaa2_dpcon_dev *dpcon); -- 1.9.1