From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0076.outbound.protection.outlook.com [104.47.40.76]) by dpdk.org (Postfix) with ESMTP id 9376D58EC for ; Thu, 15 Jun 2017 11:00:16 +0200 (CEST) Received: from BN6PR03CA0052.namprd03.prod.outlook.com (10.173.137.14) by CY1PR0301MB0604.namprd03.prod.outlook.com (10.160.142.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:14 +0000 Received: from BL2FFO11OLC004.protection.gbl (2a01:111:f400:7c09::166) by BN6PR03CA0052.outlook.office365.com (2603:10b6:404:4c::14) 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:13 +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 BL2FFO11OLC004.mail.protection.outlook.com (10.173.161.188) 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:13 +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 v5F8xWSc012830; Thu, 15 Jun 2017 02:00:10 -0700 From: Nipun Gupta To: CC: , , , , , , Nipun Gupta Date: Thu, 15 Jun 2017 14:28:44 +0530 Message-ID: <1497517136-11824-9-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: 131419908139148431; (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)(39400400002)(39840400002)(39450400003)(39410400002)(39860400002)(39380400002)(39850400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(9170700003)(86362001)(575784001)(2950100002)(36756003)(8656002)(47776003)(189998001)(77096006)(110136004)(8936002)(33646002)(105606002)(38730400002)(50466002)(85426001)(305945005)(106466001)(53936002)(8676002)(5660300001)(50986999)(498600001)(50226002)(4326008)(76176999)(2906002)(6916009)(356003)(2351001)(5003940100001)(104016004)(6666003)(81166006)(48376002)(54906002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0604; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC004; 1:6KhdqrhD1RnP/3K7q8Vq/Ss4gZD9NAwNW6iHXK9hmAK2zLPyDGLo6Zt846JLqxNxI2/thbTBYRnlAVJhvzBHffsxuAyc4IlaWCJkF8sNuor9UXtcyiiWW4Tv+Y1bvR3aC/EhmSjInZ5YGYwK6kxT9RTC7nZxJUZ5WyS7BwnlgExn7uHjCAt9BNhHXYxQtM7L4OMajDPsQ/ZUr/KgnEHcdtuX5oKRlKFCj9zxSIigRXcpTLs4QSdDdAKsa5tEX400GMHW23XZ0JZNQbrjKnAEWFs/Pb+bB4ndlC6O23iITmyyWWp6vzF+u1FJrYqe14MZswciyCj6t6qNpD2s0IUBgea0J/sbAh6MQrBHaVPJR0H5U7XXNMl0W5zSRjyPwMSa3w5e7CKIWAfh7bLukGb4bFxWkRmolSk/NZdTe27m4l9F+NWerfI75yyu8lwdisqEKzIPDwh180UIMs+y7uAs3SxKhOyH6rzgs3KSWtn7bKV2M5eg0f/1OMi2BdT551ARtbVSqdPchWFzbCasUkpXipCNt8qgBuR1ZXxEiZLo7J4mePHGO3DFhQny/06hSb/T6x3E4XXjNaBXso9fVKW7QQ123YEIu8CpOdw6q1vTFXAKjF+gMR36vGwR78WHCHQo2Us1KLOYvz9dJQz8OxrWd8Rm7F/fms4z7Vs9DP23BlbzDGURcZZxAj4iJyPxjHb9xulCIQtb4ypkR2QqxsSuBVNkRzVI3f6dGJIOo/UIC/I= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR0301MB0604: X-MS-Office365-Filtering-Correlation-Id: 36a4b8b3-ec59-4c3f-648f-08d4b3ccef83 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:CY1PR0301MB0604; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0604; 3:HjQE0cH03ud5AIxGHGHlPakvSsyXrhcmHqBgAsOAvrMGrwzr6vhpISjVSZ/vyL2ChaeK4puRjaOjgx0/VQFfluJR/yR+2zoZHQ5/6xvrL7zwQ42vhswMlBZBQfCgQ8CH3IQchp3PiS7dCOaA6JJ1YFAiagsxWrmvsBgXT3ei2/T/5zPhbzkFrrxYCv/oggsu1HjwCUgthXN93Jmw55RqbP6FMEiYgJSvGbZn41WbulPACVjzChKjHPF1/9FtLhiDocWAX3JzpCTSiGeDHmNF8UyTJRtFaSwfogBtcbw+wmdM2sFySe6av0wpTNvigqbwiu991L8gfGjYjCz+JzLv2aAkmNrtQPQAUldFJJKcluv7ND9mu3ORfQLhi67T0mSUzcu8BVXW1xfy6i3Dnv81dlPfApdcfYDSdv6zjd/dzZ73H2OCFrZVqRF/M+Vc/pbd; 25:Fo4d/WnIEO1y4h6ETF/Wi2UpcPGA/yz19xiqqTi/4pI6xXOxqo//Ono7WjNlg06UC0l6p+ufWaVldrC/e0pLW/mK55w4omm++mAxBvxe4WoISnLbVzD02MYPfGFBiYLkxpbOXAwu4jlV6PeCZGAWgedre7bct87FPTPb46u280zdAzNDpHGJs5/oNTalpFHSQK7oR96QkT7p5miEA5EXKDTGCoCJ3oqrkJrb37MesWRv46dvM3amqx4a4E316hoV7Ftt4dSbNMcSTh9+2IqqBw/jRx7hKrqgzJqlBOP9wdRnzXrUWYc7HrD2QwqIzG/dzjE0T73o16LWfxHgd6J2lrMvWAQEamdX2l+GLRSLrIrIqHdLYJPZ5Ls8RmTTBspGFzTQiz92EKFBp4C7EqmaBX1O9E256qPc9cGJaoPzwu9D90ubmcTzPn9PFhEMgpp/kzCxIgAozuucPECZXrt2zjJE3S+Qui3tFVZ3a57dDao= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0604; 31:7Zb7L/pIrhrW0bMXRv3HFM2aQRI7ef0eckS0WR2w8Urb6wk3LS5gGGvMFtncYlSjozU2T1skhk78W+qN3/zK25N1M2SpmbBT4wPBiYNti/V2h7vXhz4c82sytVGiQLwSn9Sb4tL6OE7OuOThcEMfzPVubxzD714eLZQtUdwq38aueXSJ8HWPNj0ACoX3im+Anms2ndpP0G/Rn08B4u70bAeHth7FNrXbErsbrljm14OyhR77y4ogjIeHIRAQ8jiaIPOcb+6ipnu+7utaAkAkNg== 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)(13018025)(8121501046)(5005006)(13016025)(93006095)(93001095)(3002001)(100000703101)(100105400095)(10201501046)(6055026)(6096035)(20161123559100)(20161123561025)(20161123556025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123565025)(20161123563025)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR0301MB0604; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR0301MB0604; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB0604; 4:TSJ7NoxuQLKvrSn00PY3qyhGbXOcDZAtz8Qv2qKh?= =?us-ascii?Q?TxeXntstLg/D7HusmEOeJhPgX7kjHsUyhCqvCucUuKQWK/6ZIJVyaNfeDDrl?= =?us-ascii?Q?5AwcGlQGYWa0T80krI2z3Ne0VxWSI42Y5nP5jTNIuKUBpgP/noYyGCnBfgjJ?= =?us-ascii?Q?RfaYTMerdT5qRWTf2/XAACu/gb+i+rgT1kPNzqHgcncACIF7yjb81QY3idg6?= =?us-ascii?Q?rxNzJG6hvIR13Q9d4sZwVMN0KwBQk4Sc6GEIBVvAjPZnA0MMxxY/LkmdrTIb?= =?us-ascii?Q?DCnRzJRDvZGe5hcHZvxh6zhcnqB25Qzc+yhMIurHByunIzW+IO85oFEcCPYH?= =?us-ascii?Q?hLsLgOGRHkWftqQpq82kf7RO8Y4x0CwNZPNeqMZUiwX8u8MXcQcl3IP4mAKj?= =?us-ascii?Q?asvHmMxMasmIYIwD/wy/rWbFXsgkdyCo/RjE94W8wc893hA1xRqQGJl4k5q6?= =?us-ascii?Q?enVXhR1z//aEGPic/g7RdMJe/f7R7P0L6RbC3udQa6mQ7CNDa+zT2j23fPnk?= =?us-ascii?Q?9htAUIgMCoePgGCwGxBYaPQE2eJCU9FS9CGdx3pjYT6CyO5nmMSW/W2MEVk9?= =?us-ascii?Q?MXAnNaacwG5FfaRnZwARtZQtrmuPMkYTH3O/5gbq3zLshY73U2yReYxmktT/?= =?us-ascii?Q?aGZ2oU48NEfSfPEISqfG9cL5D68O6gqtDs3EZbo0NasnD4QMC9A63mVTKH37?= =?us-ascii?Q?EqTnt1Ujqx5YbxFXrJ67pibU9M6mEWOezbU9rrosMaPCkVF7UIMUOTOfSmDQ?= =?us-ascii?Q?eKO/y2207TxfkP519enaN8PXYsaKn35Q8LjKDkSf/PCqg3nzYfQJ33tcP4PJ?= =?us-ascii?Q?x0A2Fx3XtxUKp+zLUInDxqYILdlW1P6OVNIZFV1omWy39yo5EJ73soujjQOD?= =?us-ascii?Q?Cjd4G1duTcGGTnVEYHTy0YTlVw2MU7LtNWP5kcLgxYLu/0W1TDqBXkFoGa4H?= =?us-ascii?Q?x80De10lHV1fJEaoLbKUuqeWI8ClHDbZ57pHXmGM5kbix1lh17ChdSLkrl93?= =?us-ascii?Q?oTex2CK5HPlphiDyZL+uQy8OweBVMJB8A71TAH917soiek5BDSLuNix9n8rR?= =?us-ascii?Q?hNo/yMIqg0AURErkGdulAbql/I59kaIjziLsFa9pe9VF/2lr0eT6pRxEj7sl?= =?us-ascii?Q?NHsvRZhRHYTmdzae6GNqQM46p6bI7amJQ8BcM/FDLSzxdUIs9oYW4Q8buRN2?= =?us-ascii?Q?neYTBS1PnN+lvq1yT1V7dQhGjNsNnIwfhTlNYVEeU2r+oEgGxbDWBEnhLCn4?= =?us-ascii?Q?w221dWT3AINGckyLJhjLcVo0+KUip12/LXZCN2SFArW+8SE7i9+5ILWHiH2R?= =?us-ascii?Q?Zw=3D=3D?= X-Forefront-PRVS: 0339F89554 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB0604; 23:5qYAM9xRQpFMMT6h1Je3nTxyAyJ5CCZansNTn9I?= =?us-ascii?Q?GeDQdAsWa2Yp2tUDg7/YuMt+VxRTh1M6GhDDv+IRYpXOeRch05xtZvoH5EZL?= =?us-ascii?Q?WCEJ9Gan0S+M2RQgTfF5Z1pfF+Tn+/FBwCPXMl5U91XMkKYzFShxFai3v7jG?= =?us-ascii?Q?Fs8G4K1E96OzPX3Wsm0ofBlNzFB/3F+eUKcxR8lkf7C7br9Z+k+OXXAWKti1?= =?us-ascii?Q?EYt6k2rw4xVm119lElaBxjd8H+RAs+ExEO47s4YZKIltErJrV9fOETOctHd7?= =?us-ascii?Q?MTdR00Pg4KCPNmONBy2r6/+D/tV1EjH2e1IpY8Nu7SKzR1t6W0Pyg3x/pE7q?= =?us-ascii?Q?jThdq18QivoTyhhLPPB+Hfme0Ckm8MuMsCwKpeSc75t3/9vV8L3qFYxp1WeZ?= =?us-ascii?Q?RygjfKrDKQMPBaSG9dhfVzu5UsotYWPj2HQmqk9LXOYoE+2C0rS46uHWGToA?= =?us-ascii?Q?xMGeIIUyxFvXivPP0riBnnOhwlBXCkOuJzCw7DOyx8IFbXmef84m+bFLNamJ?= =?us-ascii?Q?A8KTk8uq+ViC8SOrg4oYxNVMY202By6MX0pnZijbr7GttTH4oiA6ezhfHddw?= =?us-ascii?Q?Wp5l7gKjTc2Kl68KJMecAzHFvSrMXcz3LIJcKMC5Fp4t82esde0JpP6hTXtg?= =?us-ascii?Q?uEVQ5NhVgXOHSASs7PDRYRqWEdNWVQ+TgosKpLAR/Ca1d0aH0SXaTT26v8tt?= =?us-ascii?Q?eObZSxz7lcRV3i3OJN5u8kPd3/7RawEQ6oPZ2Qqt2cH2tsmr+aL7RK0HPC2c?= =?us-ascii?Q?XrGZdvFWT9XTaOy+2+LTyd7sU2xcigraHcTNaxQNFMvtYZbhzvNFIICIdlqw?= =?us-ascii?Q?qJuJwb1LKf7xiCPBxugJE2R506HJIs6VKzcHW39wc7KmHD2D+BxfOm8HP8nC?= =?us-ascii?Q?S2f04Z9dCYOVLi8kRKuzv70HlBfmae0MObodXyigqrsbtpxZK8R31XQdFXgQ?= =?us-ascii?Q?BehudBi4pVyk/zSY0nFNuUwutkzrfuFOHR4ZrAqhR7yLVGlalTp2ZfuJrb0l?= =?us-ascii?Q?AXsz/MuDRaf4NqJ1eeda6kLy16cO26i3eiw8fCaKFrRP+DTOXlY2TpzegMXX?= =?us-ascii?Q?Ymo0ut1yqCb9dPD/og7rHEi9XERvhQFRmgt6OYU2GzugcQUhPG+ynWQDLezu?= =?us-ascii?Q?eKLq6qo8ULaarLvDBLYjJcpyGQbWS/yuj4Rp/wrnLmv3cNuX0P0qhMlIIKrY?= =?us-ascii?Q?HyNsE4bNgjjhcdmMLzhC7ZgY6s541FkveJxpRLtkEdG0osKvUZ0Qw8AOMojG?= =?us-ascii?Q?+J3w+zwXWWGfDlLC/e8/6jOAPSc61HOTM1SthoXUd?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0604; 6:yLRTbLsLwm7eljpUtJ/G4vGh/W8kHzIUEiiajrkSttebV5giMlIlPs+K9kBgBQoMf7lqVds8vMJdL5hm6Ii/hRLXSPp719C0UgMdEFhcoOhhGIikCUNedJIYq6qSwL5QtCMb7egm93x5rQke5IltmRxeCg9W5oZzNd/4so+5GKDuop0huW2JtfzsL6J6xTk0VmXnGOgfgO2ZwTFBKdXzyIA0fF6HXojeEDeip/8bkX6O7eKtbCxWKENxgK4aSkdnW8SPh/02ewvYbbXf16gzxgVfq05WHGwyaqSdGu+9WldtNMhQKtIog4t6PUiDzZRAYUMfW+lmZqx8n6J0sigvbPGOp8Is6Z44cvLcofl8oFARru8vNFBfDI1e30EvTLYh69vKSVI1aW4jo4FEX+WwoNu0FNn8AWrjNKjdL3uoHMKrRIds8leMW6lUuzAPQdNAVHCMvzhGzhETsuh2VQQ4zfrb0EYOx8kX5STv/mZMw4IxvkJ+xv3OLbVDMPILnYexgdb1kljjCUW6WNjS853+lA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0604; 5:g1m55kE+BE57RAdzdvqgVUPn80g9rAs42011hy67becd22IFt4kfmgoFlPr+Mj4do5MdGW0HcTYa3n+7mfNSAerIhxqIIUnScQyR7qgQdVNsfVDkdMpUoa8f3y4TgMuoyXJdNWMmV8kDrLyLkO+mfu1vzvKsrCETjzHdK6dxqgV1OzSkh2SYVwoD9R6Y+RTgxNubSlc+dXK98nkiU0ZKUjt8qpfPZeRhU6HvWLzdrN3KQ/u3GB5WNpKIEZmMyv/sjD2Mlvno4UA/EypXCuKAfIAVAEcSdytjPCOXtLIxI5s9TaInZUe3+3ylUS54i1g1EC/ACBTGUtD+N3KfKa3rEAYjw1S71VVo8fTCPdApG7hIRE6MYQDXnZB9fSSIjzWfmy+GFxygNgchJ9obMwK7l+nirFLiJpDNb6kI5DxbvzwJtKY2HkiOGSLiyFQpGzvihHsi9EAXiEoAS99Us66qawX75sqVvxkQ19iOLiVKMXGC3ZYYMIpRgQXXTvsPOyooslbbNSQ+6bSLrZt2h6vYfQ==; 24:DKxb1sAc7lPcqcc1GWCUvkx99DQeD+5HlKjvd5K9US96vJmsbpx2J2Z1FXWJG3D/aqWV7lmLAs3h7RLZGEvA4GGFc3IaSboVc8xH/Hukl4U= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0604; 7:bSzgGodG10NvRoAFIC9gijsY9X9WEHMbn4K854Zf19DzzplSryWVomRkq4DGE8nzPglmDUCAHCKW2wMTSDImRjoLRbymIpVbokgHc1fHjqxzAIg2uos83sHfNbRsHpvwOKhRBI+3LcCP6xw+39jlG1Zqw5eVhnzT9Cb4cimeQ/t1es8qKuHe9mgXvEHFwHW8MSMLH9DrFksnrmSlG1zDilC8Dkgsd4HZhqGJGjuk/FzZTVjhQr8JLKKf0a3gLnCF5QGkpoE8GoXA8IFpIDoV693wvsli4JQsP/6FXbPzT300B97y7nF0ywLTY8Op+BEFH/mAKr4Cw6cxqQW0zQmOiw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2017 09:00:13.7432 (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: CY1PR0301MB0604 Subject: [dpdk-dev] [PATCH 08/20 v2] bus/fslmc: register dpci 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:17 -0000 Registering dpci as dpaa2 type device handling initialization, allocation and freeing of the device Signed-off-by: Nipun Gupta --- drivers/bus/fslmc/Makefile | 1 + drivers/bus/fslmc/fslmc_vfio.h | 1 + drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 179 +++++++++++++++++++++++++++++++ drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 15 +++ 4 files changed, 196 insertions(+) create mode 100644 drivers/bus/fslmc/portal/dpaa2_hw_dpci.c diff --git a/drivers/bus/fslmc/Makefile b/drivers/bus/fslmc/Makefile index f0ad576..364c214 100644 --- a/drivers/bus/fslmc/Makefile +++ b/drivers/bus/fslmc/Makefile @@ -71,6 +71,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += \ SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += portal/dpaa2_hw_dpio.c SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += portal/dpaa2_hw_dpbp.c +SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += portal/dpaa2_hw_dpci.c SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += fslmc_vfio.c SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += fslmc_bus.c diff --git a/drivers/bus/fslmc/fslmc_vfio.h b/drivers/bus/fslmc/fslmc_vfio.h index eddce31..7c725f4 100644 --- a/drivers/bus/fslmc/fslmc_vfio.h +++ b/drivers/bus/fslmc/fslmc_vfio.h @@ -42,6 +42,7 @@ #define DPAA2_MC_DPCON_DEVID 5 #define DPAA2_MC_DPIO_DEVID 9 #define DPAA2_MC_DPBP_DEVID 10 +#define DPAA2_MC_DPCI_DEVID 11 #define VFIO_MAX_GRP 1 diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c new file mode 100644 index 0000000..d222f26 --- /dev/null +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c @@ -0,0 +1,179 @@ +/*- + * 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 Freescale Semiconductor, Inc 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 "portal/dpaa2_hw_pvt.h" +#include "portal/dpaa2_hw_dpio.h" + +TAILQ_HEAD(dpci_dev_list, dpaa2_dpci_dev); +static struct dpci_dev_list dpci_dev_list + = TAILQ_HEAD_INITIALIZER(dpci_dev_list); /*!< DPCI device list */ + +static int +rte_dpaa2_create_dpci_device(struct fslmc_vfio_device *vdev __rte_unused, + struct vfio_device_info *obj_info __rte_unused, + int dpci_id) +{ + struct dpaa2_dpci_dev *dpci_node; + struct dpci_attr attr; + struct dpci_rx_queue_cfg rx_queue_cfg; + struct dpci_rx_queue_attr rx_attr; + int ret, i; + + /* Allocate DPAA2 dpci handle */ + dpci_node = rte_malloc(NULL, sizeof(struct dpaa2_dpci_dev), 0); + if (!dpci_node) { + PMD_INIT_LOG(ERR, "Memory allocation failed for DPCI Device"); + return -1; + } + + /* Open the dpci object */ + dpci_node->dpci.regs = rte_mcp_ptr_list[MC_PORTAL_INDEX]; + ret = dpci_open(&dpci_node->dpci, + CMD_PRI_LOW, dpci_id, &dpci_node->token); + if (ret) { + PMD_INIT_LOG(ERR, "Resource alloc failure with err code: %d", + ret); + rte_free(dpci_node); + return -1; + } + + /* Get the device attributes */ + ret = dpci_get_attributes(&dpci_node->dpci, + CMD_PRI_LOW, dpci_node->token, &attr); + if (ret != 0) { + PMD_INIT_LOG(ERR, "Reading device failed with err code: %d", + ret); + rte_free(dpci_node); + return -1; + } + + /* Set up the Rx Queue */ + memset(&rx_queue_cfg, 0, sizeof(struct dpci_rx_queue_cfg)); + ret = dpci_set_rx_queue(&dpci_node->dpci, + CMD_PRI_LOW, + dpci_node->token, + 0, &rx_queue_cfg); + if (ret) { + PMD_INIT_LOG(ERR, "Setting Rx queue failed with err code: %d", + ret); + rte_free(dpci_node); + return -1; + } + + /* Enable the device */ + ret = dpci_enable(&dpci_node->dpci, + CMD_PRI_LOW, dpci_node->token); + if (ret != 0) { + PMD_INIT_LOG(ERR, "Enabling device failed with err code: %d", + ret); + rte_free(dpci_node); + return -1; + } + + for (i = 0; i < DPAA2_DPCI_MAX_QUEUES; i++) { + /* Get the Rx FQID's */ + ret = dpci_get_rx_queue(&dpci_node->dpci, + CMD_PRI_LOW, + dpci_node->token, i, + &rx_attr); + if (ret != 0) { + PMD_INIT_LOG(ERR, + "Reading device failed with err code: %d", + ret); + rte_free(dpci_node); + return -1; + } + + dpci_node->queue[i].fqid = rx_attr.fqid; + } + + dpci_node->dpci_id = dpci_id; + rte_atomic16_init(&dpci_node->in_use); + + TAILQ_INSERT_TAIL(&dpci_dev_list, dpci_node, next); + + PMD_INIT_LOG(DEBUG, "DPAA2: Added [dpci-%d]", dpci_id); + + return 0; +} + +struct dpaa2_dpci_dev *rte_dpaa2_alloc_dpci_dev(void) +{ + struct dpaa2_dpci_dev *dpci_dev = NULL; + + /* Get DPCI dev handle from list using index */ + TAILQ_FOREACH(dpci_dev, &dpci_dev_list, next) { + if (dpci_dev && rte_atomic16_test_and_set(&dpci_dev->in_use)) + break; + } + + return dpci_dev; +} + +void rte_dpaa2_free_dpci_dev(struct dpaa2_dpci_dev *dpci) +{ + struct dpaa2_dpci_dev *dpci_dev = NULL; + + /* Match DPCI handle and mark it free */ + TAILQ_FOREACH(dpci_dev, &dpci_dev_list, next) { + if (dpci_dev == dpci) { + rte_atomic16_dec(&dpci_dev->in_use); + return; + } + } +} + +static struct rte_dpaa2_object rte_dpaa2_dpci_obj = { + .object_id = DPAA2_MC_DPCI_DEVID, + .create = rte_dpaa2_create_dpci_device, +}; + +RTE_PMD_REGISTER_DPAA2_OBJECT(dpci, rte_dpaa2_dpci_obj); diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index c022373..9f9df50 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -75,6 +75,8 @@ #define DPAA2_HW_BUF_RESERVE 0 #define DPAA2_PACKET_LAYOUT_ALIGN 64 /*changing from 256 */ +#define DPAA2_DPCI_MAX_QUEUES 2 + struct dpaa2_dpio_dev { TAILQ_ENTRY(dpaa2_dpio_dev) next; /**< Pointer to Next device instance */ @@ -123,6 +125,16 @@ struct dpaa2_queue { struct queue_storage_info_t *q_storage; }; +struct dpaa2_dpci_dev { + TAILQ_ENTRY(dpaa2_dpci_dev) next; + /**< Pointer to Next device instance */ + struct fsl_mc_io dpci; /** handle to DPCI portal object */ + uint16_t token; + rte_atomic16_t in_use; + uint32_t dpci_id; /*HW ID for DPCI object */ + struct dpaa2_queue queue[DPAA2_DPCI_MAX_QUEUES]; +}; + /*! Global MCP list */ extern void *(*rte_mcp_ptr_list); @@ -267,4 +279,7 @@ static phys_addr_t dpaa2_mem_vtop(uint64_t vaddr) struct dpaa2_dpbp_dev *dpaa2_alloc_dpbp_dev(void); void dpaa2_free_dpbp_dev(struct dpaa2_dpbp_dev *dpbp); +struct dpaa2_dpci_dev *rte_dpaa2_alloc_dpci_dev(void); +void rte_dpaa2_free_dpci_dev(struct dpaa2_dpci_dev *dpci); + #endif -- 1.9.1