From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0070.outbound.protection.outlook.com [104.47.32.70]) by dpdk.org (Postfix) with ESMTP id C33B07CBB for ; Thu, 15 Jun 2017 11:00:07 +0200 (CEST) Received: from CY4PR03CA0100.namprd03.prod.outlook.com (2603:10b6:910:4d::41) by DM2PR0301MB0607.namprd03.prod.outlook.com (2a01:111:e400:3c08::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Thu, 15 Jun 2017 09:00:06 +0000 Received: from BL2FFO11FD046.protection.gbl (2a01:111:f400:7c09::189) by CY4PR03CA0100.outlook.office365.com (2603:10b6:910:4d::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14 via Frontend Transport; Thu, 15 Jun 2017 09:00:05 +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 BL2FFO11FD046.mail.protection.outlook.com (10.173.161.208) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1157.12 via Frontend Transport; Thu, 15 Jun 2017 09:00:05 +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 v5F8xWSa012830; Thu, 15 Jun 2017 02:00:02 -0700 From: Nipun Gupta To: CC: , , , , , , Nipun Gupta Date: Thu, 15 Jun 2017 14:28:42 +0530 Message-ID: <1497517136-11824-7-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497517136-11824-1-git-send-email-nipun.gupta@nxp.com> References: <1495735361-4840-1-git-send-email-nipun.gupta@nxp.com> <1497517136-11824-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131419908057497522; (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)(39860400002)(39450400003)(39850400002)(39380400002)(39840400002)(39400400002)(39410400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(9170700003)(85426001)(356003)(498600001)(54906002)(81166006)(8676002)(5003940100001)(53936002)(77096006)(8656002)(2906002)(4326008)(305945005)(38730400002)(8936002)(36756003)(189998001)(76176999)(5660300001)(50986999)(2351001)(33646002)(50226002)(50466002)(110136004)(105606002)(106466001)(2950100002)(86362001)(48376002)(6916009)(47776003)(6666003)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0607; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD046; 1:iwwLlWHeyEbovLX8wbSGCshpHYRMCLGLM7mGjqSfMjwJ2kiVOhdxovg6VHcX1wZnUD5vF7c2R/0Lb0peP2x/AXqsHVdN62fCH7DEsLsf9LNRg2aAHDZzscQZVUPPa+RhKPzNFI7tnc1IsdMTgM7+08ohwUtUMahfZkZCPVYuzJ0ccCSCEsvCWs7DfqtqGBX0pSrlG4yVu7Lq0e3uChSZjL+We/CXfmvvEeUG8bc3BZ0CbVrrJGEZqqk6LrBBCdrtiEtIQWpgkiCNcukiu0MoJ6aes0qpwPdXo9cOiLQGmUnkOVDsTm5SkJtNYw2ijErjSoa4Zo9iPIuYPgmzAzGGV3uZkrBQ9qGDsmsb9H2Wz6rbmMog+bgeXA8WAAGEZVz3cJN4BzjDM5gI2YkHwHlDWUJtrocDSecMsRqbXKkfD/lU9hw0i8bbFvrEBnTJUYciF3eWiJobr5oQx8oG9A8WvJYGwT40uFYMqOrRMGDjkaNBiJzAeQWj0pH0XUTnGiw6N3DX3MXv1BUI4R6LqBxeCwt5a0+xNqVEb1LiPHQmIt2mCruadE7MaM+lpdWtGmVbJGdkABuHu74L/8oFjMCNmDG4awOGbRwTkUV72SRP/LjizIpE7z10qOwsUXeGeTzQf2Ab1oqTXFvglerO0H5m47jVnFDetU6oTKNw1hMu7vVU09SHOjU4g1YLbpSWyCrD5FbPQugXoISnlWMq+JtryozLh2BYSZyTM2aGDSBx5ME= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM2PR0301MB0607: X-MS-Office365-Filtering-Correlation-Id: b90d624b-828c-4fb5-1e53-08d4b3cceaa3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:DM2PR0301MB0607; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0607; 3:fkPbFXdMC34PLhKGv/A9vLou9GzKrWXYo63jV82+3yIYanLRRaU2BTPuBRtUXg7jpghuOEkw/uw/vRBc739ChaWq6GkbX1nadZoDLxU5mmWry7LmKV5AYZv1SFslbpR3vLXMYzSgg2GvmTzulpERP4u2ur2mWBA3+VgG38WlthwCkHsWl69Y4cw5cRhRDqQHinClv7gpMa0BnysNCGaa0MkLBvsSCZuus0HQKDLZvYnhtv36q+YyDI1V/5825+5iE5+MG6L8nOooJoXyB/qG5MGoaJHKOZqbES2emDeXv2QQVpBgk2kvdYt10FI+EY4Rs5NnjININ8S1HsxKj6O42UFOqleT7gBfZu1rEEA9s+vUuqMU86vSu9Q60olt8Na1/5JztdnBL88yfYCu/ZGcUIpc7smmEYHEUj55GCWgryT8D3zTK2169NNg1dsolcKy; 25:o7ujutZZCPOLR2hp6pG+WjDy3Thm/nqOSJ0dChR8H07yu4k89hyyaKFvnK0KPcCtypGWPiiaR9i36HrwkChWRAySJhxPErVeNlvdV4a/lFH2QEurxCy4pLa/Wn+N2VLJItWrIYAZc6c9QLIDdt2FQ/qeb5oNteU4+kf2VLcmh7wwFedCgallVvzzsRNUjiaQmeuTcuM/U7TH0XjuXfnreAs6Ln0DEiayvpCBGuw7rkmjR48uW34yBu4COBDSPrHj7ZN72sRRBiHFoZDXNBIHlsi++MY5P1ycuIkdMSm8fav5KzO+4XFs53k6lR4d/YpDcjKlhKJ+VEI1LMC9koNK5XbxhCfJyFsWK39W3b+W3WvFTH61IHSAiFhuCIPVaajw5OiY6/vVISVAn9uVaxxFU0WPGoiplHXEtvNLE2pvjt04CkHxBTkywWGzXuKIoAKFquZdh8iQLTe3p+XL+mkPmaqhXFwg7Sb+SS4jneqg9mk= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0607; 31:U7p7VmC++CXhJMAAUoH7FglDnxEz09jG4VEzp+ZZFjWDnTONEej2VAq5BYEZpo+KUD31Shun+WoOyJ+Ap3UxJm5f2MiOCBogx6t5t18irGpEhDaKaKjo9FOy4k8eT7qeb+qApbTm63Z9zfXz7ywsc2qzYAfFz+baNiz/PAy1BXHSoJVI4wPXpkE68LmY4o7YOlT2CkghhrlbS2dD7dLQv8QecmdCayeEBVebyD00PKQXYv5w4gSpSRokbyvIGnIWouluyzqUqqUOTi+1W/Iv3Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123559100)(20161123563025)(20161123561025)(20161123556025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123565025)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR0301MB0607; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR0301MB0607; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0607; 4:719jj71oYGOl1wJB7GY95wK6zqdIPTj7hRwieJQO?= =?us-ascii?Q?uS5iYwcntSQomNn33XuSbtmRu3A5ZF30fn9+TmNpL9ZlQToTXVgMUq/jNdN1?= =?us-ascii?Q?A2Mu3Fu2j7k9Pd3Nxtip/S1Q8K+jEXrmo5QCg7xqn+Defwe0kAhSrsZmsglz?= =?us-ascii?Q?gosg2nytxQg4akyGquAcQTLHDskiU4PmNzwG6NCPP0oDumpbh0smKoyxjzlk?= =?us-ascii?Q?WDjdOYjmTU/RIAfrN3MrPXsEMy7Jy9CwQMA7a00A1N1an9fG/MooJqhuxFVX?= =?us-ascii?Q?+UJisHW3gDQ5IHJkf2T357lhGsb5ykYW6Z2aFbn3wxPsyns5haMIuSo3nNM5?= =?us-ascii?Q?SILub5T9tMXoJPvg/NlynmwwHLMeLXWReZ96BJvKjzKDKCnxV/bDAMLIsKHm?= =?us-ascii?Q?KP50UALci/KCuAqlfoDAll7PIQgwOUX28d2Fl7VjvZn9sLBaN5ksl/44J7B4?= =?us-ascii?Q?Ai01azVwk40uFUC/9uMBGx1SUjhXjjsEE5ri4TdCiH9v5pE3Gf7cJoLmCryY?= =?us-ascii?Q?6tD0Cv89FaOpa71X0+/25p6p2dVKqXcBRLglaTEY3wkZeBtroGtWOVLcoCs6?= =?us-ascii?Q?Ne2EpXp/eUN0n/zpELSeKJOnwsN1cZ75ULpAtOYDICnvDrXq9yHvBDKENbhA?= =?us-ascii?Q?lLDasoh5HJUqTVSzDdeMmlGUAxKo4Dno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DquE0QnmOEkyAGhgvPJ3+Qy0?= =?us-ascii?Q?1LI0s6t3v1qCvG9ZcqtKwXz5ttS72hQqwPijV5VEn3KGMrsONi5wjsBJi8+S?= =?us-ascii?Q?PBG95OxeBom5JHIKj5xdiNPy9Gce0KdsFKkndcMNxw39Aktjod/W2MAs9Hjy?= =?us-ascii?Q?wHGmwQbw1MsmiosP7uXemhsRjDiUBGRjt8HU13+9WrZLEVyloCK+YyDKOrca?= =?us-ascii?Q?xzCLtSYge/JUpOrXIdSA=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0607; 6:V77nxF/hm/R4Vi6ugSToxBRCm2XXgu1HdNga6nJY5q8MGhoGfvAJjBTp5SM7CkLAwg7D05iaoAOSP1EUvwWNp+pKNhBJpoiI1JgCDtqudbT635qAeATF/D1eVJRDdBURxxv2AzhFa6gQNEP28mjvD0plYAJFc061G/2sVeKRG8duyKB6ZzU7XEH4LR7KCirDSDOuZN6T66yQbolVX46580psr+6SrWre0j61tXiWgf5tlYjiQSaQ6INmmP4ITQdg7f2gMehkgu9mjkx5hxB9KdQ5m/fFwSgVny2ZqPl1C5JH1GY+Toni2+V8f6vOw66L0t3e57TG1VCthguGXW2eDcwcT4RmuEkoxrmPDFVl1Tf7Ih9Ar3Dktc9ea8LjoggiNswQrx1gnlypUhcDDtNPOBRqS60Ryij0UFaYCd2ZshbIOox63T4TB6OgGNaUZeXW6xhmtwCNYXFlUwGuynxT5IHYPlxyMqCwS8GkPf41nLU8vR3Dy+RvsrChh5PCzdcgMMPL0sa0VwG57KHFq0y05g== X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0607; 5:bqEWX8AVeZwudNINf7IRHb/AbBYXNGhL3X5CYzaMCdbmZIBaU6C9Xlm/SQ6m88i5j36ROSSi8Q/AaulqzlTiVWF1ED9B8IprWKYx07Sq2sNVznKrcHBlI7WRCgNuQOXwMQfTojn2i5xCGqa3yl61ENMW/b6x55GR6U2kyLB1dX0Y86gnefxACO7+l2lQ+Oou6q7yAPF9C9ixHyH/W3yI4vI4P4BRvC3HZXxPa1qNSBlUbjgmXx4wFEbsEpPB8Pk37oqc63LBhRmDO61ME4zpIerD5CNUgApMbVoaUaypsUcawVm1heKtn6kvi7JhLD44ceNfgjOQuj0lcDFLH2srUMmmUxWfbFBmqbqRDp4htYrCJa9/dcKBjbeIRRoVZixGvbmKwP4+eF1OWa+84KpQJyyn6QK+LhpCAu2oI583QzeSpie8Q4omrHCffbn0zZe59VsOVMbpuieSV4QxKQIVfW7LtqSGgWJQpwsII3Z2N7RLZGQ0mj7KnWpqgDIzc0LpCj6H1t6YA7TcEw85Sq1n8g==; 24:RTCqH/FNelVCutrtW4E8b6cu/nKafGowNgb/W+RtUISlEWeKQDDaN4DLqmRYWVCZj7pAru743QY3G3GmwnEcWIx6BG/rdAuunU643Ugbfc4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0607; 7:oKUVY4pqLJq6wdDmCpFLJe9SZy5cNSZVx13ZNyDfJc5dF7FSx7erVO0WadW+zx0RhYznhylcCQUziBx/q/5e1c2yXOmSbZ9xuGUNP2QMUfqxO1LWA8Nz/n0kllq5pdQuxrRyGj0BUXW6iTzCW+eiH1YXcKqTre5X+XdF/2nkmnCdH3AfrisKIBvT6GnXwor9IgM1SBW1eeQxTknOJVApcXoIxTIShWcAUMXCyya/2zBNtP849B68kzw14b8GCRxifiwGQzEIif3AEP9onRrhxg1e8EC6yl5cflkaov5QmpR4Zo4lTARDbRhTXUE82p7xvsMKUZ6Rrz2bdUdYG/msZw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2017 09:00:05.5781 (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: DM2PR0301MB0607 Subject: [dpdk-dev] [PATCH 06/20 v2] event/dpaa2: register dpcon as dpaa2 device for bus scan 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, 15 Jun 2017 09:00:08 -0000 Registering dpcon as dpaa2 type device handling initialization, allocation and freeing of the device Signed-off-by: Nipun Gupta --- drivers/event/dpaa2/Makefile | 8 ++ drivers/event/dpaa2/dpaa2_eventdev.h | 18 +++++ drivers/event/dpaa2/dpaa2_hw_dpcon.c | 139 +++++++++++++++++++++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 drivers/event/dpaa2/dpaa2_hw_dpcon.c diff --git a/drivers/event/dpaa2/Makefile b/drivers/event/dpaa2/Makefile index b76cf58..001904a 100644 --- a/drivers/event/dpaa2/Makefile +++ b/drivers/event/dpaa2/Makefile @@ -38,7 +38,14 @@ LIB = librte_pmd_dpaa2_event.a CFLAGS += $(WERROR_FLAGS) +CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc +CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include +CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc +CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/portal +CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa2 CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa2 +CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal + # versioning export map EXPORT_MAP := rte_pmd_dpaa2_event_version.map @@ -47,6 +54,7 @@ LIBABIVER := 1 # # all source are stored in SRCS-y # +SRCS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV) += dpaa2_hw_dpcon.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV) += dpaa2_eventdev.c # this lib depends upon: diff --git a/drivers/event/dpaa2/dpaa2_eventdev.h b/drivers/event/dpaa2/dpaa2_eventdev.h index 959f443..b151502 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.h +++ b/drivers/event/dpaa2/dpaa2_eventdev.h @@ -34,6 +34,10 @@ #define __DPAA2_EVENTDEV_H__ #include +#include +#include +#include + #define EVENTDEV_NAME_DPAA2_PMD event_dpaa2 #ifdef RTE_LIBRTE_PMD_DPAA2_EVENTDEV_DEBUG @@ -48,4 +52,18 @@ #define PMD_DRV_ERR(fmt, args...) \ RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ## args) +struct dpaa2_dpcon_dev { + TAILQ_ENTRY(dpaa2_dpcon_dev) next; + struct fsl_mc_io dpcon; + uint16_t token; + rte_atomic16_t in_use; + uint32_t dpcon_id; + uint16_t qbman_ch_id; + uint8_t num_priorities; + uint8_t channel_index; +}; + +struct dpaa2_dpcon_dev *rte_dpaa2_alloc_dpcon_dev(void); +void rte_dpaa2_free_dpcon_dev(struct dpaa2_dpcon_dev *dpcon); + #endif /* __DPAA2_EVENTDEV_H__ */ diff --git a/drivers/event/dpaa2/dpaa2_hw_dpcon.c b/drivers/event/dpaa2/dpaa2_hw_dpcon.c new file mode 100644 index 0000000..27f5bcb --- /dev/null +++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c @@ -0,0 +1,139 @@ +/*- + * BSD LICENSE + * + * Copyright 2017 NXP. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of NXP nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * 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 "dpaa2_eventdev.h" + +TAILQ_HEAD(dpcon_dev_list, dpaa2_dpcon_dev); +static struct dpcon_dev_list dpcon_dev_list + = TAILQ_HEAD_INITIALIZER(dpcon_dev_list); /*!< DPCON device list */ + +static int +rte_dpaa2_create_dpcon_device(struct fslmc_vfio_device *vdev __rte_unused, + struct vfio_device_info *obj_info __rte_unused, + int dpcon_id) +{ + struct dpaa2_dpcon_dev *dpcon_node; + struct dpcon_attr attr; + int ret; + + /* Allocate DPAA2 dpcon handle */ + dpcon_node = rte_malloc(NULL, sizeof(struct dpaa2_dpcon_dev), 0); + if (!dpcon_node) { + PMD_DRV_LOG(ERR, "Memory allocation failed for DPCON Device"); + return -1; + } + + /* Open the dpcon object */ + dpcon_node->dpcon.regs = rte_mcp_ptr_list[MC_PORTAL_INDEX]; + ret = dpcon_open(&dpcon_node->dpcon, + CMD_PRI_LOW, dpcon_id, &dpcon_node->token); + if (ret) { + PMD_DRV_LOG(ERR, "Resource alloc failure with err code: %d", + ret); + rte_free(dpcon_node); + return -1; + } + + /* Get the device attributes */ + ret = dpcon_get_attributes(&dpcon_node->dpcon, + CMD_PRI_LOW, dpcon_node->token, &attr); + if (ret != 0) { + PMD_DRV_LOG(ERR, "Reading device failed with err code: %d", + ret); + rte_free(dpcon_node); + return -1; + } + + /* Updating device specific private information*/ + dpcon_node->qbman_ch_id = attr.qbman_ch_id; + dpcon_node->num_priorities = attr.num_priorities; + dpcon_node->dpcon_id = dpcon_id; + rte_atomic16_init(&dpcon_node->in_use); + + TAILQ_INSERT_TAIL(&dpcon_dev_list, dpcon_node, next); + + PMD_DRV_LOG(DEBUG, "DPAA2: Added [dpcon-%d]", dpcon_id); + + return 0; +} + +struct dpaa2_dpcon_dev *rte_dpaa2_alloc_dpcon_dev(void) +{ + struct dpaa2_dpcon_dev *dpcon_dev = NULL; + + /* Get DPCON dev handle from list using index */ + TAILQ_FOREACH(dpcon_dev, &dpcon_dev_list, next) { + if (dpcon_dev && rte_atomic16_test_and_set(&dpcon_dev->in_use)) + break; + } + + return dpcon_dev; +} + +void rte_dpaa2_free_dpcon_dev(struct dpaa2_dpcon_dev *dpcon) +{ + struct dpaa2_dpcon_dev *dpcon_dev = NULL; + + /* Match DPCON handle and mark it free */ + TAILQ_FOREACH(dpcon_dev, &dpcon_dev_list, next) { + if (dpcon_dev == dpcon) { + rte_atomic16_dec(&dpcon_dev->in_use); + return; + } + } +} + +static struct rte_dpaa2_object rte_dpaa2_dpcon_obj = { + .object_id = DPAA2_MC_DPCON_DEVID, + .create = rte_dpaa2_create_dpcon_device, +}; + +RTE_PMD_REGISTER_DPAA2_OBJECT(dpcon, rte_dpaa2_dpcon_obj); -- 1.9.1