virtio: add new driver
[dpdk.git] / lib / librte_ether / rte_ethdev.h
index 524ef4f..002535a 100644 (file)
@@ -1134,6 +1134,17 @@ extern struct rte_eth_dev rte_eth_devices[];
  */
 extern uint8_t rte_eth_dev_count(void);
 
+/**
+ * Function for internal use by dummy drivers primarily, e.g. ring-based
+ * driver.
+ * Allocates a new ethdev slot for an ethernet device and returns the pointer
+ * to that slot for the driver to use.
+ *
+ * @return
+ *   - Slot in the rte_dev_devices array for a new device;
+ */
+struct rte_eth_dev *rte_eth_dev_allocate(void);
+
 struct eth_driver;
 /**
  * @internal
@@ -1246,6 +1257,15 @@ extern int rte_ixgbe_pmd_init(void);
  */
 extern int rte_ixgbevf_pmd_init(void);
 
+/**
+ * The initialization function of the driver for Qumranet virtio-net
+ * Ethernet devices.
+ * Invoked once at EAL start time.
+ * @return
+ *   0 on success
+ */
+extern int rte_virtio_pmd_init(void);
+
 /**
  * The initialization function of *all* supported and enabled drivers.
  * Right now, the following PMDs are supported:
@@ -1295,6 +1315,13 @@ int rte_pmd_init_all(void)
        }
 #endif /* RTE_LIBRTE_IXGBE_PMD */
 
+#ifdef RTE_LIBRTE_VIRTIO_PMD
+       if ((ret = rte_virtio_pmd_init()) != 0) {
+               RTE_LOG(ERR, PMD, "Cannot init virtio PMD\n");
+               return (ret);
+       }
+#endif /* RTE_LIBRTE_VIRTIO_PMD */
+
        if (ret == -ENODEV)
                RTE_LOG(ERR, PMD, "No PMD(s) are configured\n");
        return (ret);