ethdev: add device type
[dpdk.git] / lib / librte_ether / rte_ethdev.c
index a26af75..b5e476f 100644 (file)
@@ -227,7 +227,7 @@ rte_eth_dev_find_free_port(void)
 }
 
 struct rte_eth_dev *
-rte_eth_dev_allocate(const char *name)
+rte_eth_dev_allocate(const char *name, enum rte_eth_dev_type type)
 {
        uint8_t port_id;
        struct rte_eth_dev *eth_dev;
@@ -251,6 +251,7 @@ rte_eth_dev_allocate(const char *name)
        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;
        nb_ports++;
        return eth_dev;
 }
@@ -300,7 +301,7 @@ rte_eth_dev_init(struct rte_pci_driver *pci_drv,
        rte_eth_dev_create_unique_device_name(ethdev_name,
                        sizeof(ethdev_name), pci_dev);
 
-       eth_dev = rte_eth_dev_allocate(ethdev_name);
+       eth_dev = rte_eth_dev_allocate(ethdev_name, RTE_ETH_DEV_PCI);
        if (eth_dev == NULL)
                return -ENOMEM;