From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0072.outbound.protection.outlook.com [104.47.41.72]) by dpdk.org (Postfix) with ESMTP id 77F428E7E for ; Tue, 20 Sep 2016 14:42:56 +0200 (CEST) Received: from BN6PR03CA0072.namprd03.prod.outlook.com (10.173.137.34) by BLUPR0301MB2004.namprd03.prod.outlook.com (10.164.22.18) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.629.8; Tue, 20 Sep 2016 12:42:55 +0000 Received: from BN1BFFO11FD001.protection.gbl (2a01:111:f400:7c10::1:183) by BN6PR03CA0072.outlook.office365.com (2603:10b6:404:4c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.619.10 via Frontend Transport; Tue, 20 Sep 2016 12:42:54 +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 BN1BFFO11FD001.mail.protection.outlook.com (10.58.144.64) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.629.5 via Frontend Transport; Tue, 20 Sep 2016 12:42:54 +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 u8KCexsj006559; Tue, 20 Sep 2016 05:42:51 -0700 From: Shreyansh Jain To: CC: , David Marchand , , Thomas Monjalon , Shreyansh Jain Date: Tue, 20 Sep 2016 18:11:29 +0530 Message-ID: <1474375296-26078-18-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474375296-26078-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1474375296-26078-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131188489750330465; (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)(87936001)(4326007)(47776003)(50466002)(68736007)(2950100001)(105606002)(106466001)(5660300001)(11100500001)(189998001)(110136003)(626004)(2351001)(229853001)(76176999)(48376002)(50986999)(586003)(97736004)(356003)(36756003)(81156014)(81166006)(575784001)(19580405001)(8676002)(19580395003)(86362001)(104016004)(92566002)(8936002)(8666005)(50226002)(305945005)(77096005)(5890100001)(7846002)(2906002)(85426001)(5003940100001)(33646002)(7059030)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0301MB2004; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD001; 1:bPuSfXbrZg1483HWGfDEQfUvXJOM3nMS4YFVqJufqprbMlGCtY3p+au1+W6v1DGggNEkjuGtvkaFG8+TL8eNOa0/Y8y868Rt+mX7agTw97xBdTJsugpl/1ZXWq6hK6iz+KItoLI9gM2fnitkkU64mXbsO5wzPboRhI4Oc42QBH2fZ8OrYd4fbdSp+1wOMLKK91MxM2MsWoSLlXJiUoucU0T2PT2ZnGRqzgpb++fLzU4cG8iHDDBwGAV38k7e/hLD+/wGD3ygYkQHgT+LBdM/4SyqbkjPSr9jPgi98q9jhW2kghH5uhlWRVMfXaJPPAgTrmstoveJi2fv9Hwdahi0WlOvnk8nhx+NGPtX1liU42DWIm67Jx9KpSWooTjeCzy+AS1cRjxCqxGepmRbD7JT59Qm1mRv8a+cq98EgnICJwC9VXkn+BwIcrCYouBDpxmMz7dKQzVq0bwBIDq76v9nzRBn/y305udz7BX52EMkrY8S7xJlagJ1Djo2ZVN7jAjGHCt/eJ6//jxdQFxFqAOkl5v+BzR7d/j1jTbsr2XzkrvCvgTgYCZi0RZLy+rk/km09qWdUTLo/3qaYPB0FYNRSd9Dy9fxr1yfby9NL50HBlQkhZxtuo02E963mJKdGr4ezcxXfh+tKnypLr6mae6s4ID4GoXOJKBOqcvw8SmMq+AiyzrmJOJM88tpVb5zQV2QvGjNx0a+N75tkd+Z8cflRq1n12LRV0PFFcGyt8uWB+IKfkjD2mFaNXK9SBpojDtC MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 7779481d-7b24-4505-3159-08d3e153a494 X-Microsoft-Exchange-Diagnostics: 1; BLUPR0301MB2004; 2:MgMTEM0uBVAyJ9y+ImPb2wCzauU/nKiqMpW0Nw5xmRLqXzIWEb3lJj/POe4l8TeUJmOQY8sknVJ24rmbNm5mJoQSRJhPhq0muD5YCHAo6j3UXcScIHqpBx2MzMgGZrxdxCYuAZD0thDzLUPiUNtIbYD4IglgGLdw1NoODX3hyJUOA/On6ziil59KioVKNGCS; 3:+ov9iw0+4paOFDgxA/YSnJVsR+opQXDbjMn2rXLpG5loPXzxZYyKWeyHMfRobvvk8mfeYHSZ1eFvy5bkf9DGQc3cSaNUTsBZsc8F32Dm28kuw5vUSqIBUV5+pXkP/GYv+0mz9YlQPDS1WQdRkaV5XUQiGR/8vDhq/bcJeLFRFjFYMez4ac4511fAU79Zawv86hLTmNlgtLKqZuYGBpENo2RTBRZrwm+kTtaUaeVl/2Q= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0301MB2004; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0301MB2004; 25:owFT3PkD5Y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kWNcIpl1zxwv7f6YnokvvTdeEiZyVFAJkL+1pf++FEq2e5ktIDwjx3LG5/wj/mNcjnAIbW3OvxToEtNN/wmKcu/FJpsXHGWoQVjYZPqnvs558kW2/RYztLnSmvMGz9FdsIGoTC1MffETxWlx9ixR/S3vaXNVVSJo1eq+V8Eh6sr9xL3JpoujtmSzZbYfQbe6dk54N4yQCWPpRh51U6yVd8wOXcO9majNsccVbDYKZspOlCdqxeoeI2dOROksaDt89Lpu54qjZPSE7eHc84yTF3ROmLWrbDLuw/AdyB7Vv94/HYr5yrKiYh2cG5Bmw0xv7CKUSXsUylrgBJW8jEZ+0yD4ei56B/lOHJBqOddEqUUDTcCam3WobFPiABiX/jOlcCDmqYADaDDkCEF2svaqkPvgnMyg/cMzGHHF1qkqhtGlm8tmHgVlONiMpUulPyRVh4eMKaaovUtYFZkwyaD8npJ5AoiGLym6o7UQxbtOJKqSZUQJ/XqskRgdmPf4ixSVlw9m6SpYX8++86dsWsQYH8= 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)(8121501046)(5005006)(13018025)(13015025)(13017025)(13024025)(13023025)(10201501046)(3002001)(6055026); SRVR:BLUPR0301MB2004; BCL:0; PCL:0; RULEID:(400006); SRVR:BLUPR0301MB2004; X-Forefront-PRVS: 0071BFA85B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0301MB2004; 23:8qrnMUH7HvGfck1cfy47wqOITGBIK3O+AAbNk8g?= =?us-ascii?Q?RJPEla3CzNmEA7Rii2AkBDhRj83wYhe0OBnKiMw3CIl09hJtoXxmZHsGiMnc?= =?us-ascii?Q?zCUUGPfMvGsGs48GLUX0wbh9GsVF/B0e/8IW+um5rtIPKhjni6BCliBsKpjL?= =?us-ascii?Q?ksbQqJ8DdCPGgEYj0gy4EdoIHr+BLgqgDiu54Q9XviJKWNeF2bxMv0N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lhLCbHFmG1VmFRf9SoMeu0x50/g7xvBIvOAsgi41IbULdOK+kzFpwx5rFUKmxG8bIlYFwJi8xSD8/vKGxy SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2016 12:42:54.7210 (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: BLUPR0301MB2004 Subject: [dpdk-dev] [PATCH v11 17/24] 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: Tue, 20 Sep 2016 12:42:57 -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 | 10 ++++++---- drivers/net/bonding/rte_eth_bond_pmd.c | 10 ++++++---- drivers/net/mpipe/mpipe_tilegx.c | 18 +++++++++++------- drivers/net/null/rte_eth_null.c | 10 ++++++---- drivers/net/pcap/rte_eth_pcap.c | 10 ++++++---- drivers/net/ring/rte_eth_ring.c | 10 ++++++---- drivers/net/vhost/rte_eth_vhost.c | 10 ++++++---- drivers/net/virtio/virtio_user_ethdev.c | 9 ++++++--- drivers/net/xenvirt/rte_eth_xenvirt.c | 10 ++++++---- 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, 103 insertions(+), 72 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 93ae2d7..050f8fc 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, }; -PMD_REGISTER_DRIVER(pmd_af_packet_drv, net_af_packet); +DRIVER_REGISTER_VDEV(net_af_packet, pmd_af_packet_drv); DRIVER_REGISTER_PARAM_STRING(net_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 09ce7bf..e19fc5e 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, }; -PMD_REGISTER_DRIVER(bond_drv, net_bonding); +DRIVER_REGISTER_VDEV(net_bonding, bond_drv); DRIVER_REGISTER_PARAM_STRING(net_bonding, "slave= " diff --git a/drivers/net/mpipe/mpipe_tilegx.c b/drivers/net/mpipe/mpipe_tilegx.c index 66b43ec..135b78f 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, +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, +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, net_mpipe_xgbe); -PMD_REGISTER_DRIVER(pmd_mpipe_gbe_drv, net_mpipe_gbe); +DRIVER_REGISTER_VDEV(net_mpipe_xgbe, pmd_mpipe_xgbe_drv); +DRIVER_REGISTER_VDEV(net_mpipe_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 42ec107..c83b62b 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, }; -PMD_REGISTER_DRIVER(pmd_null_drv, net_null); +DRIVER_REGISTER_VDEV(net_null, pmd_null_drv); DRIVER_REGISTER_PARAM_STRING(net_null, "size= " "copy="); diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index 418fc52..8c7f6eb 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, }; -PMD_REGISTER_DRIVER(pmd_pcap_drv, net_pcap); +DRIVER_REGISTER_VDEV(net_pcap, pmd_pcap_drv); DRIVER_REGISTER_PARAM_STRING(net_pcap, "rx_pcap= " "tx_pcap= " diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index b90684c..9cdeb51 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, }; -PMD_REGISTER_DRIVER(pmd_ring_drv, net_ring); +DRIVER_REGISTER_VDEV(net_ring, pmd_ring_drv); DRIVER_REGISTER_PARAM_STRING(net_ring, "nodeaction=[attach|detach]"); diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index d0bffbd..01a1f18 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, }; -PMD_REGISTER_DRIVER(pmd_vhost_drv, net_vhost); +DRIVER_REGISTER_VDEV(net_vhost, pmd_vhost_drv); DRIVER_REGISTER_PARAM_STRING(net_vhost, "iface= " "queues="); diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index c682d8f..50de484 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, }; -PMD_REGISTER_DRIVER(virtio_user_driver, net_virtio_user); +DRIVER_REGISTER_VDEV(net_virtio_user, virtio_user_driver); DRIVER_REGISTER_PARAM_STRING(net_virtio_user, "path= " "mac= " diff --git a/drivers/net/xenvirt/rte_eth_xenvirt.c b/drivers/net/xenvirt/rte_eth_xenvirt.c index 2ffa54c..605aba9 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, }; -PMD_REGISTER_DRIVER(pmd_xenvirt_drv, net_xenvirt); +DRIVER_REGISTER_VDEV(net_xenvirt, pmd_xenvirt_drv); DRIVER_REGISTER_PARAM_STRING(net_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