#include <rte_hexdump.h>
#include <rte_cryptodev.h>
#include <rte_cryptodev_pmd.h>
-#include <rte_dev.h>
+#include <rte_vdev.h>
#include <rte_malloc.h>
#include <rte_cpuflags.h>
return 0;
}
-static struct rte_driver aesni_gcm_pmd_drv = {
- .type = PMD_VDEV,
+static struct rte_vdev_driver aesni_gcm_pmd_drv = {
+ .driver = {
+ .type = PMD_VDEV,
+ },
.init = aesni_gcm_init,
.uninit = aesni_gcm_uninit
};
-PMD_REGISTER_DRIVER(aesni_gcm_pmd_drv, CRYPTODEV_NAME_AESNI_GCM_PMD);
+DRIVER_REGISTER_VDEV(CRYPTODEV_NAME_AESNI_GCM_PMD, aesni_gcm_pmd_drv);
DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_GCM_PMD,
"max_nb_queue_pairs=<int> "
"max_nb_sessions=<int> "
#include <rte_hexdump.h>
#include <rte_cryptodev.h>
#include <rte_cryptodev_pmd.h>
-#include <rte_dev.h>
+#include <rte_vdev.h>
#include <rte_malloc.h>
#include <rte_cpuflags.h>
return 0;
}
-static struct rte_driver cryptodev_aesni_mb_pmd_drv = {
- .type = PMD_VDEV,
+static struct rte_vdev_driver cryptodev_aesni_mb_pmd_drv = {
+ .driver = {
+ .type = PMD_VDEV,
+ },
.init = cryptodev_aesni_mb_init,
.uninit = cryptodev_aesni_mb_uninit
};
-PMD_REGISTER_DRIVER(cryptodev_aesni_mb_pmd_drv, CRYPTODEV_NAME_AESNI_MB_PMD);
+DRIVER_REGISTER_VDEV(CRYPTODEV_NAME_AESNI_MB_PMD, cryptodev_aesni_mb_pmd_drv);
DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_MB_PMD,
"max_nb_queue_pairs=<int> "
"max_nb_sessions=<int> "
#include <rte_hexdump.h>
#include <rte_cryptodev.h>
#include <rte_cryptodev_pmd.h>
-#include <rte_dev.h>
+#include <rte_vdev.h>
#include <rte_malloc.h>
#include <rte_cpuflags.h>
return 0;
}
-static struct rte_driver cryptodev_kasumi_pmd_drv = {
- .type = PMD_VDEV,
+static struct rte_vdev_driver cryptodev_kasumi_pmd_drv = {
+ .driver = {
+ .type = PMD_VDEV,
+ },
.init = cryptodev_kasumi_init,
.uninit = cryptodev_kasumi_uninit
};
-PMD_REGISTER_DRIVER(cryptodev_kasumi_pmd_drv, CRYPTODEV_NAME_KASUMI_PMD);
+DRIVER_REGISTER_VDEV(CRYPTODEV_NAME_KASUMI_PMD, cryptodev_kasumi_pmd_drv);
DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_KASUMI_PMD,
"max_nb_queue_pairs=<int> "
"max_nb_sessions=<int> "
#include <rte_common.h>
#include <rte_config.h>
#include <rte_cryptodev_pmd.h>
-#include <rte_dev.h>
+#include <rte_vdev.h>
#include <rte_malloc.h>
#include "null_crypto_pmd_private.h"
return 0;
}
-static struct rte_driver cryptodev_null_pmd_drv = {
- .type = PMD_VDEV,
+static struct rte_vdev_driver cryptodev_null_pmd_drv = {
+ .driver = {
+ .type = PMD_VDEV,
+ },
.init = cryptodev_null_init,
.uninit = cryptodev_null_uninit
};
-PMD_REGISTER_DRIVER(cryptodev_null_pmd_drv, CRYPTODEV_NAME_NULL_PMD);
+DRIVER_REGISTER_VDEV(CRYPTODEV_NAME_NULL_PMD, cryptodev_null_pmd_drv);
DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_NULL_PMD,
"max_nb_queue_pairs=<int> "
"max_nb_sessions=<int> "
#include <rte_hexdump.h>
#include <rte_cryptodev.h>
#include <rte_cryptodev_pmd.h>
-#include <rte_dev.h>
+#include <rte_vdev.h>
#include <rte_malloc.h>
#include <rte_cpuflags.h>
return 0;
}
-static struct rte_driver cryptodev_snow3g_pmd_drv = {
- .type = PMD_VDEV,
+static struct rte_vdev_driver cryptodev_snow3g_pmd_drv = {
+ .driver = {
+ .type = PMD_VDEV,
+ },
.init = cryptodev_snow3g_init,
.uninit = cryptodev_snow3g_uninit
};
-PMD_REGISTER_DRIVER(cryptodev_snow3g_pmd_drv, CRYPTODEV_NAME_SNOW3G_PMD);
+DRIVER_REGISTER_VDEV(CRYPTODEV_NAME_SNOW3G_PMD, cryptodev_snow3g_pmd_drv);
DRIVER_REGISTER_PARAM_STRING(CRYPTODEV_NAME_SNOW3G_PMD,
"max_nb_queue_pairs=<int> "
"max_nb_sessions=<int> "
#include <rte_ethdev.h>
#include <rte_malloc.h>
#include <rte_kvargs.h>
-#include <rte_dev.h>
+#include <rte_vdev.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
return 0;
}
-static struct rte_driver pmd_af_packet_drv = {
- .type = PMD_VDEV,
+static struct rte_vdev_driver pmd_af_packet_drv = {
+ .driver = {
+ .type = PMD_VDEV,
+ },
.init = rte_pmd_af_packet_devinit,
.uninit = rte_pmd_af_packet_devuninit,
};
-PMD_REGISTER_DRIVER(pmd_af_packet_drv, net_af_packet);
+DRIVER_REGISTER_VDEV(net_af_packet, pmd_af_packet_drv);
DRIVER_REGISTER_PARAM_STRING(net_af_packet,
"iface=<string> "
"qpairs=<int> "
#include <rte_ip_frag.h>
#include <rte_devargs.h>
#include <rte_kvargs.h>
-#include <rte_dev.h>
+#include <rte_vdev.h>
#include <rte_alarm.h>
#include <rte_cycles.h>
return 0;
}
-static struct rte_driver bond_drv = {
- .type = PMD_VDEV,
+static struct rte_vdev_driver bond_drv = {
+ .driver = {
+ .type = PMD_VDEV,
+ },
.init = bond_init,
.uninit = bond_uninit,
};
-PMD_REGISTER_DRIVER(bond_drv, net_bonding);
+DRIVER_REGISTER_VDEV(net_bonding, bond_drv);
DRIVER_REGISTER_PARAM_STRING(net_bonding,
"slave=<ifc> "
#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>
return 0;
}
-static struct rte_driver pmd_mpipe_xgbe_drv = {
- .type = PMD_VDEV,
+static struct rte_vdev_driver pmd_mpipe_xgbe_drv = {
+ .driver = {
+ .type = PMD_VDEV,
+ },
.init = rte_pmd_mpipe_devinit,
};
-static struct rte_driver pmd_mpipe_gbe_drv = {
- .type = PMD_VDEV,
+static struct rte_vdev_driver pmd_mpipe_gbe_drv = {
+ .driver = {
+ .type = PMD_VDEV,
+ },
.init = rte_pmd_mpipe_devinit,
};
-PMD_REGISTER_DRIVER(pmd_mpipe_xgbe_drv, net_mpipe_xgbe);
-PMD_REGISTER_DRIVER(pmd_mpipe_gbe_drv, net_mpipe_gbe);
+DRIVER_REGISTER_VDEV(net_mpipe_xgbe, pmd_mpipe_xgbe_drv);
+DRIVER_REGISTER_VDEV(net_mpipe_gbe, pmd_mpipe_gbe_drv);
static void __attribute__((constructor, used))
mpipe_init_contexts(void)
#include <rte_ethdev.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
-#include <rte_dev.h>
+#include <rte_vdev.h>
#include <rte_kvargs.h>
#include <rte_spinlock.h>
return 0;
}
-static struct rte_driver pmd_null_drv = {
- .type = PMD_VDEV,
+static struct rte_vdev_driver pmd_null_drv = {
+ .driver = {
+ .type = PMD_VDEV,
+ },
.init = rte_pmd_null_devinit,
.uninit = rte_pmd_null_devuninit,
};
-PMD_REGISTER_DRIVER(pmd_null_drv, net_null);
+DRIVER_REGISTER_VDEV(net_null, pmd_null_drv);
DRIVER_REGISTER_PARAM_STRING(net_null,
"size=<int> "
"copy=<int>");
#include <rte_string_fns.h>
#include <rte_cycles.h>
#include <rte_kvargs.h>
-#include <rte_dev.h>
+#include <rte_vdev.h>
#include <net/if.h>
return 0;
}
-static struct rte_driver pmd_pcap_drv = {
- .type = PMD_VDEV,
+static struct rte_vdev_driver pmd_pcap_drv = {
+ .driver = {
+ .type = PMD_VDEV,
+ },
.init = rte_pmd_pcap_devinit,
.uninit = rte_pmd_pcap_devuninit,
};
-PMD_REGISTER_DRIVER(pmd_pcap_drv, net_pcap);
+DRIVER_REGISTER_VDEV(net_pcap, pmd_pcap_drv);
DRIVER_REGISTER_PARAM_STRING(net_pcap,
"rx_pcap=<string> "
"tx_pcap=<string> "
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_string_fns.h>
-#include <rte_dev.h>
+#include <rte_vdev.h>
#include <rte_kvargs.h>
#include <rte_errno.h>
return 0;
}
-static struct rte_driver pmd_ring_drv = {
- .type = PMD_VDEV,
+static struct rte_vdev_driver pmd_ring_drv = {
+ .driver = {
+ .type = PMD_VDEV,
+ },
.init = rte_pmd_ring_devinit,
.uninit = rte_pmd_ring_devuninit,
};
-PMD_REGISTER_DRIVER(pmd_ring_drv, net_ring);
+DRIVER_REGISTER_VDEV(net_ring, pmd_ring_drv);
DRIVER_REGISTER_PARAM_STRING(net_ring,
"nodeaction=[attach|detach]");
#include <rte_ethdev.h>
#include <rte_malloc.h>
#include <rte_memcpy.h>
-#include <rte_dev.h>
+#include <rte_vdev.h>
#include <rte_kvargs.h>
#include <rte_virtio_net.h>
#include <rte_spinlock.h>
return 0;
}
-static struct rte_driver pmd_vhost_drv = {
- .type = PMD_VDEV,
+static struct rte_vdev_driver pmd_vhost_drv = {
+ .driver = {
+ .type = PMD_VDEV,
+ },
.init = rte_pmd_vhost_devinit,
.uninit = rte_pmd_vhost_devuninit,
};
-PMD_REGISTER_DRIVER(pmd_vhost_drv, net_vhost);
+DRIVER_REGISTER_VDEV(net_vhost, pmd_vhost_drv);
DRIVER_REGISTER_PARAM_STRING(net_vhost,
"iface=<ifc> "
"queues=<int>");
#include <rte_malloc.h>
#include <rte_kvargs.h>
+#include <rte_vdev.h>
#include "virtio_ethdev.h"
#include "virtio_logs.h"
return 0;
}
-static struct rte_driver virtio_user_driver = {
- .type = PMD_VDEV,
+static struct rte_vdev_driver virtio_user_driver = {
+ .driver = {
+ .type = PMD_VDEV,
+ },
.init = virtio_user_pmd_devinit,
.uninit = virtio_user_pmd_devuninit,
};
-PMD_REGISTER_DRIVER(virtio_user_driver, net_virtio_user);
+DRIVER_REGISTER_VDEV(net_virtio_user, virtio_user_driver);
DRIVER_REGISTER_PARAM_STRING(net_virtio_user,
"path=<path> "
"mac=<mac addr> "
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_string_fns.h>
-#include <rte_dev.h>
+#include <rte_vdev.h>
#include <cmdline_parse.h>
#include <cmdline_parse_etheraddr.h>
return 0;
}
-static struct rte_driver pmd_xenvirt_drv = {
- .type = PMD_VDEV,
+static struct rte_vdev_driver pmd_xenvirt_drv = {
+ .driver = {
+ .type = PMD_VDEV,
+ },
.init = rte_pmd_xenvirt_devinit,
.uninit = rte_pmd_xenvirt_devuninit,
};
-PMD_REGISTER_DRIVER(pmd_xenvirt_drv, net_xenvirt);
+DRIVER_REGISTER_VDEV(net_xenvirt, pmd_xenvirt_drv);
DRIVER_REGISTER_PARAM_STRING(net_xenvirt,
"mac=<mac addr>");
*/
if (!strncmp(driver->driver.name, name,
strlen(driver->driver.name)))
- return driver->driver.init(name, args);
+ return driver->init(name, args);
}
RTE_LOG(ERR, EAL, "no driver found for %s\n", name);
*/
if (!strncmp(driver->driver.name, name,
strlen(driver->driver.name)))
- return driver->driver.uninit(name);
+ return driver->uninit(name);
}
RTE_LOG(ERR, EAL, "no driver found for %s\n", name);
/** Double linked list of device drivers. */
TAILQ_HEAD(rte_driver_list, rte_driver);
-/**
- * Initialization function called for each device driver once.
- */
-typedef int (rte_dev_init_t)(const char *name, const char *args);
-
-/**
- * Uninitilization function called for each device driver once.
- */
-typedef int (rte_dev_uninit_t)(const char *name);
-
/**
* Driver type enumeration
*/
TAILQ_ENTRY(rte_driver) next; /**< Next in list. */
enum pmd_type type; /**< PMD Driver type */
const char *name; /**< Driver name. */
- rte_dev_init_t *init; /**< Device init. function. */
- rte_dev_uninit_t *uninit; /**< Device uninit. function. */
};
/**
/** Double linked list of virtual device drivers. */
TAILQ_HEAD(vdev_driver_list, rte_vdev_driver);
+/**
+ * Initialization function called for each virtual device driver once.
+ */
+typedef int (rte_vdev_init_t)(const char *name, const char *args);
+
+/**
+ * Uninitilization function called for each virtual device driver once.
+ */
+typedef int (rte_vdev_uninit_t)(const char *name);
+
/**
* A virtual device driver abstraction.
*/
struct rte_vdev_driver {
TAILQ_ENTRY(rte_vdev_driver) next; /**< Next in list. */
struct rte_driver driver; /**< Inherited general driver. */
+ rte_vdev_init_t *init; /**< Virtual device init. function. */
+ rte_vdev_uninit_t *uninit; /**< Virtual device uninit. function. */
};
/**