From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0066.outbound.protection.outlook.com [104.47.32.66]) by dpdk.org (Postfix) with ESMTP id 9120B5A50 for ; Fri, 26 Aug 2016 15:58:28 +0200 (CEST) Received: from BN6PR03CA0032.namprd03.prod.outlook.com (10.175.124.18) by BY2PR0301MB0710.namprd03.prod.outlook.com (10.160.63.152) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.9; Fri, 26 Aug 2016 13:58:25 +0000 Received: from BY2FFO11FD008.protection.gbl (2a01:111:f400:7c0c::140) by BN6PR03CA0032.outlook.office365.com (2603:10b6:404:10c::18) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21 via Frontend Transport; Fri, 26 Aug 2016 13:58:23 +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;nxp.com; dkim=none (message not signed) header.d=none; 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 BY2FFO11FD008.mail.protection.outlook.com (10.1.14.159) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Fri, 26 Aug 2016 13:58:23 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u7QDvHpx023630; Fri, 26 Aug 2016 06:58:20 -0700 From: Shreyansh Jain To: CC: , , , , Shreyansh Jain Date: Fri, 26 Aug 2016 19:27:00 +0530 Message-ID: <1472219823-29486-23-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472219823-29486-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1472219823-29486-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131166935039441610; (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)(7916002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(586003)(305945005)(50226002)(104016004)(97736004)(2950100001)(11100500001)(356003)(7846002)(8936002)(81166006)(2351001)(5003940100001)(81156014)(8676002)(36756003)(77096005)(229853001)(50466002)(19580405001)(8666005)(106466001)(47776003)(626004)(189998001)(110136002)(92566002)(50986999)(2906002)(76176999)(575784001)(68736007)(86362001)(5890100001)(4326007)(33646002)(87936001)(105606002)(19580395003)(48376002)(5660300001)(85426001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB0710; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD008; 1:kH/em+wFIA9BqpwC6b5QFjqnf3FWx4MIie3l5DbRA3wmC3pP3ZJ304AESUNDMnOMLD4bC/WL+rhcEX73pwK/wKXsl/BktzPidw4Uhc9N4OSTnHluRNp+AHJi/RoDB73wnCn6o00FhsOaMquz4q/7X4lozr4TfTeftIrGmh4xfwKFij/iZTlHK/FsyreQIKL4bipH8+6DD0jEXfr1bGP7RXuHV3D7CoyqXpE2i8Li0XvmNHp9Xha0jzD/+Mg6RCeqida6Z0ahJWrtfduzlJCLoTb32QSv/TGHmPzcdOC4bOR6wzUmJoi8LYHtUYHWnZ8Ljvcax/eBw2O+ah/O7V35INjSew7GH/pYk5LC5S8nh/X5luP5lXG+UcJm0HhIZp1a7Q5ZF8FAK1INpG5TC/7mlJA06p45qFL6YzUGG3cKhk8R7Qlr1gBt5nkmAlyVpUJ+Loz7fZMdRMqvQSOG3KmW0Luv/FNsCkCJ/q+vg5C5vKDsMA9E/2NOpOJaf55FfltZrXUhvC5tWC0loWY560rfmChujc31I1QZrEpFCxPGXqQ+sZZBLUaMBy5PjlVE0wpZ08yn4Jct3O3ASY2PaSLdqZwlMj8/5+yLVgPgmkBwhrinT2Y2NddG+9eVIs5UjScZ8OF6tQXog9Ab9qKjYyg6ZSWewU+Gxq69CWycF/NKYHwiQvDahvQCQV9mevz1Ri8OUNipsdgaPOQZkzlvY55p9QEjzWKc8KpFDu+FU8ofVD0= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 3f7fb18d-748b-4f53-6fc2-08d3cdb90bb1 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0710; 2:5ezUN1tmu8V64e6vxDrP4jxHKITimtBJxpXMvgeRd4kw0ipXREkyPKTmSty9/Nd9jbbEW3QVKSZxVmkq4ukMZcfBY+ZB0aWGmKdbPgg6D3SHB5Bx26Ylq0FU7bfIAt6/ngzB4+gVaKlkNwQ5bBTIYEJVtyN5XpFPztYdNEW9q3oHuGsCtbj54low4HfWhJDw; 3:znmbfi5SkVZ+ae5qXxKrD7Bxb5D5BTzGNU+ZZPOtRCE3Jti3aUORtEpSG0ZOFcln8y6geT/ARLqqghFChyotzB+VAboQ7qUw2x8Y6Bnvbx4F2IG6TEX/Xk/Z2099rmOW0N0V5eXCDxH6DFXziBK53FoJorg4WL9DI3+CqW4imcAhKkVXR8wds1IR9dieckV3D/MFzh5uhYckQ3zq62BV8xYl9fUbSaopaPxF194vqL8=; 25:sZ6qUag3rJoixwaLgLCaJzGSTNdTdvrupGse2PuVDUa1OoOVQ7qUv8F7CxTlFajtv7MYc2vdHK1ZL9FmI8MH5LeAEcnObCSu69IPfzawb5Wx4M3buqy+Q/zVgr7dX2RpsmT7dmo5slOVYXO99jxxuD3jar60IcHGc43AcUwlvb7QFtfazWKHd8An9oEb//2eo7W0qmANI9an/FDt67s5RlnnGf9/Xa3dYhjsW/4QQhta5FP83BySJLj+VVvlx3XPaDVrBaRSfYRsg9goM6f44DE8EVqu3zuMIU6QmNDiVP5bN9clwiLhVp942eZPtkpPwLCCIzZpXBAuYgqA3Q3pNnly/HVyXH9ax1WaPDIbk4EKjx8uKP4HRPsR/A/RpC9SlkjK05D0NjQtk4+Si3355QsHciI+V9lZdKtUIhTxCro= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0710; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0710; 31:bMPfvvthVwsM2w7oyfKRnNTKVg7N26Ra5iBvxfbWhrSMZkWr+LmrsVXC/9SkNv9JdBBEngkh7JMSJxj8LtnYFGRK33EA+HqlV5iM5kWMjzu7QGwsbgnpFrAI/tamGyeNVKBOfnKi8xptS3XqGHScVw5iWKGmfIWtMwN82FpgrpitcTnnuvLhlvF3Mwx+CnO4YNAd1hDSr5RWsg9f4St70piN0LWI6SK03szt9ICnG5g=; 4:WK9BcqFNi2E4NIe7vBppZyiwD4h357iFfWul/sr0vfZ3aZNSmgka1+qmoS/LiCz9XfF7q6JXpXPqsBrnykhuq2re3xsuMQlZ6ksLJ2NtV1u6Br11gAj4DsdXlqTwwptpdSuUu8c5Sqo2bTSe3p1QTJfb3AcZjXEpMJq0r9NWotyEBYIwg63sIDrxCqBeTz8CsY3xPODw0oz1xbdQoRqexYU7UZoJQcFdzuCsNS3POXlLSGzZAheZup0eTpuMmctztqIVhhjrFzWws7e0kOoBGGWPK5eD8DzYqMit8vJWF9Wg71XgIKl05EhlHExba1khw+Y93sUcO9HNwPouLthrkr2t4FA2mSEVFNSv+7vIb+iW1xZgeVn81DheW3AQcv9haG5FhuPSaWhvoK7p4q9MZeVO1I1O92w14NiYVhjsbkBubomSBPkXcQak60u8qkF7AQYTvHmTaCatFo9gEH9Mr5hHwzwEadGKk1PLWy8eLvyK/yy7E5RM/g+vTaYz35kMfu7Dnj5Z/QkNwXz3EvF396FvjVxJ53IOoGI3ig65RIE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13015025)(13023025)(13024025)(13018025)(13017025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BY2PR0301MB0710; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB0710; X-Forefront-PRVS: 00462943DE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB0710; 23:6NSEeickgbuYJVwBxg8B6T+GmRQqmutq7xEvnr3?= =?us-ascii?Q?0L+WAVAkZkfm7ZedqQ/F/xxaJI3KPXsAtKfNSVnctbxrwTr6caKxgNujemHv?= =?us-ascii?Q?LzaUMdZ3pMr0nerHVchL9pswISpcMPLexdu26DC4nvRE+AaUsJY+igY731Av?= =?us-ascii?Q?9jwnNGPpkD9SEyT6FpaJGdBFTmCs1syd9ik+A5M4KC3wGP9UJ17fGnVQxec4?= =?us-ascii?Q?zejtSU/9RoZ78sq7vwhcNi1AalgDyUXD37O+zLmomsT8bcULots/VjFFaGN8?= =?us-ascii?Q?gUy0XinRHs/7Yjurt+6fbURyluhsX0kjv1xLtf0cLgR9j4UvT7iP/JHUWde0?= =?us-ascii?Q?lWJzC0gTvBpp3h0zNB5zSuy1Jt1noaRXASzPiR8TnSxEd1At1TsGPqnh2cxi?= =?us-ascii?Q?CAIxMpH4GUDdX3Zw1/sV2GLT4kQAobYJfQ5EBu4YdNf4mYgDwk0fEikc3mWi?= =?us-ascii?Q?XDdirkVuxp48c+0QahlTfCnwew+YrNUz3RV5Jn7YOEb1eG+7eQ+F4UHhb1JR?= =?us-ascii?Q?KShDoTaH7UkhapAwrEwqqhH4U7g25mhjCMajFSLn4/0AgTYtOKvBVT16+sB4?= =?us-ascii?Q?dyoAwC2Aoh3tm4CuKHIbxydjOtiLJ45bnc5hrHhseij5FZh/zjxe5GoAYn8l?= =?us-ascii?Q?sSstcb8azXLi1EcEcdJm6H5RYrhlMh08zu5FXluzo7OJ9VssvMed9wDdkY+m?= =?us-ascii?Q?aZhdH1W7+Ts0wWqFH7u0CmNuUIP9lKhmMQXWErw3Qh1Lb9uAWRik34we0GSd?= =?us-ascii?Q?ADq0MA+kMumA0jF2TU9oRQkBwL3ecF1DrR3moRpvcRzZDOVVeKGgQ6kdNt4V?= =?us-ascii?Q?vadR7j3p9R0ogLFiDh9UDgVWpgFrSyveEXQxlZveFtfIsOTOaqaVHAPGaMFh?= =?us-ascii?Q?QradrJH4UQWP+TMPAGVJtjIJMTM+uASf+HnyVKOg+ij07ANY/6WR+UaWbDQi?= =?us-ascii?Q?gpUvnUzV12tKNXSen9lgrWo6ZDqwo7BBY8fTBUGGLy2Eu70TEQR3OalnSbak?= =?us-ascii?Q?qzpkD3P7VKNhZHBhvJH3NbOEdr9YYbOqrU4aaYxJqUc3+HbRU4SRLpZmOdkp?= =?us-ascii?Q?kWZfT8gvJsug0oQN1+qdA4u8N772KVqjikXIUUrf/Njv4w1OS8QYbaOMgVIS?= =?us-ascii?Q?/iLuivD2+jWcig07xqyI58j3dNERqs/UbxYUPHdbSrfLq84+HUw/F2xc8yr8?= =?us-ascii?Q?J/56588lLxNI2EZYnqwAY7BnMadLf3Zc1QvLWK7+lyi8pZOW5P965vI104A?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB0710; 6:pXDEcozOX+bz4Lzgyuhy+OEWTFvKPGpZewduu7J60HwLCG6U+GkeFBcbJU1zPpxEFP5FL4EuDnF3zho+UKofcOze6KlkNcXrZwspvhEsHnikBw0HsdYPFGt55wQCcO3v9vDoZPz/7iqX7934dvsmvpWgJgdcM/NiGOx+B1aYBjYg4mtw1BTOCPIghtlmT8FZLR1LFdIxavR5zfCvkvTkjojxIAEe9X01y5UHeZ2FngQxtroOFiBTX8UBQ/1bJRT0OI0C82a+ijBJYoRAHmq6tFsUrV9SlL1lXSoVzWudkyU=; 5:HOtv4Evs4CAfqzFfPbWKNXrV1Z/qcLvLwXkYaUk2Gnsr9ttUezs9LC4K7oaJX6fvjFpeiWtVu/LLRyUlHa8Hknyrf2fj7c/L1dBS/Wh450LL61zeMeBGTLnywnCo1hIXP/dBgNwDeK5GcmBE5Sb6fGXGQhemW4Y5sJSZAsmfbcE=; 24:446dNgXtmvUHU1+G5L7q+gXUykAw3U3K+z4azS7oq4glb/NNeKiyfzp5JSjs1+PXgy7nASZeG5paWzjQ2dgz7fyUYjNzlpoxWFeD9zLJgoA=; 7:7ZJqGYL+f7kgtlvVNrzAo+uwcg8kCbOCUvdc/iddO6fpxW41eQMK7Ic+1VvKOYnzNXWSsiyh8FIPRnCd62oqy2svB5ziVa4jdWRvFbIqIa1CCOuKOCdQNf4w5AsTS/BuSAqfsCiU6QVyQcZbG8YbbOlO6yIOC3R+Tk1h3x7TwNQx0VZZXDWO28ZTZx/QtTSgWoEVvQJMzJPTMN4ttZQEJ1MOzTpHLEPOMkFnwx5NcWflNjaAcflJDpmTsKFFLNZJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2016 13:58:23.6165 (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: BY2PR0301MB0710 Subject: [dpdk-dev] [PATCH v8 22/25] eal/pci: inherit rte_driver by rte_pci_driver X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 13:58:29 -0000 Remove the 'name' member from rte_pci_driver and move to generic rte_driver. Most of the PMD drivers were initially using DRIVER_REGISTER_PCI(..) as well as assigning a name to eth_driver.pci_drv.name member. In this patch, only the original DRIVER_REGISTER_PCI(..) name has been populated into the rte_driver.name member - assignments through eth_driver has been removed. Signed-off-by: Jan Viktorin Signed-off-by: Shreyansh Jain --- app/test/test_pci.c | 10 +++++++--- app/test/virtual_pmd.c | 2 +- drivers/crypto/qat/qat_qp.c | 2 +- drivers/net/bnx2x/bnx2x_ethdev.c | 2 -- drivers/net/bnxt/bnxt_ethdev.c | 1 - drivers/net/cxgbe/cxgbe_ethdev.c | 1 - drivers/net/cxgbe/sge.c | 7 ++++--- drivers/net/e1000/em_ethdev.c | 1 - drivers/net/e1000/igb_ethdev.c | 2 -- drivers/net/ena/ena_ethdev.c | 1 - drivers/net/enic/enic_ethdev.c | 1 - drivers/net/fm10k/fm10k_ethdev.c | 1 - drivers/net/i40e/i40e_ethdev.c | 1 - drivers/net/i40e/i40e_ethdev_vf.c | 1 - drivers/net/i40e/i40e_fdir.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 2 -- drivers/net/mlx4/mlx4.c | 4 +++- drivers/net/mlx5/mlx5.c | 4 +++- drivers/net/nfp/nfp_net.c | 5 ++--- drivers/net/qede/qede_ethdev.c | 2 -- drivers/net/thunderx/nicvf_ethdev.c | 1 - drivers/net/virtio/virtio_ethdev.c | 3 +-- drivers/net/vmxnet3/vmxnet3_ethdev.c | 4 ++-- drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +- lib/librte_cryptodev/rte_cryptodev.c | 4 ++-- lib/librte_eal/common/eal_common_pci.c | 4 ++-- lib/librte_eal/common/include/rte_pci.h | 4 ++-- lib/librte_eal/linuxapp/eal/rte_eal_version.map | 3 +++ lib/librte_ether/rte_ethdev.c | 6 +++--- 29 files changed, 38 insertions(+), 45 deletions(-) diff --git a/app/test/test_pci.c b/app/test/test_pci.c index 69f78d9..ae597ab 100644 --- a/app/test/test_pci.c +++ b/app/test/test_pci.c @@ -78,14 +78,18 @@ struct rte_pci_id my_driver_id2[] = { }; struct rte_pci_driver my_driver = { - .name = "test_driver", + .driver = { + .name = "test_driver" + }, .devinit = my_driver_init, .id_table = my_driver_id, .drv_flags = 0, }; struct rte_pci_driver my_driver2 = { - .name = "test_driver2", + .driver = { + .name = "test_driver2" + }, .devinit = my_driver_init, .id_table = my_driver_id2, .drv_flags = 0, @@ -95,7 +99,7 @@ static int my_driver_init(__attribute__((unused)) struct rte_pci_driver *dr, struct rte_pci_device *dev) { - printf("My driver init called in %s\n", dr->name); + printf("My driver init called in %s\n", dr->driver.name); printf("%x:%x:%x.%d", dev->addr.domain, dev->addr.bus, dev->addr.devid, dev->addr.function); printf(" - vendor:%x device:%x\n", dev->id.vendor_id, dev->id.device_id); diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c index 8a1f0d0..56eeb99 100644 --- a/app/test/virtual_pmd.c +++ b/app/test/virtual_pmd.c @@ -586,7 +586,7 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, goto err; pci_dev->numa_node = socket_id; - pci_drv->name = virtual_ethdev_driver_name; + pci_drv->driver.name = virtual_ethdev_driver_name; pci_drv->id_table = id_table; if (isr_support) diff --git a/drivers/crypto/qat/qat_qp.c b/drivers/crypto/qat/qat_qp.c index 5de47e3..2e7188b 100644 --- a/drivers/crypto/qat/qat_qp.c +++ b/drivers/crypto/qat/qat_qp.c @@ -300,7 +300,7 @@ qat_queue_create(struct rte_cryptodev *dev, struct qat_queue *queue, * Allocate a memzone for the queue - create a unique name. */ snprintf(queue->memz_name, sizeof(queue->memz_name), "%s_%s_%d_%d_%d", - dev->driver->pci_drv.name, "qp_mem", dev->data->dev_id, + dev->driver->pci_drv.driver.name, "qp_mem", dev->data->dev_id, queue->hw_bundle_number, queue->hw_queue_number); qp_mz = queue_dma_zone_reserve(queue->memz_name, queue_size_bytes, socket_id); diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c index 214b655..847888e 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.c +++ b/drivers/net/bnx2x/bnx2x_ethdev.c @@ -618,7 +618,6 @@ eth_bnx2xvf_dev_init(struct rte_eth_dev *eth_dev) static struct eth_driver rte_bnx2x_pmd = { .pci_drv = { - .name = "rte_bnx2x_pmd", .id_table = pci_id_bnx2x_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, .devinit = rte_eth_dev_pci_probe, @@ -633,7 +632,6 @@ static struct eth_driver rte_bnx2x_pmd = { */ static struct eth_driver rte_bnx2xvf_pmd = { .pci_drv = { - .name = "rte_bnx2xvf_pmd", .id_table = pci_id_bnx2xvf_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 28eb8b9..d5ca9bf 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1045,7 +1045,6 @@ bnxt_dev_uninit(struct rte_eth_dev *eth_dev) { static struct eth_driver bnxt_rte_pmd = { .pci_drv = { - .name = "rte_" DRV_MODULE_NAME "_pmd", .id_table = bnxt_pci_id_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c index 431b06d..a37b124 100644 --- a/drivers/net/cxgbe/cxgbe_ethdev.c +++ b/drivers/net/cxgbe/cxgbe_ethdev.c @@ -1039,7 +1039,6 @@ out_free_adapter: static struct eth_driver rte_cxgbe_pmd = { .pci_drv = { - .name = "rte_cxgbe_pmd", .id_table = cxgb4_pci_tbl, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c index ab5a842..736f08c 100644 --- a/drivers/net/cxgbe/sge.c +++ b/drivers/net/cxgbe/sge.c @@ -1645,7 +1645,8 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq, iq->size = cxgbe_roundup(iq->size, 16); snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", - eth_dev->driver->pci_drv.name, fwevtq ? "fwq_ring" : "rx_ring", + eth_dev->driver->pci_drv.driver.name, + fwevtq ? "fwq_ring" : "rx_ring", eth_dev->data->port_id, queue_id); snprintf(z_name_sw, sizeof(z_name_sw), "%s_sw_ring", z_name); @@ -1697,7 +1698,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq, fl->size = cxgbe_roundup(fl->size, 8); snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", - eth_dev->driver->pci_drv.name, + eth_dev->driver->pci_drv.driver.name, fwevtq ? "fwq_ring" : "fl_ring", eth_dev->data->port_id, queue_id); snprintf(z_name_sw, sizeof(z_name_sw), "%s_sw_ring", z_name); @@ -1893,7 +1894,7 @@ int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq, nentries = txq->q.size + s->stat_len / sizeof(struct tx_desc); snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", - eth_dev->driver->pci_drv.name, "tx_ring", + eth_dev->driver->pci_drv.driver.name, "tx_ring", eth_dev->data->port_id, queue_id); snprintf(z_name_sw, sizeof(z_name_sw), "%s_sw_ring", z_name); diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 1281c8b..7f8fc21 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -391,7 +391,6 @@ eth_em_dev_uninit(struct rte_eth_dev *eth_dev) static struct eth_driver rte_em_pmd = { .pci_drv = { - .name = "rte_em_pmd", .id_table = pci_id_em_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_DETACHABLE, diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 395477e..811d9ae 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -1078,7 +1078,6 @@ eth_igbvf_dev_uninit(struct rte_eth_dev *eth_dev) static struct eth_driver rte_igb_pmd = { .pci_drv = { - .name = "rte_igb_pmd", .id_table = pci_id_igb_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_DETACHABLE, @@ -1095,7 +1094,6 @@ static struct eth_driver rte_igb_pmd = { */ static struct eth_driver rte_igbvf_pmd = { .pci_drv = { - .name = "rte_igbvf_pmd", .id_table = pci_id_igbvf_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index ee906d4..4d6e83f 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1686,7 +1686,6 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, static struct eth_driver rte_ena_pmd = { .pci_drv = { - .name = "rte_ena_pmd", .id_table = pci_id_ena_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 59812d0..c80b8f7 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -613,7 +613,6 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev *eth_dev) static struct eth_driver rte_enic_pmd = { .pci_drv = { - .name = "rte_enic_pmd", .id_table = pci_id_enic_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 26cdc10..11e4014 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -3055,7 +3055,6 @@ static const struct rte_pci_id pci_id_fm10k_map[] = { static struct eth_driver rte_pmd_fm10k = { .pci_drv = { - .name = "rte_pmd_fm10k", .id_table = pci_id_fm10k_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_DETACHABLE, diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index dacaaea..892a221 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -663,7 +663,6 @@ static const struct rte_i40e_xstats_name_off rte_i40e_txq_prio_strings[] = { static struct eth_driver rte_i40e_pmd = { .pci_drv = { - .name = "rte_i40e_pmd", .id_table = pci_id_i40e_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_DETACHABLE, diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 4a745f9..952bcd3 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1554,7 +1554,6 @@ i40evf_dev_uninit(struct rte_eth_dev *eth_dev) */ static struct eth_driver rte_i40evf_pmd = { .pci_drv = { - .name = "rte_i40evf_pmd", .id_table = pci_id_i40evf_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index f65c411..a4efc6d 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -251,7 +251,7 @@ i40e_fdir_setup(struct i40e_pf *pf) /* reserve memory for the fdir programming packet */ snprintf(z_name, sizeof(z_name), "%s_%s_%d", - eth_dev->driver->pci_drv.name, + eth_dev->driver->pci_drv.driver.name, I40E_FDIR_MZ_NAME, eth_dev->data->port_id); mz = i40e_memzone_reserve(z_name, I40E_FDIR_PKT_LEN, SOCKET_ID_ANY); diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index d2f46bc..65ec846 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -1562,7 +1562,6 @@ eth_ixgbevf_dev_uninit(struct rte_eth_dev *eth_dev) static struct eth_driver rte_ixgbe_pmd = { .pci_drv = { - .name = "rte_ixgbe_pmd", .id_table = pci_id_ixgbe_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_DETACHABLE, @@ -1579,7 +1578,6 @@ static struct eth_driver rte_ixgbe_pmd = { */ static struct eth_driver rte_ixgbevf_pmd = { .pci_drv = { - .name = "rte_ixgbevf_pmd", .id_table = pci_id_ixgbevf_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index b333ad6..3d2df9c 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -5911,7 +5911,9 @@ static const struct rte_pci_id mlx4_pci_id_map[] = { static struct eth_driver mlx4_driver = { .pci_drv = { - .name = MLX4_DRIVER_NAME, + .driver = { + .name = MLX4_DRIVER_NAME + }, .id_table = mlx4_pci_id_map, .devinit = mlx4_pci_devinit, .drv_flags = RTE_PCI_DRV_INTR_LSC, diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index ebad7cb..82c11f3 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -728,7 +728,9 @@ static const struct rte_pci_id mlx5_pci_id_map[] = { static struct eth_driver mlx5_driver = { .pci_drv = { - .name = MLX5_DRIVER_NAME, + .driver = { + .name = MLX5_DRIVER_NAME + }, .id_table = mlx5_pci_id_map, .devinit = mlx5_pci_devinit, .drv_flags = RTE_PCI_DRV_INTR_LSC, diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index cbaf219..764d58d 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -214,7 +214,7 @@ ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name, const struct rte_memzone *mz; snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", - dev->driver->pci_drv.name, + dev->driver->pci_drv.driver.name, ring_name, dev->data->port_id, queue_id); mz = rte_memzone_lookup(z_name); @@ -1000,7 +1000,7 @@ nfp_net_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); - dev_info->driver_name = dev->driver->pci_drv.name; + dev_info->driver_name = dev->driver->pci_drv.driver.name; dev_info->max_rx_queues = (uint16_t)hw->max_rx_queues; dev_info->max_tx_queues = (uint16_t)hw->max_tx_queues; dev_info->min_rx_bufsize = ETHER_MIN_MTU; @@ -2460,7 +2460,6 @@ static struct rte_pci_id pci_id_nfp_net_map[] = { static struct eth_driver rte_nfp_net_pmd = { .pci_drv = { - .name = "rte_nfp_net_pmd", .id_table = pci_id_nfp_net_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_DETACHABLE, diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index a92dd3b..2ef432f 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -1478,7 +1478,6 @@ static struct rte_pci_id pci_id_qede_map[] = { static struct eth_driver rte_qedevf_pmd = { .pci_drv = { - .name = "rte_qedevf_pmd", .id_table = pci_id_qedevf_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, @@ -1492,7 +1491,6 @@ static struct eth_driver rte_qedevf_pmd = { static struct eth_driver rte_qede_pmd = { .pci_drv = { - .name = "rte_qede_pmd", .id_table = pci_id_qede_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index ad7d607..783acbf 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -1759,7 +1759,6 @@ static const struct rte_pci_id pci_id_nicvf_map[] = { static struct eth_driver rte_nicvf_pmd = { .pci_drv = { - .name = "rte_nicvf_pmd", .id_table = pci_id_nicvf_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 5453709..7abacd3 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1304,7 +1304,6 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev) static struct eth_driver rte_virtio_pmd = { .pci_drv = { - .name = "rte_virtio_pmd", .id_table = pci_id_virtio_map, .drv_flags = RTE_PCI_DRV_DETACHABLE, .devinit = rte_eth_dev_pci_probe, @@ -1534,7 +1533,7 @@ virtio_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) struct virtio_hw *hw = dev->data->dev_private; if (dev->pci_dev) - dev_info->driver_name = dev->driver->pci_drv.name; + dev_info->driver_name = dev->driver->pci_drv.driver.name; else dev_info->driver_name = "virtio_user PMD"; dev_info->max_rx_queues = (uint16_t)hw->max_rx_queues; diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index d732979..857e59a 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -137,7 +137,8 @@ gpa_zone_reserve(struct rte_eth_dev *dev, uint32_t size, const struct rte_memzone *mz; snprintf(z_name, sizeof(z_name), "%s_%d_%s", - dev->driver->pci_drv.name, dev->data->port_id, post_string); + dev->driver->pci_drv.driver.name, + dev->data->port_id, post_string); mz = rte_memzone_lookup(z_name); if (mz) @@ -328,7 +329,6 @@ eth_vmxnet3_dev_uninit(struct rte_eth_dev *eth_dev) static struct eth_driver rte_vmxnet3_pmd = { .pci_drv = { - .name = "rte_vmxnet3_pmd", .id_table = pci_id_vmxnet3_map, .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_DETACHABLE, .devinit = rte_eth_dev_pci_probe, diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index 9deeb3f..e6d93f3 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -774,7 +774,7 @@ ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name, const struct rte_memzone *mz; snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", - dev->driver->pci_drv.name, ring_name, + dev->driver->pci_drv.driver.name, ring_name, dev->data->port_id, queue_id); mz = rte_memzone_lookup(z_name); diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index c81e366..2e17169 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -459,7 +459,7 @@ rte_cryptodev_pci_probe(struct rte_pci_driver *pci_drv, return 0; CDEV_LOG_ERR("driver %s: crypto_dev_init(vendor_id=0x%x device_id=0x%x)" - " failed", pci_drv->name, + " failed", pci_drv->driver.name, (unsigned) pci_dev->id.vendor_id, (unsigned) pci_dev->id.device_id); @@ -870,7 +870,7 @@ rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info) dev_info->pci_dev = dev->pci_dev; if (dev->driver) - dev_info->driver_name = dev->driver->pci_drv.name; + dev_info->driver_name = dev->driver->pci_drv.driver.name; } diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index da0038f..308c2a9 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -195,7 +195,7 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d } RTE_LOG(INFO, EAL, " probe driver: %x:%x %s\n", dev->id.vendor_id, - dev->id.device_id, dr->name); + dev->id.device_id, dr->driver.name); if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) { /* map resources for devices that use igb_uio */ @@ -255,7 +255,7 @@ rte_eal_pci_detach_dev(struct rte_pci_driver *dr, loc->function, dev->numa_node); RTE_LOG(DEBUG, EAL, " remove driver: %x:%x %s\n", dev->id.vendor_id, - dev->id.device_id, dr->name); + dev->id.device_id, dr->driver.name); if (dr->devuninit && (dr->devuninit(dev) < 0)) return -1; /* negative value is an error */ diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index 2b36727..60a5222 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -199,7 +199,7 @@ typedef int (pci_devuninit_t)(struct rte_pci_device *); */ struct rte_pci_driver { TAILQ_ENTRY(rte_pci_driver) next; /**< Next in list. */ - const char *name; /**< Driver name. */ + struct rte_driver driver; /**< Inherit core driver. */ pci_devinit_t *devinit; /**< Device init. function. */ pci_devuninit_t *devuninit; /**< Device uninit function. */ const struct rte_pci_id *id_table; /**< ID table, NULL terminated. */ @@ -493,7 +493,7 @@ void rte_eal_pci_register(struct rte_pci_driver *driver); RTE_INIT(pciinitfn_ ##nm); \ static void pciinitfn_ ##nm(void) \ { \ - (pci_drv).name = RTE_STR(nm);\ + (pci_drv).driver.name = RTE_STR(nm);\ rte_eal_pci_register(&pci_drv); \ }\ DRIVER_EXPORT_NAME(nm, __COUNTER__) diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map index c0bd391..b8bfd4b 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -172,4 +172,7 @@ DPDK_16.11 { rte_eal_dev_attach; rte_eal_dev_detach; + rte_eal_vdrv_register; + rte_eal_vdrv_unregister; + } DPDK_16.07; diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index cf38f32..d7179e1 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -276,7 +276,7 @@ rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv, return 0; RTE_PMD_DEBUG_TRACE("driver %s: eth_dev_init(vendor_id=0x%u device_id=0x%x) failed\n", - pci_drv->name, + pci_drv->driver.name, (unsigned) pci_dev->id.vendor_id, (unsigned) pci_dev->id.device_id); if (rte_eal_process_type() == RTE_PROC_PRIMARY) @@ -2566,7 +2566,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name, const struct rte_memzone *mz; snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d", - dev->driver->pci_drv.name, ring_name, + dev->driver->pci_drv.driver.name, ring_name, dev->data->port_id, queue_id); mz = rte_memzone_lookup(z_name); @@ -3208,7 +3208,7 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_de eth_dev->data->kdrv = pci_dev->kdrv; eth_dev->data->numa_node = pci_dev->numa_node; - eth_dev->data->drv_name = pci_dev->driver->name; + eth_dev->data->drv_name = pci_dev->driver->driver.name; } int -- 2.7.4