From patchwork Fri Aug 26 13:56:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 15399 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 2D6DB5AA7; Fri, 26 Aug 2016 15:58:08 +0200 (CEST) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0071.outbound.protection.outlook.com [104.47.40.71]) by dpdk.org (Postfix) with ESMTP id B3F885A83 for ; Fri, 26 Aug 2016 15:58:05 +0200 (CEST) Received: from DM2PR03CA0033.namprd03.prod.outlook.com (10.141.96.32) by SN2PR03MB1886.namprd03.prod.outlook.com (10.164.114.146) with Microsoft SMTP Server (TLS) id 15.1.434.16; Fri, 26 Aug 2016 13:58:02 +0000 Received: from BY2FFO11FD035.protection.gbl (2a01:111:f400:7c0c::180) by DM2PR03CA0033.outlook.office365.com (2a01:111:e400:2428::32) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9 via Frontend Transport; Fri, 26 Aug 2016 13:58:02 +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 BY2FFO11FD035.mail.protection.outlook.com (10.1.14.220) 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:02 +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 u7QDvHpp023630; Fri, 26 Aug 2016 06:58:00 -0700 From: Shreyansh Jain To: CC: , , , , Shreyansh Jain Date: Fri, 26 Aug 2016 19:26:52 +0530 Message-ID: <1472219823-29486-15-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: 131166934832583217; (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)(575784001)(68736007)(19580395003)(2906002)(106466001)(77096005)(92566002)(19580405001)(229853001)(2351001)(8936002)(81166006)(5890100001)(50226002)(50986999)(48376002)(36756003)(76176999)(626004)(104016004)(86362001)(5003940100001)(87936001)(105606002)(97736004)(110136002)(33646002)(4326007)(8666005)(50466002)(305945005)(7846002)(85426001)(47776003)(11100500001)(8676002)(189998001)(81156014)(2950100001)(5660300001)(356003)(586003)(26583001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB1886; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD035; 1:XXEdKfv/kbpSKvl4pU4QkF8so9V0peUOkogdQpWemulaPSBHFYZ4EcfRNqirCQ7cuD1r9XNyhynMmGjy+5Ma74VfBb/sBxcWTTIB9RuDzTiknG4L8uh/9z56d8EZS5hm+deCeeVh40L5lWLpcgdTy9+yH4bqHvDLsrK6Wk/WSc60Q1z9xKnE7XHxVAyQaDfF3hVIlYlRlbV8X6OM4ve4Lwm9P6p6qB9AWIRwmX1UlRY2AYxgd0066h4eVWVsg1d42oKDU98xQsQTG4PU24Ff1YNF5Ax8elRVaBIx66rsEsRHRcdi0a365zUDqzj6SYWuGKW4MOP9K74IP9V7p/3ZOqYzOC4GH50AfmGlKR7OUbVG8QElHirKFXaA5wJDisEfIPaBUtuzIC4FvMN/4aLdeqIQMTMbEkY5+M0YBzzl9z3ywxMyWA6NZnFHeQio6pdaghwgYXwQZXqMRFJJ1LLuPOLfNzC7EHhghs5hP1p3tGRWsz3PJ9mBH+91SrafDvheMO0hjETgIvp9siAN0yqrsrlKRX/K4SM+AQNmaqd7Sv1xeW+t+aqHseA8P5drHA3bQJ824C30a1bFX06flt5VsIL+pYvvnbktM32Xb8/Z+Qpf/L5vEcGXprtbh5VDfQc+poZDrBFSWU7caxH2JMAo2IC3EZu468WTwrVEAEPm3PWdGvWXe5CoSyD45HrHM9BvNGy4EACbji1YLr9iqsIQKizDKNmQzDgm8epnsLiv52k= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: ba8c3520-8706-4445-a5c8-08d3cdb8ff5a X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB1886; 2:3hbJ0jxzib1tA4rk2taY02J5/AMw+UvE8YUHpnR1dqWZ2wl6sedXuvk7If1bfDQHKYNvXM/QJmfMT6PFUJJKLAr9JPbsk6Mf7bxQ2QPG4DxQAC9mBDUNNnSTQUihgGrnRgA7G0+i4Cxr4SEADV6KQxK/7J32PnBrQjxtPFOPsbiYH/JB2wOQRe4ydkXv75/T; 3:Ufqf5rxEry8H6h23XIMX5g8xJf2iSPSLhSCzHInnzqWYqTnq9hwyV7Mh1mWhn7nt0b0UNae19P8BtfdTHtmT7aeVlAyQtVhs3ai0lpMlp8AXc8zWDPGaZbhQlD6Z7lHfXnwkQdLNIoNSJL0+nsBbOEN0vjiN7+r/pZJBVdUrlfb24L+/whBIIa1RBydibIi1Fq/4ZXHwHBIpxvDK82oxj9ISsfpr72sYRvc7+kG1nGI= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN2PR03MB1886; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB1886; 25:J+l/2H5NPCYAlLbjUaTC5PH4bunzAr1Vepf2/Ts4xv0SkiYzkupg0d+6LnAwAxRhYE1Cfim+HFRJTMTzyGsRxSVPPUlpv7B9zDy+0tPYxh76QtJJtro/5ZHrO7Ow9BFFtWWd4ONCu+S508bUSGBUNzMsPcQQwwuXiAOGET7GNBwbcH55NXgzjkTGzKPvyzkgKPL8xGWsJ7x3BS40YdJJBmICcBPfBzDMoA2Exgpik3Uk+AiHjoXbRrm76dwh9ou4mTGOMDCyf4lsXCj0akoqdS9Kj3T9vZjF9Twhgdu2DHA0fRzKd+VdErSA6YgiEvmiMVjC4tBTJewlVOQE0JGHwj6RfCE77eIYC4ZaI67EzTzBTPxkgX9O3a97Aivlo0jIEQaG4DIz5cXGwCdAMzrV33vmfAV01i4eItcmfamup5OjOWbvJ0KRzaEFEbbxXeuCeohlxD8V3AZvx8bCzn3YcLbVBsfr8wjqY9KA9uQm82YiZPV0Kibb8pRvI1jTPxiMrR1mZ2NELDAqLIE56YIyHaw2qiAizbTNlzHg9O0nrB3snxY+1XwGw9O4TWPXlKjUMCgWYg4lmMleYasgnCFUMg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13024025)(13023025)(13017025)(13018025)(13015025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:SN2PR03MB1886; BCL:0; PCL:0; RULEID:(400006); SRVR:SN2PR03MB1886; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB1886; 4:UMJPVk/vs2ff9aJWYQonW+r58oHanWarKaV/3+GqQJR53vA79jxf2EuCtSeBAGCJFh5nobAZCFw5UhJlkf7Gzy0+jZQJVFfiemErSIxbd9horeUjraioEAG6AfMNerQPhlne6ysxOe8rjHbAMHmBIk3OBInvy3WN1IDH4MjTQLncHnahRcj6Q0Qbgsc3WoDZKHF6xdv5SNXmx4jptsMpyKIpvAck/Q1PkeUdyGP3Jk6h8qmQ1rt0mYuqcnTaqd+wPgX8bX7OiIX9eTzzv9/KAwOxM2IZpOMrRFApQueOh3w7a/16a3E1sMfXey9gVNCCbBLzxXWFddFh/ckBZXvZB/dQKTHQZLXLZryLXs8EF5ZP/qe2fOfUYJhl6YC1b99Rq5ggjAFCH/W5fiCxGtgnpMXN8LOYCYTaVCeVRcJavd0Oo5t2skr0TB/4Ixd4Gi8D4G51D8QfvwWiwIoFceZfLHFXPA634ortDUA/qk4JMkf5m4+/52qrsBN4KdgBm9/6p/0etFYLxejFQka863Y06w== X-Forefront-PRVS: 00462943DE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB1886; 23:4j3hendcVxuVr+9IJp9KdWFASPJrhnHbBZE3b/X/L?= =?us-ascii?Q?U34eLlVXsmKM8zJtOStKUgi6mG6VwI7z/giJni3Q8Enzhb4MF87zCHCS+Br+?= =?us-ascii?Q?MLXlm2zeqkCZDregk12lg47eiZfCjCKnFOqYFL1uGLSmwxU9b2yxuiCVug1w?= =?us-ascii?Q?mouT+3CnDOV9lzRYt5eTWPBUeh5zgZsNHw98IDjsBYmUtchgpgL1YM9J4UYw?= =?us-ascii?Q?PjaMMyt6QraYFFIAP21WeqO5mSeaO+4shzEMR7thfC003RWBqrw5DZ8HJhsR?= =?us-ascii?Q?DNiSvRVvMmfYxxlRJTmxZ9yJdE7lu7futybt5RPQ93SaiA9zciNskT8WINrP?= =?us-ascii?Q?BghsyU1E8XSuX1kgVXE0XP2rct8eoUkCYUaIFjJuDXMHL+Exf2YgndbtoaNU?= =?us-ascii?Q?K1nmMH2WMU82sNr+YkS756Sxrk7izJ8G47T8GLOv4lM8XaE3lydC0G8Mzgzl?= =?us-ascii?Q?iFGPfSeuBDh8O8eFRm1jAjOeIebifXAGnAwz8Zgvlilv3Y5iPwYCGl8s4T/l?= =?us-ascii?Q?Z7rJisHAD24fiEx3/6MLE/czMforblu+71vgLQRvgbZ7KhnmPy8ILaOCPUld?= =?us-ascii?Q?yxa+v4i2vdC2MUOgFMja5/ApXXODHChwte7Rv8ofMrurzcTSbZiW/0eHpN1x?= =?us-ascii?Q?TGAWlRVwmterB3UHiTMxUBg2+P84fhpIPVLYum7kmkwU2gnGPtZDlsIwOnoF?= =?us-ascii?Q?8T5IysMU9CC8wrZnZ0X/oetLJWo0NwT6qKqXEiO5fchYIo9luTkx2tt4JA9q?= =?us-ascii?Q?AcZ1Facw+/apRexlJmeS24y9H+Fboh+x1kMTLCXc3ivumT3mxrZz+myAAmpQ?= =?us-ascii?Q?oV2j+CqSA6qojblHkDuTbS1tMsK88ZcRldW2GJqkdFAOBkECoLQdL6hmDti7?= =?us-ascii?Q?7+IH9KziQPwnCCqOk1fLRHZv+ZcE3fdiwPrAb3hMzjKcbqtLIpNCDLgOOLIp?= =?us-ascii?Q?hmFif7rclFwLBNN0C2h531a8rOqPiY+onYjj+Rhb/9Ms2XS7G8GiTxpOoMg8?= =?us-ascii?Q?HoWtzbQhsgBMBotvzqlGtmJmUls+w01BGq9NjH68yDWmeYUWGhforU4DBXow?= =?us-ascii?Q?ngIlXBtKOIv4shL+SmPxzf0b+NV5VlOdVlpSgoCTD0PrZMXCwQLY/xeWUVQ7?= =?us-ascii?Q?za9S1xuxbrAKfp0ES2u1X9LGXy68X8KWx/abdH90k1NO9oXy732EQJkrqa+r?= =?us-ascii?Q?YuYbX/8rHXCMbd0vXoTxwFRJ2jZQA3wNuSGdH2EZ9Rq3XwPVw+E+IuDiPyw9?= =?us-ascii?Q?sZBJtlXIB2BeExdVwgx2aY9JQYpXkhImcD6lz8qgUo6iotEhKedw2WlsYYDr?= =?us-ascii?B?UT09?= X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB1886; 5:V5oN/GGA+Rs9speqV8bnWI686HN3dJ6vgcBXN7e8WvMRuz3oS3THCnuHi54KWZUhbsD7hY3I82C9lrHx9V2BPimFXZBD7vIjzxL7Ev2Y34jGvUAj1ekkeEFTgu5TGgBuyHlagYhJSmNoG7AI9zplz0piclH7IfM4msku6aRpMMs=; 24:czyej9OIXdJKOoqOW7i8BExBZBMane+sxjWVuHpIAp/nZI8FJ+gbAIFMNRaWUaWMzql1xFuXzjlxx3ruDZ6NjXta+FLWfiByNTd0RcmL8Z0= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2016 13:58:02.9307 (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: SN2PR03MB1886 Subject: [dpdk-dev] [PATCH v8 14/25] ethdev: get rid of device type 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Now that hotplug has been moved to eal, there is no reason to keep the device type in this layer. Signed-off-by: David Marchand Signed-off-by: Shreyansh Jain --- app/test/virtual_pmd.c | 2 +- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/bonding/rte_eth_bond_api.c | 2 +- drivers/net/cxgbe/cxgbe_main.c | 2 +- drivers/net/mlx4/mlx4.c | 2 +- drivers/net/mlx5/mlx5.c | 2 +- drivers/net/mpipe/mpipe_tilegx.c | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/pcap/rte_eth_pcap.c | 2 +- drivers/net/ring/rte_eth_ring.c | 2 +- drivers/net/vhost/rte_eth_vhost.c | 2 +- drivers/net/virtio/virtio_user_ethdev.c | 2 +- drivers/net/xenvirt/rte_eth_xenvirt.c | 2 +- examples/ip_pipeline/init.c | 22 ---------------------- lib/librte_ether/rte_ethdev.c | 5 ++--- lib/librte_ether/rte_ethdev.h | 15 +-------------- 16 files changed, 16 insertions(+), 52 deletions(-) diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c index b4bd2f2..8a1f0d0 100644 --- a/app/test/virtual_pmd.c +++ b/app/test/virtual_pmd.c @@ -581,7 +581,7 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, goto err; /* reserve an ethdev entry */ - eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_PCI); + eth_dev = rte_eth_dev_allocate(name); if (eth_dev == NULL) goto err; diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index f795566..d629ee3 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -666,7 +666,7 @@ rte_pmd_init_internals(const char *name, } /* reserve an ethdev entry */ - *eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL); + *eth_dev = rte_eth_dev_allocate(name); if (*eth_dev == NULL) goto error; diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index 203ebe9..8514652 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -189,7 +189,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id) } /* reserve an ethdev entry */ - eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL); + eth_dev = rte_eth_dev_allocate(name); if (eth_dev == NULL) { RTE_BOND_LOG(ERR, "Unable to allocate rte_eth_dev"); goto err; diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c index ceaf5ab..922155b 100644 --- a/drivers/net/cxgbe/cxgbe_main.c +++ b/drivers/net/cxgbe/cxgbe_main.c @@ -1150,7 +1150,7 @@ int cxgbe_probe(struct adapter *adapter) */ /* reserve an ethdev entry */ - pi->eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_PCI); + pi->eth_dev = rte_eth_dev_allocate(name); if (!pi->eth_dev) goto out_free; diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 2bed4de..b333ad6 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -5803,7 +5803,7 @@ mlx4_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) snprintf(name, sizeof(name), "%s port %u", ibv_get_device_name(ibv_dev), port); - eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_PCI); + eth_dev = rte_eth_dev_allocate(name); } if (eth_dev == NULL) { ERROR("can not allocate rte ethdev"); diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 3658769..ebad7cb 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -617,7 +617,7 @@ mlx5_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) snprintf(name, sizeof(name), "%s port %u", ibv_get_device_name(ibv_dev), port); - eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_PCI); + eth_dev = rte_eth_dev_allocate(name); } if (eth_dev == NULL) { ERROR("can not allocate rte ethdev"); diff --git a/drivers/net/mpipe/mpipe_tilegx.c b/drivers/net/mpipe/mpipe_tilegx.c index 93f8730..c0d0e3b 100644 --- a/drivers/net/mpipe/mpipe_tilegx.c +++ b/drivers/net/mpipe/mpipe_tilegx.c @@ -1587,7 +1587,7 @@ rte_pmd_mpipe_devinit(const char *ifname, return -ENODEV; } - eth_dev = rte_eth_dev_allocate(ifname, RTE_ETH_DEV_VIRTUAL); + eth_dev = rte_eth_dev_allocate(ifname); if (!eth_dev) { RTE_LOG(ERR, PMD, "%s: Failed to allocate device.\n", ifname); rte_free(priv); diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 7a24884..ce49945 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -517,7 +517,7 @@ eth_dev_null_create(const char *name, goto error; /* reserve an ethdev entry */ - eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL); + eth_dev = rte_eth_dev_allocate(name); if (eth_dev == NULL) goto error; diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index 7e213eb..7fbc60e 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -822,7 +822,7 @@ rte_pmd_init_internals(const char *name, const unsigned nb_rx_queues, goto error; /* reserve an ethdev entry */ - *eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL); + *eth_dev = rte_eth_dev_allocate(name); if (*eth_dev == NULL) goto error; diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index a7048c7..5690dcd 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -303,7 +303,7 @@ do_eth_dev_ring_create(const char *name, } /* reserve an ethdev entry */ - eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL); + eth_dev = rte_eth_dev_allocate(name); if (eth_dev == NULL) { rte_errno = ENOSPC; goto error; diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index 7539cd4..2bb761b 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -714,7 +714,7 @@ eth_dev_vhost_create(const char *name, char *iface_name, int16_t queues, goto error; /* reserve an ethdev entry */ - eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL); + eth_dev = rte_eth_dev_allocate(name); if (eth_dev == NULL) goto error; diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index daef09b..aadfdc0 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -277,7 +277,7 @@ virtio_user_eth_dev_alloc(const char *name) struct virtio_hw *hw; struct virtio_user_dev *dev; - eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL); + eth_dev = rte_eth_dev_allocate(name); if (!eth_dev) { PMD_INIT_LOG(ERR, "cannot alloc rte_eth_dev"); return NULL; diff --git a/drivers/net/xenvirt/rte_eth_xenvirt.c b/drivers/net/xenvirt/rte_eth_xenvirt.c index 99f6cc8..6b15381 100644 --- a/drivers/net/xenvirt/rte_eth_xenvirt.c +++ b/drivers/net/xenvirt/rte_eth_xenvirt.c @@ -654,7 +654,7 @@ eth_dev_xenvirt_create(const char *name, const char *params, goto err; /* reserve an ethdev entry */ - eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL); + eth_dev = rte_eth_dev_allocate(name); if (eth_dev == NULL) goto err; diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c index cd167f6..0dbc332 100644 --- a/examples/ip_pipeline/init.c +++ b/examples/ip_pipeline/init.c @@ -606,29 +606,12 @@ app_link_set_tcp_syn_filter(struct app_params *app, struct app_link_params *cp) } } -static int -app_link_is_virtual(struct app_link_params *p) -{ - uint32_t pmd_id = p->pmd_id; - struct rte_eth_dev *dev = &rte_eth_devices[pmd_id]; - - if (dev->dev_type == RTE_ETH_DEV_VIRTUAL) - return 1; - - return 0; -} - void app_link_up_internal(struct app_params *app, struct app_link_params *cp) { uint32_t i; int status; - if (app_link_is_virtual(cp)) { - cp->state = 1; - return; - } - /* For each link, add filters for IP of current link */ if (cp->ip != 0) { for (i = 0; i < app->n_links; i++) { @@ -736,11 +719,6 @@ app_link_down_internal(struct app_params *app, struct app_link_params *cp) uint32_t i; int status; - if (app_link_is_virtual(cp)) { - cp->state = 0; - return; - } - /* PMD link down */ status = rte_eth_dev_set_link_down(cp->pmd_id); if (status < 0) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 86c9d1a..cf38f32 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -191,7 +191,7 @@ rte_eth_dev_find_free_port(void) } struct rte_eth_dev * -rte_eth_dev_allocate(const char *name, enum rte_eth_dev_type type) +rte_eth_dev_allocate(const char *name) { uint8_t port_id; struct rte_eth_dev *eth_dev; @@ -216,7 +216,6 @@ rte_eth_dev_allocate(const char *name, enum rte_eth_dev_type type) snprintf(eth_dev->data->name, sizeof(eth_dev->data->name), "%s", name); eth_dev->data->port_id = port_id; eth_dev->attached = DEV_ATTACHED; - eth_dev->dev_type = type; eth_dev_last_created_port = port_id; nb_ports++; return eth_dev; @@ -248,7 +247,7 @@ rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv, rte_eal_pci_device_name(&pci_dev->addr, ethdev_name, sizeof(ethdev_name)); - eth_dev = rte_eth_dev_allocate(ethdev_name, RTE_ETH_DEV_PCI); + eth_dev = rte_eth_dev_allocate(ethdev_name); if (eth_dev == NULL) return -ENOMEM; diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index b005c1b..2a697ec 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1603,17 +1603,6 @@ struct rte_eth_rxtx_callback { }; /** - * The eth device type. - */ -enum rte_eth_dev_type { - RTE_ETH_DEV_UNKNOWN, /**< unknown device type */ - RTE_ETH_DEV_PCI, - /**< Physical function and Virtual function of PCI devices */ - RTE_ETH_DEV_VIRTUAL, /**< non hardware device */ - RTE_ETH_DEV_MAX /**< max value of this enum */ -}; - -/** * @internal * The generic data structure associated with each ethernet device. * @@ -1643,7 +1632,6 @@ struct rte_eth_dev { */ struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT]; uint8_t attached; /**< Flag indicating the port is attached */ - enum rte_eth_dev_type dev_type; /**< Flag indicating the device type */ } __rte_cache_aligned; struct rte_eth_dev_sriov { @@ -1756,8 +1744,7 @@ struct rte_eth_dev *rte_eth_dev_allocated(const char *name); * @return * - Slot in the rte_dev_devices array for a new device; */ -struct rte_eth_dev *rte_eth_dev_allocate(const char *name, - enum rte_eth_dev_type type); +struct rte_eth_dev *rte_eth_dev_allocate(const char *name); /** * @internal