#include <unistd.h>
#include <rte_eal.h>
-#include <rte_dev.h>
+#include <rte_vdev.h>
#include <rte_eal_memconfig.h>
#include <rte_ethdev.h>
#include <rte_malloc.h>
static __thread struct mpipe_local mpipe_local;
static struct mpipe_context mpipe_contexts[GXIO_MPIPE_INSTANCE_MAX];
static int mpipe_instances;
-static const char *drivername = "MPIPE PMD";
/* Per queue statistics. */
struct mpipe_queue_stats {
}
static int
-rte_pmd_mpipe_devinit(const char *ifname,
+rte_pmd_mpipe_probe_common(struct rte_vdev_driver *drv, const char *ifname,
const char *params __rte_unused)
{
gxio_mpipe_context_t *context;
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);
eth_dev->data->dev_private = priv;
eth_dev->data->mac_addrs = &priv->mac_addr;
- eth_dev->data->dev_flags = 0;
eth_dev->data->kdrv = RTE_KDRV_NONE;
eth_dev->driver = NULL;
- eth_dev->data->drv_name = drivername;
+ eth_dev->data->drv_name = drv->driver.name;
eth_dev->data->numa_node = instance;
eth_dev->dev_ops = &mpipe_dev_ops;
return 0;
}
-static struct rte_driver pmd_mpipe_xgbe_drv = {
- .type = PMD_VDEV,
- .init = rte_pmd_mpipe_devinit,
+static int
+rte_pmd_mpipe_xgbe_probe(const char *ifname, const char *params __rte_unused)
+{
+ return rte_pmd_mpipe_probe_common(&pmd_mpipe_xgbe_drv, ifname, params);
+}
+
+static int
+rte_pmd_mpipe_gbe_probe(const char *ifname, const char *params __rte_unused)
+{
+ return rte_pmd_mpipe_probe_common(&pmd_mpipe_gbe_drv, ifname, params);
+}
+
+static struct rte_vdev_driver pmd_mpipe_xgbe_drv = {
+ .probe = rte_pmd_mpipe_xgbe_probe,
};
-static struct rte_driver pmd_mpipe_gbe_drv = {
- .type = PMD_VDEV,
- .init = rte_pmd_mpipe_devinit,
+static struct rte_vdev_driver pmd_mpipe_gbe_drv = {
+ .probe = rte_pmd_mpipe_gbe_probe,
};
-PMD_REGISTER_DRIVER(pmd_mpipe_xgbe_drv, xgbe);
-PMD_REGISTER_DRIVER(pmd_mpipe_gbe_drv, gbe);
+RTE_PMD_REGISTER_VDEV(net_mpipe_xgbe, pmd_mpipe_xgbe_drv);
+RTE_PMD_REGISTER_ALIAS(net_mpipe_xgbe, xgbe);
+RTE_PMD_REGISTER_VDEV(net_mpipe_gbe, pmd_mpipe_gbe_drv);
+RTE_PMD_REGISTER_ALIAS(net_mpipe_gbe, gbe);
static void __attribute__((constructor, used))
mpipe_init_contexts(void)