From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0053.outbound.protection.outlook.com [104.47.36.53]) by dpdk.org (Postfix) with ESMTP id 616D87F00 for ; Fri, 16 Sep 2016 06:32:58 +0200 (CEST) Received: from DM5PR03CA0006.namprd03.prod.outlook.com (10.175.104.16) by BY2PR0301MB2005.namprd03.prod.outlook.com (10.163.196.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.619.10; Fri, 16 Sep 2016 04:32:56 +0000 Received: from BN1AFFO11FD036.protection.gbl (2a01:111:f400:7c10::103) by DM5PR03CA0006.outlook.office365.com (2603:10b6:3:118::16) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.629.8 via Frontend Transport; Fri, 16 Sep 2016 04:32:57 +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 BN1AFFO11FD036.mail.protection.outlook.com (10.58.52.240) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.619.6 via Frontend Transport; Fri, 16 Sep 2016 04:32:56 +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 u8G4Trg0029256; Thu, 15 Sep 2016 21:32:53 -0700 From: Shreyansh Jain To: CC: , David Marchand , , Thomas Monjalon , Shreyansh Jain Date: Fri, 16 Sep 2016 09:59:53 +0530 Message-ID: <1474000200-16705-19-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1474000200-16705-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131184739763817202; (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)(1109001)(1110001)(339900001)(189002)(199003)(189998001)(2351001)(104016004)(586003)(81156014)(19580395003)(87936001)(5003940100001)(50466002)(50226002)(5660300001)(86362001)(92566002)(85426001)(19580405001)(110136003)(575784001)(48376002)(8676002)(8936002)(81166006)(77096005)(2950100001)(626004)(229853001)(97736004)(8666005)(106466001)(36756003)(50986999)(76176999)(33646002)(105606002)(7846002)(5890100001)(305945005)(2906002)(4326007)(47776003)(356003)(68736007)(7059030)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB2005; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD036; 1:HmUCIvUSuLLLfHdUDIIVZIV1/WYeOvM2SMTpN70AF9g1/lrVAjJ3oI3LIGT1oFDU/0IGIUKeAKogq5uIMdPcpnsOc6SETewIzjkhcRc/ZUXaGTRyP2LzbDHqRlYp8pI1klzi+milwTYL85lZvd/sWdJMwCV9Bi93ld9VqsodVN9bnKVYLBhokKdgmz7NQC2I1/+KAfE5OnXNqcRPeJT3vvIdKsFoKR4YgjID+zo4aEWYjtnaOSmdmetUqR2u+JppklZSGHvj0vS8ot4J5o/54ZbNUZHwIUQKwkpEVfK9RYjtPc8adCxjD0PgoKTsRCPfph4uK0RrUWIq5sdepDDMoJSwJ5TalMEJOJ4+ymUO44JiaOIlaGYUjbOe/tuDff9GG6Sak9JUUbQJzZWv2PElHQEhoQ1RWoZ+miUjvsQm3Ub3z8Svf01ukPItWp+m+OpwpdeKQETJGCu1HNJkhd7JigOhQafUSMXZN0AGF8baHF0fbkYYgBx8k0P4J41p59UTENMZV+kYk1NXjyv/AXrrJMl5xST3QSU3RmiauADrGP1gdJhjwW6gBMddimz730qbIhx927xni1/TRSQJJcQIhFuwq9fDRJLasYpEehP0b8BwFzGRoo1mwaeHe3Cl3I377rjOBwZCG7/zyoBm7IBlDTYUU7IYDOsggvjbBgmL8gIPRKEQwqqmy3+qJATZkQ3AbaxTLN6MYa7/c0LzZyPmnvXFUrnjbleKtPmt+VYZBwE= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 75d170a4-bc9a-432a-a991-08d3ddea8807 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2005; 2:Kss5puyjrmHsZCZSHBq0NWc/w65Mx7Qapn9AXltqpOGQte26YYBH9Pmr/ItS6KoXUmC9nInBRH482MYNZx5rGic+sM/uDsM7ArbH4Pte36Xuiq0ilQxxTwHNPaVd9YMXFH6iN9n1KACbvYcVytgCxRJszGV0vHCMf7PzWVj/eFoTTsIgdY2lbduP1ACIfbWA; 3:tl5R4bNH3E1ev5g3v44Emu1X4Cdp0t1aU5IzcUg4Wls5mbL45mljMpicqo/+itgLgfWSfGnsW+KQLQDGrh75TJT3Kh+glkGi00WJaN+FwmHZAY/F0JV9GpW2pOD6lwkLKDXyvE0Ta0ZYnA4IrYvrb/RRMwgtqAVdc32QvyeZeXvsSlFBDSWXkhL4j9sJU+k6qWhddve1mVvX0D1udkYj7FG0vdLaB8dUkkqbC4xEZkI= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB2005; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2005; 25:Bfg390TYSrVGdK99ETaFoEhDH8CxrMCvyr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DiYUFu1GTuldWLOxuK/cmufyWzC3Se0Xsdx87FnfLG5cEy6V762k9PVPJs4/rh9uiv61dZXTEorsXkUziFi9vf1CbK4a59NgjLnnVpMkqKQ9UJKKpamces5tIUOAOnHF4HckDRE4bmHaAM7bqEVHHz+ieOz6ACPDqt491OTyOIgZrHF2psxxejV0Pr0fG8gy9pCeHB7IrN7xAIatQsp5qkpCPb9Cm/Dxahwk5EkTO7kDVjR1zm3yCo+dF/8aXgdZTkjlfEaiFNg6dt9uxDF8TgrHocwYHZq6a9othazAUoSWxWTRIgSvFQ8Q1rSl4dihMOTIRYV8ASLzCBFJCkQmdOKHbv3Nnw9PDJBhZHad7dp/hw9VMf1C23Roy8xMnfJTxUt8HS5erVN8aqNVzA3fQ8r2wCBXSfKUG3A7arwe7tt/HcT5e1UW62ZKvO+sjKhGmrdNSphEby60tpspMjP2byDdfM54JmBDbKsJTyRsHTEOPCsiNyU8OGxCXp6U= 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)(13017025)(5005006)(8121501046)(13015025)(13024025)(13023025)(13018025)(10201501046)(3002001)(6055026); SRVR:BY2PR0301MB2005; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB2005; X-Forefront-PRVS: 0067A8BA2A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB2005; 23:NBC7fBPzb6UmFJoVPUD1Cj7fy12YNRW7MDaKAMu?= =?us-ascii?Q?ywigmNUJ1xxp4Bhm7JED31612+3QM6NvI21wCrFeH06Hp/zmLh1/xVJw91rz?= =?us-ascii?Q?rSpAMiLgd5ecrrmkx1ArT53gXix4S6mIhaae4mY4MStUDggLInrOBxUbdk5e?= =?us-ascii?Q?DxvUY2fZBajzq8xFEnLM9zb8Xzr+p+LOOMBM0jRekK3GBZhwtCttCrRwVlNQ?= =?us-ascii?Q?2ydr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krwWfbV?= =?us-ascii?Q?DKifujbTroQcp06AgzsU6Vz1f3sAI5iJH9zNsIeZ8h1Jmamkm1sAWAz8S5jy?= =?us-ascii?Q?2p9mt4mps2V7iLTSqHnfcu9c2TeFmc8qzIBlZb66RYL+g62Txo9XWTw89IA?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2005; 6:oeDSqjODDzl5c7TWJvmuqr4xojgh53xO+M5/hsK13+F4flGQs98er4+rjyuVm1uWQGbuLH4rylGdfNeQMGgOlI79nPPJH1WRHOKo7B4kPs5Go/fFI+MqqR7rlM8/ubCPI8iP8FbtMel07wpSScG2ylLjSjtSwEZVmc3HmSTI/jJIE5i+1PcOXj2Cdz5QP2uPAgQaOhBl+a24DPLECQVecqeK4bgSXdURegH80szAe0QPFzCoRUzXIMOfS2zp/bIuuNBdbILts/WTqvFx7ld+tiP23IE9dkOdv2JkKfYUDSg=; 5:PZto1qBn615v+jNirSDZSaYqASc4CsnhjKAe7RYRLn4saf6YgX1q00WX4DAygEv/BGjChM0Fz1d2Bvdv6obCWIcEYNY+OtSeKhIS2bx0QKdhZq28QGWSNxgr+ENZV+gbbio146vq7qXWthsWsKCXTfzZrfU1e96kGviyZa5o9RE=; 24:vWN6FOd44SUAi75GyhESqXc6uz2P/aEzYUJ1Iso4pJeBQXL6ofKTh4PaPxVzPSmvpRX+J23H/1bYoESR0DNVI6UYAPp+Uapoml7LO9P6MMQ=; 7:4l6PfIgixxA+UoHe6hbglT5z2+uPnUih0wb781HhzqS63JuiFjfQAytFJ0dDQJ15kOaltTDKnEkcEp9Oe9PlFjsu9JynGxW6AUjQJjrn+zVLmcGSDVKzBmThb07N74869/ScsUarD+3AdpDH7+jWRcVGvT6/HwD/y7hAeVWMULb1P9MdigtcM0JlgI2h+k+kL+x074sECUfDq3fMG4vQ4n9sSIhUc0kir25bObeeqzyXibpHzMLCD08iK5+WhaBJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2016 04:32:56.1789 (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: BY2PR0301MB2005 Subject: [dpdk-dev] [PATCH v10 18/25] drivers: convert VDRV to use RTE VDEV 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, 16 Sep 2016 04:32:59 -0000 From: Jan Viktorin All PMD_VDEV drivers can now use rte_vdev_driver instead of the rte_driver (which is embedded in the rte_vdev_driver). Signed-off-by: Jan Viktorin Signed-off-by: Shreyansh Jain --- drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 10 ++++++---- drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 10 ++++++---- drivers/crypto/kasumi/rte_kasumi_pmd.c | 10 ++++++---- drivers/crypto/null/null_crypto_pmd.c | 10 ++++++---- drivers/crypto/snow3g/rte_snow3g_pmd.c | 10 ++++++---- drivers/net/af_packet/rte_eth_af_packet.c | 12 +++++++----- drivers/net/bonding/rte_eth_bond_pmd.c | 12 +++++++----- drivers/net/mpipe/mpipe_tilegx.c | 22 +++++++++++++--------- drivers/net/null/rte_eth_null.c | 12 +++++++----- drivers/net/pcap/rte_eth_pcap.c | 12 +++++++----- drivers/net/ring/rte_eth_ring.c | 12 +++++++----- drivers/net/vhost/rte_eth_vhost.c | 12 +++++++----- drivers/net/virtio/virtio_user_ethdev.c | 11 +++++++---- drivers/net/xenvirt/rte_eth_xenvirt.c | 12 +++++++----- lib/librte_eal/common/eal_common_vdev.c | 4 ++-- lib/librte_eal/common/include/rte_dev.h | 12 ------------ lib/librte_eal/common/include/rte_vdev.h | 12 ++++++++++++ 17 files changed, 113 insertions(+), 82 deletions(-) diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c index dc0b033..c93ebfe 100644 --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include @@ -514,13 +514,15 @@ aesni_gcm_uninit(const char *name) return 0; } -static struct rte_driver aesni_gcm_pmd_drv = { - .type = PMD_VDEV, +static struct rte_vdev_driver aesni_gcm_pmd_drv = { + .driver = { + .type = PMD_VDEV, + }, .init = aesni_gcm_init, .uninit = aesni_gcm_uninit }; -PMD_REGISTER_DRIVER(aesni_gcm_pmd_drv, CRYPTODEV_NAME_AESNI_GCM_PMD); +DRIVER_REGISTER_VDEV(CRYPTODEV_NAME_AESNI_GCM_PMD, aesni_gcm_pmd_drv); DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_GCM_PMD, "max_nb_queue_pairs= " "max_nb_sessions= " diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index b2d0c8c..30c0706 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include @@ -714,13 +714,15 @@ cryptodev_aesni_mb_uninit(const char *name) return 0; } -static struct rte_driver cryptodev_aesni_mb_pmd_drv = { - .type = PMD_VDEV, +static struct rte_vdev_driver cryptodev_aesni_mb_pmd_drv = { + .driver = { + .type = PMD_VDEV, + }, .init = cryptodev_aesni_mb_init, .uninit = cryptodev_aesni_mb_uninit }; -PMD_REGISTER_DRIVER(cryptodev_aesni_mb_pmd_drv, CRYPTODEV_NAME_AESNI_MB_PMD); +DRIVER_REGISTER_VDEV(CRYPTODEV_NAME_AESNI_MB_PMD, cryptodev_aesni_mb_pmd_drv); DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_MB_PMD, "max_nb_queue_pairs= " "max_nb_sessions= " diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c index 4e21743..ba2829d 100644 --- a/drivers/crypto/kasumi/rte_kasumi_pmd.c +++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include @@ -650,13 +650,15 @@ cryptodev_kasumi_uninit(const char *name) return 0; } -static struct rte_driver cryptodev_kasumi_pmd_drv = { - .type = PMD_VDEV, +static struct rte_vdev_driver cryptodev_kasumi_pmd_drv = { + .driver = { + .type = PMD_VDEV, + }, .init = cryptodev_kasumi_init, .uninit = cryptodev_kasumi_uninit }; -PMD_REGISTER_DRIVER(cryptodev_kasumi_pmd_drv, CRYPTODEV_NAME_KASUMI_PMD); +DRIVER_REGISTER_VDEV(CRYPTODEV_NAME_KASUMI_PMD, cryptodev_kasumi_pmd_drv); DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_KASUMI_PMD, "max_nb_queue_pairs= " "max_nb_sessions= " diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c index 909b04f..4c12faa 100644 --- a/drivers/crypto/null/null_crypto_pmd.c +++ b/drivers/crypto/null/null_crypto_pmd.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include "null_crypto_pmd_private.h" @@ -268,13 +268,15 @@ cryptodev_null_uninit(const char *name) return 0; } -static struct rte_driver cryptodev_null_pmd_drv = { - .type = PMD_VDEV, +static struct rte_vdev_driver cryptodev_null_pmd_drv = { + .driver = { + .type = PMD_VDEV, + }, .init = cryptodev_null_init, .uninit = cryptodev_null_uninit }; -PMD_REGISTER_DRIVER(cryptodev_null_pmd_drv, CRYPTODEV_NAME_NULL_PMD); +DRIVER_REGISTER_VDEV(CRYPTODEV_NAME_NULL_PMD, cryptodev_null_pmd_drv); DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_NULL_PMD, "max_nb_queue_pairs= " "max_nb_sessions= " diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c index 87cd070..10c6b83 100644 --- a/drivers/crypto/snow3g/rte_snow3g_pmd.c +++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include @@ -638,13 +638,15 @@ cryptodev_snow3g_uninit(const char *name) return 0; } -static struct rte_driver cryptodev_snow3g_pmd_drv = { - .type = PMD_VDEV, +static struct rte_vdev_driver cryptodev_snow3g_pmd_drv = { + .driver = { + .type = PMD_VDEV, + }, .init = cryptodev_snow3g_init, .uninit = cryptodev_snow3g_uninit }; -PMD_REGISTER_DRIVER(cryptodev_snow3g_pmd_drv, CRYPTODEV_NAME_SNOW3G_PMD); +DRIVER_REGISTER_VDEV(CRYPTODEV_NAME_SNOW3G_PMD, cryptodev_snow3g_pmd_drv); DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_SNOW3G_PMD, "max_nb_queue_pairs= " "max_nb_sessions= " diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index d629ee3..9a9a2ee 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include @@ -889,13 +889,15 @@ rte_pmd_af_packet_devuninit(const char *name) return 0; } -static struct rte_driver pmd_af_packet_drv = { - .type = PMD_VDEV, +static struct rte_vdev_driver pmd_af_packet_drv = { + .driver = { + .type = PMD_VDEV, + }, .init = rte_pmd_af_packet_devinit, - .uninit = rte_pmd_af_packet_devuninit, + .uninit = rte_pmd_af_packet_devuninit }; -PMD_REGISTER_DRIVER(pmd_af_packet_drv, eth_af_packet); +DRIVER_REGISTER_VDEV(eth_af_packet, pmd_af_packet_drv); DRIVER_REGISTER_PARAM_STRING(eth_af_packet, "iface= " "qpairs= " diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index b20a272..5fa2a93 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include @@ -2508,13 +2508,15 @@ bond_ethdev_configure(struct rte_eth_dev *dev) return 0; } -static struct rte_driver bond_drv = { - .type = PMD_VDEV, +static struct rte_vdev_driver bond_drv = { + .driver = { + .type = PMD_VDEV, + }, .init = bond_init, - .uninit = bond_uninit, + .uninit = bond_uninit }; -PMD_REGISTER_DRIVER(bond_drv, eth_bond); +DRIVER_REGISTER_VDEV(eth_bond, bond_drv); DRIVER_REGISTER_PARAM_STRING(eth_bond, "slave= " diff --git a/drivers/net/mpipe/mpipe_tilegx.c b/drivers/net/mpipe/mpipe_tilegx.c index c0d0e3b..efb000b 100644 --- a/drivers/net/mpipe/mpipe_tilegx.c +++ b/drivers/net/mpipe/mpipe_tilegx.c @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include #include @@ -1623,18 +1623,22 @@ rte_pmd_mpipe_devinit(const char *ifname, return 0; } -static struct rte_driver pmd_mpipe_xgbe_drv = { - .type = PMD_VDEV, - .init = rte_pmd_mpipe_devinit, +static struct rte_vdev_driver pmd_mpipe_xgbe_drv = { + .driver = { + .type = PMD_VDEV, + }, + .init = rte_pmd_mpipe_devinit }; -static struct rte_driver pmd_mpipe_gbe_drv = { - .type = PMD_VDEV, - .init = rte_pmd_mpipe_devinit, +static struct rte_vdev_driver pmd_mpipe_gbe_drv = { + .driver = { + .type = PMD_VDEV, + }, + .init = rte_pmd_mpipe_devinit }; -PMD_REGISTER_DRIVER(pmd_mpipe_xgbe_drv, xgbe); -PMD_REGISTER_DRIVER(pmd_mpipe_gbe_drv, gbe); +DRIVER_REGISTER_VDEV(xgbe, pmd_mpipe_xgbe_drv); +DRIVER_REGISTER_VDEV(gbe, pmd_mpipe_gbe_drv); static void __attribute__((constructor, used)) mpipe_init_contexts(void) diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index ce49945..be4169e 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include @@ -686,13 +686,15 @@ rte_pmd_null_devuninit(const char *name) return 0; } -static struct rte_driver pmd_null_drv = { - .type = PMD_VDEV, +static struct rte_vdev_driver pmd_null_drv = { + .driver = { + .type = PMD_VDEV, + }, .init = rte_pmd_null_devinit, - .uninit = rte_pmd_null_devuninit, + .uninit = rte_pmd_null_devuninit }; -PMD_REGISTER_DRIVER(pmd_null_drv, eth_null); +DRIVER_REGISTER_VDEV(eth_null, pmd_null_drv); DRIVER_REGISTER_PARAM_STRING(eth_null, "size= " "copy="); diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index 7fbc60e..d6718b8 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include @@ -1083,13 +1083,15 @@ rte_pmd_pcap_devuninit(const char *name) return 0; } -static struct rte_driver pmd_pcap_drv = { - .type = PMD_VDEV, +static struct rte_vdev_driver pmd_pcap_drv = { + .driver = { + .type = PMD_VDEV, + }, .init = rte_pmd_pcap_devinit, - .uninit = rte_pmd_pcap_devuninit, + .uninit = rte_pmd_pcap_devuninit }; -PMD_REGISTER_DRIVER(pmd_pcap_drv, eth_pcap); +DRIVER_REGISTER_VDEV(eth_pcap, pmd_pcap_drv); DRIVER_REGISTER_PARAM_STRING(eth_pcap, "rx_pcap= " "tx_pcap= " diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 5690dcd..77bd664 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include @@ -623,12 +623,14 @@ rte_pmd_ring_devuninit(const char *name) return 0; } -static struct rte_driver pmd_ring_drv = { - .type = PMD_VDEV, +static struct rte_vdev_driver pmd_ring_drv = { + .driver = { + .type = PMD_VDEV, + }, .init = rte_pmd_ring_devinit, - .uninit = rte_pmd_ring_devuninit, + .uninit = rte_pmd_ring_devuninit }; -PMD_REGISTER_DRIVER(pmd_ring_drv, eth_ring); +DRIVER_REGISTER_VDEV(eth_ring, pmd_ring_drv); DRIVER_REGISTER_PARAM_STRING(eth_ring, "nodeaction=[attach|detach]"); diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index 2bb761b..e2610b4 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include #include @@ -924,13 +924,15 @@ rte_pmd_vhost_devuninit(const char *name) return 0; } -static struct rte_driver pmd_vhost_drv = { - .type = PMD_VDEV, +static struct rte_vdev_driver pmd_vhost_drv = { + .driver = { + .type = PMD_VDEV, + }, .init = rte_pmd_vhost_devinit, - .uninit = rte_pmd_vhost_devuninit, + .uninit = rte_pmd_vhost_devuninit }; -PMD_REGISTER_DRIVER(pmd_vhost_drv, eth_vhost); +DRIVER_REGISTER_VDEV(eth_vhost, pmd_vhost_drv); DRIVER_REGISTER_PARAM_STRING(eth_vhost, "iface= " "queues="); diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index aadfdc0..7975298 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -37,6 +37,7 @@ #include #include +#include #include "virtio_ethdev.h" #include "virtio_logs.h" @@ -461,13 +462,15 @@ virtio_user_pmd_devuninit(const char *name) return 0; } -static struct rte_driver virtio_user_driver = { - .type = PMD_VDEV, +static struct rte_vdev_driver virtio_user_driver = { + .driver = { + .type = PMD_VDEV, + }, .init = virtio_user_pmd_devinit, - .uninit = virtio_user_pmd_devuninit, + .uninit = virtio_user_pmd_devuninit }; -PMD_REGISTER_DRIVER(virtio_user_driver, virtio_user); +DRIVER_REGISTER_VDEV(virtio_user, virtio_user_driver); DRIVER_REGISTER_PARAM_STRING(virtio_user, "path= " "mac= " diff --git a/drivers/net/xenvirt/rte_eth_xenvirt.c b/drivers/net/xenvirt/rte_eth_xenvirt.c index 6b15381..7da0f17 100644 --- a/drivers/net/xenvirt/rte_eth_xenvirt.c +++ b/drivers/net/xenvirt/rte_eth_xenvirt.c @@ -56,7 +56,7 @@ #include #include #include -#include +#include #include #include @@ -759,12 +759,14 @@ rte_pmd_xenvirt_devuninit(const char *name) return 0; } -static struct rte_driver pmd_xenvirt_drv = { - .type = PMD_VDEV, +static struct rte_vdev_driver pmd_xenvirt_drv = { + .driver = { + .type = PMD_VDEV, + }, .init = rte_pmd_xenvirt_devinit, - .uninit = rte_pmd_xenvirt_devuninit, + .uninit = rte_pmd_xenvirt_devuninit }; -PMD_REGISTER_DRIVER(pmd_xenvirt_drv, eth_xenvirt); +DRIVER_REGISTER_VDEV(eth_xenvirt, pmd_xenvirt_drv); DRIVER_REGISTER_PARAM_STRING(eth_xenvirt, "mac="); diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c index 67cb397..1a4dec6 100644 --- a/lib/librte_eal/common/eal_common_vdev.c +++ b/lib/librte_eal/common/eal_common_vdev.c @@ -74,7 +74,7 @@ rte_eal_vdev_init(const char *name, const char *args) */ if (!strncmp(driver->driver.name, name, strlen(driver->driver.name))) - return driver->driver.init(name, args); + return driver->init(name, args); } RTE_LOG(ERR, EAL, "no driver found for %s\n", name); @@ -98,7 +98,7 @@ rte_eal_vdev_uninit(const char *name) */ if (!strncmp(driver->driver.name, name, strlen(driver->driver.name))) - return driver->driver.uninit(name); + return driver->uninit(name); } RTE_LOG(ERR, EAL, "no driver found for %s\n", name); diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h index 6cc9b01..8796f97 100644 --- a/lib/librte_eal/common/include/rte_dev.h +++ b/lib/librte_eal/common/include/rte_dev.h @@ -105,16 +105,6 @@ rte_pmd_debug_trace(const char *func_name, const char *fmt, ...) TAILQ_HEAD(rte_driver_list, rte_driver); /** - * Initialization function called for each device driver once. - */ -typedef int (rte_dev_init_t)(const char *name, const char *args); - -/** - * Uninitilization function called for each device driver once. - */ -typedef int (rte_dev_uninit_t)(const char *name); - -/** * Driver type enumeration */ enum pmd_type { @@ -129,8 +119,6 @@ struct rte_driver { TAILQ_ENTRY(rte_driver) next; /**< Next in list. */ enum pmd_type type; /**< PMD Driver type */ const char *name; /**< Driver name. */ - rte_dev_init_t *init; /**< Device init. function. */ - rte_dev_uninit_t *uninit; /**< Device uninit. function. */ }; /** diff --git a/lib/librte_eal/common/include/rte_vdev.h b/lib/librte_eal/common/include/rte_vdev.h index 9c5cc54..1e6b338 100644 --- a/lib/librte_eal/common/include/rte_vdev.h +++ b/lib/librte_eal/common/include/rte_vdev.h @@ -44,11 +44,23 @@ extern "C" { TAILQ_HEAD(vdev_driver_list, rte_vdev_driver); /** + * Initialization function called for each virtual device driver once. + */ +typedef int (rte_vdev_init_t)(const char *name, const char *args); + +/** + * Uninitilization function called for each virtual device driver once. + */ +typedef int (rte_vdev_uninit_t)(const char *name); + +/** * A virtual device driver abstraction. */ struct rte_vdev_driver { TAILQ_ENTRY(rte_vdev_driver) next; /**< Next in list. */ struct rte_driver driver; /**< Inherited general driver. */ + rte_vdev_init_t *init; /**< Virtual device init. function. */ + rte_vdev_uninit_t *uninit; /**< Virtual device uninit. function. */ }; /** -- 2.7.4