ixgbe/base: support X550em_x V2 device
[dpdk.git] / drivers / net / null / rte_eth_null.c
index 64e9000..77fc988 100644 (file)
@@ -366,13 +366,6 @@ eth_stats_reset(struct rte_eth_dev *dev)
        }
 }
 
-static struct eth_driver rte_null_pmd = {
-       .pci_drv = {
-               .name = "rte_null_pmd",
-               .drv_flags = RTE_PCI_DRV_DETACHABLE,
-       },
-};
-
 static void
 eth_queue_release(void *q)
 {
@@ -501,7 +494,6 @@ eth_dev_null_create(const char *name,
        const unsigned nb_rx_queues = 1;
        const unsigned nb_tx_queues = 1;
        struct rte_eth_dev_data *data = NULL;
-       struct rte_pci_device *pci_dev = NULL;
        struct pmd_internals *internals = NULL;
        struct rte_eth_dev *eth_dev = NULL;
 
@@ -525,10 +517,6 @@ eth_dev_null_create(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)
                goto error;
@@ -540,8 +528,8 @@ eth_dev_null_create(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 ethdev data
+        * - point eth_dev_data to internals
         * - and point eth_dev structure to new eth_dev_data structure
         */
        /* NOTE: we'll replace the data element, of originally allocated eth_dev
@@ -558,9 +546,6 @@ eth_dev_null_create(const char *name,
 
        rte_memcpy(internals->rss_key, default_rss_key, 40);
 
-       pci_dev->numa_node = numa_node;
-       pci_dev->driver = &rte_null_pmd.pci_drv;
-
        data->dev_private = internals;
        data->port_id = eth_dev->data->port_id;
        data->nb_rx_queues = (uint16_t)nb_rx_queues;
@@ -571,10 +556,15 @@ eth_dev_null_create(const char *name,
 
        eth_dev->data = data;
        eth_dev->dev_ops = &ops;
-       eth_dev->pci_dev = pci_dev;
-       eth_dev->driver = &rte_null_pmd;
+
        TAILQ_INIT(&eth_dev->link_intr_cbs);
 
+       eth_dev->driver = NULL;
+       eth_dev->data->dev_flags = RTE_ETH_DEV_DETACHABLE;
+       eth_dev->data->kdrv = RTE_KDRV_NONE;
+       eth_dev->data->drv_name = drivername;
+       eth_dev->data->numa_node = numa_node;
+
        /* finally assign rx and tx ops */
        if (packet_copy) {
                eth_dev->rx_pkt_burst = eth_null_copy_rx;
@@ -588,7 +578,6 @@ eth_dev_null_create(const char *name,
 
 error:
        rte_free(data);
-       rte_free(pci_dev);
        rte_free(internals);
 
        return -1;
@@ -691,14 +680,13 @@ rte_pmd_null_devuninit(const char *name)
        RTE_LOG(INFO, PMD, "Closing null ethdev on numa socket %u\n",
                        rte_socket_id());
 
-       /* reserve an ethdev entry */
+       /* find the ethdev entry */
        eth_dev = rte_eth_dev_allocated(name);
        if (eth_dev == NULL)
                return -1;
 
        rte_free(eth_dev->data->dev_private);
        rte_free(eth_dev->data);
-       rte_free(eth_dev->pci_dev);
 
        rte_eth_dev_release_port(eth_dev);