X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Fcommon%2Finclude%2Frte_vdev.h;h=29f5a52309ac274dc3ac5e15a2d5b5c03726d8bd;hb=cbf10af6ded52f42c68f9d01317750cb94204c66;hp=2d02c68d734a5fe1144a91a238b6acd23cc1f5e3;hpb=fea892e35f211d1f7aa4991dd415a9b5f40dad76;p=dpdk.git diff --git a/lib/librte_eal/common/include/rte_vdev.h b/lib/librte_eal/common/include/rte_vdev.h index 2d02c68d73..29f5a52309 100644 --- a/lib/librte_eal/common/include/rte_vdev.h +++ b/lib/librte_eal/common/include/rte_vdev.h @@ -41,18 +41,23 @@ extern "C" { #include #include -#define VIRTUAL_BUS_NAME "virtual" - struct rte_vdev_device { TAILQ_ENTRY(rte_vdev_device) next; /**< Next attached vdev */ struct rte_device device; /**< Inherit core device */ }; +/** + * @internal + * Helper macro for drivers that need to convert to struct rte_vdev_device. + */ +#define RTE_DEV_TO_VDEV(ptr) \ + container_of(ptr, struct rte_vdev_device, device) + static inline const char * rte_vdev_device_name(const struct rte_vdev_device *dev) { - if (dev && dev->device.devargs) - return dev->device.devargs->virt.drv_name; + if (dev && dev->device.name) + return dev->device.name; return NULL; }