From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0078.outbound.protection.outlook.com [104.47.32.78]) by dpdk.org (Postfix) with ESMTP id EDD0B567C for ; Tue, 6 Jun 2017 16:11:12 +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=FcRdQmYSj5tXMTtT/C4eXyzR7E3ZYZE/O3oa05PQrgM=; b=WKJsMacUsP8GZWfAKfM+iJffd/z1K/u+sqMFH9wcs9XjGhgzM6oxE3KvvGKb1stvuh2U91vzKYNxZY0xwgXq1XTCyGDHAobuGheyoJ2advOwB0PvItIBbW3oBjjp0w1ENw+eh0RHekP5DFgP2tYzTXyxa1aovOnHT4+vXmipEj0= 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.domain.name (122.167.102.185) by BY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Tue, 6 Jun 2017 14:11:07 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: thomas@monjalon.net, bruce.richardson@intel.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, gage.eads@intel.com, nipun.gupta@nxp.com, Jerin Jacob , Gaetan Rivet Date: Tue, 6 Jun 2017 19:40:46 +0530 Message-Id: <20170606141046.32103-1-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170601164146.13501-1-jerin.jacob@caviumnetworks.com> References: <20170601164146.13501-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.167.102.185] X-ClientProxiedBy: MA1PR01CA0071.INDPRD01.PROD.OUTLOOK.COM (10.174.56.11) To BY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY1PR0701MB1724: X-MS-Office365-Filtering-Correlation-Id: e9df4b1a-d031-479c-164d-08d4ace5e217 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 3:JxpRTzGc42onaO5+gZMh/z2GqFIIU/W1brSWHgOiAvBuOpoi04BZAiWVNzlI1q8Np8JvnIeJVu7JC02HOhK4E4BNsQCKLd4BwN6Di+pimNcNdhyaF/fWUua/ccCoBJ08nFJ6AsPifl/4gzWjknvjmuXPcndT/5LcyLoCxZCyMFzq3UssyoGwNdgPDuzggEiE+7jkckHEQp0ZHebxIm1JagbLsrXDiLt8dfMzMSHlisc14aJHSlpVJguthzDxVmgY/U0aVLOA37nkrmOegB4l4gpyrBEIZ1J8miiVjrSmOp2w4GW4eHYoIp0Rl+nYzYtinyFBT1k64W+Wt1vuR80hhQ==; 25:bMPK8H1XupovbyEXxKpObWIy194TBdpwdqeAJ73JQ9rj0o2Xh2PE9GywHSy4zqbmFSlvSiGFYCPZiB7njCBkUNVBiQhwYgoFtMDl7uKzQpGQsGoqf9deZht+rZDTtkmYsBpR5MnhOXLLK3uGcwIPLIh88yAD+GJ75GNvjoHYxGnee/OI4xGyruPe6P281dCdbOYgWDQ1/ll7hSe3bHXPfSnkQrtNm+pcWHssOHp1I44NHK7/jL18x83kq0AGyXrbQKVmqCNI1uLYVw0fJ0TLbVV4hUmDpj5HREXFQveBIj+dNvtMceIObyzMxn/omT1LtmHfnuGXl5ll5Xo7lc++L6B2a3m0KrStBrW3GN2O8+UQ+It0pGolSx4QoBiunuihNPeKHIQMSy6iqraodLWWLlg8G6asGfTvAH11aINl9wccPa4j25K3YpGMoyVMoI82ml0QPoCcrSl+4vMFyKLDIf5aiRYCJiHFsj9QgBqXers= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 31:FGS7wu0j2Tp7hcG0J8JlOlHToG1V0xaGPK12EctA+gHHuNv+go3AhDLUb9eUAcfuiy05e7pE1ndHc+JC9dwT0cmJGPZxsO4kG3UOO06jv7E/ruyz+q3id8gStT0Nl6J/KHE60urQdwqcIF1F0QUek+agnnEioJ6tfefX4bkqAIec4ccl/wg8WWlF2k/xVBNWSd8Um3oUw0QNgRu3A2kRFx6q3SIaZ3q/oRNmSoP7eLY=; 20:X4qbZyUQ1GFtwbWjgqd/eXYvXqALwGKE9d/I+L7SNaSfW1R8fkiX9UjqQmoz1v7BE+oFalCJCqE0mmju4UP/FXyDP5vCgVWLgcu0ugcDWSmM7suiTSr/yNa1m2Tq0lhWejzfuALwqX+kmc2ZZ0IKjhoIEwvoZvEiiEn8Yst7L1C5AeaJeQ57yoHn0p+Wt8npqycieXrcciNDjAbyZ7mlRTLAVj7cC4V90PzJ8J58TFg39mtDjaoiH3vvxzXBn/WPQAtwmFKT8Sf7E8sx/IzkepOfNgrcgoq8DwtyjoG10Yh1YKeHDQ6IhQXD2NnZXWI2YEiUrs1xwyAnWVOamvx4Ns8Yv4EAnpfQWNzE4e8wtYtqKCQaKv29nqU+92cTntvEF2o2OxDR2sMVozLWLUwrUzdYAJHHcZ9rXLkKJWbHDtZfMnX/AspJB1IEhYsEC6YBOVQ2it3IjopuOUVwtGaMRKI94KtaCxZCa2TunLOsZMkDeIGhqMhSyHaPHKMCGnBqkqYwQzo8K+gHTNXerLOVne8/uoDFW8kFP39hxyJLqVQ+UuGwbvyVcVDg/8xEgyNumO6XexAi0a/TyzD4N2XTPidy5Yq1LflNKVzU+0l5MO4= 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)(100000703101)(100105400095)(10201501046)(93006095)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123555025)(20161123560025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY1PR0701MB1724; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1724; 4:t6Itk+cwwsoXbm1ptBBpwnUP2H1mmouCkWi9Vz9E?= =?us-ascii?Q?X8iAJpGhufQbJfY352kC1N01D5isRqrZSXYO4rtzGIEr7wD44fO3t3jHJBoS?= =?us-ascii?Q?hYYNOAAN5GegtPmerE2lO/L0ZOeO8bGMhYBy9/gMLUTDF6SKGf0Q1bfnx9N3?= =?us-ascii?Q?FOVsCLG44bdVAwRV67rvvzuISVezQ6NbosUgu4c4aBLR1ZdN0+L/IgdCiD8l?= =?us-ascii?Q?wZInpJt/nhm6h+iURm3ROUE74hfJkNtum1lUhJ7vp/8nrL3PtuF5JRmO8af5?= =?us-ascii?Q?eiCR9DhK6nFGGpTJD9/XGG3hywqNHdYZ3XPtZXPoG6PNsXeSg+5KV4pTlDiM?= =?us-ascii?Q?oPP0AxnnFDHVMCX3CepuxRQf7JYCUiXoruChmiPxFg1s2l5T4La/vEXil856?= =?us-ascii?Q?umiOsbIgtQq6peYbfQi4G/HqK4sYfN7gRd0wEeapj4gw9wLSxRqE9owzPp+/?= =?us-ascii?Q?5czhNp8N4VI0PXrZk0SEtTBLJwdPvsfFqXzU0PUPjxWYnVfwRqie8qN434Bd?= =?us-ascii?Q?2TuVedW0y7IWee0s6i4vY1eojUz0AKayXpDdnrbARmeCM4SFn5pUbT9u21Ou?= =?us-ascii?Q?7O4UCUQ6Qz1NFj5lmJlXKb7D9VHz3a0aIOkP9lE+7PXv03Q1tDMv+/Z5u4rU?= =?us-ascii?Q?HY5MGaes8MBMZyW1et4UXbFy73TR9vvjo0NodEyrT+uPCkBZOBzVCMAWA2dD?= =?us-ascii?Q?nEPjDBi83aFMIdA9nD6aUMBj/Zk+VhuCF7D3SfLk4ul3kEbLZHZDlC7Ls9Xt?= =?us-ascii?Q?fTxkudczWTt+/BgwKRg+OdqoPQmXVknW1+iPhwTeCTHMkhQqmaiiyKD0Bryl?= =?us-ascii?Q?c/eaXu/n4KC+LD0/8Gsnjcs262ubp2w0bf/F6MTIuzaFMd7Sbz4i12l1an2b?= =?us-ascii?Q?D9XFJ0np5GjiPvCwigWaG4cm0dYp2MGilKyG7MLFTLgI9+4PGO/e8vJuAwDZ?= =?us-ascii?Q?IwFMH0YaRBLZlZJq6ExdWFiR6dbQJEfaJBmXDa6s0N+taVeRK3uVCZgOND5W?= =?us-ascii?Q?txxPUKpgf7Yi9i09uKhFRmAi7ISAZky7Pz40aYq9aNy1mcoCb9Eu3jozzTHg?= =?us-ascii?Q?k3pI6psDP3KOT/zZvqRktAUSw3UGlJFQnE0B+rbT6dKxCNXAU7xJIenQ8vJS?= =?us-ascii?Q?Nft4wPqVC4M=3D?= X-Forefront-PRVS: 033054F29A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39850400002)(39400400002)(39410400002)(39840400002)(39450400003)(5890100001)(54906002)(110136004)(6666003)(6916009)(38730400002)(50986999)(42882006)(81166006)(66066001)(47776003)(76176999)(6506006)(305945005)(36756003)(50466002)(6486002)(53936002)(8656002)(4326008)(8676002)(2950100002)(25786009)(6512007)(5660300001)(5003940100001)(42186005)(53416004)(50226002)(189998001)(3846002)(6116002)(575784001)(2351001)(33646002)(72206003)(1076002)(2361001)(48376002)(2906002)(478600001)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1724; H:jerin.domain.name; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Di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h9Bw== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 5:SUunzfOVcx15sNDQ9wtbWATPSej216foFyfvw95HnZ5Ql3CvikrlNvrr6BuIVNX0IVuE0JagCER9wz0uXQpF4YUvVPD8xUHRCaZAqJMSAXgViQiAmGtmT+Ke9wTHX/g8nixGZxwRtupzIYKI2L9yYrZIIlIx1cItrANaARw/p9+1yTbuBm5+L5CdZYNGNP5TGKpWdtbm4HkzQGeFRuHcbYBB9jJAEDdVpzccrvGDfXjioPYgniGZfCeisBrOAJK1GlPmd1TqK7BDbIU9WljtkdiWZUqxQFiWg6g3RMqba/+Z5L6ZWKVeXdvQZBkd4yWNcgIjQtcLkeuZkg/qEzWoqqLp+WptiTdzI5bvpwycufFzGR/mJTdp8M42txB3y5DsMUJueQGcknabp0qsvyArXHwsjT/W4/grX3UF0dkztspaDoY4vM8xiuQCr4We07Sce1P1vRNZuZCaM9iED0EfGd3LTP61SteCmkFFyNd3K96wfqDdkRjJ6rq12UXgAkuC; 24:aZ7z3ydbzCGf3KzQm2g6h6FGUxfXHDEErp8dRR6ARgSHxMximcU6tiyC6UJADL3wobNJirt9lsMIwEC82EeLU/DKUfARjcV6NJzQ3m2Nfqc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 7:ttt0XevStc7NrOGukAzNEgGnoh6/sKmOAoxX6KdJIMgMvitWI+SWv5SktOQdgPh7YRjriJFY91VWdYjE580Is4bQUmknGPNkMKAahiSVDaEWIRhhh2Vu4pnJI2ocqSRxN3gWXXhH/jBF8Gx5VahLZoQkgbZuI0A9MKY3jZaUlJ9HqNFW/Blz882k69sPwipoP8dKfJTYBFnHAhvEeho9NCMGiM03q0lWccKk48/Ul/NM87JzatQxgu1RBEYjJYAa2I0UjAEdshDb53+b9VteuNRWLariX4RKNN2lJOWZ/FivcWXp5HF2S5nFqIP7MDnoulBuC4i7XvJljRX3oEErQw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2017 14:11:07.3296 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1724 Subject: [dpdk-dev] [PATCH v2] eventdev: remove PCI dependency 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: Tue, 06 Jun 2017 14:11:13 -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 --- v2: - Remove rte_pci.h from rte_eventdev.c(Gaetan) --- 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.0