From patchwork Wed Sep 7 14:08:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 15667 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 A11FA919B; Wed, 7 Sep 2016 16:10:11 +0200 (CEST) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0075.outbound.protection.outlook.com [104.47.41.75]) by dpdk.org (Postfix) with ESMTP id 262348E7D for ; Wed, 7 Sep 2016 16:10:09 +0200 (CEST) Received: from BY2PR03CA074.namprd03.prod.outlook.com (10.141.249.47) by BY2PR0301MB2005.namprd03.prod.outlook.com (10.163.196.27) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9; Wed, 7 Sep 2016 14:10:08 +0000 Received: from BY2FFO11FD047.protection.gbl (2a01:111:f400:7c0c::120) by BY2PR03CA074.outlook.office365.com (2a01:111:e400:2c5d::47) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.609.9 via Frontend Transport; Wed, 7 Sep 2016 14:10:07 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; 6wind.com; dkim=none (message not signed) header.d=none; 6wind.com; dmarc=fail action=none header.from=nxp.com; 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 BY2FFO11FD047.mail.protection.outlook.com (10.1.15.175) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Wed, 7 Sep 2016 14:10:07 +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 u87E8BCx013556; Wed, 7 Sep 2016 07:10:04 -0700 From: Shreyansh Jain To: CC: , Shreyansh Jain , "David Marchand" Date: Wed, 7 Sep 2016 19:38:06 +0530 Message-ID: <1473257297-7221-15-git-send-email-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473257297-7221-1-git-send-email-shreyansh.jain@nxp.com> References: <1466510566-9240-1-git-send-email-shreyansh.jain@nxp.com> <1473257297-7221-1-git-send-email-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131177310075197918; (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)(199003)(189002)(2351001)(68736007)(77096005)(105606002)(4326007)(5003940100001)(106466001)(104016004)(87936001)(8676002)(8936002)(229853001)(81166006)(81156014)(11100500001)(50226002)(7846002)(76176999)(356003)(305945005)(2906002)(36756003)(50466002)(47776003)(8666005)(19580405001)(19580395003)(626004)(85426001)(97736004)(110136002)(5890100001)(86362001)(92566002)(575784001)(48376002)(586003)(5660300001)(50986999)(33646002)(189998001)(2950100001)(26583001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB2005; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD047; 1:6FI7sGINXkepjBU+dlytrofUPt6rHa3tSCJyEIBVGBe+pnQ7/S74NUxlk3xuVgVDhguWaDLSMOEL9ItIs+GxJQJG2eq57SuudkiBBvQzjLY4AAHVqgG/Ol3bZ88EjCeaUsBteAObWL0x758xG+Tz1mnmJKQDZ1Ma203l/mNz6R1zz654dvITq2lxnZskO8p/OVHKUzfrO7ULmEtFvUkWrMwcJNtwRze8Z8jt9lizVUTz5bYbLUaP/2kUOU2q4ZXn7EYfOQHTQoiVsQ649SWsP2K5alDPnwBN6Z77eOdmdjFV01YEVmR9Z2uTWK+FtiljuSMdCgjZQldml8z6CnOhK7bFpAuSCYMdVwDM40M8J2JCc0xXRDB7Mw7GDtMlCoZxlFCojJF/Z4aos4dM2QRrG3Sekr86b/vJFfzOPjgSs9O8py61bNKrWSoFw43q3uHiPj5w19ImY2J43QyA+F37XWUVLPG25UFQWvEcFpkE7gTCRuxJknHGmcQiAzcw4zwMev10WYhcF0eEFP4B5pGGXU3LPP1t6sioYkJiQDG+lY4RaHcnEJTkZ+Wn9175FsL0Ul5mXOvYNtWnjvGbIHpy6vy+VLJJ0TMc2T0vkl3K6UDQWyUloJV3o7GrgHhYeQZd MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 6a73207c-6269-4875-8ee6-08d3d728ac03 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2005; 2:5qWb8BLZi6nUfmI97cFFvPPnE/lu2Z991R58TySEoCGDAyvGtbaQ5J0lH/GbmHlpPAr977VoETQk6lWgS9gYX8eXldZD4+hj8yyTOCGailOBH+var7VrcFviqQb8WNmSOK4Gk+F3ARIL8k4r5iRc61W1YrJQPStR/xLyZfp7xTdqfoxEZ5rjvn2ryCj+6vSM; 3:SSC0HzYwD7ezjL6dPvifft7la+VuqYGO6VRI5LelBYL1+hxB3C4uGVG5j++p3GBXvVy6czRphDnPUr6iRMp5YJMTNLdh9Nauufjic7vSN/HzLwG38Rc1QuIS3VxdmxT2FWLiqerG9AkQ1Ha7ykz2Q4B0bm8aIhc30Cn0Alln9sMnlrpih1j2CmdBdYqmH+mOQTX7weNz9UJGbryGJJefMxrwxEPd3kJNLzBbMZBncWs= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB2005; X-Microsoft-Exchange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Tv1aq/a3BU3V0wWMhl/W0EXF/G1H3XUVuAnnJ5PovG43NOFGwUX/ufk56IRemSK+ZdkIiQiTaNzs9BeIiPuu84QRlXVBoJR+QsiaqMnIhUf2olsFHWhbPIlPQ0UtedwYx16q/CIxoHZ1a9ml7HjLfnUKCGrGraScBdc3LJFkeH2wzucwIqKn8TrN0hle2UCdayFAB3uTWrO+hkJSDjgHLedQTW8k5slCg4Pp++6g6s+1/XPmudDB6n7G1MFCeR3cU8sFjseAzFcrUpCdFnjWFnmhZQnFniCEkhJD6jA6FmMdAec6wMXHbt4zNLURALpDlR6LuRP2/k30ihJD9NvsH+NE3AERzz7kA417fKp8unhor0DaINpOT8Kr5UNG8K8gtWs2sB/P7zxGX52kYGU2E9hXbVLlK5932j7tlVRNJt4tsLsg8xf7TyoPTft+UjX9W0cjvvHjPbz2o16fp9L7g+YQ7O/A/0PI2y13Y35bpVWeBrZ/gjxIVMz2AfcUvcvOq3Ssh1f4RMTwVY= 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)(13015025)(13023025)(13024025)(13018025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BY2PR0301MB2005; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR0301MB2005; X-Forefront-PRVS: 0058ABBBC7 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB2005; 23:jsEiux0B6c82Hu90+YdvamSoaeJMnwioEKkEP2D?= =?us-ascii?Q?pVa6UvkGoHE5Ijm6J9zz6uIar9tpiDnlx66yYbeMrd7flJ+hEMRBb17LEZuZ?= =?us-ascii?Q?XkL/+oENaiLO0tblCBdGMx8nJ28Jx4MIjU+TyIt3LeHC8SLFdeQoMilQcqfR?= =?us-ascii?Q?ft6fStJEFeKMpqqaO9e7YnbaU4H15q1o6WNzwjYfqTmTSrKSF0JECujQ5565?= =?us-ascii?Q?5oqIHwqUUnPq9W8aj8ntzaEcWYgBOjsrEf9jjT5vF/eA0h6GIBc7qOQiTJlK?= =?us-ascii?Q?m8Xz94s2US1qHzGkuqnN16bb8ob5HqUMId+JYXSDrNeaimZTCvflMtlUHvCV?= =?us-ascii?Q?OB73sKPrY5bxemktOCfHJgQWK7h+8jSftyvCTqygK1z7V5FXg24IoQbs1YrE?= =?us-ascii?Q?z/dUDxT3KM27Nrbz2LCF/X7tH/F33y8m2tJQeC0x254sOid6wZD4uS/J3xo5?= =?us-ascii?Q?yme710ZFS1aYG61Q1a9DIe3yqYlWnti/myJj2IbrQUKV0enTOqf5781ik9O8?= =?us-ascii?Q?W0S7Dka8ncsRt3x21gkaviRBG+9IePlrN4clrj6U4sn/zfU9dj7jGhL9W1Sf?= =?us-ascii?Q?mRPLKxqusY4JSYFQ76al2aAnVtFqSMRVMtd+pOVPPuv7evKqfpmVa319ztsX?= =?us-ascii?Q?pDmi41H70LP2bMoUdE0XEOTgQuCQKR7kI71Hj06jAKudhfJ5fbcjDgauyktA?= =?us-ascii?Q?rduRDfyAyIJ/WEqxli5mVU0Q+o/WZKqBAFm9kpZLemUN1Hqomzr7008050wH?= =?us-ascii?Q?4DM+KJ8xwUVcjRJMHalws6CFY+xSFmc1r49LNHOJ/UQsChVcos0/FwOSbo62?= =?us-ascii?Q?SDzDsGwjZM1hWlF1D6nhVyHm4+0YXVKPc1EY9ctI0Zh7sSHYDYQh+b5lSDin?= =?us-ascii?Q?0ax31ns2Bveyc+JOSlWZoXKIb2F4vtMoHHdwyRDA3yQkp99rghfEhS79C8aT?= =?us-ascii?Q?eZun1L3yvi5f+jxDRgykN5Vb0w4Y7szGo+JrCiOpGlK6xpMKA9SrMosda7sH?= =?us-ascii?Q?y5Pbd8cWKuE2u5phw/vBZnxggfthkxvlMDlzMs/7AJtg0TJU8peiNpORHSpu?= =?us-ascii?Q?uxGKM8B8cDRkiBrEWWwcnv92WAkXRLSf6Ev13a266yTk6f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PhMiam8hf+m SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2016 14:10:07.0361 (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 v9 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