[dpdk-dev,08/20] af_packet: remove pci device driver
diff mbox

Message ID 1443445418-18498-9-git-send-email-bernard.iremonger@intel.com
State Superseded, archived
Headers show

Commit Message

Bernard Iremonger Sept. 28, 2015, 1:03 p.m. UTC
From: David Hunt <david.hunt@intel.com>

initialise dev_flags, driver, kdrv, drv_name and numa_node fileds in eth_dev data.

Signed-off-by: David Hunt <david.hunt@intel.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/af_packet/rte_eth_af_packet.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

Patch
diff mbox

diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index bdd9628..7c3c455 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -5,7 +5,7 @@ 
  *
  *   Originally based upon librte_pmd_pcap code:
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
  *   Copyright(c) 2014 6WIND S.A.
  *   All rights reserved.
  *
@@ -431,7 +431,6 @@  rte_pmd_init_internals(const char *name,
                        struct rte_kvargs *kvlist)
 {
 	struct rte_eth_dev_data *data = NULL;
-	struct rte_pci_device *pci_dev = NULL;
 	struct rte_kvargs_pair *pair = NULL;
 	struct ifreq ifr;
 	size_t ifnamelen;
@@ -469,10 +468,6 @@  rte_pmd_init_internals(const char *name,
 	if (data == NULL)
 		goto error;
 
-	pci_dev = rte_zmalloc_socket(name, sizeof(*pci_dev), 0, numa_node);
-	if (pci_dev == NULL)
-		goto error;
-
 	*internals = rte_zmalloc_socket(name, sizeof(**internals),
 	                                0, numa_node);
 	if (*internals == NULL)
@@ -655,8 +650,8 @@  rte_pmd_init_internals(const char *name,
 	/*
 	 * now put it all together
 	 * - store queue data in internals,
-	 * - store numa_node info in pci_driver
-	 * - point eth_dev_data to internals and pci_driver
+	 * - store numa_node info in eth_dev
+	 * - point eth_dev_data to internals
 	 * - and point eth_dev structure to new eth_dev_data structure
 	 */
 
@@ -669,17 +664,18 @@  rte_pmd_init_internals(const char *name,
 	data->dev_link = pmd_link;
 	data->mac_addrs = &(*internals)->eth_addr;
 
-	pci_dev->numa_node = numa_node;
-
 	(*eth_dev)->data = data;
 	(*eth_dev)->dev_ops = &ops;
-	(*eth_dev)->pci_dev = pci_dev;
+	(*eth_dev)->data->dev_flags = 0;
+	(*eth_dev)->driver = NULL;
+	(*eth_dev)->data->drv_name = NULL;
+	(*eth_dev)->data->kdrv = RTE_KDRV_NONE;
+	(*eth_dev)->data->numa_node = numa_node;
 
 	return 0;
 
 error:
 	rte_free(data);
-	rte_free(pci_dev);
 
 	if (*internals) {
 		for (q = 0; q < nb_queues; q++) {