From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0062.outbound.protection.outlook.com [104.47.34.62]) by dpdk.org (Postfix) with ESMTP id CC643378B for ; Fri, 9 Jun 2017 10:37:59 +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; bh=RFnmNoLByb7kmThRKZG0mPbSxi7NcPRhY4TVMQ3/tSA=; b=TyJ0GP0lWapvXii10LdMn6OoY+3AyihNGUAqr1Gxeb6Kw9FY4Hiy74Nvd6CtTGFfFln8h0wEiW7sDBp5X1RnZHJ+7337cpKMbymtx8p0VFVbql3YMMT+WCYlxOvU0y8n/p+pVOYMO7nTQlh/ixM6PQzA0M7N9TF2mAZqSzkFC7g= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin.caveonetworks.com (111.93.218.67) by BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Fri, 9 Jun 2017 08:37:55 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: bruce.richardson@intel.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, gage.eads@intel.com, nipun.gupta@nxp.com, gaetan.rivet@6wind.com, Jerin Jacob Date: Fri, 9 Jun 2017 14:07:26 +0530 Message-Id: <20170609083729.10586-2-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170609083729.10586-1-jerin.jacob@caviumnetworks.com> References: <20170607084333.6338-2-jerin.jacob@caviumnetworks.com> <20170609083729.10586-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0113.INDPRD01.PROD.OUTLOOK.COM (10.174.144.29) To BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLUPR0701MB1713: X-MS-Office365-Filtering-Correlation-Id: c60eeb4b-f0eb-4678-00a5-08d4af12d496 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 3:/dPkNmLm8pOa7xVrHfPhw/VnLW7fWRHInnWlgZO+JQEeKZaNNyckaJRzO8RXAcb3Y6jzthK+8Dj5n2GFP6owX26zV7s2A2UZPGzYrccU/Y0KFHdpX4yUrJLtCjjSe1qIavT033sXxj8Q49Myr7zzhbHmf/qQnLEdzCrtU9pukKHKiEwRqoQxxajxfzMHIc6tp9oB7f22DrLqrCUmPAkyPEjsXnHKBZqLzdjChtnUiQ1pA6kLmqx7en2nROmp77QcYp2OelfCf2XSXFNyQK6blW0ARryXZxwb4hNk243g9gApnZeQ6H16attA+vDmeLFxeUTI9DN1TU0PKRDdfi4j9Q==; 25:Av/O/8cHAh5HVxa1feZgXK3NBF31/rQuCC1iI0FNyrE7Dmms/QCRYCnL0dnFywls2BJYNe3olK2WpWtgXuwCqcPWvZER/6hE4zohHoQInsy9A8Ho8ahILmTaffvzuYQoc3Y6tA8rUzpVAzIqSYC3SSCzzIqp5mn0GA7D91HhReXz6ro/pAfFNziSjtuGZy35AuxLRNpbJVkHVfQJkM8uTdRNp1Yn1NhkPVy1WR1BDKl/h6xjUQ8e9rs7ruH6IKS0HFE3xULDqWJsUOdHjJxe3L9loRjRskdQ41cuiI/BN7QuX/T9tftQEN30sCdlbR+n8h2NzOQCkDAu3I7zkkDH9WkZMeB122WSjye5RBYBe+4pnoY4VsNnwl01kv5YVtkL4S+wh3Se/RlDVazskEuHs9e6+R5UJnXGqyOEan9MvxOnU8UO8JddfLsSwFCkha/F3kpFdTSrppDRAf3zDhX+bTzvGuVo5j5FiH4Jil2gVdM= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 31:2rNL3000w4rzJlG/3KtvrzAFtZjyaNT6WwpaRffCmyU4c9gGuoqpvGJhsKk3os9Ksz35u0oOb+NAEbQgQCSEDZ8AVW96KGPkledTXRvB8oXOmyCw6GFHzFua03YIyUes3Q5JkEKEDQcSgsAOv4zomYwa2YbvDSG+CnT0J+10rdsHFoIjBxn4XNiPWe00Nxh+SaT9Ub4PHshoxHwTV5G/SDaYJB0zfIi8Qefe+7nhT3k=; 20:b4L/4deki3vYBvev0ZWmBZF5qoxTwl+1suRCwj1cVB7oCtMN7qz7JGCGA9J+lZcldTS2qjChh4BUClznoCwGEEGO6cx69Atc5iMoIXESBEBpnmqZoZfZe33Eh6vtOPA7u+bI2r/gFuBVDbzQI0QRG65kgM+u3qDV+AYxgT7erUsDVVbYgO1fCIKWs3twmTMc8x4yskFGvlxSA/q3qQ+dZEbtWbbt5mVhUt0OQOGZykHZBKLOnSIBcUzhnCYxCIiSF1UWYvzH/N5TDYAbaro7h3XCuR2v5AN1H8XSnl9Kl8ejCAHPMNmG+4UXSs4Gk5WtDzLLm0/CSwr47dteDArCn7RhIAA/dvXv5/9Xg8dqIEkfandIf1StwsdWa5upITA4st5glKi9Coi2lK0pM1Jkyj02ABr6D1Z1eGIy4o/HNtx3gHg2VDITufoUFIgonI58VJjlDVhXxiA3Yv+6cJcA2OjnN3Bl5IEaOtSRInmBRyiSs6ytxNm+1nrBYJgAoJ2hVVxm8GAZMFK5qi2QSuYxD8Mw8hXevKq04YYLgwrkAAoogUL6QIfa2rPeEMO9fAYsvr/tRJlqJl3h4YivYeuGct4fgNFFKrkWQWtmbQkGWKQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(20161123555025)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0701MB1713; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1713; 4:UJapGyjn3pCFDm+gG23UQRmM3342vkSgoECFGSys?= =?us-ascii?Q?+HpnMBUMpG16IyTDR9cz6ZRVIFBflZuIUt5vMhntNnoibi49aPTVcXEY4jBj?= =?us-ascii?Q?AOtjaUSn4h3CDQyoXXHklSB2ZLD0ipLbHYLAQMt94GXGcXTbjWr8e2CMfh+Z?= =?us-ascii?Q?lhP2DJC9YPDlQkO8huSjbYG4Re5ga5ivOqocEi8YzbHGoYM4jz6rxqSihOMC?= =?us-ascii?Q?yPaw0agT0k9DL97UhslRXPMZf2bHfwwKTlz8BvSwjrx5WF3xu9Ys/WdpvOCH?= =?us-ascii?Q?KZCqNw2m9lF6JKbuJTrJWpB5ibf8NlSGnU6VOP2ozEIY1lmfX9/zlisPDIsq?= =?us-ascii?Q?g6x7DWIf8tG47HwlVM7SJjvEn5eUMGY2UK677qGX+jIvDlIUsUwVLW2FTsOj?= =?us-ascii?Q?egRzeA2W6PzQd3r172RvoK9/QHEc1m0yT6oFQ3/nrxqCBbBKGtzBJ8Z3iuMt?= =?us-ascii?Q?n0lotDtHFZ6Zrd6W2AlUjVpY9FC2rIXCUktFgYqkAlt67Sq3iSv5y4I/E64Q?= =?us-ascii?Q?CG36fW4alw7J8RdIOrrooKwfFzMrWluhLn28sWunJgB1mANeeMvaTvoHu2VK?= =?us-ascii?Q?HFaKyWJGIt9QFea+L5rBYTQRHaySE/KHh954oevIkU9XX6+54RWmp0EB/8Wg?= =?us-ascii?Q?FjKBQLix7SMl1qjlbkWfmakoqOaTvvoQM2W7jmOOQE9T9Lxfe0SSnriKoYTx?= =?us-ascii?Q?bmB9hvmGSWrBozoo8XC6MKIRpXJW16E76QyjcPm25ptN+OB/w6c0f/bUrsQG?= =?us-ascii?Q?UuawlsXJ9gaC22+82KfrxJOlKseB/eJJr1KZ7dUc86NL3j6UJ3Vrxt4Ncd22?= =?us-ascii?Q?UNncpB8uDqxSE+Ku4Rol54be8vgY24dyGbZIe7yhnrpZ3RYLyleKgyFtvuFV?= =?us-ascii?Q?SxHLH9IhcIynrAUPZJTQTkrCJcHlrn6brIM0kr5m/rX5bj7wUPuRQugdjkHc?= =?us-ascii?Q?hB1Aq+qOpUcBdbE6RXiez0PVkvwwzVQzvkh8NW3tSfaiIUpi2sFqkJQHkvE5?= =?us-ascii?Q?NcwjCCXKIBn21X4XLnIKKf6KWbhHO+aL+DlpqYvlQoJKMoYS8MtjUHHP1yga?= =?us-ascii?Q?q1aQjtkehyBK3TA60g4JXf3dU8nrUhRbEPKHXaK0rh2+1vR6gqOY8O6F622L?= =?us-ascii?Q?GM/ke+pkdP0=3D?= X-Forefront-PRVS: 03333C607F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39400400002)(39450400003)(39850400002)(39840400002)(39410400002)(48376002)(47776003)(76176999)(8656002)(66066001)(6512007)(5890100001)(2950100002)(25786009)(4326008)(53936002)(6916009)(5009440100003)(3846002)(1076002)(6666003)(478600001)(42882006)(6506006)(36756003)(6486002)(50986999)(110136004)(575784001)(2906002)(33646002)(305945005)(2361001)(50226002)(81166006)(7736002)(8676002)(53416004)(107886003)(42186005)(38730400002)(72206003)(5003940100001)(2351001)(5660300001)(189998001)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1713; H:jerin.caveonetworks.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1713; 23:V3yM//kIW6ZadvsvRy6q8+l0cWTZ/8VcJymTUCI?= =?us-ascii?Q?j5h+0zoRRgXriSSyW3Z98gsI+khc/9fxWoVWcfUFD4X9WNInthj9wg9Laxvv?= =?us-ascii?Q?93iC/PVb8T59i5hlgeL26wSDTg3DfP2weycgpPQRuWKi9/PXJ7y682jwjx1D?= =?us-ascii?Q?5hJB7OetzIEJ3MsjY4ByzJQJvkFQFzPXe0kH3Tb2TId3917xeziyNp/1D9t9?= =?us-ascii?Q?V/zgGhwKDKsk63xDMCCm/OA79aToll8/7J42k2CXcfFf29+oDaEienOnw2u1?= =?us-ascii?Q?gjMwfyKAzfKsytJHJdhjMjMG3ioJ/WJsYAibiA8SHJHet6ydIFAfht5LdL9P?= =?us-ascii?Q?dKyycVmfHVT3gKSTiR8yyejKYUdTTg+kJUAyFjA05r0uRUDL5XKO+3LUUWCq?= =?us-ascii?Q?Gprx3Wzs9fOZxjxoC8mvMnb5xKfE82LsvaaLlaJ7wnQSRmPPlF3QWdAjeKRK?= =?us-ascii?Q?cuB/UBEqH8RRpb6gw8w9fbJid1B/bm5+aGD/QhFH+Ls1KF4ClvCKM8g2cr9K?= =?us-ascii?Q?DLkGJDJ8t5LQEBU6Nv8FhRfFRmlDQclsX60n7egVGI7lz88pLUNakYpO7QIL?= =?us-ascii?Q?1H8pi11pjuB8s8Z0/rIzKqWN8fSl/PX6ush8XDiI6tQNFv/gz/kUjvCQ/vwv?= =?us-ascii?Q?duAPU4xNMt53nRU9QZapY1xoDHITqjrgHKVnpMFdR/QwQcZhdns1/D8MUERn?= =?us-ascii?Q?0ij/mBVAwsCvFF9UMZWXGCGnuqg0Ly2SvJYGIz6JcF8AxeXjBYSr4EBfBoO/?= =?us-ascii?Q?VuItHndmWTpWiIO/8d+NxbjLn2oN+iRPfirtgBSRY94YaoLCliDcHD+qXz6i?= =?us-ascii?Q?SJ41epMoFcx4xNZRvoyorkliOav//BeZ0kgLQsp6reCewfkeddLy45ZNLe2c?= =?us-ascii?Q?H8yfkUn7adAd0/BsYZPmbHJGj5nfthdJ1mvjRlTPUexA8cxJbZBBdQt/yD4D?= =?us-ascii?Q?+yGitMa8DqyI72BtbjA2uFyIfU58aZFBxoMyGbP08z6Pd7bCJJg5rM3uo+cp?= =?us-ascii?Q?rrI5YAzY8R09UZxDELnpYcHfyVMTmYcmJBaW/mPzzTHaZBUE9XQXrfF1OoHg?= =?us-ascii?Q?FmqoUfBvjnSGl/sdd4Xm4DaMWuYLCNUrqZ9SZu+PGjhwb7KCCt12Fyd+dgdu?= =?us-ascii?Q?GkZKqmxMOsSQyLeEZ4iwysyZuWuVqyDw80tDuOvHT4jbduqRr5CZk1ZdEBQQ?= =?us-ascii?Q?eL+rI2ION2Xp+yl5ioqCTe+DI8aEBLZSx2lIVnngZdvATbG86fJoaoa15pg?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 6:pKhWvJqBgyWXSOlOATwyja45VM1hod6/P4EgBJyPu1qhEo381EOiYF73rYgswMWw6CUCyXh8pvRA3vaSZxbzOBuZpwPRL39Snz15tq1+9IPrE9KTK2P3L8PvqSSe4vE40GmmO+iM2x8kDTalY6GalLWvValtUXyiAMPqeDPbr6WY3U+xijmySr+b/GwuLsuXkLlRSgRDZHJA2Fw0fgLRCLNX9mmVKsE3oDl/jXPwViMjrbD3+7OVfhQxRxNKmruXvri0kkkfoS7mpHlAeKo3UxFGYFPlUnC7qmymxfiqcETVGh/W5Ujs3EHbWn/WugJ6Y7nyRevDyUO4oa4/ZOVcajrOA55ewXzBUKhikidW7oXoHsNMhZvaxaWDAxPP/E86pmbnLvIfX1ehiqF7CjUi1rqsVT8b9SWL7ni/+EpTES9A4sblNMn4/kNGWzWmErqEUWf6b0LIfkO+IWiErcJn43a59mlS7Wu9xBp+s1dDtem7eEI7fxWjlvCImBpUgUK2TpMFFnsuwieg4CfR1VUHQQ== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 5:gyR2Q+pL+Y1uaG8x+LdLcbSKNyWYHO5B+5vnt3dDhMUHQGnkMW30ctSrdCmQF/th6JJDPUFe/BHo4FHYcfPHajzatkRTVQd7+2yBjVfbxXXV5pWGY5ZVQZeDTodsZc4p6zWc7paPO51WkhbhHOmjGztpXMkm/NlNNZki86k3Di+eEhvOXLx8Pk/uD1uX6X4LZJzajjAKisS0lU6lC2bn8qNb/sbmFn1GUA8jhACiD2+B0ZPt7hUS/mkRiBfqjrW49cz0SFM1UtoQn+dOiNVDQcO27tFegr5fGDgFFOu1Wpxomq4YogiGyyAMqSAjB3aOVN4X4bGfPZHXHu8Xnam+0Q1BYuaIizpIiP3okWwQnq+0KL0cUZiePI339o+oOqDfTU8zkwM3j8teOGtk5Q7IT3nIW4u8Ld752wJs71HLRNf8T+Y7AzzWpv2NNmgFqwtIev2Y1yXLx3fJULAosrSPHXvsRZfAOSw/PXsv7roK9lVrEV9IAYzpr9wKj5OwHqXW; 24:nzfMyGPrSzGTuTeJs0s2IDiVQi93zm6kVgUUnZSKO6wTgExFKJdOckKjt0VdfMgqkhk5jzuW69oKAVxTwxB3oN0J4pUVQVfNa97bb4iu7PY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 7:NfWxu7+/HruYC4PbOY0M38K3oHLWLuZebyMN/d1KP7vdaio4gW5X8CxPctNEeqWKYlje6NfOaFPFU5GJyoaigxG82U5byOy1+PxUHp2+zI8Ns+XbPaQGNQke8qhxdv1scBA2hurINvPngevIqByZsiNjefeQNYSjBXNyiL88iOfWbXv3wZF1zQqidd41IGfveqDrraeZjt9JADfrLfrq7ib4spczkxqUZqNZR07l3AMvmK/POwvLwK9AUFCv09W+byz5WV2jCEo1rZb1NBs50psAc9T4h5cLm6F8Bwg2EraD0k1BRIZ9EfrnZ3ufvX2DSEwg4jrovtaYNZPCJ8iEmA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2017 08:37:55.4454 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1713 Subject: [dpdk-dev] [PATCH v4 1/4] eventdev: remove PCI dependency from generic data structures 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: Fri, 09 Jun 2017 08:38:01 -0000 Remove the PCI dependency from generic data structures and moved the PCI specific code to rte_event_pmd_pci* CC: Gaetan Rivet Signed-off-by: Jerin Jacob --- drivers/event/skeleton/skeleton_eventdev.c | 30 +++++++++----- lib/librte_eventdev/rte_eventdev.c | 38 +++++++----------- lib/librte_eventdev/rte_eventdev.h | 2 - lib/librte_eventdev/rte_eventdev_pmd.h | 63 ++++-------------------------- 4 files changed, 41 insertions(+), 92 deletions(-) diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c index 800bd76e0..34684aba0 100644 --- a/drivers/event/skeleton/skeleton_eventdev.c +++ b/drivers/event/skeleton/skeleton_eventdev.c @@ -427,18 +427,28 @@ static const struct rte_pci_id pci_id_skeleton_map[] = { }, }; -static struct rte_eventdev_driver pci_eventdev_skeleton_pmd = { - .pci_drv = { - .id_table = pci_id_skeleton_map, - .drv_flags = RTE_PCI_DRV_NEED_MAPPING, - .probe = rte_event_pmd_pci_probe, - .remove = rte_event_pmd_pci_remove, - }, - .eventdev_init = skeleton_eventdev_init, - .dev_private_size = sizeof(struct skeleton_eventdev), +static int +event_skeleton_pci_probe(struct rte_pci_driver *pci_drv, + struct rte_pci_device *pci_dev) +{ + return rte_event_pmd_pci_probe(pci_drv, pci_dev, + sizeof(struct skeleton_eventdev), skeleton_eventdev_init); +} + +static int +event_skeleton_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_event_pmd_pci_remove(pci_dev, NULL); +} + +static struct rte_pci_driver pci_eventdev_skeleton_pmd = { + .id_table = pci_id_skeleton_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING, + .probe = event_skeleton_pci_probe, + .remove = event_skeleton_pci_remove, }; -RTE_PMD_REGISTER_PCI(event_skeleton_pci, pci_eventdev_skeleton_pmd.pci_drv); +RTE_PMD_REGISTER_PCI(event_skeleton_pci, pci_eventdev_skeleton_pmd); RTE_PMD_REGISTER_PCI_TABLE(event_skeleton_pci, pci_id_skeleton_map); /* VDEV based event device */ diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index 20afc3f0e..fd0406747 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include @@ -126,8 +125,6 @@ rte_event_dev_info_get(uint8_t dev_id, struct rte_event_dev_info *dev_info) dev_info->dequeue_timeout_ns = dev->data->dev_conf.dequeue_timeout_ns; dev_info->dev = dev->dev; - if (dev->driver) - dev_info->driver_name = dev->driver->pci_drv.driver.name; return 0; } @@ -1250,18 +1247,18 @@ rte_event_pmd_vdev_uninit(const char *name) int rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv, - struct rte_pci_device *pci_dev) + struct rte_pci_device *pci_dev, + size_t private_data_size, + eventdev_pmd_pci_callback_t devinit) { - struct rte_eventdev_driver *eventdrv; struct rte_eventdev *eventdev; char eventdev_name[RTE_EVENTDEV_NAME_MAX_LEN]; int retval; - eventdrv = (struct rte_eventdev_driver *)pci_drv; - if (eventdrv == NULL) - return -ENODEV; + if (devinit == NULL) + return -EINVAL; rte_pci_device_name(&pci_dev->addr, eventdev_name, sizeof(eventdev_name)); @@ -1275,7 +1272,7 @@ rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv, eventdev->data->dev_private = rte_zmalloc_socket( "eventdev private structure", - eventdrv->dev_private_size, + private_data_size, RTE_CACHE_LINE_SIZE, rte_socket_id()); @@ -1285,10 +1282,9 @@ rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv, } eventdev->dev = &pci_dev->device; - eventdev->driver = eventdrv; /* Invoke PMD device initialization function */ - retval = (*eventdrv->eventdev_init)(eventdev); + retval = devinit(eventdev); if (retval == 0) return 0; @@ -1307,12 +1303,12 @@ rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv, } int -rte_event_pmd_pci_remove(struct rte_pci_device *pci_dev) +rte_event_pmd_pci_remove(struct rte_pci_device *pci_dev, + eventdev_pmd_pci_callback_t devuninit) { - const struct rte_eventdev_driver *eventdrv; struct rte_eventdev *eventdev; char eventdev_name[RTE_EVENTDEV_NAME_MAX_LEN]; - int ret; + int ret = 0; if (pci_dev == NULL) return -EINVAL; @@ -1324,22 +1320,16 @@ rte_event_pmd_pci_remove(struct rte_pci_device *pci_dev) if (eventdev == NULL) return -ENODEV; - eventdrv = (const struct rte_eventdev_driver *)pci_dev->driver; - if (eventdrv == NULL) - return -ENODEV; - /* Invoke PMD device un-init function */ - if (*eventdrv->eventdev_uninit) { - ret = (*eventdrv->eventdev_uninit)(eventdev); - if (ret) - return ret; - } + if (devuninit) + ret = devuninit(eventdev); + if (ret) + return ret; /* Free event device */ rte_event_pmd_release(eventdev); eventdev->dev = NULL; - eventdev->driver = NULL; return 0; } diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h index 20e7293e0..c5b2b7453 100644 --- a/lib/librte_eventdev/rte_eventdev.h +++ b/lib/librte_eventdev/rte_eventdev.h @@ -1063,8 +1063,6 @@ struct rte_eventdev { /**< Functions exported by PMD */ struct rte_device *dev; /**< Device info. supplied by probing */ - const struct rte_eventdev_driver *driver; - /**< Driver for this device */ RTE_STD_C11 uint8_t attached : 1; diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h index 4005b3c98..faa6989b4 100644 --- a/lib/librte_eventdev/rte_eventdev_pmd.h +++ b/lib/librte_eventdev/rte_eventdev_pmd.h @@ -87,60 +87,6 @@ extern "C" { #define RTE_EVENTDEV_DETACHED (0) #define RTE_EVENTDEV_ATTACHED (1) -/** - * Initialisation function of a event driver invoked for each matching - * event PCI device detected during the PCI probing phase. - * - * @param dev - * The dev pointer is the address of the *rte_eventdev* structure associated - * with the matching device and which has been [automatically] allocated in - * the *rte_event_devices* array. - * - * @return - * - 0: Success, the device is properly initialised by the driver. - * In particular, the driver MUST have set up the *dev_ops* pointer - * of the *dev* structure. - * - <0: Error code of the device initialisation failure. - */ -typedef int (*eventdev_init_t)(struct rte_eventdev *dev); - -/** - * Finalisation function of a driver invoked for each matching - * PCI device detected during the PCI closing phase. - * - * @param dev - * The dev pointer is the address of the *rte_eventdev* structure associated - * with the matching device and which has been [automatically] allocated in - * the *rte_event_devices* array. - * - * @return - * - 0: Success, the device is properly finalised by the driver. - * In particular, the driver MUST free the *dev_ops* pointer - * of the *dev* structure. - * - <0: Error code of the device initialisation failure. - */ -typedef int (*eventdev_uninit_t)(struct rte_eventdev *dev); - -/** - * The structure associated with a PMD driver. - * - * Each driver acts as a PCI driver and is represented by a generic - * *event_driver* structure that holds: - * - * - An *rte_pci_driver* structure (which must be the first field). - * - * - The *eventdev_init* function invoked for each matching PCI device. - * - * - The size of the private data to allocate for each matching device. - */ -struct rte_eventdev_driver { - struct rte_pci_driver pci_drv; /**< The PMD is also a PCI driver. */ - unsigned int dev_private_size; /**< Size of device private data. */ - - eventdev_init_t eventdev_init; /**< Device init function. */ - eventdev_uninit_t eventdev_uninit; /**< Device uninit function. */ -}; - /** Global structure used for maintaining state of allocated event devices */ struct rte_eventdev_global { uint8_t nb_devs; /**< Number of devices found */ @@ -579,18 +525,23 @@ rte_event_pmd_vdev_init(const char *name, size_t dev_private_size, int rte_event_pmd_vdev_uninit(const char *name); +typedef int (*eventdev_pmd_pci_callback_t)(struct rte_eventdev *dev); + /** * Wrapper for use by pci drivers as a .probe function to attach to a event * interface. */ int rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv, - struct rte_pci_device *pci_dev); + struct rte_pci_device *pci_dev, + size_t private_data_size, + eventdev_pmd_pci_callback_t devinit); /** * Wrapper for use by pci drivers as a .remove function to detach a event * interface. */ -int rte_event_pmd_pci_remove(struct rte_pci_device *pci_dev); +int rte_event_pmd_pci_remove(struct rte_pci_device *pci_dev, + eventdev_pmd_pci_callback_t devuninit); #ifdef __cplusplus } -- 2.13.1