summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/dpdk/device/common.c')
-rw-r--r--src/plugins/dpdk/device/common.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/dpdk/device/common.c b/src/plugins/dpdk/device/common.c
index 0c43bfe02bb..2521abde97a 100644
--- a/src/plugins/dpdk/device/common.c
+++ b/src/plugins/dpdk/device/common.c
@@ -260,6 +260,19 @@ dpdk_get_pci_device (const struct rte_eth_dev_info *info)
return NULL;
}
+/* If this device is VMBUS return pointer to info, otherwise NULL */
+struct rte_vmbus_device *
+dpdk_get_vmbus_device (const struct rte_eth_dev_info *info)
+{
+ const struct rte_bus *bus;
+
+ bus = rte_bus_find_by_device (info->device);
+ if (bus && !strcmp (bus->name, "vmbus"))
+ return container_of (info->device, struct rte_vmbus_device, device);
+ else
+ return NULL;
+}
+
/*
* fd.io coding-style-patch-verification: ON
*